PageSourceSearch

https://www.montagna.tv/wp-content/themes/montagnatv2023/assets/js/scripts.js?ver=2.7

js montagna.tv collected 2026-09-24 22:53:55 UTC 6,192 bytes, 226 lines download raw bytes

1/**
2 * Disable console.log
3 */
4var logger = (function () {
5  var oldConsoleLog = null;
6  var pub = {};
7
8  pub.enableLogger = function enableLogger() {
9    if (oldConsoleLog == null) return;
10
11    window["console"]["log"] = oldConsoleLog;
12  };
13
14  pub.disableLogger = function disableLogger() {
15    oldConsoleLog = console.log;
16    window["console"]["log"] = function () {};
17  };
18
19  return pub;
20})();
21//logger.disableLogger();
22
23/**
24 * Mobile detect
25 */
26!(function (a) {
27  var b = /iPhone/i,
28    c = /iPod/i,
29    d = /iPad/i,
30    e = /(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,
31    f = /Android/i,
32    g = /(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,
33    h =
34      /(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,
35    i = /IEMobile/i,
36    j = /(?=.*\bWindows\b)(?=.*\bARM\b)/i,
37    k = /BlackBerry/i,
38    l = /BB10/i,
39    m = /Opera Mini/i,
40    n = /(CriOS|Chrome)(?=.*\bMobile\b)/i,
41    o = /(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,
42    p = new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)", "i"),
43    q = function (a, b) {
44      return a.test(b);
45    },
46    r = function (a) {
47      var r = a || navigator.userAgent,
48        s = r.split("[FBAN");
49      return (
50        "undefined" != typeof s[1] && (r = s[0]),
51        (s = r.split("Twitter")),
52        "undefined" != typeof s[1] && (r = s[0]),
53        (this.apple = {
54          phone: q(b, r),
55          ipod: q(c, r),
56          tablet: !q(b, r) && q(d, r),
57          device: q(b, r) || q(c, r) || q(d, r),
58        }),
59        (this.amazon = {
60          phone: q(g, r),
61          tablet: !q(g, r) && q(h, r),
62          device: q(g, r) || q(h, r),
63        }),
64        (this.android = {
65          phone: q(g, r) || q(e, r),
66          tablet: !q(g, r) && !q(e, r) && (q(h, r) || q(f, r)),
67          device: q(g, r) || q(h, r) || q(e, r) || q(f, r),
68        }),
69        (this.windows = {
70          phone: q(i, r),
71          tablet: q(j, r),
72          device: q(i, r) || q(j, r),
73        }),
74        (this.other = {
75          blackberry: q(k, r),
76          blackberry10: q(l, r),
77          opera: q(m, r),
78          firefox: q(o, r),
79          chrome: q(n, r),
80          device: q(k, r) || q(l, r) || q(m, r) || q(o, r) || q(n, r),
81        }),
82        (this.seven_inch = q(p, r)),
83        (this.any =
84          this.apple.device ||
85          this.android.device ||
86          this.windows.device ||
87          this.other.device ||
88          this.seven_inch),
89        (this.phone =
90          this.apple.phone || this.android.phone || this.windows.phone),
91        (this.tablet =
92          this.apple.tablet || this.android.tablet || this.windows.tablet),
93        "undefined" == typeof window ? this : void 0
94      );
95    },
96    s = function () {
97      var a = new r();
98      return (a.Class = r), a;
99    };
100  "undefined" != typeof module && module.exports && "undefined" == typeof window
101    ? (module.exports = r)
102    : "undefined" != typeof module &&
103      module.exports &&
104      "undefined" != typeof window
105    ? (module.exports = s())
106    : "function" == typeof define && define.amd
107    ? define("isMobile", [], (a.isMobile = s()))
108    : (a.isMobile = s());
109})(this);
110
111/**
112 * Get Cookie
113 */
114function getCookieOld(name) {
115  var dc = document.cookie;
116  var prefix = name + "=";
117  var begin = dc.indexOf("; " + prefix);
118  if (begin == -1) {
119    begin = dc.indexOf(prefix);
120    if (begin != 0) return null;
121  } else {
122    begin += 2;
123    var end = document.cookie.indexOf(";", begin);
124    if (end == -1) {
125      end = dc.length;
126    }
127  }
128  return decodeURI(dc.substring(begin + prefix.length, end));
129}
130function getCookie(name) {
131  window.__lxG__consent__ = window.__lxG__consent__ || {};
132  if (typeof window.__lxG__consent__.getState === "function") {
133      var currentConsentState = window.__lxG__consent__.getState();
134      if (currentConsentState === 1 || currentConsentState === null) {
135          return true;
136      } else {
137          return null;
138      }
139  }
140  return null;
141}
142
143(function ($) {
144  "use strict";
145  /**
146   * Scrolled into view helper
147   */
148  function isScrolledIntoView(elem) {
149    var docViewTop = $(window).scrollTop();
150    var docViewBottom = docViewTop + $(window).height();
151
152    var elemTop = $(elem).offset().top;
153    var elemBottom = elemTop + $(elem).height();
154
155    return elemBottom <= docViewBottom && elemTop >= docViewTop;
156  }
157
158  /**
159   * Sticky elements
160   */
161  var $window,
162    navbarHeight,
163    $stickyEl,
164    elTop,
165    elHeight,
166    bodyHeight,
167    sidebarHeight,
168    incremento,
169    elParentHeight;
170  $window = $(window);
171  $stickyEl = $("#HALFPAGE");
172  $window.scroll(function () {
173    $stickyEl.toggleClass(
174      "stickyFixed",
175      $window.scrollTop() > elTop - navbarHeight &&
176        $window.scrollTop() < elTop + elParentHeight - elHeight - navbarHeight
177    );
178    $stickyEl.toggleClass(
179      "stickyBottom",
180      $window.scrollTop() >= elTop + elParentHeight - elHeight - navbarHeight
181    );
182  });
183
184  /**
185   * Sticky sidebar on load
186   */
187
188  function sidebar() {
189    navbarHeight = $("#main-nav").outerHeight();
190    if ($("#text-40").length > 0 && $("#HALFPAGE > div").height() > 0) {
191      elTop = $("#text-40").offset().top;
192      elParentHeight = $("#HALFPAGE").parent().height();
193      elHeight = $("#HALFPAGE").height();
194      bodyHeight = $(".main-content").outerHeight();
195      sidebarHeight = $("aside.sidebar").outerHeight();
196      if (bodyHeight != sidebarHeight) {
197        incremento = bodyHeight - sidebarHeight;
198        elParentHeight = $("#HALFPAGE").parent().height();
199        $("#HALFPAGE")
200          .parent()
201          .height(elParentHeight + incremento);
202      }
203    }
204  }
205  setInterval(function () {
206    sidebar();
207  }, 500);
208
209  /**
210   * Mobile menu trigger helper
211   */
212  $("header").on("touchend", "#mobile-menu-icon", function () {
213    $("body").addClass("menu-open");
214  });
215  $(".close-side-aside").on("touchend", function () {
216    $("body").removeClass("menu-open");
217  });
218  /* fix for search breadcrumb ?!
219  if ($("#breadcrumb .current").length > 0)
220    $("#breadcrumb .current").text(
221      "Risultato di ricerca per la parola '" +
222        $(".page-title span").text() +
223        "'"
224    );
225    */
226})(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.