1"use strict"; 2 3/* global Cookies */ 4 5$(function () { 6 function removeAllCookies() { 7 var cookies = Cookies.get(); 8 for (var cookie in cookies) { 9 Cookies.remove(cookie); 10 } 11 } 12 function removeAllConsentCookies() { 13 var cookies = Cookies.get(); 14 for (var cookie in cookies) { 15 if (cookie.match(/^cookie-consent/)) { 16 Cookies.remove(cookie); 17 } 18 } 19 } 20 $('button[data-toggle="optout"]').click(function (e) { 21 e.preventDefault(); 22 removeAllCookies(); 23 window.location.reload(); 24 }); 25 $('button', '#cookie-consent').click(function (e) { 26 e.preventDefault(); 27 removeAllConsentCookies(); 28 var $btn = $(this), 29 selector = 'input[type="checkbox"]'; 30 switch ($btn.data('accept')) { 31 case 'checked': 32 selector += ':checked'; 33 break; 34 } 35 $(selector, '#cookie-consent').each(function () { 36 var $this = $(this), 37 name = $this.attr('name'), 38 val = $this.val(); 39 Cookies.set(name, val, { 40 expires: 30 41 }); 42 }); 43 Cookies.set('cookie-consent', 1, { 44 expires: 30 45 }); 46 window.location.reload(); 47 }); 48 function updateCookieConsentSpacing() { 49 var $consent = $('#cookie-consent'); 50 if ($consent.length && $consent.is(':visible')) { 51 var height = $consent.outerHeight(); 52 document.documentElement.style.setProperty('--cookie-consent-height', "".concat(height, "px")); 53 } else { 54 document.documentElement.style.removeProperty('--cookie-consent-height'); 55 } 56 } 57 $(window).on('resize', updateCookieConsentSpacing); 58 $('button[data-toggle="cookie-consent"]').click(function (e) { 59 e.preventDefault(); 60 $('#cookie-consent').addClass('is-visible').show(); 61 updateCookieConsentSpacing(); 62 }); 63 if (Cookies.get('cookie-consent') === undefined) { 64 $('#cookie-consent').addClass('is-visible').show(); 65 updateCookieConsentSpacing(); 66 } else { 67 var cookies = Cookies.get(); 68 for (var cookie in cookies) { 69 if (cookie.match(/^cookie-consent_/)) { 70 $('input[type="checkbox"][name="' + cookie + '"]', '#cookie-consent').prop('checked', true); 71 if ($.isFunction(window[cookies[cookie]])) { 72 window[cookies[cookie]](); 73 } 74 $('[data-init^="' + cookie + '"]').each(function () { 75 var $this = $(this), 76 fn = $this.data('init').replace(cookie, 'init'); 77 $this[fn](); 78 }); 79 } 80 } 81 } 82});
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.