1(function($){ 2 $.fn.responsiveAd = function(options) { 3 4 var opts = $.extend({ 5 screenSize: 'all' 6 },options); 7 8 this.placeAds = function(screenSize) { 9 10 var obj = this; 11 12 var deviceSize = ''; 13 if (Modernizr.mq('only screen and (min-width:1024px)')==true) { 14 deviceSize = 'desktop'; 15 } 16 else if (Modernizr.mq('only screen and (min-width:768px) and (max-width: 1024px)')==true) { 17 deviceSize = 'tablet'; 18 } 19 else if (Modernizr.mq('only screen and (min-width:320px) and (max-width: 480px)')==true) { 20 deviceSize = 'mobile'; 21 } 22 23 var placeAd = false; 24 if (opts.screenSize.search('all') != '-1') { 25 placeAd = true; 26 } 27 else if (screenSize.search(deviceSize) != '-1') { 28 placeAd = true; 29 } 30 31 if (placeAd == true) { 32 script = document.createElement("script"); 33 script.type = "text/javascript"; 34 script.text = 'googletag.cmd.push(function() { googletag.display("'+obj.attr('id')+'"); });'; 35 36 id = obj.attr('id'); 37 38 // Added by David: 11/02/2015 39 // Check that the block exists first 40 if (document.getElementById(id) !== null) { 41 document.getElementById(id).appendChild(script); 42 } 43 } 44 45 } 46 47 return this.placeAds(opts.screenSize); 48 }; 49})(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.