PageSourceSearch

https://yakovlev-stom.ru/lib/js/cookies.js

js yakovlev-stom.ru collected 2026-10-07 18:00:02 UTC 934 bytes, 21 lines download raw bytes

1function checkCookies(){
2    let cookieDate = localStorage.getItem('cookieDate');
3    let cookieNotification = document.getElementById('cookie_notification');
4    
5    let cookieBtn = cookieNotification.querySelector('.cookie_accept');
6    
7   // console.log(cookieBtn);
8
9    // Если записи про кукисы нет или она просрочена на 1 год, то показываем информацию про кукисы
10   	if( !cookieDate || (+cookieDate + 31536000000) < Date.now() ){
11        cookieNotification.classList.add('show');
12    }
13
14    // При клике на кнопку, в локальное хранилище записывается текущая дата в системе UNIX
15    cookieBtn.addEventListener('click', function(){
16        localStorage.setItem( 'cookieDate', Date.now() );
17        cookieNotification.classList.remove('show');
18    })
19}
20
21checkCookies();

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.