You probably downloaded v1.3 but if you are adding it to the stemapp widgets folder then the new version will only get added to a new app not an existing one, unless you specifically add it to the existing app by copying the v1.3 of eSearch to the [install dir]/server/apps/[app #]/widgets folder.
Is this one of the steps covered in Tapas' documentation on updating an existing app if the webapp builder and widgets have been upgraded to the next version?
The 'all' issue appears to only happen when the 'Filter by Map Extent' is enabled. The queryExcute appears to fire twice. The results temporarily appear and then it fires again and wipes out the results.
They are all working like a well oiled machine. I will be using these as templates to create my web apps in WAB 1.3.
Thanks for the new draw_point.png that replaces:
\widgets\eSearch\css\images\draw_point.png
\widgets\identify\css\images\draw_point.png
I noticed that the manifest.json file under your eLocate 1.3 download is still showing:
"version": "1.2.0.3",
"wabVersion": "1.3",
I edited them to read:
"version": "1.3",
"wabVersion": "1.4",
The manifest.json file under MapProgress 1.3 download needs to be updated as well:
I like how my settings persists in WAB 1.3.
For example, I can turn on the ZIP Codes layer, and zoom to a new location.
If I reload the app, it remembers my settings in the Layer List Widget, and zooms me to my last map extent.
This will be a welcome feature in our apps that use 50 plus data layers.
You have created a solid WAB 1.3 release of all your Custom Widgets. I especially like how well Identify 1.3 works in tandem with eSearch 1.3 without ever raising any conflicts.
Each one of your Custom Widgets is a gem and performs an essential task not covered by the standard ESRI widgets.
I never thought I will ever see all the Flex functionality carried over to the JavaScript environment using the Web AppBuilder. You have made this happen in less than a year.
As an added bonus, these WAB apps are compatible with touch enabled devices, folds down gracefully to fit your smartphone or tablet, and does not require the end user to download a plug-in.
Thanks to your intuitive configuration wizards, any lay person can configure your widgets without ever having to write any code.
It looks like the Web AppBuilder has finally eclipsed the FlexViewer
I am trying to configure the esearch widget (version 1.3) but I am running into an issue that I think has something to do with some of my layers being related to other tables. Anyone getting an error when trying to configure the esearch widget for layers with relationship classes?
Thanks for the reply. I was able to use a 1.2 version of the widget with the same map service I am trying to use with the 1.3 version and esearch worked fine. I am not trying to query the related tables. I guess the widget was changed and now it doesn't allow you to configure layers that are involved in a relationship class.
Sorry I did not have a smooth migration to WAB 1.3 and ended up reverting some code in the initial 1.3 release unintentionally. The fix is a very simple one line fix. Open the eSearch Widget.js in your apps widgets folder and find line 915 - def.resolve(layerInfo);
what i did in the older version was alter the opacity from .6 to .8 but i must have done something else as well (which i didnt make a note of) because the header bar color is Black in the old one.
in the new version the bar is dark gray, which is ok, but i am curious about how i would change the color if wanted to.
FYI- just a reminder because it has been a long time, here is the code you had me add to the \FoldableTheme\common.css
I did monitor your replies to Barnaby Rockwell in your Identify thread regarding UNC paths. I already have a virtual directory to a folder set up. I had already observed what you pointed out, in that Internet Exploder, er, Explorer opens up "file://" links, despite this not being a proper browser design. Well, once I set up a Virtual Directory in IIS, this was solved and all browsers could open the links in the attribute field "Sketch" as below, on our legacy site (built much before WAB, and uses regular ESRI popups from the early 3.x API).
So... I'm putting a link on my eSearch popups:
Now, here's my scenario:
The "SKETCH" attribute field in this layer has a local server at the beginning of the link. Here is an example of a link: \\server-1.servername.local\GISDataFolderVirtualDir\hyperlinks\sav\ws_sketches\Valve Program\Sheet 9785\9785-268.pdf
Note that I changed the real servername above for security; it would be Robert-1.Robertserver.local for example.
Now, what I did on our old inhouse site was simply used Javascript to chop off the first 20 or so characters, so that the link became: GISDataFolderVirtualDir\hyperlinks\sav\ws_sketches\Valve Program\Sheet 9785\9785-268.pdf
Then, I added back on the internal site's name (mapping.internalWebServer.local) to the front of the link string:
So after this two-step string manipulation in Javascript, it was good to go. A working link to a folder of data.
My Question: can eSearch modify the Link field? It would perhaps be useful to be able to use regular expressions in the Link box to alter the link and accomplish the above. Can it use regular expressions? Or is it treated just as a string?
I am beginning to poke around and look at the underlying code of eSearch. The other thought I had was since I have to get this to working one way or another, I may consider hardcoding this into your widget (altering eSearch code), with an If statement so any layer with a "SKETCH" attribute is sliced and diced with javascript to correct the link. What line in what file would I do this in if I did it this way?
Can it use regular expressions? Or is it treated just as a string?
No regular expressions are not supported. It is treated as a string and fields in curly braces are substituted for actual field values.
I will have to find some time to point you to the correct line to modify to manipulate the link and replace the string portion you are wanting to substitute.
Hi Robert, thank you and any time at your convenience of course!
I am perusing widget.js around lines1800, 1900 and 2540 which looks about right, and if it is useful for folks if I get it working I'll post a code fragment, if other people have this kind of use case.
Ah, indeed, I was just editing that! as I researched it..I indeed came to the same conclusion!! One of those things that would be really cool but require too much dev time as it's probably a narrow use case, not too common. I wish I could just change the links or calculate a new field but for now, the users have this workflow and I need to engineer around it.
So, I believe I have found the relevant parts of the code, the strLink and qLink? I'll update here when and if I get a solution working dealing with modifying the link input.
I found that it is from some serious code regression when I updated to 1.3 I had some issue and ended up using some old code by mistake. I will be releasing 1.3.0.1 soon that will address the issue.
Would anyone else think it would be useful to have a "select all" button for Popup Only in the layer config?
I have dozens of layers each with dozens of fields and I spend a lot of time clicking checkbox after checkbox to deselect from popup. I know I could edit it by hand but it would be much quicker for a Select all, and then just re-add the one or two items I need. For example: we have a parcel layer for each year going back to the 1990s. But all I want on the results on the right is Name and Property Address. Then I uncheck the other 25 fields for each layer.
Second question: It would be useful to have a third kind of symbology to show features found with eSearch query. Symbology from Server WITH HIGHLIGHT. For example, let's say I want to use server symbology for my address points. But the address point list is already on. I want to select just a few with the Search by Shape. I have no way of seeing on the map what features I just selected.
The reason one would want server symbology, is say the feature is a commonly understood icon. Like the black and white disc for monitoring wells. Or a fire hydrant for hydrants. My symbology Defaults in eSearch are just thick purple lines and points and a yellow background highlighting. But that kills any unique symbology, like hydrants, or colors for lines like utilities, etc by overriding it. So I propose this to be a distinct third option. It can be as simple as just using the already available standard cyan highlighting/halo, the one that happens already out of the box when you click on a feature on the map and get the popup infowindow. It would perhaps be useful to even allow us users to customize the symbology of the halo highlight for this third option but that would be icing on the cake, the standard static cyan highlight would be a great addition, at least for now, and would be fine for our site. Does this sound useful to everyone, and you see what I mean and why this would be important?
Thank you again Robert and everyone on the thread. We use this widget for its search by Shape as a super Identify. I don't use Identify for anything except its All Visible Layers functionality. When you pair these two together, it's an awesome Identify package. Just fantastic. Robert it's gotten very positive feedback from our municipal users. It's a huge step up from our old legacy viewer and its cumbersome querying and identify!!
TAPAS DAS thank you for your endorsement and interest as well in these.
Another reason for the check All popups is sometimes the update breaks the config and I can't simply copy the config to the new vers of eSearch and I have to re-uncheck the popups. Also I prefer using graphical user interface most of the time vs going in by hand to correct something such as this, is it is less subject to error (coding typos hehe) through the widget Config in the Builder. Thanks again for anyone else if they provide input on if these are useful to them or their users, also.
Can you check if you are using the 1.3 version of the widget in your app? To do this you need to hold the Alt key on the keyboard and click somewhere inside the widget and it will report the widgets version. It sounds like you are using a 1.2.x version of the widget in that app.
2. I need to investigate this. It sounds good but I need to see the practicality of implementing this. BTW there are already 3 symbology types so this would be a fourth (server, default config, layer).
edit: this post isn't showing as a reply on GeoNet for me. In case anyone's wondering it's in reply to where I asked Robert about internal links at the top of this page. Don't know what happened to GeoNet's nested replies. Anyhow...
Here is my code for anyone else interested. I know it's pretty basic and fairly hard-coded but I thought I'd share in case it will help anyone else with internal link paths.
For me all links point to the same root directory, so I created a virtual directory (GISVirtualDir) pointing to the second level of each link (they will all be structured this way, like \\server-1.serv1.locall\GISVirtualDir\links\file.pdf), hacked off the first 22 chars, added the site path to the front of the URL (http://site.name1.local/site10), and it works.
First I test if a layer has this particular field ('sketch').
I added this after the line testing linkFieldNull.:
Kevin....just a side note... if the geonet thread flow isn't working, you can always copy the link to a comment by right-clicking on the date of the response. For example (not sure if this is the comment you were looking or or not)
I deleted the app again, then I cleared my cache this time, and downloaded the eSearch 1.3. I got the above errors and warnings in my browser console. But I got it to work this time. I was just grabbing the rest service as anyone can by clicking on the layer list, then looking at the description. I saw the error above and tried going through Server, copied the rest services from my inside URL and it worked.
Thanks for taking the time to help me. I We really appreciate the work you have done to create these custom apps. You do amazing work!
Robert, regarding your question above about running WAB in https, how do I set it up any other way? I just downloaded WAB, registered the app, then started creating my app. It may be a dumb question, but I don't know any other way. I know enough to mess things up, but not enough to fix it. So as can be expected, I can only load secured rest services into the app.
Slightly related, I got eSearch to work on most of my rest services; however, when I set up the Expression Value to query my county zoning rest service, it just says processing and never finds the uniques for the field (0 of 2712). Does this have to do with me using secured protocol? Or why would it give me the "ESRI (processing) Wheel of Death"? The weird thing is, I ran the exact same set up in 1.2 and it worked great.
So the reason that you WAB is using https is because you provided a https url to your portal when you first setup WAB. The fix is simple shutdown WAB and go to your [install dir]\server folder and delete the signininfo.json and then restart WAB and it will ask you again for your portal url (make sure to use http this time) and then it will likely ask for the App Id again. Once you provide those you will be using WAB in http. Now why it was working in 1.2 and not in 1.3 is a mystery.
';
}
}
}
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(/