1var topBanRefCnt = 0; 2 3function dfpRndInt() { 4 return Math.floor(Math.random() * (16000 - 14000)) + 14000; 5 //return Math.floor(Math.random() * (6000 - 4000)) + 4000; 6} 7 8(function($){ 9 var rtime; 10 var run_id; 11 var timeout = false; 12 var delta = 100; 13 14 $(window).resize(function() { 15 rtime = new Date(); 16 17 if (timeout === false) { 18 timeout = true; 19 setTimeout(resizeEnd, delta); 20 } 21 }); 22 23 $(window).on("orientationchange",function(){ 24 resizeAds(); 25 }); 26 27 function resizeEnd() { 28 if (new Date() - rtime < delta) { 29 run_id = setTimeout(resizeEnd, delta); 30 } else { 31 timeout = false; 32 resizeAds(); 33 clearTimeout(run_id); 34 } 35 } 36 37 function resizeAds() { 38 var viewportWidth = $(window).width(); 39 40 $('.adunit').each(function(o) { 41 var $iframe = $(this).find('iframe:first'); 42 var $banner = $iframe.contents().find('img'); 43 var $ampImg = $iframe.contents().find('amp-img'); 44 var bannerDimensions = $(this).attr('data-dimensions'); 45 var w = 0; 46 var h = 0; 47 $ampImg.removeAttr('style'); 48 49 if (bannerDimensions == '728x90') { 50 if (viewportWidth >= 1200) { 51 w = 728; 52 h = 90; 53 } else if (viewportWidth >= 980) { 54 w = 597; 55 h = 74; 56 } else if (viewportWidth >= 768) { 57 w = 450; 58 h = 56; 59 } else { 60 w = viewportWidth - 4; 61 h = (viewportWidth * 0.1236263736263736) + 3; 62 } 63 } else { 64 // LICH multi-sized slot 65 if (bannerDimensions.indexOf(',') > -1) { 66 var viewportW = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 67 var viewportH = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 68 69 if (viewportW > 690) { 70 bannerDimensions = '1200x52'; 71 } else { 72 bannerDimensions = '700x60'; 73 } 74 } 75 76 var bannerWidth = parseFloat(bannerDimensions.substring(0, bannerDimensions.indexOf("x"))); 77 var bannerHeight = parseFloat(bannerDimensions.substring(bannerDimensions.indexOf("x")+1)); 78 79 w = $iframe.parent().width(); 80 h = (parseFloat(w) * (bannerHeight/bannerWidth)) + 1; 81 } 82 83 $iframe.attr('width', w + 'px').attr('height', h + 'px'); 84 $ampImg.width(w).height(h); 85 $banner.width(w).height(h); 86 }); 87 } 88 89 $(document).ready(function(){ 90 $.dfp({ 91 dfpID: '1023345', 92 sizeMapping: { 93 'top-narrow-sizing': [ 94 {browser: [690, 300], ad_sizes: [1200, 52]}, 95 {browser: [0, 0], ad_sizes: [700, 60]} 96 ] 97 }, 98 afterAllAdsLoaded: function ($adUnits) { 99 $('.adunit').each(function(o) { 100 if ($(this).css('display') == 'none') { 101 $(this).parent().addClass('blank-ad-parent'); 102 $(this).parent().hide(); 103 } 104 }); 105 106 setTimeout(function(){ 107 resizeAds(); 108 }, 100); 109 110 setTimeout(function(){ 111 refreshLeaderboard(); 112 }, dfpRndInt()); 113 114 } 115 }); 116 }); 117 118 119 function refreshLeaderboard() { 120 topBanRefCnt++; 121 122 $('.header-leaderboard > div.adunit').dfp({ 123 dfpID: '1023345', 124 refreshExisting: true, 125 afterAllAdsLoaded: function ($adUnits) { 126 $('.dfp-narrow-top > div.adunit').each(function(o) { 127 if($(this).css('display') == 'none') { 128 $(this).parent().addClass('blank-ad-parent'); 129 $(this).parent().hide(); 130 } 131 }); 132 133 setTimeout(function(){ 134 resizeAds(); 135 }, 100); 136 137 if (topBanRefCnt < 11) { 138 setTimeout(function(){ 139 refreshLeaderboard(); 140 }, dfpRndInt()); 141 } 142 } 143 }); 144 } 145
146 /* function refreshTopBottomNarrowAds() { 147 topBanRefCnt++; 148 149 $('.dfp-narrow-top > div.adunit').dfp({ 150 dfpID: '1023345', 151 refreshExisting: true, 152 sizeMapping: { 153 'top-narrow-sizing': [ 154 {browser: [690, 300], ad_sizes: [1200, 52]}, 155 {browser: [0, 0], ad_sizes: [700, 60]} 156 ] 157 }, 158 afterAllAdsLoaded: function ($adUnits) { 159 $('.dfp-narrow-top > div.adunit').each(function(o) { 160 if($(this).css('display') == 'none') { 161 $(this).parent().addClass('blank-ad-parent'); 162 $(this).parent().hide(); 163 } 164 }); 165 166 setTimeout(function(){ 167 resizeAds(); 168 }, 100); 169 170 if (topBanRefCnt < 11) { 171 setTimeout(function(){ 172 refreshTopBottomNarrowAds(); 173 }, dfpRndInt()); 174 } 175 } 176 }); 177 } */ 178 179})(jQuery); 180
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.