PageSourceSearch

https://www.crmpr.org.br/js/contrast.js

js crmpr.org.br collected 2026-09-24 20:34:59 UTC 1,234 bytes, 48 lines download raw bytes

1(function () {
2    var Contrast = {
3        storage: 'contrastState',
4        cssClass: 'contrast',
5        currentState: null,
6        check: checkContrast,
7        getState: getContrastState,
8        setState: setContrastState,
9        toogle: toogleContrast,
10        updateView: updateViewContrast
11    };
12
13    window.toggleContrast = function () { Contrast.toogle(); };
14    
15    function checkContrast() {
16        this.updateView();
17    }
18
19    function getContrastState() {
20        return localStorage.getItem(this.storage) === 'true';
21    }
22
23    function setContrastState(state) {
24        localStorage.setItem(this.storage, '' + state);
25        this.currentState = state;
26        this.updateView();
27    }
28
29    function updateViewContrast() {
30        var body = document.body;        
31
32        if (this.currentState === null)
33            this.currentState = this.getState();
34
35        if (this.currentState)
36            body.classList.add(this.cssClass);
37        else
38            body.classList.remove(this.cssClass);
39    }
40
41    function toogleContrast() {
42        this.setState(!this.currentState);
43    }
44    
45    $(document).ready(function() {
46        Contrast.check();
47    });
48})();

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.