1(function ($, Drupal, drupalSettings) { 2 3 Drupal.uv_gdpr = Drupal.uv_gdpr || {}; 4 5 Drupal.uv_gdpr.getStatus = function () { 6 return Cookies.get(drupalSettings.uv_gdpr.cookie_status_name); 7 } 8 9 document.addEventListener('DOMContentLoaded', function() { 10 var status = Drupal.uv_gdpr.getStatus(); 11 // Matomo 12 if (typeof _paq === 'object') { 13 if (status == 'all' 14 || (!!Drupal.eu_cookie_compliance.hasAgreed && Drupal.eu_cookie_compliance.hasAgreed('matomo')) 15 ) { 16 _paq.push(['setCookieConsentGiven']); 17 } 18 else { 19 var addRequireCookieConsent = true; 20 21 for (iterator = 0; iterator < _paq.length; iterator++) { 22 if (_paq[iterator] 23 && _paq[iterator][0] 24 && _paq[iterator][0] == 'requireCookieConsent' 25 ) { 26 addRequireCookieConsent = false 27 } 28 } 29 30 if (addRequireCookieConsent) { 31 _paq.push(['requireCookieConsent']); 32 } 33 } 34 } 35 36 // Facebook Pixel 37 if (typeof fbq === 'function') { 38 if (status == 'all' 39 || (!!Drupal.eu_cookie_compliance.hasAgreed && Drupal.eu_cookie_compliance.hasAgreed('facebook_pixel')) 40 ) { 41 fbq('consent', 'grant'); 42 } 43 else { 44 fbq('consent', 'revoke'); 45 } 46 } 47 48 // Google Analytics 49 if (typeof ga === 'function' && typeof gaProperty === 'string') { 50 if (status != 'all' 51 && (!Drupal.eu_cookie_compliance.hasAgreed || !Drupal.eu_cookie_compliance.hasAgreed('google_analytics')) 52 ) { 53 window['ga-disable-' + gaProperty] = true; 54 } 55 } 56 57 }, false); 58 59 Drupal.behaviors.uvGdprCheckAndWithdrawConsent = { 60 attach: function (context, settings) { 61 if (typeof settings.uv_gdpr != 'undefined' 62 && typeof settings.uv_gdpr.withdraw_consent != 'undefined' 63 && typeof settings.uv_gdpr.withdraw_consent.insert_after != 'undefined' 64 && typeof settings.uv_gdpr.withdraw_consent.output != 'undefined' 65 && typeof settings.uv_gdpr.withdraw_consent.wrapper_class != 'undefined' 66 && typeof settings.uv_gdpr.withdraw_consent.button_class != 'undefined' 67 ) { 68 $(once('withdraw-consent-init', 'html', context)).each(function () { 69 $( settings.uv_gdpr.withdraw_consent.insert_after).after( settings.uv_gdpr.withdraw_consent.output ); 70 $('.' + settings.uv_gdpr.withdraw_consent.wrapper_class + ' .' + settings.uv_gdpr.withdraw_consent.button_class).click(function() { 71 var cookies = Cookies.get(); 72 73 // Shamelesly stolen from eu_cookie_compliance 74 // Shamelesly stolen from eu_cookie_compliance 75 for (var i in cookies) { 76 // Clear cookies the easy way except for the logged in user 77 if (!i.startsWith('SESS')) { 78 Cookies.remove(i); 79 80 var hostname = window.location.hostname; 81 var cookieRemoved = false; 82 var index = 0; 83 84 while (!cookieRemoved && hostname !== '') { 85 // Attempt to remove. 86 cookieRemoved = Cookies.remove(i, { domain: '.' + hostname, path: '/' }); 87 if (!cookieRemoved) { 88 cookieRemoved = Cookies.remove(i, { domain: hostname, path: '/' }); 89 } 90 91 index = hostname.indexOf('.'); 92 93 // We can be on a sub-domain, so keep checking the main domain as well. 94 hostname = (index === -1) ? '' : hostname.substring(index + 1); 95 } 96 97 // Some jQuery Cookie versions don't remove cookies well. Try again
98 // using plain js. 99 if (!cookieRemoved) { 100 document.cookie = i + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;'; 101 } 102 } 103 } 104 105 url = window.location.href; 106 url += ( url.indexOf('?') >= 0 ? '&' : '?' ) + 'mode=cookieconsentrevoked'; 107 108 window.location.href = url; 109 window.location.reload(true) 110 }); 111 }); 112 } 113 } 114 }; 115})(jQuery, Drupal, drupalSettings);
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.