PageSourceSearch

https://lifehappens.org/wp-content/plugins/life-happens-incrementor/js/lh-incrementor.js?ver=1.0

js lifehappens.org collected 2026-09-24 09:26:40 UTC 2,477 bytes, 56 lines download raw bytes

1function pollIncrementor() {
2    var xhr = new XMLHttpRequest();
3    xhr.open('GET', lhIncrementorAjax.ajaxurl + '?action=lh_incrementor_poll', true);
4    xhr.onreadystatechange = function() {
5        if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
6            var response = JSON.parse(xhr.responseText);
7            if (response.success && response.data && response.data.number) {
8                var incrementorNumber = document.querySelector('.lh-incrementor-number');
9                var currentDigits = incrementorNumber.querySelectorAll('.lh-incrementor-digit');
10                var updatedNumber = response.data.number.toString().padStart(4, '0');
11
12                if (currentDigits.length > 0) {
13                    if (currentDigits.length === updatedNumber.length) {
14                        for (var i = 0; i < currentDigits.length; i++) {
15                            currentDigits[i].textContent = updatedNumber[i];
16                        }
17                    } else {
18                        incrementorNumber.innerHTML = '';
19                        for (var i = 0; i < updatedNumber.length; i++) {
20                            var digitSpan = document.createElement('span');
21                            digitSpan.className = 'lh-incrementor-digit';
22                            digitSpan.textContent = updatedNumber[i];
23                            incrementorNumber.appendChild(digitSpan);
24                        }
25                    }
26                }
27            }
28        }
29    };
30    xhr.send();
31}
32
33document.addEventListener('DOMContentLoaded', function() {
34    var incrementorButton = document.querySelector('.lh-incrementor-button');
35
36    if (incrementorButton) {
37        incrementorButton.addEventListener('click', function() {
38            if (incrementorButton.disabled) {
39                return;
40            }
41
42            var xhr = new XMLHttpRequest();
43            xhr.open('POST', lhIncrementorAjax.ajaxurl, true);
44            xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
45            xhr.onreadystatechange = function() {
46                if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
47                    pollIncrementor(); // Start polling for updates after each button click
48                }
49            };
50            xhr.send('action=lh_incrementor_increment');
51        });
52    }
53
54    // Start initial polling when the page loads
55    pollIncrementor();
56});

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.