Next weird thing with your service is the results of this query.
If you take these 1000 ObjectIDs which contains 201686 (which is OWN1="STEAMBOAT WHARF PROPERTIES LLC") and execute the query with a where of
gisdata.GISADMIN.Parcels.OBJECTID IN (203964,204026,204020,204066,204069,204500,203979,204027,204056,203985,204481,204562,204004,204277,204492,204389,204303,204442,204482,204388,203585,203469,203542,203597,203547,203679,203414,203496,203471,203781,203684,203660,203660,203586,203586,203936,203895,203544,203528,203131,203118,203167,203455,203455,203455,203455,203455,203455,203455,203455,203455,203060,203132,203100,203044,203306,203332,203334,203216,203164,202715,202715,202979,203133,203133,203133,203133,203133,203133,203133,203133,203133,203133,203133,203133,203272,202802,202908,203246,203097,203243,202714,203341,202810,203161,203300,203165,203492,203509,203529,203368,203516,203462,203631,215102,203966,203575,203655,203646,203754,203609,215098,203894,203436,203447,203453,203813,203837,203856,203911,203911,202685,203163,203042,203455,203455,203455,203455,203998,204073,204122,204070,204088,204033,204059,204474,204571,215097,204498,204441,204299,203504,203443,203530,203573,203764,203765,203783,203890,203607,203662,202874,203075,203455,203455,203455,203455,203455,203455,203455,203455,203455,203980,203762,203847,203751,203862,202867,202909,202944,203029,202700,202994,202712,202880,203084,203123,203036,203149,203188,203137,203235,202839,203117,203021,203054,203410,203416,203485,203485,203420,203438,203688,203681,203690,203906,203618,203970,203623,203616,203951,203927,203527,203535,203803,202755,202675,202706,202794,203013,203081,203455,203455,203455,203455,202765,202793,212696,203204,203274,202704,200822,200695,200314,200465,200655,200522,201002,200803,201037,200605,200627,198465,198170,198504,198506,198636,198564,198812,203455,203455,203455,203144,203168,202777,212695,202699,203182,203140,203079,203002,203133,201695,199381,198746,198902,199067,198915,198979,199103,199408,199253,198693,198745,198791,198773,199375,202383,202383,201903,202564,202465,206272,206006,201901,202049,201896,202650,201255,201609,201188,199185,199411,198847,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,201602,201402,202140,202141,202278,202037,202104,202432,202501,202610,201111,201359,201216,201712,201136,201235,201391,201415,201454,201723,201093,201565,201582,201648,201668,201762,201744,201509,201569,201574,201736,201686,201860,201794,201949,202135,201810,201857,202199,202332,202355,202434,202548,202608,202515,202417,201947,202066,202320,202389,202416,206093,206270,206151,206174,206196,206154,206124,205951,206226,206263,206255,206000,205948,205946,206005,206208,206220,206221,206035,206086,206134,205978,205995,205953,206056,206070,205964,205994,206015,206044,206058,205354,205453,205561,205573,205648,205575,205619,205564,205585,205736,205735,205739,205504,205577,205860,205674,205857,205852,205755,205907,205807,205888,205920,205802,205806,205389,205523,205944,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,199293,202820,203070,203050,203112,203102,202915,203150,203181,203133,203133,203133,203133,203038,203041,203041,203125,203303,203146,203177,202710,202834,202884,203133,203133,203133,203133,203133,203133,203133,203133,203133,203133,203133,203133,203356,203155,202723,203108,202961,202795,202840,202681,202681,202974,203026,203130,203083,202851,203153,203154,201383,201261,201518,202404,201906,202119,201944,202025,202954,201252,201487,201487,201256,201437,201541,201642,202061,202211,202260,202260,201981,202265,202625,199136,197682,197943,197901,196862,197026,197230,197029,204242,204151,204174,204198,204246,204115,204075,204155,204184,204255,204108,204191,204607,204339,204406,204516,204523,204383,204433,204499,204307,204542,204598,204489,204121,204180,204202,204181,204192,204165,204355,204609,204360,204519,204594,204553,204330,203961,204119,204105,204289,204001,203988,204304,204304,203962,204560,204563,204232,204238,204535,203487,203596,203440,203461,203525,203706,203806,203774,203770,203914,203963,202960,203148,203455,203455,201524,201724,201225,201433,201129,201213,201507,201198,202475,202128,202334,201905,202222,202270,203133,203133,203133,202729,202848,202861,202888,202956,203018,203101,203020,201399,201257,201462,201113,201548,201750,202522,202530,202578,202490,201554,201429,201180,201180,201484,201731,201176,202391,202177,202366,201760,202023,202178,201912,202084,202491,202617,202616,201687,201693,201693,201693,201693,201693,201693,201693,201784,202111,202139,201817,201776,202538,202595,206274,206127,205979,206066,205993,206117,206125,206106,206262,205958,206008,206089,205981,206012,202132,202226,202273,202479,202481,202481,202553,202636,201192,201612,201332,201392,201347,201749,201100,202275,202403,201885,202137,202276,202412,201881,202423,201868,202280,202568,202544,201309,201571,201708,201742,201468,201229,201353,201223,201323,201720,201180,201180,201176,201176,201466,201597,201681,201739,202207,201780,202028,202127,202174,201862,202418,202285,202285,202339,201770,201786,202013,202394,202045,202242,203455,203455,202934,203094,202936,203103,203375,203323,203266,203342,203342,203147,202718,202720,203133,203133,203133,203133,203247,203173,202919,203171,203139,203219,203252,202953,203077,203400,203562,203441,203465,203600,215103,203652,215101,203580,203603,215100,203460,203637,203736,203854,203810,203873,205382,205531,205630,205454,205665,205678,205812,205910,205417,205554,205666,205659,205622,205656,205795,205823,203133,202728,202736,202687,216697,202768,203016,203068,202850,202973,201356,201326,201178,203136,202807,202844,202788,202892,203379,202713,202693,202783,202846,202727,202745,202812,202886,202882,203424,201664,201664,201367,202054,202218,202296,202388,201830,202392,203887,203877,203455,203455,203455,203455,203455,203455,203455,202701,202991,203037,202824,202868,203129,202877,202967,203043,203059,203221,203312,203245,203133,203133,203133,203133,203133,202589,206118,206120,206139,205980,206179,206112,206009,206020,206159,206128,205983,206046,206144,206085,206099,206193,206202,206253,206252,205967,205956,206050,206064,206014,206107,206119,206042,205943,206027,206073,205387,205452,205503,205579,205595,205476,205589,205785,205841,205869,205775,205506,205654,205722,205792,205939,205892,205522,205650,205623,205849,205912,205932,205865,205836,205716,205885,205725,205343,205634,205642,205644,205732,205529,205529,205491,205530,205553,205714,205925,203133,203133,203133,202787,202985,203063,203091,203121,203121,202911,203014,201269,201620,201774,201692,203322,203322,202651,203023,203096,203128,203128,203205,203141,203145,202674,202654,202654,202697,202691,202845,202889,203051,202941,203110,203027,201159,202130,202357,201979,201880,202508,201815,201139,201552,201733,201135,202372,202196,202428,202220,202220,202510,212697,201105,202036,202031,202330,201990,202018,202345,202591,201308,201486,201190,201329,201480,201187,201274,201463,201185,201183,201327,201464,202059,205838,205764,205702,205935,205914,205879,205991,205314,205447,205334,205496,205649,205537,205890,205915,205783,205709,205738)
It returns 1000 results but not 201686!!!
There is some issue with your map service. I would contact esri tech support.
I am in need of help. In the results tab, is it possible to remove the options "Pan to", "Flash", "Save To My Content" and "Statistics"?
Another issue is that I need to include two date fields in the widget, that is, the start date and the end date. These fields will not perform any filter on the map. I'll just need to use them to later generate an excel spreadsheet using an external application made in C #. This is another thing that I need to check how to get the results array.
Thank you for your help.
Worked perfectly.
I just need to find out where the results are stored, so I can take one of the attributes and pass it to my ASP.NET C #
application. Hug, Gilberto.
Hello! Robert, I debugged it with google chrome, and I was able to check the place where
I could insert what I needed. Follow below:
In the '_onSearchFinish' function of the widget.js file
for (i = 0; i < len; i++) {
var featureAttributes = results.features.attributes;
sListaCodigosEstacoes += "'" + featureAttributes["myAttribute"] + "',"; //variable with content i need
Thanks!
Hug,
Gilberto.
The Web Development Team did a terrific job with WAB 2.16.
I am excited about the next generation Web AppBuilder – the new Experience Builder Platform built upon JavaScript 4.x.
This has the potential to revolutionize the way we build complete websites just the way the Web AppBuilder has forever changed the way we design Web Apps.
I posted a Blog with a detailed step-by-step Tutorial on how to design a website using the Developer Edition of the ArcGIS Experience Builder:
The Developer Edition of ExB is necessary to add Custom Widgets.
I added a chapter at the end of the tutorial discussing the Evolution of the Experience Builder.
It was Moxie Zhang’s vision to make it easy for non-programmers to design Web Apps which led to the original ArcGIS Viewer for FLEX.
You took the FlexViewer to dizzying heights with your set of Custom Widgets. The most popular widget ever designed for the FlexViewer was your original Enhanced Search Widget.
Moxie’s team then came up with the ArcGIS Web AppBuilder platform based on JavaScript 3.x.
It was a monumental effort on your part to transfer all your Flex Code into JavaScript and keep all your Custom Widgets alive for us.
Your efforts have forever changed the landscape of Web App Design.
This has been long journey. This has saved us thousands of hours of our programming time.
The new Experience Builder based on JavaScript 4.x opens up a whole new frontier. It offers seamless switching between 2D and 3D views. The platform is built Mobile First.
Everything gracefully collapses to fit your Smartphone.
I can hardly wait to test out your Custom Widgets for ExB as you release them in the future!
On behalf of our Web Development Community I would like to say a big THANK YOU to you, Moxie and the rest of the Team.
I used the code as a starting point and would like to modify it a little bit further.
Is it possible to add a sign in option as the first thing that the user sees when they open this widget?
The idea is to use this widget to share secure data on a public app.A subset of the users would search this data after signing in. The widget would also be publicly shared but wont show any of its tabs until the user has signed in using their ArcGIS enterprise credentials.
I tried to secure this widget through portal groups but as soon as I added it to the public app and reloaded it, the login credentials were required.
I also attempted to integrate this code from ArcGIS API for JS 4.12 but was unsuccessful.
I wish the apps built through web appBuilder could separate the security of layers,widgets and the app itself.
Where a prompt to login only pops-up when the user turns on the secured layer or attempts to open a secured widget.
First of all, congratulations on the widget. Very well written and helped me a lot.
I have only one doubt: is there any way to include in the common text fields, a style of auto-complete, that is, depending on what the user is typing, to suggest the possibilities?
I can't seem to get the widget to use the popup from the Web Map. It will only use the popup from the eSearch config. I'm using the latest versions of both the Dev Edition (2.16) and the eSearch widget (2,13). Has anyone else had the same issue?
I'm trying to replicate the functionality of the Flex esearch widget for an owner mailing list application that people in my org are still using (but in need of an upgrade). I've looked into a few different options including the Public Notification widget but e-search is still the best for its speed and functionality. I have a few questions that I can't seem to figure out.
The workflow is that the user selects a property (by attribute or by graphic) and then creates a buffer from the property to select from the buffer graphic.Then they export the results to csv.
To make the process simple, I would like to disable the Results tab from automatically opening every time a search is completed. The user can open it manually when they are finished selecting a property and applying the buffer.
Is there a way to disable the Results tab from auto opening after a search?
Also in the By Spatial tab, is there a way to disable the pop-up that says 'Do you want to use the Buffer Graphics or the Selection Graphics?' and instead choose Buffer graphics by default?
None of these are essential, but would help in making the application simpler for the average user.
I have tried searching this thread and the help doc for the widget, but I am not finding anything... I am wondering if instead of the results tab being displayed after a search, the summary popup could be displayed automatically after the search (instead of having to click the "more..." option on the bottom of the results window. I am basically trying to get a summary window/popup on several fields by using a graphical search.
Hi Robert -- I'm having a hard time finding the spot in the code that controls which tab in the eSearch widget opens by default. I'd like to change the default so that it opens to the By Shape tab instead of the By Value tab. Can you point me in the right direction, please?
Maybe this has been asked already and I couldn't find it, but is there a way to include the search results in the attribute table, but not have the attribute table open automatically? I would like the user to have the option to view the attribute table at their discretion. Thanks
Yes, I tried changing some code in that method as well with no luck. When I comment out your above method, it forces the attribute table to stay closed, but then when I do open it after a search, it is empty. Oh well. Thanks for checking it out.
This seems to get the job done. As long as the AT widget is configured to NOT filter results by the map extent, the search returns the results in the map without the AT automatically opening, but if the user wants to see the results in the AT, they are there once it opens.
Robert, I'm having an issue with the configuration of the eSearch widget. Everything is working fine, but I've been asked to add two different projections to the list of options. When I open the window to add in a new WKID, the value that I enter in that first box disappears as soon as I tab or click outside of the WKID box. The same thing happens if I open the window for an existing projection in the widget -- the window is empty when it opens and my data entry in the blanks do not persist. I fear that my tinkering in the configs\eLocate\config_widgets_eLocate_Widget_21 file has caused this issue. Are you seeing any issues with your version of the widget?
I upgraded to the 2.13 Widget with 2.16 WAB and now the search doesn't work correctly anymore.
Old correct way:
SQL Where with layers definition expression: Upper(OWNER) LIKE Upper('%Fei%') AND Upper(OWNER) LIKE Upper('%Fei%') AND Upper(OWNER) LIKE Upper('%Marok%') AND Upper(PARID) LIKE Upper('%%') AND Upper(PARCEL_ADDR) LIKE Upper('%%') AND Upper(LEGAL) LIKE Upper('%%') Widget.js:2156:19
New Incorrect:
SQL Where with layers definition expression: Upper(OWNER) LIKE Upper('%Fei Fei Marok%')Widget.js:2516:19
Stupid me, I didn't think to even look at General Settings. TY
But that just turned the first box into a OR phrase not an AND with all fields
SQL Where with layers definition expression: Upper(OWNER) LIKE Upper('%Fei%') OR Upper(OWNER) LIKE Upper('%Fei%') OR Upper(OWNER) LIKE Upper('%Marok%') Widget.js:2516:19
So I still missing something obvious?
I did find the line to change the OR to and AND in the widget. js, to fix that issue for a single box, but why am I setting the rest of the boxes in my widget disconnected from the first field?
I am trying to figure out where the code lives for the popup menu in the Results tab (see attachment). I would like to accomplish 2 things.
1. Change the name of a menu item in the popup menu. Typically I would look in the strings.js file for those changes, but I realize they are not found there for this menu. And,
2. Delete one of the popup menu options from showing up (would like to not have "Save to my Content" as an option at all). I have accomplished removals like this in the past using a rule in the widgets html file, but again, i am lost as to where the code for this popup menu comes from.
';
}
}
}
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 {
lingoThreadLangSelected(lang, '910880');
} catch (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(/