1 2; /* Start:"a:4:{s:4:"full";s:76:"/bitrix/components/bf/cookiespro/templates/.default/script.js?17507610233207";s:6:"source";s:61:"/bitrix/components/bf/cookiespro/templates/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3 function setCookie(cname, exdays) { 4 var d = new Date(); 5 exdays = exdays*1; 6 d.setTime(d.getTime() + (exdays*24*60*60*1000)); 7 var expires = "expires="+ d.toUTCString(); 8 var cvalue = 1; 9 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 10} 11 12function getCookie(cname) { 13 var name = cname + "="; 14 var decodedCookie = decodeURIComponent(document.cookie); 15 var ca = decodedCookie.split(';'); 16 for(var i = 0; i <ca.length; i++) { 17 var c = ca[i]; 18 while (c.charAt(0) == ' ') { 19 c = c.substring(1); 20 } 21 if (c.indexOf(name) == 0) { 22 return c.substring(name.length, c.length); 23 } 24 } 25 return ""; 26} 27 28function checkCookies(name, days, timeStart, timeEnd, fixed){ 29 let cookieNotification = document.getElementById('cookie_notification'); 30 let optionSetting = document.getElementById('cookie_accept_check_2'); 31 32 let cookieBtn = cookieNotification.querySelectorAll('.js-cookie_accept'); 33 let cancelBtn = cookieNotification.querySelectorAll('.js-cookie_cancel'); 34 35 let changeBlock = cookieNotification.querySelectorAll('.js-cookie_setting'); 36 37 // ÐÑи клике на кнопкÑ, в локалÑное Ñ ÑанилиÑе запиÑÑваеÑÑÑ ÑекÑÑÐ°Ñ Ð´Ð°Ñа в ÑиÑÑеме UNIX 38 var cancel = getCookie(name+'_cancel'); 39 var set = getCookie(name); 40 if (!cancel) { 41 42 43 for(let c=0; c < cancelBtn.length; c++){ 44 cancelBtn[c].addEventListener('click', function(){ 45 setCookie(name+'_cancel', days); 46 localStorage.setItem( 'cookieDate', Date.now() ); 47 cookieNotification.classList.remove('bfpro-show'); 48 document.body.classList.remove('bf-fixed'); 49 }); 50 } 51 52 if (!set) { 53 54 setTimeout( 55 function(){cookieNotification.classList.add('bfpro-show'); 56 if(fixed =='Y'){ 57 document.body.classList.add('bf-fixed'); 58 } 59 }, 60 timeStart*1000); 61 62 for(let j=0; j < cookieBtn.length; j++){ 63 cookieBtn[j].addEventListener('click', function(){ 64 setCookie(name, days); 65 if(optionSetting.checked){ 66 setCookie(name+'_all', days); 67 } 68 localStorage.setItem( 'cookieDate', Date.now() ); 69 cookieNotification.classList.remove('bfpro-show'); 70 document.body.classList.remove('bf-fixed'); 71 window.location.reload(); 72 }); 73 } 74 75 for(let ch=0; ch < changeBlock.length; ch++){ 76 changeBlock[ch].addEventListener('click', function(){ 77 if($('.js-open-checked .cookie_accept').length){ 78 $('.js-open-checked .cookie_accept').attr('checked', false); 79 $('.cookie_check.js-open-checked').removeClass('js-open-checked'); 80 } 81 toggleVisibility('cookie_step_1'); 82 toggleVisibility('cookie_step_2'); 83 }); 84 } 85 setTimeout(function(){ 86 cookieNotification.classList.remove('bfpro-show'); 87 document.body.classList.remove('bf-fixed'); 88 }, 89 timeEnd*1000); 90 } 91 } 92} 93 94 95function toggleVisibility(elementId) { 96 var element = document.getElementById(elementId); 97 if (element.style.display === 'none') { 98 element.style.display = 'block'; 99 } else { 100 element.style.display = 'none'; 101 } 102} 103/* End */ 104;; /* /bitrix/components/bf/cookiespro/templates/.default/script.js?17507610233207*/
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.