PageSourceSearch

https://bezdroza.pl/assets/bezdroza/js/wcag.js

js bezdroza.pl collected 2026-09-25 23:50:31 UTC 1,614 bytes, 45 lines download raw bytes

1function getCookie(cname) {
2    let name = cname + "=";
3    let decodedCookie = decodeURIComponent(document.cookie);
4    let ca = decodedCookie.split(';');
5    for(let i = 0; i <ca.length; i++) {
6      let c = ca[i];
7      while (c.charAt(0) == ' ') {
8        c = c.substring(1);
9      }
10      if (c.indexOf(name) == 0) {
11        return c.substring(name.length, c.length);
12      }
13    }
14    return "";
15}
16
17function defaultContrast(){
18    var contrast = getCookie('contrast');
19    if(contrast == 'contrast1'){
20        turnOnHighContrast();
21    }
22}
23
24function turnOnHighContrast(){
25    var defaultContrast = document.getElementsByClassName("accessibility__contrast accessibility_0")[0];
26    var highContrast = document.getElementsByClassName("accessibility__contrast accessibility_1")[0];
27    var bodyTag = document.getElementsByTagName("body")[0];
28    defaultContrast.classList.remove("current");
29    highContrast.classList.add("current");
30    bodyTag.classList.add("wcag-high-contrast");
31    document.cookie = "contrast=contrast1";
32}
33
34function turnOffHighContrast(){
35    var defaultContrast = document.getElementsByClassName("accessibility__contrast accessibility_0")[0];
36    var highContrast = document.getElementsByClassName("accessibility__contrast accessibility_1")[0];
37    var bodyTag = document.getElementsByTagName("body")[0];
38    highContrast.classList.remove("current");
39    defaultContrast.classList.add("current");
40    bodyTag.classList.remove("wcag-high-contrast");
41    document.cookie = "contrast=contrast0";
42}
43document.addEventListener('DOMContentLoaded', function() {
44    defaultContrast();
45}, false);

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.