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.