PageSourceSearch

https://led-technology.ru/local/components/ledtehnology/new.new.calculator.v2/templates/calc1-2/script.js

js led-technology.ru collected 2026-10-06 03:46:01 UTC 4,621 bytes, 104 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function () {
2    setTimeout(function () {
3        RunningLines.changeActiveBlocks();
4    }, 100);
5
6    document.querySelectorAll('[name="CALC_1[HEIGHT]"], [name="CALC_1[WIDTH]"], [name="CALC_1[VIEW]"]')
7        .forEach(function (_input) {
8            _input.addEventListener('change', function () {
9                RunningLines.changeSizes();
10            })
11        });
12
13    document.querySelectorAll('#calc-1 .calculator-counter__sign').forEach(function (sign) {
14        sign.addEventListener('click', function (e) {
15            e.preventDefault();
16            let _value = 1;
17            if (sign.classList.contains('calculator-counter__sign_minus')) {
18                _value = -1;
19            }
20            let parent = this.closest('label');
21            let _input = parent.querySelector('input');
22
23            if (_input.name === 'CALC_1[WIDTH]') {
24                document.querySelector('[name="CALC_1[WIDTH]"]').value = Number(document.querySelector('[name="CALC_1[WIDTH]"]').value) + _value;
25            }
26
27            if (_input.name === 'CALC_1[HEIGHT]') {
28                document.querySelector('[name="CALC_1[HEIGHT]"]').value = Number(document.querySelector('[name="CALC_1[HEIGHT]"]').value) + _value;
29            }
30
31            RunningLines.changeSizes();
32        })
33    });
34
35    document.querySelectorAll('#calc-1 [name="CALC_1[COLOR]"]').forEach(function (_input) {
36        _input.addEventListener('change', function (e) {
37            document.querySelectorAll('#calc-1 .calculator-interactive-block__elem').forEach(function (_elem) {
38                _elem.setAttribute('data-color', _input.value);
39                RunningLines.changeSizes();
40                RunningLines.changePrice();
41            })
42        });
43    });
44
45    document.querySelectorAll('#calc-1 [name="CALC_1[VIEW]"]').forEach(function (_elem) {
46        _elem.addEventListener('change', function () {
47            document.querySelector('#calc-1 .calculator-where__elem.active').classList.remove('active');
48            document.querySelector('#calc-1 .calculator-where__elem[data-value="' + _elem.value + '"]').classList.add('active');
49            RunningLines.changeActiveBlocks();
50        });
51    });
52
53    document.querySelector('#calc-1').addEventListener('click', function (e) {
54        let _target = e.target;
55        if (_target.classList.contains('calculator-where__elem')) {
56            if (_target.classList.contains('active')) {
57                return false;
58            }
59            let where = _target.getAttribute('data-value');
60            this.querySelector('.calculator-where__elem.active').classList.remove('active');
61            _target.classList.add('active');
62
63            document.querySelector('[name="CALC_1[VIEW]"][value="' + where + '"]').checked = true;
64            RunningLines.changeActiveBlocks();
65            RunningLines.changeSizes();
66            return false;
67        }
68
69        if (_target.classList.contains('calculator__reset')) {
70            let _form = _target.closest('form');
71            _form.reset();
72            let colorInput = document.querySelector('#calc-1 [name="CALC_1[COLOR]"]:checked');
73            document.querySelectorAll('#calc-1 .calculator-interactive-block__elem').forEach(function (_elem) {
74                _elem.setAttribute('data-color', colorInput.value);
75            });
76            document.querySelector('#calc-1 .calculator-where__elem.active').classList.remove('active');
77            document.querySelector('#calc-1 .calculator-where__elem[data-value="' + RunningLines.getActiveView() + '"]').classList.add('active');
78
79            RunningLines.changeActiveBlocks();
80            RunningLines.changeSizes();
81            RunningLines.changePrice();
82            return false;
83        }
84
85        if (_target.classList.contains('calculator-get-commercial')) {
86            window.calculatorResult = RunningLines.getResults();
87            return false;
88        }
89
90        if (_target.classList.contains('calculator-buy-in-installments')) {
91            e.preventDefault();
92            let sizes = RunningLines.getSizes();
93            let productName = 'Бегущая строка (' + (sizes.width / 10) + 'см x ' + (sizes.height / 10) + 'см)';
94            MainFunctions.createPayment(productName, RunningLines.getPrice());
95            return false;
96        }
97    });
98
99    document.querySelectorAll('[name="CALC_1[HEIGHT]"], [name="CALC_1[WIDTH]"], [name="CALC_1[ADDITIONAL][]"]').forEach(function (_input) {
100        _input.addEventListener('change', function () {
101            RunningLines.changeSizes();
102        })
103    });
104});

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.