1BX.ready(function () { 2 BX.namespace("Bquadro.CookieNotification"); 3 4 const App = { 5 init() { 6 this.container = document.getElementById('bquadro_cookie_panel'); 7 if (!this.container) return; 8 9 this.panel = this.container.querySelector('.cookie-panel'); 10 if (!this.panel) return; 11 12 this.btnEl = this.container.querySelector('.cookie-panel__btn'); 13 if (!this.btnEl) return; 14 15 this.btnEl.addEventListener('click', () => this.btnClick()); 16 17 this.checkCookies(); 18 }, 19 20 btnClick() { 21 this.setCookie('cookies_policy', 'true', 365); 22 this.panel.classList.toggle("cookie-panel--close"); 23 $(this.panel).slideUp(500); 24 }, 25 26 setCookie(name, value, days) { 27 let expires = ""; 28 if (days) { 29 const date = new Date(); 30 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 31 expires = "; expires=" + date.toUTCString(); 32 } 33 document.cookie = `${name}=${value || ""}${expires}; path=/`; 34 }, 35 36 getCookie(name) { 37 const matches = document.cookie.match( 38 new RegExp( 39 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 40 ) 41 ); 42 return matches ? decodeURIComponent(matches[1]) : undefined; 43 }, 44 45 checkCookies() { 46 const cookieValue = this.getCookie('cookies_policy'); 47 // ÐÑли кÑки неÑ, показÑваем Ð¿Ð°Ð½ÐµÐ»Ñ 48 if (cookieValue === undefined) { 49 this.panel.classList.remove("cookie-panel--close"); 50 $(this.panel).slideDown(500); 51 } else { 52 // ÐÑли кÑки еÑÑÑ, ÑкÑÑваем Ð¿Ð°Ð½ÐµÐ»Ñ (на вÑÑкий ÑлÑÑай) 53 this.panel.classList.add("cookie-panel--close"); 54 $(this.panel).hide(); 55 } 56 }, 57 }; 58 59 BX.Bquadro.CookieNotification.App = App; 60 App.init(); 61});
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.