PageSourceSearch

https://ekimovka.ru/templates/it_blackwhite/js/cookie.js

js ekimovka.ru collected 2026-10-02 10:17:43 UTC 1,332 bytes, 35 lines download raw bytes

1
2    function setCookie(name, value, days) {
3        let expires = "";
4        if (days) {
5            let date = new Date();
6            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
7            expires = "; expires=" + date.toUTCString();
8        }
9        document.cookie = name + "=" + (value || "") + expires + "; path=/";
10    }
11
12    function getCookie(name) {
13        let matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
14        return matches ? decodeURIComponent(matches[1]) : undefined;
15    }
16
17
18    function checkCookies() {
19        let cookieNote = document.getElementById('cookie_note');
20        let cookieBtnAccept = cookieNote.querySelector('.cookie_accept');
21
22        // Если куки cookies_policy нет или она просрочена, то показываем уведомление
23        if (!getCookie('cookies_policy')) {
24            cookieNote.classList.add('show');
25        }
26
27        // При клике на кнопку устанавливаем куку cookies_policy на один год
28        cookieBtnAccept.addEventListener('click', function () {
29            setCookie('cookies_policy', 'true', 365);
30            cookieNote.classList.remove('show');
31        });
32    }
33
34    checkCookies();
35    

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.