1(function($) { 2 3 $(document).on('ready', function (e) { 4 5 function setCookie(name,value,days) { 6 var expires = ""; 7 if (days) { 8 var date = new Date(); 9 date.setTime(date.getTime() + (days*24*60*60*1000)); 10 expires = "; expires=" + date.toUTCString(); 11 } 12 document.cookie = name + "=" + (value || "") + expires + "; path=/"; 13 } 14 function getCookie(name) { 15 var nameEQ = name + "="; 16 var ca = document.cookie.split(';'); 17 for(var i=0;i < ca.length;i++) { 18 var c = ca[i]; 19 while (c.charAt(0)==' ') c = c.substring(1,c.length); 20 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 21 } 22 return null; 23 } 24 function eraseCookie(name) { 25 document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 26 } 27 28 // Initialize TimeMe 29 TimeMe.initialize({ 30 idleTimeoutInSeconds: 30 // seconds 31 }); 32 // Check if user has already cookie 33 if( getCookie('userType') == null ) { 34 // Add cookie if user has been on website over than 40 secs 35 TimeMe.callAfterTimeElapsedInSeconds(40, function() { 36 setCookie('ellapsedTimeOnPage', '40 seconds'); 37 setCookie('userType', 'engaged'); 38 }); 39 // Update cookie when user has been on website over 5 mins 40 TimeMe.callAfterTimeElapsedInSeconds(300, function() { 41 setCookie('ellapsedTimeOnPage', '300 seconds'); 42 setCookie('userType', 'engaged'); 43 }); 44 } 45 }); 46 47})(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.