PageSourceSearch

https://britishdesign.ru/local/templates/bvshd_2019/components/bit…/script.js?17900731732135

js britishdesign.ru collected 2026-09-24 17:13:44 UTC 2,135 bytes, 65 lines download raw bytes

1(function () {
2    document.addEventListener("DOMContentLoaded", function () {
3        const nodes = document
4            .querySelectorAll(".header__hover-menu .header__hover-menu-item-block a");
5
6        [...nodes].forEach((node) => node.addEventListener("click", function (e) {
7            const filter = document.querySelector(".intensives-filter");
8
9            if (filter && (e.target.dataset.type === "intensive")) {
10                e.preventDefault();
11
12                [...filter.querySelectorAll(`input[type=checkbox]`)].forEach(input => input.checked = false);
13                filter.querySelector(`input[data-code=${e.target.dataset.code}]`).click();
14                filter.scrollIntoView();
15            }
16        }));
17    });
18})();
19
20document.addEventListener('DOMContentLoaded', () => {
21  const targetNode = document.body;
22  const config = { attributes: true, childList: true, subtree: true };
23
24  function formatPhoneNumber(inputValue) {
25    if (inputValue.length < 10) {
26      return inputValue;
27    }
28    if (inputValue.startsWith('8') || inputValue.startsWith('7')) {
29      inputValue = inputValue.substring(1);
30    } else if (inputValue.startsWith('+7')) {
31      inputValue = inputValue.substring(2);
32    }
33    return inputValue;
34  }
35
36  const callback = (mutationList, observer) => {
37    for (const mutation of mutationList) {
38      if (mutation.type === "childList") {
39        addInputEvent();
40      }
41    }
42  };
43
44  function addInputEvent() {
45    const phoneNumberInput = document.querySelectorAll('.input-field__input.js-input.js-phone-country');
46    if (phoneNumberInput) {
47      phoneNumberInput.forEach((element) => {
48        if (!element.hasAttribute('data-input-event')) {
49          element.setAttribute('data-input-event', 'true');
50          element.addEventListener('input', function () {
51            let inputValue = element.value.trim();
52            let formattedNumber = formatPhoneNumber(inputValue);
53            element.value = formattedNumber;
54          });
55        }
56      })
57    }
58  }
59
60  addInputEvent();
61
62  const observer = new MutationObserver(callback);
63
64  observer.observe(targetNode, config);
65});

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.