PageSourceSearch

https://khshield.com/template/js/module/PlusMinusModule.js

js khshield.com collected 2026-10-08 10:46:17 UTC 1,695 bytes, 39 lines download raw bytes

1export default function PlusMinusModule() {
2    var event = new Event("change");
3    const count = document.querySelectorAll('.count')
4    if (count) {
5        count.forEach(item => {
6            const input = item.querySelector('.count-input');
7            const number = item.querySelector('.count-number');
8            number.innerHTML = `${input.value < 10 && input.value > 0 ? "0" : " "}` + input.value;
9        })
10    }
11    document.addEventListener('click', (e) => {
12        const count = e.target.closest('.count');
13        const countBtnPlus = e.target.closest('.count-btn.count-plus')
14        const countBtnMinus = e.target.closest('.count-btn.count-minus');
15        if (count) {
16            const countNumber = count.querySelector('.count-number');
17            const countInput = count.querySelector('.count-input');
18            console.log(countNumber);
19            if (countBtnPlus) {
20                if (parseInt(countInput.value) < parseInt(countInput.max)) {
21                    countInput.value++;
22                    countNumber.innerHTML =
23                        `${countInput.value < 10 && countInput.value > 0 ? "0" : " "}` + countInput.value;
24                    countInput.dispatchEvent(event);
25                }
26            }
27            if (countBtnMinus) {
28                if (parseInt(countInput.value) > parseInt(countInput.min)) {
29                    countInput.value--;
30                    countNumber.innerHTML =
31                        `${countInput.value < 10 && countInput.value > 0 ? "0" : " "}` + countInput.value;
32                    countInput.dispatchEvent(event);
33                }
34            }
35
36        }
37    })
38
39}

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.