PageSourceSearch

https://hotsprings.org/site/assets/js/ux.js

js hotsprings.org collected 2026-10-02 07:32:03 UTC 2,273 bytes, 60 lines download raw bytes

1function sessionAsyncRemove(event) {
2    event.preventDefault();
3    const card = event.currentTarget.closest('.card-wrap'); // assuming currentTarget is the clicked link
4    // const title = card.querySelector('.uk-card-title');
5    const link = card.querySelector('.async');
6    
7    const xhr = new XMLHttpRequest();
8    
9    xhr.onload = function() {
10        if (this.status < 200 || this.status >= 300) {
11            this.card.style.display = 'initial';
12        } else {
13            const id = this.card.getAttribute('data-id');
14            const url = window.location.toString();
15            this.card.style.display = 'initial';
16            this.card.classList.toggle('uk-active');
17            // this.title.innerText = 'Request Completed';
18            this.link.setAttribute('href', url + '?add=' + id);
19        }
20    };
21
22    // add these items to the request to be able to access it in the onload callback
23    xhr.card = card;
24    // xhr.title = title;
25    xhr.link = link;
26    
27    xhr.open('GET', event.currentTarget.href, true);
28    xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); // you need this for $config->ajax to work
29    xhr.send();
30}
31
32function sessionAsyncAdd(event) {
33    event.preventDefault();
34    const card = event.currentTarget.closest('.card-wrap'); // assuming currentTarget is the clicked link
35    // const title = card.querySelector('.uk-card-title');
36    const link = card.querySelector('.async');
37    
38    const xhr = new XMLHttpRequest();
39
40    xhr.onload = function() {
41        if (this.status < 200 || this.status >= 300) {
42            this.card.style.display = 'initial';
43        } else {
44            const id = this.card.getAttribute('data-id');
45            const url = window.location.toString();
46            this.card.classList.toggle('uk-active');
47            // this.title.innerText = 'Request Completed';
48            this.link.setAttribute('href', url + '?remove=' + id);
49        }
50    };
51
52    // add these items to the request to be able to access it in the onload callback
53    xhr.card = card;
54    // xhr.title = title;
55    xhr.link = link;
56
57    xhr.open('GET', event.currentTarget.href, true);
58    xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); // you need this for $config->ajax to work
59    xhr.send();
60}

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.