PageSourceSearch

https://www.neste.ee/sites/all/modules/custom/neste_ajax_error_modal/neste_ajax_error_modal.js?tlthv2

js neste.ee collected 2026-09-26 13:57:33 UTC 2,261 bytes, 73 lines download raw bytes

1(function ($) {
2
3Drupal.errorModal = function() {
4  var positionErrorModal = function() {
5    var wWidth = $(window).width();
6    var dWidth = 400;
7
8    var wHeight = $(window).height();
9    var dHeight = 200;
10    $('.ui-dialog').width(dWidth);
11    $('.ui-dialog').height(dHeight);
12    $('.ui-dialog-content').height(dHeight - 30);
13    $('.ui-dialog').css({
14      left: (wWidth - dWidth) / 2,
15      top: (wHeight - dHeight) / 2,
16      position: 'fixed'
17    });
18  }
19
20  $(window).resize( function () {
21    positionErrorModal();
22  });
23  if ($("#dialog").length > 0) {
24    var modal_content = Drupal.settings.nesteAjaxErrorModal.infotext;
25    var cta_link = "";
26    if (Drupal.settings.nesteAjaxErrorModal.logged_in) {
27      cta_link = '<div class="login"><a class="c-cta" href="/login_neste?dest=' + encodeURIComponent(window.location.pathname) + encodeURIComponent(window.location.search) + '">' + Drupal.t('Login') + '</a></div>';
28    }
29    else {
30      cta_link = '<div class="refresh"><a class="c-cta" href="javascript:window.location.reload(true)">' + Drupal.t('Reload') + '</a></div>';
31    }
32
33    $("#dialog").html("<div class='content-ajax-error'><div class='modal-content'>" + modal_content +  "</div>" + cta_link + "</div>");
34
35    $("#dialog").dialog({
36      autoOpen: true,
37      draggable: false,
38      resizable: false,
39      title: '',
40      width: 400,
41      maxWidth: 400,
42      height: 200,
43      modal: true,
44      closeOnEscape: true,
45      open: function(event, ui) {
46        $('.ui-widget-overlay').bind('click', function() {
47          $("#dialog").dialog('close');
48        });
49        positionErrorModal();
50      }
51    });
52  }
53};
54
55if (Drupal.ajax) {
56  Drupal.ajax.prototype.exoveReplacedEerror = Drupal.ajax.prototype.error;
57  Drupal.ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
58    // First handle the normal error procedure.
59    this.exoveReplacedEerror(xmlhttprequest, uri, customMessage);
60
61    // If callback is system/ajax
62    // Response code is 200
63    // Response empty
64    // Then proceed with error modal
65
66    if ((xmlhttprequest.status !== 200) || uri !== "/system/ajax" || xmlhttprequest.responseText !== "") {
67      return;
68    }
69    // Launch the modal window
70    Drupal.errorModal();
71  };
72}
73})(jQuery);

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.