console.error(‘Error attaching controller to ‘ + elementTag, error);
} // globals (like DS) must be registered before other files call DS.service() or DS.component()
registerGlobals(); // wait until everything else has been mounted before instantiating legacy DS controllers
document.addEventListener(‘DOMContentLoaded’, function ()
mountDollarSliceComponents();
);
}, “42”:42,”63″:63,”64″:64,”65″:65,”66″:66,”67″:67,”68″:68];
window.modules[“ads.legacy”] = [function(require,module,exports){“use strict”;
DS.service(“adService”, [“$window”, “headerBidding”, “$visibility”, function ($window, headerBidding, $visibility) {
$window.googletag = $window.googletag “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com” , $window.googletag.cmd = $window.googletag.cmd “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com” [];
$window.pbjs = $window.pbjs “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com” ;
$window.pbjs.que = $window.pbjs.que “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com” [];
var adIndex = ,
adSlotsWithRefresh = [],
testParam = getTestParam(),
pageId = getPageId(),
slotData = [];
/**
* Checks if url query parameters contain ‘test_ads’ and returns it’s value
* @return string
*/
function getTestParam()
var TEST_ADS_REGEX = /[?&]test_ads=([^?]+)/;
var results = TEST_ADS_REGEX.exec($window.location.search);
return results ? results[1] : “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”;
/*
* Config GPT scripts
*/
$window.googletag.cmd.push(function ()
var pageType = document.querySelector(“.js-analytics-js-data”).getAttribute(“data-pagetype”).replace(“http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”, “-“);
$window.googletag.pubads().disableInitialLoad();
$window.googletag.enableServices();
var cacheBustValue = Math.floor(Math.random() * 10000000000000),
cacheBustMeta = document.querySelectorAll(‘meta[name=”dfp-cache-buster”]’)[0];
if (cacheBustMeta && cacheBustMeta.content)
cacheBustValue = cacheBustMeta.content;
$window.googletag.pubads().setTargeting(“dfp_cache_buster”, cacheBustValue).setTargeting(“page_id”, pageId).setTargeting(“page_type”, pageType);
var usprivacyRegex = /usprivacy=d+[YN]Y/;
if (document.cookie.match(usprivacyRegex))
$window.googletag.pubads().setRequestNonPersonalizedAds(1);
if (testParam)
googletag.pubads().setTargeting(“kw”, “test_” + testParam);
// AB value
var ABCookie = document.cookie.match(/AB=(d+_d+)/);
if (ABCookie && ABCookie.length > 1)
googletag.pubads().setTargeting(“ab_var”, ABCookie[1]);
enableAdRefresh();
);
/*
* Request ad from the DFP
*/
this.requestAd = function (ad_data)
ad_data.defineSlot();
googletag.pubads().refresh([ad_data.gptSlot],
changeCorrelator: false
);
;
/**
* Add refresh to some ad slots
*/
function enableAdRefresh()
googletag.pubads().addEventListener(“slotRenderEnded”, function (event)
var slot = event.slot;
var slotId = slot.getSlotElementId();
var slotElement = $window.document.getElementById(slotId);
if (Array.isArray(event.size) && event.size[0] && event.size[1])
var size = event.size[0] + “x” + event.size[1];
if (refreshEnabled(size) && !adSlotsWithRefresh[slotId])
updateSlotTargeting(slot);
addRefreshToSlot(slot, slotData[slotId], slotElement);
adSlotsWithRefresh[slotId] = true;
);
/**
* Every 20 sec check if slot is in view
* If it is, request new ad from the DFP
*/
function addRefreshToSlot(slot, ad_data, slotElement)
var refreshInterval = 30000;
setInterval(function ()
if (adIsInView(slotElement))
headerBidding.prebid(ad_data, slot);
, refreshInterval);
/**
* Removes prebid targeting
* Adds targetig for the specific height
*/
function updateSlotTargeting(slot)
slot.clearTargeting(“hb_adid”);
slot.clearTargeting(“hb_bidder”);
slot.clearTargeting(“hb_pb”);
slot.clearTargeting(“hb_size”);
slot.setTargeting(“refresh”, “yes”);
/**
* Checks ad’s size to make sure it’s enabled to refresh
*/
function refreshEnabled(size)
// Nonstandard ad sizes, not allowed to refresh
var teadsSize = “2×2”,
nativeSize = “1×2”,
customSize = “1×3”,
podcastTextAdSize = “1×4”;
return size !== teadsSize && size !== nativeSize && size !== customSize && size !== podcastTextAdSize;
/**
* Checks if ad slot is in view and window is focused
*/
function adIsInView(slotElement)
var windowHasFocus = $window.document.hasFocus();
if (!windowHasFocus)
return false;
else
return $visibility.isElementInViewport(slotElement);
/*
* Create ad object
*/
this.createAd = function (el)
var type = el.getAttribute(“data-type”),
prebid = el.getAttribute(“data-prebid”),
dataDfpSizes = el.getAttribute(“data-sizes”),
dataPrebidSizes = el.getAttribute(“data-prebid-sizes”),
rubiconZoneId = el.getAttribute(“data-zone-id”),
appnexusPlacementId = el.getAttribute(“data-placement-id”),
trustxId = el.getAttribute(“data-trustx-id”),
criteoZoneId = el.getAttribute(“data-criteo-id”),
indexSiteId = el.getAttribute(“data-site-id”),
tripleliftCode = el.getAttribute(“data-tl-code”);
if (!adIndex[type])
adIndex[type] = 1;
el.id = type + “-” + adIndex[type];
adIndex[type]++;
var ad =
id: el.id,
type: type,
adUnit: getAdUnit(),
prebid: getBoolean(prebid),
dfpSizes: getSizeArray(dataDfpSizes),
prebidSizes: getSizeArray(dataPrebidSizes),
rubiconZoneId: rubiconZoneId,
appnexusPlacementId: appnexusPlacementId,
trustxId: trustxId,
criteoZoneId: criteoZoneId,
indexSiteId: indexSiteId,
tripleliftCode: tripleliftCode,
gptSlot: null,
defineSlot: function defineSlot()
this.gptSlot = $window.googletag.defineSlot(this.adUnit, this.dfpSizes, this.id);
slotData[this.id] = this;
this.gptSlot.addService(googletag.pubads()); // slot level targeting
this.gptSlot.setTargeting(“site”, “redux”);
this.gptSlot.setTargeting(“refresh”, “no”);
this.gptSlot.setTargeting(“pos”, this.id);
$window.googletag.display(this.id);
;
return ad;
;
/**
* Converts “true” / “false” strings to boolean
* @param string value
* @returns boolean
*/
function getBoolean(value)
return value === “true” ? true : false;
/**
* Returns sizes as an array
* @param string sizes
* @returns array
*/
function getSizeArray(sizes)
var sizesArray = [];
if (sizes && sizes.length)
sizes = sizes.split(“,”);
sizes.map(function (size)
size = size.split(“x”);
var w = parseInt(size[0]);
var h = parseInt(size[1]);
sizesArray.push([w, h]);
);
return sizesArray;
/**
* Returns ad node
* @returns string
*/
function getAdNode()
var adNodeElement = document.querySelector(“div[data-adnode]”),
adNode = “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”;
if (adNodeElement)
adNode = adNodeElement.getAttribute(“data-adnode”);
return adNode;
/**
* Returns DFP ad unit
* @returns string
*/
function getAdUnit()
var networkCode = “91898098”,
platform = “slate.com”,
adNode = getAdNode();
return networkCode + “/” + platform + “/” + adNode;
/**
* Returns page id
* @returns string
*/
function getPageId()
var html = window.document.documentElement,
dataUri = html.getAttribute(“data-uri”),
pageId = dataUri.split(“/”)[2].replace(“@published”, “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”);
return pageId;
}]);
}, ];
window.modules[“headerbidding.legacy”] = [function(require,module,exports){“use strict”;
DS.service(“headerBidding”, function () {
var adData,
permutiveData = getPermutiveData(),
section = getSection(),
isMember = require(2).isMember(),
HARD_TIMEOUT = 1500; // max amount of time ad calls are delayed for headerbidding
this.prebid = function (data)
adData = data;
adData.biddersManager =
adserverRequestSent: false,
prebid: false,
amazon: false
;
var _self = this;
window.slateCMP.TCF.ready.then(function (tcData)
_self.requestBidsFromExchanges.call(_self);
); // header bidding has a fixed amount of time to finish
// after that we call ad server
setTimeout(function ()
googletag.cmd.push(function ()
defineGptSlot(adData);
callAdServer(adData);
);
, HARD_TIMEOUT);
; // Request bids from the exchanges
this.requestBidsFromExchanges = function ()
this.getBidsFromPrebidExchanges();
this.getBidsFromAmazon();
; // get bids from all prebid partners
this.getBidsFromPrebidExchanges = function () {
var prebidAdUnit = this.createPrebidAdUnit();
pbjs.que.push(function () {
pbjs.addAdUnits([prebidAdUnit]); // cache a reference to the ad data at this time,
// before we re-assign those variable names when we run auctions for other ad units
var data = adData;
pbjs.requestBids(
adUnitCodes: [adData.id],
bidsBackHandler: function bidsBackHandler()
googletag.cmd.push(function ()
pbjs.que.push(function ()
// gpt slot must be defined before bids are set
defineGptSlot(data);
pbjs.setTargetingForGPTAsync([data.id]); // add winning bid to the ad slot
pbjs.removeAdUnit(data.id); // remove ad unit from prebid
data.biddersManager.prebid = true; // mark prebid as done
bidderFinished(data);
);
);
);
});
}; // get bids from amazon
this.getBidsFromAmazon = function ()
var apsAdUnit = this.createApsAdUnit(),
prebidTimeout = pbjs.getConfig(“bidderTimeout”),
timeout = prebidTimeout ? prebidTimeout : 800,
// cache a reference to the ad data at this time,
// before we re-assign those variable names when we run auctions for other ad units
data = adData;
if (apstag)
apstag.fetchBids(
slots: [apsAdUnit],
timeout: timeout
, function (bids)
googletag.cmd.push(function ()
// gpt slot must be defined before bids are set
defineGptSlot(data);
apstag.setDisplayBids();
data.biddersManager.amazon = true; // mark amazon as done
bidderFinished(data);
);
);
; // check if both prebid and amazon are done
// and if the ad server request hasn’t been sent yet
function bidderFinished(data)
if (data.biddersManager.amazon && data.biddersManager.prebid)
callAdServer(data);
// call ad server
function callAdServer(data)
if (data.biddersManager.adserverRequestSent)
return;
data.biddersManager.adserverRequestSent = true;
googletag.cmd.push(function ()
googletag.pubads().refresh([data.gptSlot],
changeCorrelator: false
); // send request to the dfp
);
// gpt slot is defined here, after header bidding, because we don’t
// want to delay header bidding until gpt is ready
// this function will be called from amazon callback, prebid callback and after timeout
// slot will be defined just once
function defineGptSlot(data)
// check if gpt slot has been already defined
if (!data.gptSlot)
data.defineSlot();
// Returns prebid ad unit
this.createPrebidAdUnit = function ()
var outstreamMediaType =
context: “outstream”,
playerSize: [444, 250]
;
var bannerMediaType =
sizes: adData.prebidSizes
;
var adUnit =
code: adData.id,
mediaTypes:
banner: bannerMediaType
,
bids: this.getBidders()
; // add outstream configs if outstream is enabled for this slot
if (this.outstreamEnabled(adData.type))
adUnit.mediaTypes.video = outstreamMediaType;
return adUnit;
; // returns an array of bidders to call
// bidders are added in the order they will be called by prebid
this.getBidders = function ()
var isMobile = window.innerWidth -1;
; // returns permutive data
function getPermutiveData()
var pSegs;
try
pSegs = JSON.parse(window.localStorage._papns “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com” “[]”).slice(0, 250).map(String);
catch (e)
pSegs = [];
return pSegs;
function getTeadsData()
// teads data for each section
var teadsData =
news_and_politics:
pageId: 79225,
placementId: 85784
,
culture:
pageId: 90291,
placementId: 97769
,
technology:
pageId: 90293,
placementId: 97775
,
business:
pageId: 90294,
placementId: 97778
,
human_interest:
pageId: 90292,
placementId: 97772
;
return teadsData[section];
function getSpotxChannelId()
var channelId = 301647;
if (section === “news_and_politics”)
channelId = 301477;
else if (section === “culture”)
channelId = 301481;
else if (section === “technology”)
channelId = 301485;
else if (section === “business”)
channelId = 301483;
else if (section === “human_interest”)
channelId = 301479;
return channelId;
function getSection()
var adnodeElement = document.querySelector(“div[data-adnode]”);
var adNode = adnodeElement.getAttribute(“data-adnode”);
var section = adNode.split(“/”)[0];
return section;
});
}, “2”:2];
window.modules[“lazyload.legacy”] = [function(require,module,exports)”use strict”;
require(69); // for side effects
var Layzr = require(70);
var instance = Layzr(
threshold: 100
);
instance.on(“src:before”, function (element)
// add a load event listener
element.addEventListener(“load”, function (event)
element.parentElement.classList.add(“loaded”);
);
);
document.addEventListener(“DOMContentLoaded”, function (event)
instance.update().check().handlers(true);
);
, “69”:69,”70″:70];
window.modules[“prebid.min.legacy”] = [function(require,module,exports){“use strict”;
function _typeof(obj) if (typeof Symbol === “function” && typeof Symbol.iterator === “symbol”) _typeof = function _typeof(obj) return typeof obj; ; else _typeof = function _typeof(obj) return obj && typeof Symbol === “function” && obj.constructor === Symbol && obj !== Symbol.prototype ? “symbol” : typeof obj; ; return _typeof(obj);
/* prebid.js v4.7.0
Updated : 2020-09-10 */
!function (u) {
var s = window.pbjsChunk;
window.pbjsChunk = function (e, t, n)
for (var r, i, o, a = 0, c = []; a > t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e);
, t.getBidIdParameter = function (e, t)
if (t && t[e]) return t[e];
return “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”;
, t.tryAppendQueryString = function (e, t, n)
if (n) return e + t + “=” + encodeURIComponent(n) + “&”;
return e;
, t.parseQueryStringParameters = function (e)
var t = “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”;
for (var n in e)
e.hasOwnProperty(n) && (t += n + “=” + encodeURIComponent(e[n]) + “&”);
return t = t.replace(/&$/, “http://computer-trading.com/wp-content/uploads/2020/10/1603745849_slate.com”);
, t.transformAdServerTargetingObj = function (t) {
return t && 0 ‘;
return n += ‘