1var popup = { 2 preload : function() { 3 var p = {} 4 p.layout = $('body').attr('data-layout'); 5 p.guid = $('body').attr('data-guid'); 6 7 var q = $.param(p); 8 $.getJSON('/ajax/getPopup.php?'+q,function(data) { 9 if(data.guid) { 10 popupData = data; 11 } 12 popup.init(); 13 }); 14 }, 15 init : function() { 16 if(popupData === undefined || !popupData || popupData.delay ===undefined) { 17 return; 18 } 19 20 popupData.delay = parseInt(popupData.delay); 21 popupData.max = parseInt(popupData.max); 22 23 //Check if seen 24 var p = []; 25 if(localStorage.getItem('popupCache') !== null) { 26 p = JSON.parse(localStorage.getItem('popupCache')); 27 } 28 29 var currentKey = getItemKey(p ,'id',popupData.guid); 30 if(currentKey !== false) { 31 var num = p[currentKey].num; 32 if(num >= popupData.max) { 33 return; 34 } 35 } else { 36 var num = 0; 37 } 38 39 setTimeout(function() { 40 num++; 41 popup.cachePopupData(popupData.guid,num); 42 popup.show(popupData.guid,popupData.size); 43 },popupData.delay*1000); 44 }, 45 show : function(guid,size) { 46 openCleanAjaxModal('/pages/modals/ajax/popup.php?guid='+guid,size); 47 }, 48 cachePopupData : function(id,num) { 49 var p = []; 50 if(localStorage.getItem('popupCache') !== null) { 51 p = JSON.parse(localStorage.getItem('popupCache')); 52 } 53 54 var cacheObject = {}; 55 cacheObject.id = id; 56 cacheObject.num = num; 57 58 var currentKey = getItemKey(p ,'id',id); 59 if(currentKey === false) { 60 p.push(cacheObject); 61 } else { 62 p[currentKey].id = id; 63 p[currentKey].num = num; 64 } 65 66 localStorage.setItem('popupCache',JSON.stringify(p)); 67 }, 68 markAsInteracted : function() { 69 popup.cachePopupData(popupData.guid,1000); 70 } 71 72} 73$(function() { 74 popup.preload(); 75})
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.