/** * jQuery DFP v2.1.0 * http://github.com/coop182/jquery.dfp.js * * Copyright 2015 Matt Cooper * Released under the MIT license */ !function(a,b){"use strict";!function(b){"function"==typeof define&&define.amd?define(["jquery"],b):b("object"==typeof exports?require("jquery"):a.jQuery||a.Zepto)}(function(c){var d,e=this,f="",g=0,h=0,i=0,j=".adunit",k={},l=!1,m="googleAdUnit",n=function(a,b,e){g=0,i=0,f=a,d=c(b),v(),o(e),c(function(){p(),q()})},o=function(d){if(k={setTargeting:{},setCategoryExclusion:"",setLocation:"",enableSingleRequest:!0,collapseEmptyDivs:"original",refreshExisting:!0,disablePublisherConsole:!1,disableInitialLoad:!1,noFetch:!1,namespace:b,sizeMapping:{}},"undefined"==typeof d.setUrlTargeting||d.setUrlTargeting){var e=r(d.url);c.extend(!0,k.setTargeting,{UrlHost:e.Host,UrlPath:e.Path,UrlQuery:e.Query})}c.extend(!0,k,d),k.googletag&&a.googletag.cmd.push(function(){c.extend(!0,a.googletag,k.googletag)})},p=function(){var b=a.googletag;d.each(function(){var a=c(this);g++;var d=t(a),e=s(a,d),h=u(a);a.data("existingContent",a.html()),a.html("").addClass("display-none"),b.cmd.push(function(){var g,i=a.data(m);i?g=i:(a.data("outofpage")?g=b.defineOutOfPageSlot("/"+f+"/"+d,e):(g=b.defineSlot("/"+f+"/"+d,h,e),a.data("companion")&&(g=g.addService(b.companionAds()))),g=g.addService(b.pubads()));var j=a.data("targeting");j&&c.each(j,function(a,b){g.setTargeting(a,b)});var l=a.data("exclusions");if(l){var n,o=l.split(",");c.each(o,function(a,b){n=c.trim(b),n.length>0&&g.setCategoryExclusion(n)})}var p=a.data("size-mapping");if(p&&k.sizeMapping[p]){var q=b.sizeMapping();c.each(k.sizeMapping[p],function(a,b){q.addSize(b.browser,b.ad_sizes)}),g.defineSizeMapping(q.build())}a.data(m,g),"function"==typeof k.beforeEachAdLoaded&&k.beforeEachAdLoaded.call(this,a)})}),b.cmd.push(function(){var a=b.pubads();k.enableSingleRequest&&a.enableSingleRequest(),c.each(k.setTargeting,function(b,c){a.setTargeting(b,c)});var e=k.setLocation;if("object"==typeof e&&("number"==typeof e.latitude&&"number"==typeof e.longitude&&"number"==typeof e.precision?a.setLocation(e.latitude,e.longitude,e.precision):"number"==typeof e.latitude&&"number"==typeof e.longitude&&a.setLocation(e.latitude,e.longitude)),k.setCategoryExclusion.length>0){var f,h=k.setCategoryExclusion.split(",");c.each(h,function(b,d){f=c.trim(d),f.length>0&&a.setCategoryExclusion(f)})}k.collapseEmptyDivs&&a.collapseEmptyDivs(),k.disablePublisherConsole&&a.disablePublisherConsole(),k.companionAds&&(b.companionAds().setRefreshUnfilledSlots(!0),k.disableInitialLoad||a.enableVideoAds()),k.disableInitialLoad&&a.disableInitialLoad(),k.noFetch&&a.noFetch(),a.addEventListener("slotRenderEnded",function(a){i++;var b=c("#"+a.slot.getSlotId().getDomId()),e=a.isEmpty?"none":"block",f=b.data("existingContent");"none"===e&&c.trim(f).length>0&&"original"===k.collapseEmptyDivs&&(b.show().html(f),e="block display-original"),b.removeClass("display-none").addClass("display-"+e),"function"==typeof k.afterEachAdLoaded&&k.afterEachAdLoaded.call(this,b,a),"function"==typeof k.afterAllAdsLoaded&&i===g&&k.afterAllAdsLoaded.call(this,d)}),b.enableServices()})},q=function(){d.each(function(){var b=c(this),d=b.data(m),e=a.googletag;e.cmd.push(k.refreshExisting&&d&&b.hasClass("display-block")?function(){e.pubads().refresh([d])}:function(){e.display(b.attr("id"))})})},r=function(b){var c=(b||a.location.toString()).match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/),d=c[4]||"",e=(c[5]||"").replace(/(.)\/$/,"$1"),f=c[7]||"",g=f.replace(/\=/gi,":").split("&");return{Host:d,Path:e,Query:g}},s=function(a,b){return h++,a.attr("id")||a.attr("id",b.replace(/[^A-z0-9]/g,"_")+"-auto-gen-id-"+h).attr("id")},t=function(a){var b=a.data("adunit")||k.namespace||a.attr("id")||"";return"function"==typeof k.alterAdUnitName&&(b=k.alterAdUnitName.call(this,b,a)),b},u=function(a){var b=[],d=a.data("dimensions");if(d){var e=d.split(",");c.each(e,function(a,c){var d=c.split("x");b.push([parseInt(d[0],10),parseInt(d[1],10)])})}else b.push([a.width(),a.height()]);return b},v=function(){if(l=l||c('script[src*="googletagservices.com/tag/js/gpt.js"]').length,!l){a.googletag=a.googletag||{},a.googletag.cmd=a.googletag.cmd||[];var b=document.createElement("script");b.async=!0,b.type="text/javascript",b.onerror=function(){w()};var d="https:"===document.location.protocol;b.src=(d?"https:":"http:")+"//www.googletagservices.com/tag/js/gpt.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(b,e),"none"===b.style.display&&w()}},w=function(){var b=a.googletag,d=b.cmd;setTimeout(function(){var a=function(a,c,d,e){return b.ads.push(d),b.ads[d]={renderEnded:function(){},addService:function(){return this}},b.ads[d]};b={cmd:{push:function(a){a.call(e)}},ads:[],pubads:function(){return this},noFetch:function(){return this},disableInitialLoad:function(){return this},disablePublisherConsole:function(){return this},enableSingleRequest:function(){return this},setTargeting:function(){return this},collapseEmptyDivs:function(){return this},enableServices:function(){return this},defineSlot:function(b,c,d){return a(b,c,d,!1)},defineOutOfPageSlot:function(b,c){return a(b,[],c,!0)},display:function(a){return b.ads[a].renderEnded.call(e),this}},c.each(d,function(a,c){b.cmd.push(c)})},50)};c.dfp=c.fn.dfp=function(a,c){c=c||{},a===b&&(a=f),"object"==typeof a&&(c=a,a=c.dfpID||f);var d=this;return"function"==typeof this&&(d=j),n(a,d,c),this}})}(window);

TAGGED WITH press

media tag