PageSourceSearch

https://www.whathouse.com/Blocks/RichWidgets/RichWidgets/Popup_Editor.en.js?2071

js whathouse.com collected 2026-10-02 04:43:29 UTC 23,609 bytes, 553 lines download raw bytes

1//Open an Dialog
2var RichWidgets_Popup_Editor_ShowTimeoutMilSecs = 200;
3var RichWidgets_Popup_Editor_HideTimeoutMilSecs = 800;
4var RichWidgets_Popup_Editor_InitialWidth = 210;
5var RichWidgets_Popup_Editor_InitialHeight = 100;
6var RichWidgets_Popup_Editor_notifyWidget;
7var RichWidgets_Popup_Editor_Index = 4010;
8var RichWidgets_Popup_Editor_ParentUrl;
9var RichWidgets_Popup_Editor_ClosingTag = 'closing';
10var RichWidgets_Popup_Editor_ClosingValue = 'true';
11
12function RichWidgets_Popup_Editor_init(linkId, notifyId, setTitle, setHeight, setWidth, parentUrl, useModal, autoResize, recenterOnResize, hideCloseButton) {
13 var GetLinkHref = function(widget) {
14    var linkHref;
15    var isAButton = false;
16    try {
17    //Checks if the id is from a link or not
18    linkHref = outsystems.internal.$(widget).attr('href');
19
20    //Tests for visibility/existence
21    if (typeof linkHref == 'undefined') {
22      var onClick = widget.getAttribute('onclick');
23      if (typeof onClick != 'undefined') {
24        isAButton = true;
25        if (onClick != null) {
26          var hrefMatch;
27          if((hrefMatch = onClick.toString().match(/href='([^']*)'/)) != null) {
28                linkHref = hrefMatch[1];
29          }
30        }
31      }
32    } //else: throw ("Inexistent or Invisible button");
33   } catch(e) {}
34  
35   return [linkHref, isAButton];
36 }
37
38 outsystems.internal.$().ready(function($) {
39  linkId = '#' + linkId;
40  var linkWidget;
41  try { linkWidget = $(linkId).get(0); } catch(e) {}
42  if (typeof linkWidget == 'undefined') {
43    //Case the widget is inexistent or invisible, it will show no errors.
44    return;
45  }
46  
47  RichWidgets_Popup_Editor_ParentUrl = parentUrl;
48  
49  var getLinkResult = GetLinkHref(linkWidget);
50  var linkHref = getLinkResult[0];
51  var isAButton = getLinkResult[1];
52
53  if (typeof linkHref == 'undefined' || linkHref == "" || linkHref == "#" || linkHref.indexOf("javascript:") == 0) {
54   try {
55       window.OsHandleException(new Error("Popup link id must be the id of a Link or Button Widget with Method Navigate."), outsystems.osErrorCodes.SystemJavascriptError, 'Popup_Editor');
56   } catch(e) {}
57   return;
58 } 
59
60  if (isAButton) {
61    //remove the existing on-click
62    linkWidget.setAttribute('onclick', linkWidget.getAttribute('onclick').toString().replace('window.location.href=', 'return false;window.location.href='));
63  }
64
65  // if there's a confirmation message, store in an attribute the result
66  if (linkWidget.getAttribute('onclick') != null) {
67    linkWidget.setAttribute('onclick', linkWidget.getAttribute('onclick').toString().replace("if( ret != true )", "outsystems.internal.$('" + linkId + "').get(0).setAttribute('confirmed', ret); if( ret != true )"));
68  }
69
70  var clickHandler = function(event) {
71  
72    //The clickHandler event is registered in osjs and outsystems.internal.$ for compatibillity reasons, they must not run both for the same click.
73    //Variable is set to false in RichWidgets_Popup_Editor_resize function.
74    if(outsystems.internal.$.data(event.target,"os-internal-processing") == true){
75        return false;
76    } else {
77        outsystems.internal.$.data(event.target,"os-internal-processing", true);
78    }
79  
80   //Check if the clicked link is disabled
81   if(linkWidget.getAttribute('disabled') != null){
82       var linkDisabled = linkWidget.getAttribute('disabled').toString().toLowerCase();
83       if(linkDisabled == 'disabled' || linkDisabled.indexOf('true') != -1){
84        return false;
85       }
86   }
87
88   if (linkWidget.getAttribute("confirmed") == 'false') {
89     outsystems.internal.$.data(event.target,"os-internal-processing", false);
90     return false;
91   }
92   if (OsIsIE()) {
93     osFocusBackend.ClearFocusedElement();
94   }
95   var popupDiv = $("<div style='text-align: center; display: none;'></div>").appendTo("body");
96   popupDiv.append('<iframe width="100%" scrolling="auto" height="100%" frameborder="0" src="javascript:void(0);"/>');
97   var waitText =  " Please wait while content is loading...";
98   var imgHTML = "<img style='border-width: 0px; height: 16px; width: 16px;' src='/RichWidgets/img/SpinBlack.gif'/>";
99   var pleaseWaitDiv = popupDiv.prepend("<div style='margin-top: 25px;' class='Text_Note'>
99" + imgHTML + waitText + "</div>")
100
101   var loadTargetPage = function () {
102      RichWidgets_Popup_Editor_notifyWidget = notifyId;
103       //load target page
104       var ohref = GetLinkHref(linkWidget)[0];
105       var rhref = ohref.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + (+ new Date().now) + "$2"); 
106       var xhref = rhref + ((rhref == ohref) ? (rhref.indexOf('?') >= 0 ? "&" : "?") + "_=" + (+new Date) : ''); 
107       popupDiv.find('iframe').attr('src', xhref); 
108       (function(popupDiv) {
109           popupDiv.find('iframe').load(function() {
110               //after loading try to resize, if it is possible resize also after each ajax call
111               if(RichWidgets_Popup_Editor_resize(popupDiv, setWidth, setHeight, true, event)) {
112                   if (autoResize) {
113                      var contentWindow = this.contentWindow;
114                      contentWindow.osAjaxBackend.BindAfterAjaxRequest(function(){
115                        contentWindow.parent.RichWidgets_Popup_Editor_resize(popupDiv, setWidth, setHeight, recenterOnResize, event);
116                      });
117                   }
118               }   
119           });
120       })(popupDiv);
121       popupDiv = null;
122       pleaseWaitDiv = null;
123   }
124
125   OpenPopup(popupDiv, setTitle, setHeight, setWidth, pleaseWaitDiv, hideCloseButton, loadTargetPage, event);
126
127   return false;
128  };
129  
130  outsystems.internal.registerClickInBothJQueries(linkId, clickHandler);
131
132  function OpenPopup(divToPopup, setTitle, setHeight, setWidth, divPleaseWait, hideCloseButton, loadTargetPage, event) {
133   //destroy any previous dialog 
134   RichWidgets_Popup_Editor_Close(null);
135   // if any close is pending, schedule to execute itself asynchronously exit
136   // if no close is pending, continue with open operation
137   var closingPopups = $('.os-internal-ui-dialog-content');
138   for(var i = 0; i < closingPopups.length; i++) {
139    if(outsystems.internal.$.data(closingPopups.get(i),RichWidgets_Popup_Editor_ClosingTag) == RichWidgets_Popup_Editor_ClosingValue) {
140        setTimeout(function() {
141            OpenPopup(divToPopup, setTitle, setHeight, setWidth, divPleaseWait, hideCloseButton, loadTargetPage, event)
142        }, 13);
143        return false;
144    }
145   }
146   $(divPleaseWait).show();
147   if (setHeight == -1) setHeight = RichWidgets_Popup_Editor_InitialHeight;
148   $(divToPopup).show().dialog({
149    dialogClass: 'os-internal-Popup',
150    resizable: false,
151    autoResize: false,
152    closeOnEscape: !hideCloseButton,
153    bgiframe: true,
154    draggable: true,
155    autoOpen: true,
156    title: setTitle,
157    modal: !(useModal === false),
158    height: setHeight,
159    position: 'center',
160    width: ((setWidth == -1) ? RichWidgets_Popup_Editor_InitialWidth: setWidth),
161    zIndex: RichWidgets_Popup_Editor_Index,
162    close: function() {
163     //If the popup is closed before it is resized (ESC) we need to set the processing event to false. 
164     outsystems.internal.$.data(event.target,"os-internal-processing", false); 
165     $(divToPopup).find('iframe').unbind("load");     
166     $(divToPopup).find('iframe').attr('src', 'about:blank');
167     setTimeout(function() {
168      $(divToPopup).find('iframe').empty();
169      $(divToPopup).empty();
170     }, 13); //We need to delay this! or IE7 crashes
171    }
172   });
173   $(divToPopup).find('iframe').height(0);
174   $(divToPopup).parents('.os-internal-ui-dialog').dropShadow();
175   
176
177   if (setTitle==" ") {
178    $(".os-internal-ui-dialog-titlebar").height(0);
179    $(".os-internal-ui-dialog-titlebar").addClass("os-internal-header-space");
180    $(".os-internal-ui-dialog-titlebar-close").attr("class","os-internal-ui-dialog-titlebar-close-no-title").html("").hide();
181    $(".os-internal-ui-dialog").css("overflow","visible");
182   } else {
183    var titleHeight = $('.os-internal-ui-dialog-titlebar').height();
184    if($('.os-internal-ui-dialog-titlebar').hasClass("os-internal-header-space")) {
185        $('.os-internal-ui-dialog-titlebar').removeClass("os-internal-header-space");
186    }
187    $(divToPopup).parents('.os-internal-Popup').height(setHeight+titleHeight);
188   }
189    if (hideCloseButton) {
190        $(".os-internal-ui-dialog-titlebar-close, .os-internal-ui-dialog-titlebar-close-no-title").remove();
191    }
192    loadTargetPage();
193  };
194 });
195}
196
197function RichWidgets_Popup_Editor_resize(divToPopup, setWidth, setHeight, recenter, event) {
198    // Code to support old resize method RichWidgets_Popup_Editor_resize(setWidth, setHeight, recenter)
199    if(typeof(recenter) == 'undefined') {
200        recenter = setHeight;
201        setHeight = setWidth;
202        setWidth = divToPopup;
203        divToPopup = outsystems.internal.$('.os-internal-ui-dialog-content');
204    }
205    
206    
207    // Resize must bail out immediately if the popup is marked as closing, and not start the animation.
208    if(outsystems.internal.$.data(divToPopup.get(0), RichWidgets_Popup_Editor_ClosingTag) == RichWidgets_Popup_Editor_ClosingValue) {
209        return false;
210    }
211    var frameObj = divToPopup.find('iframe')[0];
212    var documentServer = document.location.href.replace(/(https?:\/\/[^\/]*).*/, '$1');
213    var frameServer = frameObj.src.replace(/(https?:\/\/[^\/]*).*/, '$1');
214    var sameOrigin = (frameServer.toLowerCase() == documentServer.toLowerCase() || frameServer.indexOf("http") != 0);
215    if (!sameOrigin && (setWidth == -1 || setHeight == -1)) throw (new Error("A Popup with a screen from a different server (or https) needs explicict width, height set."));
216    if (sameOrigin) {
217        var innerDoc = (frameObj.contentDocument) ? frameObj.contentDocument : frameObj.contentWindow.document;
218        if (innerDoc.documentElement.scrollHeight == 0) // strangely this event is also triggered on close
219        return false;
220    }
221    var oldHeight = outsystems.internal.$(divToPopup).parents('.os-internal-Popup').outerHeight();
222    var width = ((setWidth == -1) ? outsystems.internal.$(innerDoc).width() : setWidth);
223    var height = ((setHeight == -1) ? outsystems.internal.$(innerDoc).height() : setHeight);
224
225    var titleHeight = outsystems.internal.$('.os-internal-ui-dialog-titlebar').height();
226    
227    // Verify if the parent window width is less than the pop-up window, if so set the responsive class on the iframe body (for responsive themes)
228    if(window.innerWidth < width)
229    {
230        // only set the class if the origin is the same
231        if(sameOrigin) {
232            $(innerDoc).find('body').addClass('Responsive');
233            width = window.innerWidth - 20; // 10px "padding" effect, to keep the popup look and feel on top of content
234        }
235    }
236
237    // Fix issues with scrollbars
238    if (setHeight == -1) {
239        // IE7 needs a little more space to remove the scrollbars
240        if (outsystems.internal.$.browser.msie) height = height + 1;
241    } else { //when explicitly setting the height
242        if (sameOrigin) innerDoc.body.style.height = 'auto';
243    }
244
245    outsystems.internal.$(divToPopup).height(height);
246
247
248    //Hide ECT
249    outsystems.internal.$(innerDoc).find('.ECT_FeedbackContainer').hide();
250    var divPopupOuterWindow = outsystems.internal.$(divToPopup).parents('.os-internal-Popup');
251
252    var animateFinal = {};
253
254    if (setHeight == -1) {
255        var oldTop = parseInt(divPopupOuterWindow.css("top"));
256        if (recenter)
257            animateFinal.top = Math.max(20, oldTop + (oldHeight - (height + titleHeight)) / 2);
258        animateFinal.height = height + titleHeight;
259    }
260
261    if (setWidth == -1) {
262        var oldLeft = parseInt(divPopupOuterWindow.css("left"));
263        if (recenter)
264            animateFinal.left = oldLeft + (divPopupOuterWindow.width() - width) / 2;
265        animateFinal.width = width;
266    }
267    
268    if(divPopupOuterWindow.width() == animateFinal.width && 
269       divPopupOuterWindow.height() == (animateFinal.height - (outsystems.internal.$.browser.msie?1:0))){
270       outsystems.internal.$(".os-internal-ui-dialog-content>.Text_Note").hide();
271       outsystems.internal.$(divToPopup).height(height - (outsystems.internal.$.browser.msie?1:0)); // restore size
272       return true; // nothing to do...
273    }
274    
275    // hide content in first resize - readjustments will not flickr
276    if(divPopupOuterWindow.width()  == RichWidgets_Popup_Editor_InitialWidth && 
277       divPopupOuterWindow.height() == RichWidgets_Popup_Editor_InitialHeight){
278        outsystems.internal.$(frameObj).height(0);
279    }
280    var onAnimationComplete = function () {
281        setTimeout(function() {
282            outsystems.internal.$(divToPopup).dialog('size');
283            outsystems.internal.$('.os-internal-ui-dialog-titlebar-close-no-title').css('display', 'block');
284            outsystems.internal.$(divToPopup).find('iframe').height("100%").width(animateFinal.width);
285        },13);
286    };
287    var divPleaseWait = outsystems.internal.$(".os-internal-ui-dialog-content>.Text_Note");
288    divPleaseWait.hide();
289
290    if (setHeight == -1 || setWidth == -1) divPopupOuterWindow.animate(animateFinal, {
291        duration: 200,
292        complete: onAnimationComplete
293    });
294    else onAnimationComplete();
295
296    innerDoc = null;
297    divPopupOuterWindow = null;
298    outsystems.internal.$.data(event.target,"os-internal-processing", false);
299    return true;
300}
301
302var popupToClose;
303function RichWidgets_Popup_Editor_Close(iFrame) {
304    // Any close requests must immediately (synchronously) tag the closing element, marking it as closing. The cleanup must be done asynchronously due to IE7..
305    popupToClose = outsystems.internal.$('.os-internal-ui-dialog-content');
306    outsystems.internal.$(popupToClose).data(RichWidgets_Popup_Editor_ClosingTag, RichWidgets_Popup_Editor_ClosingValue);
307
308    function WaitForJSONUpdateAndAJAX(continuation) {
309        var hasPendingAJAX = false;
310        var hasPendingJSONUpdate = false;
311        try {
312            hasPendingAJAX = popupToClose.find("iframe")[0].contentWindow.osQueue.length > 0;
313            hasPendingJSONUpdate = popupToClose.find("iframe")[0].contentWindow.OsJSONUpdateQueue.length > 0;
314        } catch (e) { 
315        }
316        if(hasPendingAJAX || hasPendingJSONUpdate) {
317            setTimeout(function() {WaitForJSONUpdateAndAJAX(continuation)}, 13);
318        } else {
319            continuation();
320        }
321    }
322
323    function closePopup() {
324        setTimeout(function() {
325           outsystems.internal.$(popupToClose).dialog('close'); 
326           outsystems.internal.$(popupToClose).remove();
327        },
328        0);
329    }
330    
331    WaitForJSONUpdateAndAJAX(closePopup);  
332};
333
334function RichWidgets_Popup_Editor_WithToken_init(linkId, notifyId, setTitle, setHeight, setWidth, parentUrl, useModal, autoResize, recenterOnResize, hideCloseButton, uploadTokenInputId) {
335 var GetLinkHref = function(widget) {
336    var linkHref;
337    var isAButton = false;
338    try {
339    //Checks if the id is from a link or not
340    linkHref = outsystems.internal.$(widget).attr('href');
341
342    //Tests for visibility/existence
343    if (typeof linkHref == 'undefined') {
344      var onClick = widget.getAttribute('onclick');
345      if (typeof onClick != 'undefined') {
346        isAButton = true;
347        if (onClick != null) {
348          var hrefMatch;
349          if((hrefMatch = onClick.toString().match(/href='([^']*)'/)) != null) {
350                linkHref = hrefMatch[1];
351          }
352        }
353      }
354    } //else: throw ("Inexistent or Invisible button");
355   } catch(e) {}
356  
357   return [linkHref, isAButton];
358 }
359
360 var initializeFunction = function($) {
361  linkId = '#' + linkId;
362  var linkWidget;
363  try { linkWidget = $(linkId).get(0); } catch(e) {}
364  if (typeof linkWidget == 'undefined') {
365    //Case the widget is inexistent or invisible, it will show no errors.
366    return;
367  }
368  
369  RichWidgets_Popup_Editor_ParentUrl = parentUrl;
370  
371  var getLinkResult = GetLinkHref(linkWidget);
372  var linkHref = getLinkResult[0];
373  var isAButton = getLinkResult[1];
374
375  if (typeof linkHref == 'undefined' || linkHref == "" || linkHref == "#" || linkHref.indexOf("javascript:") == 0) {
376   try {
377       window.OsHandleException(new Error("Popup link id must be the id of a Link or Button Widget with Method Navigate."), outsystems.osErrorCodes.SystemJavascriptError, 'Popup_Editor');
378   } catch(e) {}
379   return;
380 } 
381
382  if (isAButton) {
383    //remove the existing on-click
384    linkWidget.setAttribute('onclick', linkWidget.getAttribute('onclick').toString().replace('window.location.href=', 'return false;window.location.href='));
385  }
386
387  // if there's a confirmation message, store in an attribute the result
388  if (linkWidget.getAttribute('onclick') != null) {
389    linkWidget.setAttribute('onclick', linkWidget.getAttribute('onclick').toString().replace("if( ret != true )", "outsystems.internal.$('" + linkId + "').get(0).setAttribute('confirmed', ret); if( ret != true )"));
390  }
391
392  var clickHandler = function(event) {
393  
394    //The clickHandler event is registered in osjs and outsystems.internal.$ for compatibillity reasons, they must not run both for the same click.
395    //Variable is set to false in RichWidgets_Popup_Editor_resize function.
396    if(outsystems.internal.$.data(event.target,"os-internal-processing") == true){
397        return false;
398    } else {
399        outsystems.internal.$.data(event.target,"os-internal-processing", true);
400    }
401  
402   //Check if the clicked link is disabled
403   if(linkWidget.getAttribute('disabled') != null){
404       var linkDisabled = linkWidget.getAttribute('disabled').toString().toLowerCase();
405       if(linkDisabled == 'disabled' || linkDisabled.indexOf('true') != -1){
406        return false;
407       }
408   }
409
410   if (linkWidget.getAttribute("confirmed") == 'false') {
411     outsystems.internal.$.data(event.target,"os-internal-processing", false);
412     return false;
413   }
414   if (OsIsIE()) {
415     osFocusBackend.ClearFocusedElement();
416   }
417   var popupDiv = $("<div style='text-align: center; display: none;'></div>").appendTo("body");
418   popupDiv.append('<iframe width="100%" scrolling="auto" height="100%" frameborder="0" src="javascript:void(0);"/>');
419   var waitText =  " Please wait while content is loading...";
420   var imgHTML = "<img style='border-width: 0px; height: 16px; width: 16px;' src='/RichWidgets/img/SpinBlack.gif'/>";
421   var pleaseWaitDiv = popupDiv.prepend("<div style='margin-top: 25px;' class='Text_Note'>
421" + imgHTML + waitText + "</div>")
422
423   var loadTargetPage = function () {
424      RichWidgets_Popup_Editor_notifyWidget = notifyId;
425       //load target page
426       var ohref = GetLinkHref(linkWidget)[0];
427       var rhref = ohref.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + (+ new Date().now) + "$2"); 
428       var xhref = rhref + ((rhref == ohref) ? (rhref.indexOf('?') >= 0 ? "&" : "?") + "_=" + (+new Date) : ''); 
429       if (uploadTokenInputId) {
430           var token = $("#" + uploadTokenInputId).val();
431           xhref = xhref + "&Token=" + token;
432           $("#" + uploadTokenInputId).val("");
433       }
434       popupDiv.find('iframe').attr('src', xhref); 
435       (function(popupDiv) {
436           popupDiv.find('iframe').load(function() {
437               //after loading try to resize, if it is possible resize also after each ajax call
438               if(RichWidgets_Popup_Editor_resize(popupDiv, setWidth, setHeight, true, event)) {
439                   if (autoResize) {
440                      var contentWindow = this.contentWindow;
441                      contentWindow.osAjaxBackend.BindAfterAjaxRequest(function(){
442                        contentWindow.parent.RichWidgets_Popup_Editor_resize(popupDiv, setWidth, setHeight, recenterOnResize, event);
443                      });
444                   }
445               }   
446           });
447       })(popupDiv);
448       popupDiv = null;
449       pleaseWaitDiv = null;
450   }
451
452   OpenPopup(popupDiv, setTitle, setHeight, setWidth, pleaseWaitDiv, hideCloseButton, loadTargetPage, event);
453
454   return false;
455  };
456  
457  outsystems.internal.registerClickInBothJQueries(linkId, clickHandler);
458
459  function OpenPopup(divToPopup, setTitle, setHeight, setWidth, divPleaseWait, hideCloseButton, loadTargetPage, event) {
460   //destroy any previous dialog 
461   RichWidgets_Popup_Editor_Close(null);
462   // if any close is pending, schedule to execute itself asynchronously exit
463   // if no close is pending, continue with open operation
464   var closingPopups = $('.os-internal-ui-dialog-content');
465   for(var i = 0; i < closingPopups.length; i++) {
466    if(outsystems.internal.$.data(closingPopups.get(i),RichWidgets_Popup_Editor_ClosingTag) == RichWidgets_Popup_Editor_ClosingValue) {
467        setTimeout(function() {
468            OpenPopup(divToPopup, setTitle, setHeight, setWidth, divPleaseWait, hideCloseButton, loadTargetPage, event)
469        }, 13);
470        return false;
471    }
472   }
473   $(divPleaseWait).show();
474   if (setHeight == -1) setHeight = RichWidgets_Popup_Editor_InitialHeight;
475   $(divToPopup).show().dialog({
476    dialogClass: 'os-internal-Popup',
477    resizable: false,
478    autoResize: false,
479    closeOnEscape: !hideCloseButton,
480    bgiframe: true,
481    draggable: true,
482    autoOpen: true,
483    title: setTitle,
484    modal: !(useModal === false),
485    height: setHeight,
486    position: 'center',
487    width: ((setWidth == -1) ? RichWidgets_Popup_Editor_InitialWidth: setWidth),
488    zIndex: RichWidgets_Popup_Editor_Index,
489    close: function() {
490     //If the popup is closed before it is resized (ESC) we need to set the processing event to false. 
491     outsystems.internal.$.data(event.target,"os-internal-processing", false); 
492     $(divToPopup).find('iframe').unbind("load");     
493     $(divToPopup).find('iframe').attr('src', 'about:blank');
494     setTimeout(function() {
495      $(divToPopup).find('iframe').empty();
496      $(divToPopup).empty();
497     }, 13); //We need to delay this! or IE7 crashes
498    }
499   });
500   $(divToPopup).find('iframe').height(0);
501   $(divToPopup).parents('.os-internal-ui-dialog').dropShadow();
502   
503
504   if (setTitle==" ") {
505    $(".os-internal-ui-dialog-titlebar").height(0);
506    $(".os-internal-ui-dialog-titlebar").addClass("os-internal-header-space");
507    $(".os-internal-ui-dialog-titlebar-close").attr("class","os-internal-ui-dialog-titlebar-close-no-title").html("").hide();
508    $(".os-internal-ui-dialog").css("overflow","visible");
509   } else {
510    var titleHeight = $('.os-internal-ui-dialog-titlebar').height();
511    if($('.os-internal-ui-dialog-titlebar').hasClass("os-internal-header-space")) {
512        $('.os-internal-ui-dialog-titlebar').removeClass("os-internal-header-space");
513    }
514    $(divToPopup).parents('.os-internal-Popup').height(setHeight+titleHeight);
515   }
516    if (hideCloseButton) {
517        $(".os-internal-ui-dialog-titlebar-close, .os-internal-ui-dialog-titlebar-close-no-title").remove();
518    }
519    loadTargetPage();
520  };
521 };
522 initializeFunction(outsystems.internal.$);
523}
524
525function RichWidgets_Popup_Editor_Token_Generator_init(linkId, buttonId) {
526
527    outsystems.internal.$().ready(function($) {
528        linkId = '#' + linkId;
529        buttonId = '#' + buttonId;
530
531        var linkWidget;
532        try {
533            linkWidget = $(linkId).get(0);
534        } catch(e) { }
535
536        if (typeof linkWidget === 'undefined') {
537            //Case the widget is inexistent or invisible, it will show no errors.
538            return;
539        }
540
541        $(linkWidget).unbind('click');
542        $(linkWidget).attr('onclick', 'javascript:return false;');
543        $(linkWidget).attr('href', 'javascript:void(0)');
544        $(buttonId).click(function () {return false;});
545
546        $(linkWidget).click(function() {
547            $(buttonId).trigger('click');
548            return false;
549        });
550
551    });
552
553}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.