PageSourceSearch

https://lillemetropole.fr/modules/custom/mel_core/js/mel_core.js?1790848365

js lillemetropole.fr collected 2026-10-01 10:29:17 UTC 3,458 bytes, 108 lines download raw bytes

1'use strict';
2
3(function ($, Drupal, drupalSettings) {
4  if ($('.parametrage-usine-a-sites-verify-form').length) {
5    $('#edit-declaration-dns').on('change', function() {
6      $('.creation-vhost-error-message').addClass('hide');
7      $('.copyMsgSupport').addClass('hide');
8      $('.form-item-nom-domaine').hide();
9      $("#edit-creation-vhost").val("");
10      if (this.value === 'non') {
11        //$('.declaration-dns-message').removeClass('hide');
12      } else {
13        $('.declaration-dns-message').addClass('hide');
14      }
15    });
16
17    $('#edit-creation-vhost').on('change', function() {
18      if (this.value === 'non') {
19        $('.creation-vhost-error-message').removeClass('hide');
20        $('.copyMsgSupport').removeClass('hide');
21      } else {
22        $('.creation-vhost-error-message').addClass('hide');
23        $('.copyMsgSupport').addClass('hide');
24      }
25    });
26
27    $("#edit-nom-domaine").on("input", function() {
28      if ($(this).val() !== '') {
29        $('.creation-vhost-success-message').removeClass('hide');
30        $('.form-submit').removeClass('is-disabled');
31        $('.form-submit').removeAttr("disabled");
32      }
33      else {
34        $('.creation-vhost-success-message').addClass('hide');
35        $('.form-submit').addClass('is-disabled');
36        $('.form-submit').attr("disabled", "disabled");
37      }
38    });
39  }
40
41  if ($('.parametrage-usine-a-sites-add-form').length) {
42    $("#copyButton").on("click", function(e) {
43      e.preventDefault();
44      if ($('#edit-directory-name').val() !== '' && $('#edit-bdd-pwd').val() !== '') {
45        $('.form-submit').removeClass('is-disabled');
46        $('.form-submit').removeAttr("disabled");
47      }
48      else {
49        $('.form-submit').addClass('is-disabled');
50        $('.form-submit').attr("disabled", "disabled");
51      }
52    });
53  }
54
55  if ($('.automatic-login-form').length) {
56    if($('#user_details').val() !== '') {
57      $('.automatic-login-form').submit();
58    }
59  }
60
61  $("#copyButton").click(function (e) {
62    copyToClipboard(document.getElementById("edit-bdd-pwd"));
63    return false;
64  });
65
66  $("#copyMsgSupport").click(function (e) {
67    e.preventDefault();
68    copyToClipboard(document.getElementById("msg-support"));
69    setTimeout(function () {
70      $('a.declaration-dns-message')[0].click();
71    }, 1000);
72    return false;
73  });
74
75  function copyToClipboard(elem) {
76    /* Select the text field */
77    elem.select();
78    document.execCommand("copy");
79    navigator.clipboard.writeText(elem.value);
80    //elem.setSelectionRange(0, 99999); /* For mobile devices */
81  }
82
83  Drupal.behaviors.page = {
84    attach: function (context, settings) {
85      $('ul[id*="ui-id-"]', ".mel-backoffice").each(function () {
86        $(this).on('click', function () {
87          $('.form-linkit-autocomplete.form-text.ui-autocomplete-input').each(function () {
88            var input_id = $(this).attr('id');
89            var user_link = $(this).val();
90            const found = user_link.match(/^\/node\/([0-9]+)$/);
91            if (found) {
92              $.ajax({
93                method: "GET",
94                url: drupalSettings.path.baseUrl + 'url/alias',
95                data: { link: user_link }
96              })
97              .done(function (data) {
98                if (data.alias) {
99                  $('#' + input_id).val(data.alias)
100                }
101              });
102            }
103          });
104        });
105      });
106    }
107  };
108})(jQuery, Drupal, drupalSettings);

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.