PageSourceSearch

https://ordenov.net/templates/template29/js/information.js

js ordenov.net collected 2026-10-02 16:48:59 UTC 2,661 bytes, 72 lines download raw bytes

1function informationBar(text){
2    const bar = document.createElement('div');
3    bar.style.background = "#167b3f";
4    bar.style.color = "#fff";
5    bar.style.fontSize = "12px";
6    bar.style.lineHeight = "1.4";
7    bar.style.padding = "10px 0";
8
9    const container = document.createElement('div');
10    container.className = 'container';
11    container.style.position = 'relative';
12
13    const close = document.createElement('a');
14    close.style.position = 'absolute';
15    close.style.top = '-5px';
16    close.style.right = '0';
17    close.style.outline = '0';
18    close.style.textDecoration = 'none';
19    close.style.color = '#fff';
20    close.style.display = 'block';
21    close.style.width = '30px';
22    close.style.height = '30px';
23    close.href = 'javascript:;';
24    close.innerHTML = '<svg style="fill:transparent;stroke:currentColor;stroke-width:1;" viewBox="0 0 32 32"><path d="M10,10 L22,22 M22,10 L10,22"></path></svg>';
25
26    container.innerHTML = text;
27    container.appendChild(close);
28    bar.appendChild(container);
29
30    if(getCookie('information') === 'true' || !getCookie('information')){
31        const first = document.body.firstChild;
32        document.body.insertBefore(bar, first);
33        // setTimeout(function(){
34        // 	window.scrollTo( 0, 0 );
35        // },500);
36        setCookie('information', 'true', { path: '/' });
37    }
38
39    close.addEventListener('click', function(){
40        bar.parentNode.removeChild(bar);
41        setCookie('information', 'false', { path: '/' });
42    }, {once:true});
43
44    function getCookie(name) {
45        let matches = document.cookie.match(new RegExp(
46            "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
47        ));
48        return matches ? decodeURIComponent(matches[1]) : undefined;
49    }
50    function setCookie(name, value, options) {
51        options = options || {};
52        var expires = options.expires;
53        if (typeof expires == "number" && expires) {
54            var d = new Date();
55            d.setTime(d.getTime() + expires * 1000);
56            expires = options.expires = d;
57        }
58        if (expires && expires.toUTCString) {
59            options.expires = expires.toUTCString();
60        }
61        value = encodeURIComponent(value);
62        var updatedCookie = name + "=" + value;
63        for (var propName in options) {
64            updatedCookie += "; " + propName;
65            var propValue = options[propName];
66            if (propValue !== true) {
67                updatedCookie += "=" + propValue;
68            }
69        }
70        document.cookie = updatedCookie;
71    }
72}

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.