PageSourceSearch

https://tyosuojelu.fi/o/tsh-2022-theme/js/cookie-manager.js?browserId=chrome&languageId=fi_FI&t=1790004194000

js tyosuojelu.fi collected 2026-09-24 18:13:17 UTC 1,858 bytes, 57 lines download raw bytes

1var cookieConsentGiven = false;
2var cookieConsentExpires = { expires: 180 };
3
4var initCookieManager = function() {
5    if (Cookies.get("cookieConsentGiven") === 'true') {
6        cookieConsentGiven = true;
7    }
8}
9
10var cookieManagerRejectedScripts = {};
11var loadOptionalScript = function(cookieKey, callback) {
12    if (Cookies.get(cookieKey) ==='enabled') {
13        callback();
14    } else {
15        cookieManagerRejectedScripts[cookieKey] = callback;
16    }
17}
18
19var cookieManagerSetCookie = function(name, value) {
20    Cookies.set(name,  value, cookieConsentExpires);
21};
22
23var setCookieGroup = function(cookieGroup, cookieKeys, enabled) {
24    var cookieValue = enabled ? "enabled" : "disabled";
25    cookieManagerSetCookie(cookieGroup,  cookieValue);
26
27    $.each(cookieKeys, function (index, cookieKey) {
28        cookieManagerSetCookie(cookieKey,  cookieValue);
29
30        if (enabled && cookieManagerRejectedScripts[cookieKey] !== undefined) {
31            cookieManagerRejectedScripts[cookieKey]();
32        }
33    });
34};
35
36var setCookieConsentGiven = function() {
37    cookieManagerSetCookie("cookieConsentGiven", true);
38    cookieConsentGiven = true;
39}
40
41function addSelectStyles(cookieGroupValue,group) {
42    var inputs = document.getElementsByName(group);
43    //Add custom checked styles to site and banner input and check or uncheck both
44    for (let i = 0; i < inputs.length; i++) {
45        if (cookieGroupValue.checked === false) {
46            inputs[i].checked = false;
47            if (inputs[i].nextElementSibling.classList.contains("isSelected")) {
48                inputs[i].nextElementSibling.classList.remove("isSelected");
49            }
50        } else {
51            if (cookieGroupValue.checked === true) {
52                inputs[i].checked = true;
53                inputs[i].nextElementSibling.classList.add("isSelected");
54            }
55        }
56    }
57}

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.