PageSourceSearch

https://wordpresslab.ru/wp-content/themes/wplbzero/dist/js/cookie-notice.js?ver=1791464372

js wordpresslab.ru collected 2026-10-08 13:00:25 UTC 2,167 bytes, 52 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2    // Функция для установки cookie
3    function setCookie(name, value, days) {
4        var expires = '';
5        if (days) {
6            var date = new Date();
7            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
8            expires = '; expires=' + date.toUTCString();
9        }
10        document.cookie = name + '=' + (value || '') + expires + '; path=/';
11    }
12
13    // Функция для получения cookie
14    function getCookie(name) {
15        var nameEQ = name + '=';
16        var ca = document.cookie.split(';');
17        for (var i = 0; i < ca.length; i++) {
18            var c = ca[i];
19            while (c.charAt(0) === ' ') c = c.substring(1, c.length);
20            if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
21        }
22        return null;
23    }
24
25    // Проверяем, было ли уведомление принято ранее
26    var cookieNoticeAccepted = getCookie('cookie_notice_accepted');
27    var cookieNotice = document.getElementById('cookie-notice');
28    
29    if (!cookieNoticeAccepted && cookieNotice) {
30        // Показываем уведомление с небольшой задержкой
31        setTimeout(function() {
32            cookieNotice.classList.add('show');
33        }, 1000);
34        
35        // Обработчик нажатия на кнопку "Принять"
36        var acceptButton = document.getElementById('cookie-notice-accept');
37        if (acceptButton) {
38            acceptButton.addEventListener('click', function() {
39                // Устанавливаем cookie на 365 дней
40                setCookie('cookie_notice_accepted', 'true', 365);
41                
42                // Скрываем уведомление
43                cookieNotice.classList.remove('show');
44                
45                // Полностью удаляем через 500мс после анимации
46                setTimeout(function() {
47                    cookieNotice.style.display = 'none';
48                }, 500);
49            });
50        }
51    }
52});

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.