PageSourceSearch

https://traumahealing.org/wp-content/plugins/spamkill/js/spamkill_front.js?ver=2.2.17

js traumahealing.org collected 2026-10-01 11:38:20 UTC 4,079 bytes, 106 lines download raw bytes

1var spamkill_front = {};
2(function ($) {
3    console.info('spamkill_front loaded');
4
5    spamkill_front.create_and_add_hidden_field = function (name, data, form) {
6        let hidden_input = document.createElement("input");
7        hidden_input.setAttribute("type", "hidden");
8        hidden_input.setAttribute("name", name);
9        hidden_input.setAttribute("value", data);
10        form.appendChild(hidden_input);
11        return form;
12    }
13
14    spamkill_front.post_to_url = function (path, data, method) {
15        method = method || "post";
16
17        var form = document.createElement("form");
18        form.setAttribute("method", method);
19        form.setAttribute("action", path);
20
21        for (var id in data) {
22            if (typeof data[id] === 'object' && data[id] !== null) {
23                for (const nested_id in data[id]) {
24                    let new_id = id + '[' + nested_id + ']';
25                    if (typeof data[id][nested_id] === 'object' && data[id][nested_id] !== null) {
26                        for (const nested_id_l2 in data[id][nested_id]) {
27                            let new_id_l2 = id + '[' + nested_id + ']' + '[' + nested_id_l2 + ']';
28                            form = spamkill_front.create_and_add_hidden_field(new_id_l2, data[id][nested_id][nested_id_l2], form);
29                        }
30                    } else {
31                        form = spamkill_front.create_and_add_hidden_field(new_id, data[id][nested_id], form)
32                    }
33                }
34            } else {
35                form = spamkill_front.create_and_add_hidden_field(id, data[id], form)
36            }
37        }
38
39        document.body.appendChild(form);
40        form.submit();
41    }
42
43    /**
44     * Prevent form re-submitting
45     * When the user revisit the page or user refresh the page.
46     * 
47     * https://stackoverflow.com/questions/6320113/how-to-prevent-form-resubmission-when-page-is-refreshed-f5-ctrlr/45656609#45656609
48     */
49    spamkill_front.prevent_resubmit = function () {
50        if (window.history.replaceState) {
51            window.history.replaceState(null, null, window.location.href);
52        }
53    }
54
55    /**
56     * Show overlay with CSS spinner
57     */
58    spamkill_front.show_overlay = function () {
59        // Create the overlay div
60        let overlay = document.createElement('div');
61        overlay.id = 'spamkill_overlay';
62        overlay.style.position = 'fixed';
63        overlay.style.top = 0;
64        overlay.style.left = 0;
65        overlay.style.width = '100%';
66        overlay.style.height = '100%';
67        overlay.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
68        overlay.style.zIndex = '1000';
69        overlay.style.display = 'flex';
70        overlay.style.justifyContent = 'center';
71        overlay.style.alignItems = 'center';
72        // Create the CSS spinner (loader)
73        let loader = document.createElement('div');
74        loader.id = 'loader';
75        loader.style.border = '8px solid #F3F3F3';  // Light gray border
76        loader.style.borderTop = '8px solid #3498DB'; // Blue border
77        loader.style.borderRadius = '50%';
78        loader.style.width = '60px';
79        loader.style.height = '60px';
80        loader.style.animation = 'spin 1s linear infinite'; // CSS Animation
81        // Append loader to overlay
82        overlay.appendChild(loader);
83        // Append overlay to body
84        document.body.appendChild(overlay);
85        // Define the @keyframes for the spin animation via JavaScript
86        let styleSheet = document.createElement("style");
87        styleSheet.type = "text/css";
88        styleSheet.innerText = `
89            @keyframes spin {
90                0% { transform: rotate(0deg); }
91                100% { transform: rotate(360deg); }
92            }
93        `;
94        document.head.appendChild(styleSheet);
95    }
96
97    /**
98     * Hide the overlay spinner
99     */
100    spamkill_front.hide_overlay = function () {
101        let overlay = document.getElementById('spamkill_overlay');
102        if (overlay) {
103            document.body.removeChild(overlay);
104        }
105    }
106})(jQuery)

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.