1function createCookie(response){ 2 let date = new Date(); 3 date = date.setMonth(date.getMonth() + 1); 4 5 let stringFormat = new Date(date).toUTCString(); 6 7 document.cookie =`cookie_response=${response}; Path=/; SameSite=Lax; expires=${stringFormat};`; 8} 9 10function getCookie(name) { 11 const value = `; ${document.cookie}`; 12 const parts = value.split(`; ${name}=`); 13 if (parts.length === 2) return parts.pop().split(';').shift(); 14} 15 16let scroll = true; 17 18window.onload = function() { 19 window.addEventListener('scroll', () => { 20 if(!getCookie("cookie_response") && scroll == true){ 21 scroll = false; 22 document.querySelector('.overlay-cookies').classList.remove('hidden'); 23 let allButtons = document.querySelectorAll('.buttons button'); 24 25 allButtons.forEach((button, index) => { 26 button.addEventListener('click', (e)=>{ 27 e.preventDefault(); 28 29 if(index == 0){ 30 pushEventClevertap('accept'); 31 createCookie('accept'); 32 }else if(index == 1){ 33 pushEventClevertap('decline'); 34 createCookie('decline'); 35 } 36 37 document.querySelector('.cookie-modal').classList.remove('active'); 38 }) 39 }); 40 41 // show modal cookies 42 document.querySelector('.cookie-modal').classList.add('active'); 43 44 45 function pushEventClevertap(response){ 46 console.log(anonymousId); 47 48 clevertap.event.push("Response Cookie", { 49 "identityXray":anonymousId, 50 "Category":"Cookies", 51 "response":response 52 }); 53 54 document.querySelector('.overlay-cookies').classList.add('hidden'); 55 } 56 } 57 }) 58}
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.