1/** 2 * Radio Dosis - Cookie Consent 3 */ 4(function () { 5 'use strict'; 6 7 var COOKIE_KEY = 'rd_cookie_consent'; 8 var banner = document.getElementById('cookie-banner'); 9 var acceptBtn = document.getElementById('cookieAcceptBtn'); 10 var declineBtn = document.getElementById('cookieDeclineBtn'); 11 12 function getCookie(name) { 13 var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)'); 14 return v ? v[2] : null; 15 } 16 17 function setCookie(name, value, days) { 18 var d = new Date(); 19 d.setTime(d.getTime() + days * 24 * 60 * 60 * 1000); 20 document.cookie = name + '=' + value + ';expires=' + d.toUTCString() + ';path=/;SameSite=Lax'; 21 } 22 23 function hideBanner() { 24 if (banner) { 25 banner.style.opacity = '0'; 26 banner.style.transform = 'translateY(20px)'; 27 banner.style.transition = 'opacity 0.3s, transform 0.3s'; 28 setTimeout(function () { 29 banner.style.display = 'none'; 30 }, 300); 31 } 32 } 33 34 function showBanner() { 35 if (banner) { 36 banner.style.display = 'flex'; 37 setTimeout(function () { 38 banner.style.opacity = '1'; 39 banner.style.transform = 'translateY(0)'; 40 }, 100); 41 } 42 } 43 44 // Check consent 45 if (!getCookie(COOKIE_KEY)) { 46 document.addEventListener('DOMContentLoaded', function () { 47 setTimeout(showBanner, 2000); 48 }); 49 } 50 51 if (acceptBtn) { 52 acceptBtn.addEventListener('click', function () { 53 setCookie(COOKIE_KEY, 'accepted', 365); 54 hideBanner(); 55 }); 56 } 57 58 if (declineBtn) { 59 declineBtn.addEventListener('click', function () { 60 setCookie(COOKIE_KEY, 'declined', 30); 61 hideBanner(); 62 }); 63 } 64 65})();
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.