PageSourceSearch

https://autoplus-alians.ru/site/templates/scripts/additional.js?v=20260716c

js autoplus-alians.ru collected 2026-10-10 02:23:40 UTC 3,169 bytes, 69 lines download raw bytes

1// UTM tracking — save params from URL to sessionStorage
2(function() {
3  var params = new URLSearchParams(window.location.search);
4  ["utm_source", "utm_campaign", "utm_medium", "utm_content", "utm_term"].forEach(function(p) {
5    if (params.get(p)) sessionStorage.setItem(p, params.get(p));
6  });
7})();
8
9// Код всплывашки cookie на сайте
10// функция возвращает cookie с именем name, если есть, если нет, то undefined    
11function getCookie(name) {
12    let matches = document.cookie.match(new RegExp(
13    "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
14    ));
15    return matches ? decodeURIComponent(matches[1]) : undefined;
16}
17let cookiecook = getCookie("cookiecook"),
18cookiewin = document.getElementsByClassName('cookie_notice')[0];    
19// проверяем, есть ли у нас cookie, с которой мы не показываем окно и если нет, запускаем показ
20if (cookiecook != "no") {
21    // показываем    
22    cookiewin.style.display="block"; 
23    // закрываем по клику
24    document.getElementById("cookie_close").addEventListener("click", function(){
25        cookiewin.style.display="none";    
26        // записываем cookie на 1 день, с которой мы не показываем окно
27        let date = new Date;
28        date.setDate(date.getDate() + 180);    
29        document.cookie = "cookiecook=no; path=/; expires=" + date.toUTCString();               
30    });
31}
32
33;(function () {
34  if (!('ontouchstart' in window)) return;
35  var sx = 0, sy = 0, st = 0, moved = false, tracking = false, pending = null, timer = null;
36  function clear() { if (timer) { clearTimeout(timer); timer = null; } pending = null; }
37  function onStart(e) {
38    if (e.touches && e.touches.length > 1) { tracking = false; return; }
39    var t = e.changedTouches[0];
40    sx = t.clientX; sy = t.clientY; st = e.timeStamp; moved = false; tracking = true;
41  }
42  function onMove(e) {
43    if (!tracking) return;
44    var t = e.changedTouches[0];
45    if (Math.abs(t.clientX - sx) > 8 || Math.abs(t.clientY - sy) > 8) moved = true;
46  }
47  function onEnd(e) {
48    if (!tracking) return;
49    tracking = false;
50    if (moved || e.timeStamp - st > 700) return;
51    if (!e.target || !e.target.closest) return;
52    var link = e.target.closest('a.carousel__item, .carousel__item a[href]');
53    if (!link || !link.closest('.js-carousel')) return;
54    var href = link.getAttribute('href');
55    if (!href || href.charAt(0) === '#') return;
56    clear();
57    pending = { href: href, blank: link.getAttribute('target') === '_blank' };
58    timer = setTimeout(function () {
59      var p = pending; clear();
60      if (!p) return;
61      if (p.blank) window.open(p.href, '_blank'); else window.location.href = p.href;
62    }, 120);
63  }
64  function onClick() { clear(); }
65  document.addEventListener('touchstart', onStart, { passive: true });
66  document.addEventListener('touchmove', onMove, { passive: true });
67  document.addEventListener('touchend', onEnd, { passive: true });
68  document.addEventListener('click', onClick, true);
69})();

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.