1; 2(function($) { 3 function adsensei_ad_tracker(){ 4 5 setTimeout(function(){ 6 7 var ad_ids ={}; 8 $(".adsensei-location").each(function(index){ 9 ad_ids[index]= ($(this).attr('id')); 10 }); 11 12 if($.isEmptyObject( ad_ids ) == false){ 13 $.ajax({ 14 type: "POST", 15 url:adsensei_analytics.ajax_url, 16 dataType: "json", 17 data:{action:"adsensei_insert_ad_impression", ad_ids:ad_ids, adsensei_front_nonce:adsensei_analytics.adsensei_front_nonce}, 18 error: function(response){ 19 console.log(response); 20 } 21 }); 22 } 23 24 $('body').on('click', '.adsensei-location', function (e) { 25 if(e.target.getAttribute('data-attr')) { 26 var placement = $(this).attr('data-attr'); 27 if( placement == 'beginning_of_post' ){ 28 var ad_id = $(this).attr('id'); 29 var currentLocation = window.location.href; 30 var referrer = document.referrer; 31 if(ad_id){ 32 $.post(adsensei_analytics.ajax_url, 33 { action:"adsensei_insert_ad_clicks_"+placement, ad_id:ad_id, adsensei_front_nonce:adsensei_analytics.adsensei_front_nonce,currentLocation:currentLocation,referrer:referrer}, 34 function(response){ 35 console.log(response); 36 } 37 ); 38 } 39 } 40 else if( placement == 'end_of_post' ){ 41 var ad_id = $(this).attr('id'); 42 var currentLocation = window.location.href; 43 var referrer = document.referrer; 44 if(ad_id){ 45 $.post(adsensei_analytics.ajax_url, 46 { action:"adsensei_insert_ad_clicks_"+placement, ad_id:ad_id, adsensei_front_nonce:adsensei_analytics.adsensei_front_nonce,currentLocation:currentLocation,referrer:referrer}, 47 function(response){ 48 console.log(response); 49 } 50 ); 51 } 52 } 53 else if( placement == 'middle_of_post' ){ 54 var ad_id = $(this).attr('id'); 55 var currentLocation = window.location.href; 56 var referrer = document.referrer; 57 if(ad_id){ 58 $.post(adsensei_analytics.ajax_url, 59 { action:"adsensei_insert_ad_clicks_"+placement, ad_id:ad_id, adsensei_front_nonce:adsensei_analytics.adsensei_front_nonce,currentLocation:currentLocation,referrer:referrer}, 60 function(response){ 61 console.log(response); 62 } 63 ); 64 } 65 } 66 else if( placement == 'after_more_tag' ){ 67 var ad_id = $(this).attr('id'); 68 var currentLocation = window.location.href; 69 var referrer = document.referrer; 70 if(ad_id){ 71 $.post(adsensei_analytics.ajax_url, 72 { action:"adsensei_insert_ad_clicks_"+placement, ad_id:ad_id, adsensei_front_nonce:adsensei_analytics.adsensei_front_nonce,currentLocation:currentLocation,referrer:referrer}, 73 function(response){ 74 console.log(response); 75 } 76 ); 77 } 78 } 79 80 } 81 82 }); 83 $(document).on('mouseover', "#rotater_id", function(e){ 84 var rotater_id = $(this).attr('rotate_id'); 85 var element = document.getElementById("adsensei-rotate") 86 if(element){
87 element.id = rotater_id 88 } 89 } ) 90 91 $('.adsensei_ad_container').mouseout( function(){ 92 document.querySelector('.adsensei-rotatorad').id = 'adsensei-rotate' 93 } ) 94 95 $(".adsensei-location").on("click",function(){ 96 var ad_id = $(this).attr('id'); 97 var currentLocation = window.location.href; 98 var referrer = document.referrer; 99 if(ad_id){ 100 $.post(adsensei_analytics.ajax_url, 101 { action:"adsensei_insert_ad_clicks", ad_id:ad_id, adsensei_front_nonce:adsensei_analytics.adsensei_front_nonce,currentLocation:currentLocation,referrer:referrer}, 102 function(response){ 103 console.log(response); 104 }); 105 } 106 }); 107 }, 1000); 108 109 110 111 //Detecting click event on iframe based ads 112 window.addEventListener('blur',function(){ 113 if (document.activeElement instanceof HTMLIFrameElement) { 114 var data = $(this); 115 var ad_id = ""; 116 if(data.context) 117 { 118 var el = data.context.activeElement; 119 while (el.parentElement) { 120 el = el.parentElement; 121 if(el.attributes[0].name =='data-ad-id'){ 122 ad_id = el.attributes[0].value; 123 } 124 } 125 } 126 else if(typeof infolinks_adid=='number'){ 127 ad_id=infolinks_adid; 128 } 129 130 if(ad_id){ 131 $.post(adsensei_analytics.ajax_url, 132 { action:"adsensei_insert_ad_clicks", ad_id:ad_id}, 133 function(response){ 134 console.log(response); 135 }); 136 } 137 138 } 139 }); 140 141 } 142 adsensei_ad_tracker(); 143 144 function set_adsensei_Cookie_(name,value,days) { 145 var expires = ""; 146 if (days) { 147 var date = new Date(); 148 date.setTime(date.getTime() + (days*24*60*60*1000)); 149 expires = "; expires=" + date.toUTCString(); 150 } 151 document.cookie = name + "=" + (value || "") + expires + "; path=/"; 152 } 153 154 setTimeout( () => { 155 var close_btn = document.getElementsByClassName("adsensei-sticky-ad-close")[0] 156 var adsensei_sticky = document.getElementsByClassName("adsensei-sticky")[0] 157 if(close_btn){ 158 close_btn.addEventListener('click', function(){ 159 adsensei_sticky.style.display = "none" 160 set_adsensei_Cookie_('adsensei_sticky','sticky_ad',1); 161 } ) 162 } 163 }, 100); 164 165})(window.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.