1/** 2 * Adds Google Tag Manager and Live Chat to site and takes care of cookie conset 3 */ 4var gtag = null; 5 6jQuery(document).ready(function() { 7 var addGTM = function() { 8 var s = document.createElement( 'script' ); 9 s.setAttribute( 'src', `https://www.googletagmanager.com/gtag/js?id=${drupalSettings.adminModule.gtmId}`); 10 s.setAttribute('async', true); 11 document.body.appendChild( s ); 12 } 13 14 var addBoostAIChatbot = function() { 15 jQuery('<script>') 16 .attr('type', 'text/javascript') 17 .text("var options = {chatPanel: {styling: {buttons: {multiline: true}}},settings: {enableProactivityForSmallDevices: true}};var boost = window.boostInit('gls-slovenia', options);") 18 .appendTo('head'); 19 } 20 21 if (Drupal.eu_cookie_compliance.hasAgreed()){ 22 let item = jQuery(".eu-cookie-compliance-save-preferences-button"); 23 item.hide(); 24 25 let itemAcceptAlll = jQuery("#popup-buttons .agree-button"); 26 itemAcceptAlll.hide(); 27 // a new - Fake button will be created 28 } 29 30 if (Drupal.eu_cookie_compliance.hasAgreed('analytics')){ 31 // If user has agreed to Analytics cookies - Append gtagmanager 32 addGTM(); 33 window.dataLayer = window.dataLayer || []; 34 gtag = function(){ 35 dataLayer.push(arguments); 36 } 37 gtag('js', new Date()); 38 gtag('config', drupalSettings.adminModule.gtmId); 39 40 } 41 if (Drupal.eu_cookie_compliance.hasAgreed('marketing')){ 42 // If user has agreed to Marketing cookies - Append LivePersonMonitor 43 if(!(window.location.href.indexOf("/en") > -1)) { 44 addBoostAIChatbot(); 45 } 46 } 47});
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.