hmmmm. Although a different link that seems like the same thing in regards to the content I mentioned. Unless the first edited post doesn't contain the latest widget download.
Regardless expressions aren't saving. Only the expression alias and search labels save. =/ frustrating.
Argh so I need to download 1.1 of WAB then I guess?
Yes the 1.1.x version of the eSearch is for 1.1 of the WAB. There was some version naming confusion when WAB came out officially that caused me some issue with my widgets version numbers.
I have updated the help doc to remove some of the old stuff that was lingering in there.
One thing I noticed is that only the default search layer that functions is the SanFrancisco layer where I can specify parameters, but ONLY if I remove the Louisville and traffic layer as well. I also cannot get any queries from my own layer to save even though it finds the Search Layer URL, so therefore it has no parameters upon launch. =/
Something sounds screwed-up with your install. No one else has reported any issues saving search settings or the Louisville and traffic searches not working. I would recommend a fresh install of 1.1 and re-download the eSearch 1.1.3. You can check which version of the eSearch widget you are actually running by holding the Alt key and clicking on the widgets header (to be sure what version you are running).
You can check which version of the eSearch widget you are actually running by holding the Alt key and clicking on the widgets header (to be sure what version you are running).
Robert, this would be helpful for me, but not sure what "widget's header" we should be clicking. Any chance to give us a snapshot/clip?
Thanks Robert. So that is something you built into your widgets it sounds like....not a default WAB feature.
It is a nice feature and would be helpful for all custom widgets....(hint hint to others)....but being more a user of the custom widgets than author, I'm happy for anything you all provide. and of course, any widgets that come with the "default" install should already be compatible...at least one would hope.
I have a question. When I configure my links in eSearch to be displayed with my results, I choose for them to be displayed as text links, but the results tab still shows them as image links, which are difficult to see. what can I do to get text links in the result panel?
I will also second the request to have a per-query option to enable "show results in attribute table". It doesn't make sense for some queries, especially the ones where the user chooses a single value from a drop down list. It is a great feature, but would be even better if was optional.
Wow, sorry you are having such a hard time with this. No there is no special step for installing a custom widget to WAB (all you do is exactly what you said, copy it to the widgets folder).
Do you have any issue with the OTB widget in WAB?
Have you brought up your browsers web console to see what the errors are there?
No OTB widget issues as far as I have noticed. Also I tested other custom widgets like your Identify, enhanced basemap along with the Location widget without any issues there.
I always forget about the console. I initially thought it may be related to the invalid certificate browser error, but ignored it.
init.js:162 Mixed Content: The page at 'XXXXX' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/info?f=json'. This request has been blocked; the content must be served over HTTPS.
I've made a mixin that has the functionality of Robert's Version Info. I call it _WidgetMetadataMixin. I have tested it with 5 of my widgets and 9 Esri Widgets. Pretty simple to add to a widget. Four lines of code.
Great addition to the widget in hijacking the attribute table. Much appreciated. One thing I noticed in the live demo site is that the attribute window is populated on the initial search that you run, but any additional searched turn up 0 results in the attribute window.
In other words...when I click on the link and it zooms to the location and select the point they show up in the attribute window. If I select another traffic camera search it shows nothing in the attribute window.
Yep I have noticed this as well. When it does that you have to open the Layer List widget and click the "Open Attribute Table" option from the layer menu. Seems like the AT widget has some issues.
It seems that the Spatial Search is not returning correct results. When I use the spatial search feature it selects all the features in the service. Am I the only one having this issue?
new comment by Robert Scheitlin, GISP View all comments on this document
Nick,
Yep I have noticed this as well. When it does that you have to open the Layer List widget and click the "Open Attribute Table" option from the layer menu. Seems like the AT widget has some issues.
Reply to this email to respond to Robert Scheitlin, GISP's comment.
Following Enhanced Search Widget Version 1.1.4 - 4/14/15 in these streams: Inbox
This email was sent by GeoNet because you are a registered user.
You may unsubscribe instantly from GeoNet, or adjust email frequency in your email preferences
Cameron has pointed out a serious issue with the 1.1.4 release I made today and it was such a big issue that I rolled back the official release to 1.1.3 until I get this fixed. Sorry for any inconvenience.
Would someone be kind enough to provide me with the 1.1.3 version of the eSearch that they downloaded. I am really screwing up today and have just overwrote my 1.1.3 version I had on my machine. Feels like a Monday....
I have resolved the issues with the 1.1.4 release that Cameron Johnsen pointed out and have re-released now that this version has been more thoroughly tested. I was so excited to have attachments and relates working I failed to go though the full testing of the widget. Thanks for being patient.
Thanks a million for version 1.1.4 of your eSearch Widget!!!
This is the one killer widget that is going to be the centerpiece of all my web applications. I cannot believe how closely this mimics the functionality of your Flex version which is the Gold Standard.
The custom point symbols now appear the way I have them configured.
The external links show up fine in the Results pane and within the Pop-up.
However, the Attribute Table is displaying each and every field.
It would be nice if I could specify which fields I want to see in the Attribute Table, along with my chosen name that overrides the existing field alias.
I know you can select Options | Show/Hide Columns, but I want certain fields like the OBJECTID to never appear as a choice.
Your eSearch Widget is working like a champ.
However, I think I am doing something silly, as I cannot quite make it work in tandem with your Identify Widget version 1.1.0.1
I made a simple test case to illustrate what is happening.
Robert, what you did for the Flex platform was a programming masterpiece, and I cannot thank you enough for taking your time to port them over to the Web AppBuilder.
We really liked the way you threaded your Enhanced Draw Widget, Point Buffer Widget and the Enhanced Locate Widget with your Enhanced Search Widget. It was pure genius the way you could draw a shape or a multi-ring buffer using your eDraw and Buffer Widget, and subsequently use that geometry as a basis for running your Enhanced Search.
You could locate an address point and then draw a buffer around that point to run spatial searches using the eSearch widget.
It is amazing how much you pushed the envelope on the Flex platform. We are so happy and grateful that you are gradually bringing all these powerful spatial tools into the Web AppBuilder!
Issue: However, the Attribute Table is displaying each and every field
Answer: I do not see this in your app. When I use eSearch to search for counties the attribute table widget only shows the fields that the eSearch is configured to show.
I do see all the fields when you do a search and the results fail to display in the Attribute table widget and you just get a loading spinner and then I click refresh on the Attribute Table widget.
Issue: However, if I now use your Identify Widget to select another ZIP Code, I get a duplicate listing.
Answer: I do see this and I know exactly why it is occurring. Now I just have to figure out the fix. Two temporary workarounds exist.
Do not add the result as an Operational Layer.
Clear the eSearch result before using identify.
Issue: The Items are showing correctly in the Results and the Pop-up. However, the attributes values are not showing up in the Identify Widget.
Answer: This is due to a bad configuration of the Identify Widget. Not sure how it happened but the alias and field name are identical in the json and they should not be:
Yes, you are correct. The Attribute Table is showing only the fields that eSearch is configured to show. Once I cleared my Browser Cache, it started working properly.
I have to remember to clear my Browser Cache before running the tests!
Thanks for the workarounds. Yes, if do not add the results as an operational layer, or if I clear the results from the eSearch Widget, the subsequent Identify operations work perfectly.
Thanks also for the tip that the Field Names and their aliases must not be the same in the Identify Widget. Now I know why the attributes show up for some layers, but do not display on others.
HI Robert- the eSearch widget is GREAT! Thank you for getting us over some major hurdles with query/search. I was wondering about the ability to have the operational layer name (and attribute table tab name) be customizable to indicate that they are search results. Currently they both use the layer name of the service. In our case we expect the user to keep a statewide map layer of 'conservation lands' displayed but be able to search to return a subset of those features. When that happens the Layer List shows the same layer name twice (Florida Conservation Lands in image below). I would like to indicate that one of them is the search result. My current workaround is to create a new service with identical layers, just named differently, e.g. 'Conservation Lands Search', for use with the esearch tool. It is possible I have missed something. Do you have any thoughts on another way to go about this? Thank you!
This was something I broke in the 1.1.4 release it use to have "Search results: Layername" in the layer List. I will have this back in the next release as this fixes some other issues that users are experiencing.
If you feel comfortable adding a couple of line of code to the widget.js then you can have the fix right away.
in the folder server\apps\X\widgets\eSearch (where X is the number associated with your app). Open the Widget.js file in any text editor program. Do a search for "this.map.addLayer(currentLayer);" (there will only be one incident of this in the code) and then paste this code right before that line.
The fix that I mention for Amy is what will fix your issue with the eSearch and Identify widget duplicate results. In case you want to have the fix before my next release.
Hi Robert, great update. I noticed a few things that may be a bit off though.
I'm not longer able to Edit Date fields in the Included Fields section.
Also, for unique searches that generate a drop down list, I'm noticing that the first and second spaces are blank and then a value out of order, respectively. Is there any way to correct this?
I'm also getting an, "Uncaught TypeError: Cannot read property 'toString' of undefined" when I try to add a Date range expression to a search layer (For the Crimes search layer in my test site).
I am not noticing the out of order selection option in the dropdown (even on your site). The ONE black space at the beginning of the list is by design so that you can choose this blank value and basically not have that field required.
Is a problem in my code as to how I am checking for a null or undefined value.
So number one and three are valid bugs that will be addressed in the next release.
Hello again Robert- All my testing with eSearch today has been through WAB dev 1.1. It is working perfectly there. When I download and deploy to my own web server everything works great except that I can no longer get a drop down menu for my unique values searches. I can still type in the search box (intended for menu) and get an accurate result, and all other searches included spatial and other attribute searches are working without a hitch.
I thought i saw something previously about this on the forum but could not find it. Thanks for any help
I am not sure if this will help, but I had the exact same issue. Robert asked me to clear my browser cache, and then the unique list show up.
You may want to download the latest version of Google Chrome (version 42) and then press <Shift><Ctrl><del> to clear the browser cache from the beginning of time.
Thanks for the information. That makes sense now that the blank field is meant to be the "optional" use.
I went and rechecked the drop-down list and discovered that it's just two choices in the list that somehow switched places in terms of alphabetical. So you aren't getting the same two out of order?
Champion Trees: Paper Birch switched with American Chestnut
A similar switch occurred in the crimes layer as well.
Tapas is mostly correct. But he forgot about the the issue he has initially setting up a proxy. A proxy is required once the app is deployed to your own server (the proxy is provided internally in Node JS when working in WAB Dev). So you need to get a proxy setup on my web server and in your WAB apps main config.json you need to assign the proxy url.
Then that's really odd how only one of them is switched on my end (even since we're using the same test site), haha. I guess I'll have to keep at it. I'll show how it looks on my end just so you can see.
Here's Paper Birch at the top
And here's American Chestnut where Paper Birch should be. I'll keep looking into what might be causing the issue. I really do appreciate all of your help.
';
}
}
}
catch(e){
}
}
}
if (newSub.getAttribute("slang").toLowerCase() != code_l.toLowerCase()) {
if (trLabelsHtml != "") {
var labelSname = "";
if(labelEle[i].querySelector("ul li:nth-child(1)").getAttribute("aria-hidden")){
labelSname = labelEle[i].querySelector("ul li:nth-child(1)").outerHTML;
}
labelEle[i].innerHTML = "";
labelEle[i].innerHTML = labelSname + trLabelsHtml;
}
}
}
}
}
catch(e){
}
}
}
/* V 2.0:3 = Store not translated reply id */
if(lingoRSXML.snapshotLength == 0){
if($scope.falseReplyID == "") {
$scope.falseReplyID = value;
}
}
/* Get translated Body of Replies/Comments */
var lingoRBXML = doc.evaluate(lingoRBExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0;i 0) {
var attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('div.custom-attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
}
else if(rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('#attachments').length > 0){
if ("TkbArticlePage" == "BlogArticlePage") {
attachDiv = rootElement.querySelector('div.lia-quilt-row-main .lia-message-body-content').querySelector('#attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
}
else{
attachDiv = "";
}
}else{
attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('#attachments').outerHTML;
}
}
else {
attachDiv = "";
}
/* Feedback Div */
var feedbackDiv = "";
var feedbackDivs = rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('div.lia-panel-feedback-banner-safe');
if (feedbackDivs.length > 0) {
for (var k = 0; k < feedbackDivs.length; k++) {
feedbackDiv = feedbackDiv + feedbackDivs[k].outerHTML;
}
}
}
else {
var attachDiv = rootElement.querySelector('div.lia-message-body-content').querySelector('div.Attachments.preview-attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
} else {
attachDiv = "";
}
/* Everyone tags links */
if (document.querySelectorAll("div.TagList").length > 0){
var everyoneTagslink = document.querySelector('div.lia-quilt-row-main').querySelector(".MessageTagsTaplet .TagList");
if ((everyoneTagslink != null)||(everyoneTagslink != undefined)){
everyoneTagslink = everyoneTagslink.outerHTML;
}
else{
everyoneTagslink = "";
}
}
/* Feedback Div */
var feedbackDiv = "";
var feedbackDivs = rootElement.querySelector('div.lia-message-body-content').querySelectorAll('div.lia-panel-feedback-banner-safe');
if (feedbackDivs.length > 0) {
for (var m = 0; m < feedbackDivs.length; m++) {
feedbackDiv = feedbackDiv + feedbackDivs[m].outerHTML;
}
}
}
}
} catch (e) {
}
if (body_L == "") {
/* V 2.0:7 Replacing translated video data with source video data */
var newBodyVideoData = newBody.querySelectorAll('div[class*="video-embed"]');
angular.forEach($scope.videoData[value], function (sourceVideoElement, index) {
if (index <= (newBodyVideoData.length - 1)) {
newBodyVideoData[index].outerHTML = sourceVideoElement.outerHTML
}
});
/* V 2.0:7 = Replacing translated image data with source data */
var newBodyImageData = newBody.querySelectorAll('[class*="lia-image"]');
angular.forEach($scope.imageData[value], function (sourceImgElement, index) {
if (index <= (newBodyImageData.length - 1)) {
newBodyImageData[index].outerHTML = sourceImgElement.outerHTML;
}
});
/* V 2.0:7 = Replacing translated pre tag data with source data */
var newBodyPreTagData = newBody.querySelectorAll('pre');
angular.forEach($scope.preTagData[value], function (sourcePreTagElement, index) {
if (index <= (newBodyPreTagData.length - 1)) {
newBodyPreTagData[index].outerHTML = sourcePreTagElement.outerHTML;
}
});
}
var copyBodySubject = false;
if (body_L == "") {
copyBodySubject = true;
body_L = newBody.innerHTML;
}
/* This code is written as part of video fix by iTalent */
/* try{
var iframeHTMLText = body_L;
var searchIframeText = "<IFRAME";
var foundiFrameTag;
if (iframeHTMLText.indexOf(searchIframeText) > -1) {
foundiFrameTag = decodeHTMLEntities(iframeHTMLText);
foundiFrameTag = foundiFrameTag.split('src="')[1];
body_L = foundiFrameTag;
}
}
catch(e){
} */
/* This code is placed to remove the extra meta tag adding in the UI*/
try{
body_L = body_L.replace('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />','');
}
catch(e){
}
/** We should not replace the source content if user profile language and selected target language matches with source language **/
if(showTrContent) {
var compiled = false;
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = null
if("TkbArticlePage"=="IdeaPage"){
// var customAttachDiv = '';
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ;
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
compiled = true;
/* Attach atttach div */
// document.querySelector("div.translation-attachments-"+value).innerHTML = attachDiv;
rootElement.querySelectorAll('div.lia-message-body-content')[0].insertAdjacentHTML('afterend',attachDiv);
if(rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message').length > 1){
rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message')[1].remove();
}
} else {
if("TkbArticlePage"=="TkbArticlePage"){
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ;
}else{
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv + attachDiv;
compiled = true;
}
}
/* Destroy and recreate OOyala player videos to restore the videos in target languages which is written by iTalent as part of iTrack LILICON-79 */ /* Destroy and recreate OOyala player videos */
try{
// $scope.videoData[value][0].querySelector("div").getAttribute("id");
for(var vidIndex=0; vidIndex<$scope.videoData[value].length; vidIndex++){
if( $scope.videoData[value][vidIndex].querySelector("div") != null){
var containerId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].containerId;
videoId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].videoId;
/** Get the Video object */
vid = OO.Player.create(containerId,videoId);
/** Destroy the video **/
vid.destroy();
/** recreate in the same position */
var vid = OO.Player.create(containerId,videoId);
}
}
}
catch(e){
}
try{
for(var vidIndex=0; vidIndex<($scope.videoData[value].length); vidIndex++){
if($scope.videoData[value][vidIndex].querySelector('video-js') != null){
var data_id = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-video-id');
var data_account = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-account');
var data_palyer = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-player');
var div = document.createElement('div');
div.id = "brightcove";
div.class = "brightcove-player";
div.innerHTML =
'(view in my videos)'
var data = div.getElementsByClassName("video-js");
var script = document.createElement('script');
script.src = "https://players.brightcove.net/" + data_account + "/" + data_palyer + "_default/index.min.js";
for(var i=0;i< data.length;i++){
videodata.push(data[i]);
}
}
}
for(var i=0;i< videodata.length;i++){
document.getElementsByClassName('lia-vid-container')[i].innerHTML = videodata[i].outerHTML;
document.body.appendChild(script);
}
}
catch(e){
}
if(!compiled){
/* Re compile html */
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
}
}
if (code_l.toLowerCase() != newBody.getAttribute("slang").toLowerCase()) {
/* Adding Translation flag */
var tr_obj = $filter('filter')($scope.sourceLangList, function (obj_l) {
return obj_l.code.toLowerCase() === newBody.getAttribute("slang").toLowerCase()
});
if (tr_obj.length > 0) {
tr_text = "Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.".replace(/lilicon-trans-text/g, tr_obj[0].title);
try {
if ($scope.wootMessages[$rootScope.profLang] != undefined) {
tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title);
}
} catch (e) {
}
} else {
//tr_text = "This message was translated for your convenience!";
tr_text = "Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.";
}
try {
if (!document.getElementById("tr-msz-" + value)) {
var tr_para = document.createElement("P");
tr_para.setAttribute("id", "tr-msz-" + value);
tr_para.setAttribute("class", "tr-msz");
tr_para.style.textAlign = 'justify';
var tr_fTag = document.createElement("IMG");
tr_fTag.setAttribute("class", "tFlag");
tr_fTag.setAttribute("src", "/html/assets/langTrFlag.PNG");
tr_fTag.style.marginRight = "5px";
tr_fTag.style.height = "14px";
tr_para.appendChild(tr_fTag);
var tr_textNode = document.createTextNode(tr_text);
tr_para.appendChild(tr_textNode);
/* Woot message only for multi source */
if(rootElement.querySelector(".lia-quilt-forum-message")){
rootElement.querySelector(".lia-quilt-forum-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) {
rootElement.querySelector(".lia-message-view-blog-topic-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){
rootElement.querySelector(".lia-quilt-blog-reply-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-tkb-message")){
rootElement.querySelector(".lia-quilt-tkb-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){
rootElement.querySelector(".lia-quilt-tkb-reply-message").insertBefore(tr_para,rootElement.querySelector(".lia-quilt-row.lia-quilt-row-footer"));
} else if(rootElement.querySelector(".lia-quilt-idea-message")){
rootElement.querySelector(".lia-quilt-idea-message").appendChild(tr_para);
} else if(rootElement.querySelector('.lia-quilt-occasion-message')){
rootElement.querySelector('.lia-quilt-occasion-message').appendChild(tr_para);
}
else {
if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) {
rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para);
} else {
rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para);
}
}
}
} catch (e) {
}
}
} else {
/* Do not display button for same language */
// syncList.remove(value);
var index = $scope.syncList.indexOf(value);
if (index > -1) {
$scope.syncList.splice(index, 1);
}
}
}
}
});
});
/* V 1.1:2 = Reply Sync button for multi source translation */
} catch(e){
console.log(e);
}
};
if((rContent != undefined) && (rContent != "")) {
drawCanvas(decodeURIComponent(rContent));
/** Update variable with selected language code **/
$scope.previousSelCode = code_l;
}
};
/**
* @function manageTranslation
* @description Managess the translation of given language for the thread
* @param {string} langCode - Language Code
* @param {string} tid - Thread ID
*/
$scope.manageTranslation = function (langCode, tid) {
//debugger;
$scope.showTrText = false;
/* V 2.0:5 = actualStatus variable introduced to indicate detailed connector status on UI. This variable holds the actual translation percentage */
$scope.transPercent = "";
$scope.actualStatus = "";
if (tid != "") {
var bulkTranslation = lithiumPlugin.bulkTranslation(langCode, tid);
bulkTranslation.then(function (trContent) {
if(trContent.body != "") {
$scope.showPreview(trContent.body, $scope.mszList, langCode);
if(langCode != "en-US") {
$scope.showTrText = true;
}
}
if((trContent.status != "NA") && trContent.status != null) {
// $scope.transPercent = String(trContent.status);
$scope.actualStatus = String(trContent.status);
} else {
// $rootScope.errorMsg = "Translation is in progress. Please check again a few minutes."
$rootScope.errorMsg = "Translation is in progress. Please retry in a few minutes."
}
$scope.workbench = trContent.wb;
/* V 2.0:4 = Trigger uncalled or delayed callbacks (documnet uploaded/translation completed from lithium).*/
if(trContent.callback == 'true') {
var trCompletCallback = lithiumPlugin.trCompletCallback(langCode, trContent.docID);
trCompletCallback.then(function (callback){
// $rootScope.errorMsg = "Downloading Translated content in " + langCode + " now. Please check again in a few minutes."
$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
});
} else if (trContent.callback == 'upload') {
var trCompletUpload = lithiumPlugin.trCompletUpload(langCode, trContent.docID);
trCompletUpload.then(function (callback) {
//$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
});
} else if ("many" == "one") {
$scope.updateOOS();
} else if("SmartConx" == "SmartConx"){
if ("many" == "many"){
$scope.updateOOS();
}
}else if ((trContent.status != null) && trContent.status.includes("100")) {
/* If everything fine then only check Out of Sync status */
$scope.updateOOS();
} else {
/* If translation perccent is less than 100 then show the percentage on UI */
$scope.transPercent = $scope.actualStatus;
}
});
}
}
/**
* @function selectThisLang
* @description Called on select dropdown.
* @param {string} lang - Language code
*
*/
$scope.selectThisLang = function (lang, anonymousFlag) {
/* 1.4:3 Update Analytics on language selection */
try {
setTimeout(()=>{
lingoThreadLangSelected(lang, '910880');
console.log("Language",lang);
},5000)
} catch (e) {
console.log(e);
}
/** Display Translated content **/
var getTranslation = lithiumPlugin.getTranslation(lang, "910880");
getTranslation.then(function (trContent) {
if (trContent.body != "") {
$scope.showPreview(trContent.body, $scope.mszList, lang);
} else {
//$rootScope.errorMsg = "Translation is in progress. Please check again in a few minutes."
$rootScope.errorMsg = "Translation is in progress. Please retry in a few minutes."
}
});
};
var decodeEntities = (function() {
// this prevents any overhead from creating the object each time
var element = document.createElement('div');
function decodeHTMLEntities (str) {
if(str && typeof str === 'string') {
// strip script/html tags
str = str.replace(/