PageSourceSearch

https://www.lightwatervillageschool.org/include/cookie_popup/cookie_popup_v5.js

js lightwatervillageschool.org collected 2026-09-29 11:26:41 UTC 2,762 bytes, 70 lines download raw bytes

1$(function () {
2
3    var _cb_cookie = getCookie("agreed_cookie_policy");
4    $("#cb_cookie_preferences #_cb_accept_pref").css("background-color", $("#cb_cookie_landing #_cb_accept").css( "background-color" ));
5
6    if (typeof _cb_cookie === 'undefined' || _cb_cookie == '') {
7        $("#cb_cookie_policy_popup").removeClass('seen');
8        $("#cb_cookie_policy_popup_shroud").removeClass('seen');
9    } else if (_cb_cookie == 'accepted') {
10        $("#_cb_accept_all").attr('checked', 'checked');
11        $("#cb_cookie_policy_popup").addClass('show_preferences');
12    } else if (_cb_cookie == 'denied') {
13        $("#_cb_accept_thirdparty").attr('checked', 'checked');
14        $("#cb_cookie_policy_popup").addClass('show_preferences');
15    }
16
17    $("#cb_cookie_policy_popup:not(.seen) .cb_cookie_policy_popup_text .cb_cookie_button").focus();
18
19    $("#_cb_preferences").click(function (e) {
20        $("#cb_cookie_policy_popup").addClass('show_preferences');
21    });
22
23    $("#cb_cookie_landing #_cb_accept").click(function (e) {
24        $("#_cb_accept_all").attr('checked', 'checked');
25        cb_cookie_policy_popup_set_cookie();
26    });
27    $("#cb_cookie_preferences #_cb_accept_pref").click(function (e) {
28        e.preventDefault();
29        cb_cookie_policy_popup_set_cookie();
30    });
31    $("#cb_cookie_policy_popup.seen .cb_cookie_policy_popup_icon").click(function (e) {
32        $("#cb_cookie_policy_popup").removeClass('seen');
33        $("#cb_cookie_policy_popup_shroud").fadeIn();
34    });
35
36    function cb_cookie_policy_popup_set_cookie() {
37        var state = $("input[name='thirdparty']:checked").val();
38        if (typeof state === 'undefined') {
39            alert('Please select an option.');
40        } else {
41            var expirationDate = new Date();
42            expirationDate.setTime(expirationDate.getTime() + (30 * 24 * 60 * 60 * 1000)); // add 30 days
43            var expires = "expires=" + expirationDate.toUTCString();
44            var secure = '';
45            if (location.protocol == 'https:') {
46                secure = 'secure;';
47            }
48            document.cookie = "agreed_cookie_policy=" + state + ";" + expires + ";" + secure + "path=/";
49            location.reload();
50        }
51    }
52
53    function getCookie(cname) {
54        var name = cname + "=";
55        var decodedCookie = decodeURIComponent(document.cookie);
56        var ca = decodedCookie.split(';');
57        for (var i = 0; i < ca.length; i++) {
58            var c = ca[i];
59            while (c.charAt(0) == ' ') {
60                c = c.substring(1);
61            }
62            if (c.indexOf(name) == 0) {
63                return c.substring(name.length, c.length);
64            }
65        }
66        return "";
67    }
68
69    $("#cb_cookie_policy_popup").slideDown(800);
70});

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.