view/shared/assets/js/wb/ads/2.1.2/ads.js
/**
     * display an ad in all defined slots. if refreshable, update slot with a new ad
     * called to tell Google that it's time to put ads in the slots which have already been placed on the page
     */
display an ad in all defined slots. if refreshable, update slot with a new ad
called to tell Google that it's time to put ads in the slots which have already been placed on the page
display an ad in all defined slots . if refreshable update slot with a new ad called to tell Google that it ' s time to put ads in the slots which have already been placed on the page
function showAds() {
        trigger("pre.display.ads");
        $("."+settings.selector).each( function() {
            var adDiv = $(this);
            var adSlotData = adDiv.data(settings.data_store);
            var refreshable = adDiv.data('refresh') || false;
            var unfilled = adDiv.data('unfilled') || false;
            var filled = adDiv.data('filled') || false;
            var registered = adDiv.data('registered');
            if(dfp_settings.enable_single_request) {
                if(refreshable) {
                    googletag.cmd.push(function () { window.googletag.pubads().refresh([adSlotData]); });
                    debug("showAds :: refreshing ad " + adDiv.id )
                } else if( unfilled  ) {
                    googletag.cmd.push(function() { googletag.pubads().refresh([adSlotData]); });
                    debug("showAds :: filling unfilled ad " + adDiv.attr('id') );
                    adDiv.data('unfilled',false);
                }
            } else {
                if(refreshable) {
                    if(!registered){
                        googletag.cmd.push( function() {
                            googletag.display(adDiv.attr('id')); 
                            wbads.debug("registering refreshable ad " + adDiv.attr('id') );
                            adDiv.data('registered', true);
                        });
                    }
                    googletag.cmd.push(function () { window.googletag.pubads().refresh([adSlotData]); });
                    debug("showAds :: refreshing ad " + adDiv.id )
                } else if (!filled) {
                    googletag.cmd.push(function() { googletag.display(adDiv.attr('id')); });
                    debug("showAds :: displaying ad " + adDiv.attr('id') + " for the first and only time!");
                    adDiv.data('filled',true);
                } else {
                    debug("showAds :: nonrefreshing ad " + adDiv.attr('id') + " already displayed..skipping.");
                }
            }
        });
        trigger("post.display.ads");
    }
function showAds ( ) { trigger ( "pre.display.ads" ) ; $ ( "." + settings . selector ) . each ( function ( ) { var adDiv = $ ( this ) ; var adSlotData = adDiv . data ( settings . data_store ) ; var refreshable = adDiv . data ( 'refresh' ) || false ; var unfilled = adDiv . data ( 'unfilled' ) || false ; var filled = adDiv . data ( 'filled' ) || false ; var registered = adDiv . data ( 'registered' ) ; if ( dfp_settings . enable_single_request ) { if ( refreshable ) { googletag . cmd . push ( function ( ) { window . googletag . pubads ( ) . refresh ( [ adSlotData ] ) ; } ) ; debug ( "showAds :: refreshing ad " + adDiv . id ) } else if ( unfilled ) { googletag . cmd . push ( function ( ) { googletag . pubads ( ) . refresh ( [ adSlotData ] ) ; } ) ; debug ( "showAds :: filling unfilled ad " + adDiv . attr ( 'id' ) ) ; adDiv . data ( 'unfilled' , false ) ; } } else { if ( refreshable ) { if ( ! registered ) { googletag . cmd . push ( function ( ) { googletag . display ( adDiv . attr ( 'id' ) ) ; wbads . debug ( "registering refreshable ad " + adDiv . attr ( 'id' ) ) ; adDiv . data ( 'registered' , true ) ; } ) ; } googletag . cmd . push ( function ( ) { window . googletag . pubads ( ) . refresh ( [ adSlotData ] ) ; } ) ; debug ( "showAds :: refreshing ad " + adDiv . id ) } else if ( ! filled ) { googletag . cmd . push ( function ( ) { googletag . display ( adDiv . attr ( 'id' ) ) ; } ) ; debug ( "showAds :: displaying ad " + adDiv . attr ( 'id' ) + " for the first and only time!" ) ; adDiv . data ( 'filled' , true ) ; } else { debug ( "showAds :: nonrefreshing ad " + adDiv . attr ( 'id' ) + " already displayed..skipping." ) ; } } } ) ; trigger ( "post.display.ads" ) ; }
display an ad in all defined slots.
display an ad in all defined slots .
/* && adSlotData*/ // just register the refreshable slot