1// Initialize consent to false 2var consentTypes = ['Marketing', 'Analytics']; 3 4// Function to generate consent property name 5function generateConsentPropName(prop) { 6 return 'sleeknote' + prop + 'Consent'; 7} 8 9// Set initial consent values 10consentTypes.forEach(function (prop) { 11 var consentPropName = generateConsentPropName(prop); 12 if (!(consentPropName in window)) { 13 window[consentPropName] = false; 14 } 15}); 16 17// Listen for accept event 18window.addEventListener('CookieInformationConsentGiven', function () { 19 var cookieProps = ['cookie_cat_marketing', 'cookie_cat_statistic']; 20 21 cookieProps.forEach(function (prop, index) { 22 // Check if consent is given for the cookie category 23 if (window.CookieInformation.getConsentGivenFor(prop)) { 24 var consentPropName = generateConsentPropName(consentTypes[index]); 25 window[consentPropName] = true; 26 } 27 }); 28});
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.