1(function($) { 2 $(document).ready(function() { 3 4 function gdpr_cookie_compliance_setup_get_session( event_type ) { 5 var gdpr_uvid_session = false; 6 7 if ( typeof( sessionStorage ) !== "undefined" ) { 8 gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid"); 9 if ( ! gdpr_uvid_session ) { 10 sessionStorage.setItem( "gdpr_uvid", moove_frontend_gdpr_scripts.gdpr_uvid ); 11 gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid"); 12 } 13 } 14 15 return gdpr_uvid_session; 16 } 17 18 function gdpr_cookie_compliance_get_cookies(){ 19 var pairs = document.cookie.split(";"); 20 var cookies = {}; 21 for (var i=0; i<pairs.length; i++){ 22 var pair = pairs[i].split("="); 23 cookies[(pair[0]+'').trim()] = unescape(pair[1]); 24 } 25 return cookies; 26 } 27 28 function gdpr_cookie_compliance_set_cookies(name, value, days){ 29 var expires; 30 if (days) { 31 var date = new Date(); 32 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 33 expires = "; expires=" + date.toGMTString(); 34 } else { 35 expires = ""; 36 } 37 38 document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/"; 39 (JSON.parse(value)); 40 } 41 42 var started = false; 43 var timeout_req = 2000; 44 var gdpr_timeout = 0; 45 $.fn.gdpr_cookie_compliance_analytics = function(event, extras) { 46 if ( moove_frontend_gdpr_scripts.stats_enabled ) { 47 var gdpr_uvid_session = gdpr_cookie_compliance_setup_get_session( event ); 48 if ( !started ) { 49 gdpr_timeout = 0; 50 } else { 51 gdpr_timeout = gdpr_timeout + timeout_req; 52 } 53 started = true; 54 55 if ( event === 'script_inject' ) { 56 if ( typeof( localStorage ) !== "undefined" ) { 57 gdpr_uvid_session = localStorage.getItem("gdpr_uvid"); 58 if ( ! gdpr_uvid_session ) { 59 localStorage.setItem( "gdpr_uvid", moove_frontend_gdpr_scripts.gdpr_uvid ); 60 gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid"); 61 } else { 62 if ( typeof( sessionStorage ) !== "undefined" ) { 63 _gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid"); 64 if ( ! _gdpr_uvid_session ) { 65 _gdpr_uvid_session.setItem( "gdpr_uvid", moove_frontend_gdpr_scripts.gdpr_uvid ); 66 gdpr_uvid_session = sessionStorage.getItem("gdpr_uvid"); 67 } 68 _event = 'existing_session'; 69 _extras = ''; 70 try { 71 jQuery().gdpr_cookie_compliance_analytics_with_uvid( _event, _extras, _gdpr_uvid_session ); 72 jQuery().gdpr_cookie_compliance_analytics_with_uvid( 'script_injected', extras, _gdpr_uvid_session ); 73 } catch(err) { 74 // error 75 } 76 } 77 } 78 } 79 } 80 setTimeout( function(){ 81 if ( gdpr_uvid_session && event ) { 82 $.post( 83 moove_frontend_gdpr_scripts.ajaxurl, 84 { 85 action: "moove_gdpr_premium_save_analytics", 86 event: event, 87 extras: extras, 88 gdpr_uvid: gdpr_uvid_session, 89 }, 90 function( msg ) { 91 // console.warn(gdpr_uvid_session); 92 if ( gdpr_timeout >= timeout_req ) { 93 gdpr_timeout = gdpr_timeout - timeout_req; 94 } 95 } 96 ); 97 } 98 }, gdpr_timeout ); 99 100 } 101 } 102 $.fn.gdpr_cookie_compliance_analytics_with_uvid = function(event, extras, uvid) { 103 if ( moove_frontend_gdpr_scripts.stats_enabled ) { 104 var gdpr_uvid_session = uvid; 105 if ( !started ) { 106 gdpr_timeout = 0; 107 } else { 108 gdpr_timeout = gdpr_timeout + timeout_req; 109 } 110 started = true; 111 112 setTimeout( function(){ 113 if ( gdpr_uvid_session && event ) { 114 $.post( 115 moove_frontend_gdpr_scripts.ajaxurl, 116 { 117 action: "moove_gdpr_premium_save_analytics", 118 event: event, 119 extras: extras, 120 gdpr_uvid: gdpr_uvid_session, 121 }, 122 function( msg ) { 123 // console.warn(gdpr_uvid_session); 124 if ( gdpr_timeout >= timeout_req ) { 125 gdpr_timeout = gdpr_timeout - timeout_req; 126 } 127 } 128 ); 129 } 130 }, gdpr_timeout ); 131 132 } 133 } 134 });
135})(jQuery);
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.