PageSourceSearch

https://www.veolia.com.hk/themes/custom/veo_site/build/assets/scripts/utils/globalFunctions.js?v=10.6.15

js veolia.com.hk collected 2026-10-05 09:38:33 UTC 1,946 bytes, 84 lines download raw bytes

1/* exported findGetParameter */
2/* exported debounce */
3/* exported veoSiteInitGoogleMap */
4/* exported veoSiteInitBaiduMap */
5function findGetParameter(parameterName, url) {
6  'use strict';
7
8  var result = null,
9      tmp = [],
10      paramsString = window.location.search;
11
12  if(url) {
13    var customUrl = document.createElement('a');
14    customUrl.href = url;
15    paramsString = customUrl.search;
16  }
17
18  paramsString
19    .substr(1)
20    .split('&')
21    .forEach(function (item) {
22      tmp = item.split('=');
23
24      if(tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
25    });
26  return result;
27}
28
29function debounce(func, wait, immediate) {
30  'use strict';
31
32  var timeout;
33  return function() {
34    var context = this,
35        args = arguments,
36        later = function() {
37          timeout = null;
38
39          if (!immediate) func.apply(context, args);
40        },
41        callNow = immediate && !timeout;
42
43    clearTimeout(timeout);
44    timeout = setTimeout(later, wait);
45
46    if (callNow) func.apply(context, args);
47  };
48}
49
50function veoSiteInitGoogleMap() {
51  'use strict';
52  Drupal.veoSiteGoogleMapAvailable = true;
53}
54
55function veoSiteInitBaiduMap() {
56  'use strict';
57
58  var script = document.createElement('script');
59  script.src = '//api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay_min.js';
60
61  script.onload = function () {
62    var script = document.createElement('script');
63    script.src = '//api.map.baidu.com/library/MarkerClusterer/1.2/src/MarkerClusterer_min.js';
64    script.onload = function () {
65      Drupal.veoSiteBaiduMapAvailable = true;
66    };
67    document.body.appendChild(script);
68  };
69
70  document.body.appendChild(script);
71}
72
73
74function veoLoadPolyfills() {
75  'use strict';
76  if (!window.veo_theme_path) {
77    return;
78  }
79  if (!Array.from) {
80    document.write('<script src="' + window.veo_theme_path + '/assets/scripts/node_utils/polyfill.min.js' + '"><\/script>');
81  }
82}
83
84veoLoadPolyfills();

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.