I downloaded the new widget from the link, but I'm not sure I installed it correctly as I am still experiencing the same issues. My steps to install the new widget...
1. stop all WAB apps including the node.js - machine is now clean with nothing running.
2. go to the widgets folder in WAB and rename esearch to esearch_old
3. Download and unzip new esearch widget and place in widget folder
4. Started WAB and opened and existing project, new functionality did not work
5. Created new search, Functionality did not work
6. Created completely new WAB site
7. Added tool, configured, and the new functionality still did not work.
Did I install the widget incorrectly, or possible get a link to an older version?
I just downloaded the latest version and checked the code base and it does have the fix that I verified to be functioning.
I think Step 2 of renaming the eSearch folder to old_ might be an issue.
Number 4 will not work as that app already has a copy of the eSearch widget and it would have to replace the contents of "\server\apps\###\widgets\eSearch" from the "\client\stemapp\widgets\eSearch" directory. Same with number 5
Now number 6 should have worked if WAB was seeing the new eSearch Widget.
Here is 2 manual check you can do to see if the "\client\stemapp\widgets\eSearch" directory has the latest version.
Open the manifest.json and check the "version": "1.1.0.2",
Open the \client\stemapp\widgets\eSearch\setting\FieldFormatEdit.js and line 198 should be var pcbx = this.percisionCbx.getValue();
I checked the version and I do have the correct version… thanks for that info! I was searching around all morning and had the manifest open and just skipped over that… I also checked line 198 and that checked out OK too.
A ha! Renaming that widget to _old was the problem… once I removed that and restarted everything it worked great!
I also switched out the esearch in my original site and made sure to have no reference to the _old and it also works great and I’ve now learned how to update those sites now.
I am having the same problem as Cattyann with getting your enhanced search widget to show up. I did the same thing as her and your widget will not show up in the widget list. I am not using a downloaded app from AGOL.
You can not use my eSearch Widget 1.1.0.2 with a Beta version of WAB. You need to always match versions. You need to get the released version of WAB Dev edition in order to use my 1.1.0.2 version.
Great Widget Robert. Very much appreciate your hard work and found your widget to work as planned.
I had an issue with the widget opening with no url parameters. When I set the openAtStart to true in config.json I get the widget to open at start...which is great if you have url parameters to pass. Our users want it to be closed if there are no parameters to pass so....Here is some code to check for parameters and suppress the widget opening. In LayoutManager.js around line 606 (latest version of the WebApp Builder) modify the code. Yes if the widget name changes it will break this code.
I have a map service that I would like to use this search tool on. My field is a number (unique ID) and that is where I am having problems. In the widget set up I ask for values so the user can type in the ID they are looking for. I am running into two problems. First is when I set up the query using unique and I go to search I do not get a text box to search for the ID. Next when I set it up using value and then search, a text box does come up it does not seem to recognize the value. I get the error "value entered is not valid". any ideas on this?
I was digging around in the config_Search Tools.jason doing some formatting and SQL query updates I didn't know how to apply in the WAB tool and found an option for "showattachments": null, (in esearch widget, WAB)? What is this and how do I use it? I've looked through the online help and can't seem to find it in there. I noticed it on the sample site but didn't see any data behind it.
Question2, Will there be suppport for related tables in the future for the Esearch tool? this is how I currently get at related permit information for parcels using the flex version of the esearch tool.
the showattachments is not documented because it is not yet functional (still working on this). As far as the relates feature that was available in the flex version, that is something on the wish list but not on the immediate horizon because the relates in flex was tied to the FixedDataGrid in the eSearch widget and that does not exist in the WAB version.
Robert, In your Expression Value settings, Is there a way to configure the expressions default value to be empty when asking for values? or is there a code workaround for this? It seems to require a value.
Robert, when configuring the widget, whether I say OK or Cancel in an config/edit window, the widget configuration window (for esearch) closes, making me have to open it again (and drill down) pretty much after each change. Have you seen this behavior? I'm using the latest version, but grabbed my previous /server/apps/##/configs/eSearch/config_Enhanced Search.json file from a previous release.....so although the widget shows it as the correct version, could there be something out of sync in this config file? If so, I'll recreated the search from scratch.
There is an update link at the bottom of each configuration screen that you should be using Only use the OK button when you are done completely configuring the widget. In future versions I will have a popup modal dialog for each page instead.
I have looked around to see if the question had already been asked but to no avail.
Is there an ability to search across layers for an attribute without having to know the layer you actually want to search in. For example you could search for a name across 8 layers without having to specify and search each layer in a piecewise fashion.
I figured out in the config file how to search a layer based on different attributes entered into a single combobox but not the above.
You can create a composite locator that can search for an ID or value across multiple features. This is done through the geocode widget. The down side to this is that you do not get a result set like the query task on the eSearch tool. Either way this may help a little Re: Create Geocoder service for a regular layerWAB Geocode Widget Composite Locator
Once again you fixed what ESRI missed. Great Job! I do have a couple questions. I think I placed the widget in the correct location for the JAVA App builder since is showed up...\\arcgis-web-appbuilder-1.0\client\stemapp\widgets.
My second problem is with configuring the Tools. I was able to work through the documentation to add a search and place the parameters. When I'm done I see the following in the SQL Expressions Values... Upper(Name) LIKE Upper('%[value]%'). This is the same SQL Statement as I find in my flex websites using your esearch widget. However, this one is giving me an error after I save the widget and test the site. Here is the error message... Search Failed!
So it does sound like you have installed the widget correctly in "Web AppBuilder".
Can you open your browsers dev tools by clicking F12 and looking at the console run the query again and see if there are any messages there that can shed some light on this issue?
I don't see the screenshot. It would be best to more this to a new thread as comments do not give you all the abilities to post stuff like a question thread would.
Nice addition! This sounds like the first step in a customization we'd like to do. We are using the WAB to build a web app to replace an existing one that has a long history of taking a parcel number through a very simple URL query string. For example http://www.abc.org/MapApp?parcelnum=0123456789
We've configured the eSearch widget with a parcel query, and it can execute queries based on URL strings if it is open, but we would like to maintain our easy to communicate query string of "parcelnum=0123456789"
If do it the eSearch way they if we add another query, the expression number variable could change, an then dozens or more links from other organizations would break.
So what I'd like to do is write some code for the WAB app that can take our simple query string that will never change and translate it behind the scenes to the user into a call to the eSearch query.
This code you posted will come in very handy to help me get started.
I think the UI is ok… you may just want to tweak the instructions slightly. I understand the UI better now after you explaining that. Maybe I missed it in the instructions as well.
Is this SQL Statement something you would consider making editable? This would allow for more complex queries, but I suppose more user errors as well.
I am looking for a way to query based on multiple input values, so instead of something like this "Upper(PARCELID) = Upper('[value]')" I would like to compose something like "Upper(PARCELID) in Upper('[value]')" (where value is a csv list or even something like "Upper(PARCELID) in Upper('[value]','[value]','[value]','[value]')".
Or is this something I should just try to customize somewhere in your code?
I had originally thought about making the SQL Statement textbox editable but I ran into some issue and then though about user error and decided against it. Now you have the ability to make the SQL statement what ever you want by modifying the eSearchWidget_config.json
Thanks, I reviewed the help doc and I completely left the explanation about the "Definition Expression" out. I have updated the help to include an explanation and a warning.
Thanks a million for all the time and effort you have put into version 1.1.0.3 of your Enhanced Search Widget. This is the one killer widget that will make our migration from Flex to JavaScript feasible. I have somewhat resolved the proxy issues at my end, and I have almost got everything to work like your Flex version.
When I use Firefox version 35, everything works like a charm. I created a test app here:
I am trying to find all the Libraries within 2 miles of a Road Segment.
First, I perform an Attribute Search to find Road Segment number 602.
Next, I apply a search distance of 2 miles within the Spatial Tab.
The blue buffer is drawn as expected.
Next, I search for Libraries that are entirely contained within this blue buffer.
I select the Buffer Graphics option
The search returns 9 Libraries. This works perfectly in Firefox version 35.
However, when I repeat the same steps in Google Chrome Version 40, I get an error message.
If I open the Attributes Tab, select Search Layer = Road Segments, and Press [Search] in Chrome,
I immediately get a Search failed error message!
When I use Internet Explorer version 9, I can get further, but the blue buffer never draws.
I can open the Attributes Tab, Select the Road Segments layer and press Search in IE9.
In IE9, it does highlight the selected Road Segment in red.
The next step is to buffer this Road Segment by 2 miles.
I open the Spatial Tab, and apply a buffer of 2 miles. At this point, I am expecting to see a Blue buffer.
However, nothing happens!
The buffer never draws in IE9.
I have created a web page to test out all your custom Widgets for the Web Application Builder Developer Edition 1.1. This has your Enhanced Basemap Gallery Widget and Google Street View Widget. They work like a champ on all browsers.
I am delighted that you are on a mission to duplicate all of this Flex functionality to the JavaScript platform as closely as you can. The Flex version still feels more robust and dependable with no such browser specific issues.
This Enhanced Search Widget, along with the Local Layers Widget, brought a set of key features that were sorely missing in the Web AppBuilder.
Thank you once again for your generosity in developing all these essential tools and sharing them with us.
You still have the app pointing to AGOL geometry service and have not change it to use your own. I would HIGHLY recommend using your own. The issue results from try to use a HTTPS url for the Geometry service on AGOL.
The fix is simple open the main config.json for this site and find the geometryService property and change it to use your own geometry service.
Thanks so much for testing this out and explaining the error I was making by leaving the Geometry Service pointing back to the AGOL geometry service.
I had never thought of that. Now that you mentioned it, I remember that I changed the Geometry Service to use our own on the Flex Version for better performance.
I will edit the config.json file, make the changes, and post the modified app this evening.
3. I had a question on what to enter for the "appId"
Should I leave this empty? In this example I entered the AppId of the Application I registered when I fired up the Web AppBuilder. Is this the right thing to do?
So far I got your Enhanced Search Widget 1.1.0.3 to work flawlessly on IE11, Firefox 36.
It also works brilliantly on Safari running on an iPad Air2 and an iPhone 6. The way the widget fills up the whole screen on an iPhone 6 is pure genius. This is a truly responsive design and this is one area where it trumps the Flex version.
However, I am still could not make this work on Chrome. I see from your screenshot that this is working fine at your end on Chrome version 40. This is puzzling!
Here is what I get when I try this on Chrome:
The first problem I see is that the drop down is missing from the Unique Values list.
When I press the [Search] button, I get an error message: Search failed !
I am running Google Chrome on a PC running Windows 7 Professional SP1.
I must be missing something really simple. I have placed a zipped copy of this application at:
This is the most important widget and we are so close to a perfect solution!
Your Enhanced Search Widget does magic. It brings the power of spatial analysis to the Smartphone via an intuitive GUI that even a layperson can understand.
Did you clear your cache in Chrome? I just tested again after clearing my cache and everything is still fine in chrome. Can you check the console in chrome and see if there are any errors?
First of all: GREAT app. Second, is there a plan to allow us to configure the auto zoom level per each search rather then for the entire application? Depending on the data being searched having the application zoom to a different search level would be helpful. At least to us!
The only time the zoom scale is used is for point results or if there is an issue with the returned geometry. Based on that info is this still important to you?
Thanks Robert. We search on a variety of point data. It would be nice to be able to define the zoom level differently based on the specific search. But maybe we are the exception and a default zoom level is preferable to most users. Wouldn't be the first time!
The addition of making the zoom scale configurable by layer is pretty minimal so I will add it to the enhancement list for the next version. Thanks for the feedback.
';
}
}
}
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(/