Skip to content

Commit

Permalink
Various files: clean up unneeded code (prebid#8778)
Browse files Browse the repository at this point in the history
* Update example2.js

* Update example.js

* Update config.js

* Update freewheel-sspBidAdapter.js

* Update browsiRtdProvider.js

* Update consentManagementUsp.js

* Update synacormediaBidAdapter.js

* Update trustpidSystem.js

* Update tappxBidAdapter.js

* Update nobidBidAdapter.js

* Update visxBidAdapter.js

* Update remote.html

* Update prebidServer_example.html

* Update openxBidAdapter.js

* Update fintezaAnalyticsAdapter.js

* Update postbid-config.js

* Update postbid-config.js

* Update fintezaAnalyticsAdapter.js

* Update 1plusXRtdProviderExample.html

* Update prebidServer_example.html

* Update blueconicRtdProvider_example.html

* Update hadronRtdProvider_example.html

* Update airgridRtdProvider_example.html

* Update userId_example.html

* Update inskin_example.html

* Update serverbidServer_example.html

* Update postbid-config.js
  • Loading branch information
patmmccann authored and JacobKlein26 committed Feb 8, 2023
1 parent 6f45de1 commit e239053
Show file tree
Hide file tree
Showing 23 changed files with 32 additions and 51 deletions.
6 changes: 2 additions & 4 deletions integrationExamples/gpt/1plusXRtdProviderExample.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//securepubads.g.doubleclick.net/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand All @@ -109,4 +107,4 @@ <h2>1plusX RTD Module for Prebid</h2>
</div>
</body>

</html>
</html>
5 changes: 1 addition & 4 deletions integrationExamples/gpt/airgridRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@
var gads = document.createElement("script");
gads.async = true;
gads.type = "text/javascript";
var useSSL = "https:" == document.location.protocol;
gads.src =
(useSSL ? "https:" : "http:") +
"//www.googletagservices.com/tag/js/gpt.js";
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName("script")[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/amp/remote.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

// load Prebid.js
(function () {
var d = document, pbs = d.createElement("script"), pro = d.location.protocal;
var d = document, pbs = d.createElement("script");
pbs.type = "text/javascript";
pbs.src = prebidSrc;
var target = document.getElementsByTagName("head")[0];
Expand Down
6 changes: 2 additions & 4 deletions integrationExamples/gpt/blueconicRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
</script>
<script src="//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js" async></script>
<script src="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js" async></script>

<script>
var googletag = googletag || {};
Expand Down Expand Up @@ -88,9 +88,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//securepubads.g.doubleclick.net/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/hadronRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/inskin_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/prebidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/serverbidServer_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
gads.src = 'https://securepubads.g.doubleclick.net/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
Expand Down
10 changes: 5 additions & 5 deletions integrationExamples/postbid/oas/postbid-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

(function() {
var pbjsEl = document.createElement("script"); pbjsEl.type = "text/javascript";
pbjsEl.async = true; var isHttps = 'https:' === document.location.protocol;
pbjsEl.src = (isHttps ? "https" : "http") + "://acdn.adnxs.com/prebid/not-for-prod/prebid.js";
var pbjsTargetEl = document.getElementsByTagName("head")[0];
var pbjsEl = document.createElement('script'); pbjsEl.type = 'text/javascript';
pbjsEl.async = true;
pbjsEl.src = 'https://acdn.adnxs.com/prebid/not-for-prod/prebid.js'
var pbjsTargetEl = document.getElementsByTagName('head')[0];
pbjsTargetEl.insertBefore(pbjsEl, pbjsTargetEl.firstChild);
})();

Expand Down Expand Up @@ -51,4 +51,4 @@ pbjs.que.push(function() {
});
});
</script>
<iframe id='postbid_if_3' FRAMEBORDER="0" SCROLLING="no" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" ALLOWTRANSPARENCY="true" WIDTH="0" HEIGHT="0"></iframe>
<iframe id='postbid_if_3' FRAMEBORDER="0" SCROLLING="no" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" ALLOWTRANSPARENCY="true" WIDTH="0" HEIGHT="0"></iframe>
4 changes: 2 additions & 2 deletions libraries/analyticsAdapter/examples/libraries/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ events.init();
// overwrite example object and handle 'on' callbacks
window[window.ExampleAnalyticsGlobalObject] = example = utils.errorless(function() {
if (arguments[0] && arguments[0] === 'on') {
var eventName = arguments[1] && arguments[1];
var args = arguments[2] && arguments[2];
var eventName = arguments[1];
var args = arguments[2];
if (eventName && args) {
if (eventName === 'bidAdjustment') {
pbjsHandlers.onBidAdjustment.apply(this, [args]);
Expand Down
4 changes: 2 additions & 2 deletions libraries/analyticsAdapter/examples/libraries/example2.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ events.init();
// overwrite example object and handle 'on' callbacks
window[window.ExampleAnalyticsGlobalObject2] = example = utils.errorless(function() {
if (arguments[0] && arguments[0] === 'on') {
var eventName = arguments[1] && arguments[1];
var args = arguments[2] && arguments[2];
var eventName = arguments[1];
var args = arguments[2];
if (eventName && args) {
if (eventName === 'bidAdjustment') {
pbjsHandlers.onBidAdjustment.apply(this, [args]);
Expand Down
4 changes: 2 additions & 2 deletions modules/browsiRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function collectData() {
function waitForData(callback) {
if (_browsiData) {
_dataReadyCallback = null;
callback(_browsiData);
callback();
} else {
_dataReadyCallback = callback;
}
Expand All @@ -102,7 +102,7 @@ function waitForData(callback) {
export function setData(data) {
_browsiData = data;
if (isFn(_dataReadyCallback)) {
_dataReadyCallback(_browsiData);
_dataReadyCallback();
_dataReadyCallback = null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/consentManagementUsp.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function lookupUspConsent({onSuccess, onError}) {
let uspapiFrame;
let uspapiFunction;

while (!uspapiFrame) {
while (true) {
try {
if (typeof f.__uspapi === 'function') {
uspapiFunction = f.__uspapi;
Expand Down
2 changes: 1 addition & 1 deletion modules/fintezaAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function initSession() {
!checkSessionByExpires() ||
!checkSessionByReferer() ||
!checkSessionByDay()) {
sessionId = '' + timestamp + getRandAsStr(SESSION_RAND_PART);
sessionId = '' + timestamp + getRandAsStr(SESSION_RAND_PART); // lgtm [js/insecure-randomness]
begin = timestamp;

isNew = true;
Expand Down
2 changes: 1 addition & 1 deletion modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function formatAdHTML(bid, size) {
var libUrl = '';
if (integrationType && integrationType !== 'inbanner') {
libUrl = PRIMETIME_URL + getComponentId(bid.params.format) + '.min.js';
script = getOutstreamScript(bid, size);
script = getOutstreamScript(bid);
} else {
libUrl = MUSTANG_URL;
script = getInBannerScript(bid, size);
Expand Down
2 changes: 1 addition & 1 deletion modules/nobidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function nobidBuildRequests(bids, bidderRequest) {
var serializeState = function(divIds, siteId, adunits) {
var filterAdUnitsByIds = function(divIds, adUnits) {
var filtered = [];
if (!divIds || !divIds.length) {
if (!divIds.length) {
filtered = adUnits;
} else if (adUnits) {
var a = [];
Expand Down
2 changes: 0 additions & 2 deletions modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,11 @@ function getViewportDimensions(isIfr) {
} catch (e) {
return;
}
docEl = tDoc.documentElement;
body = tDoc.body;

width = tWin.innerWidth || docEl.clientWidth || body.clientWidth;
height = tWin.innerHeight || docEl.clientHeight || body.clientHeight;
} else {
docEl = tDoc.documentElement;
width = tWin.innerWidth || docEl.clientWidth;
height = tWin.innerHeight || docEl.clientHeight;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/synacormediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const spec = {
});

// CCPA
if (bidderRequest && bidderRequest.uspConsent) {
if (bidderRequest.uspConsent) {
deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent);
}

Expand Down
4 changes: 2 additions & 2 deletions modules/tappxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ function buildOneRequest(validBidRequests, bidderRequest) {
(typeof uuid !== 'undefined' && uuid !== null) &&
(typeof uuid.source == 'string' && uuid.source !== null) &&
(typeof uuid.uids[0].id == 'string' && uuid.uids[0].id !== null)
)
);

if (typeof user !== 'undefined') { user.ext.eids = eidsArr }
user.ext.eids = eidsArr;
};

let regs = {};
Expand Down
2 changes: 1 addition & 1 deletion modules/trustpidSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function getTrustpidFromStorage() {
logInfo(`${LOG_PREFIX}: Domain acronym found: ${acronym}`);

// Domain is correct in both local storage and idGraph, but no acronym is existing for the domain
if (domain && !acronym) {
if (!acronym) {
return {
trustpid: null,
acr: null
Expand Down
2 changes: 1 addition & 1 deletion modules/visxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function _isAdSlotExists(adUnitCode) {
}

const gptAdSlot = getGptSlotInfoForAdUnitCode(adUnitCode);
if (gptAdSlot && gptAdSlot.divId && document.getElementById(gptAdSlot.divId)) {
if (gptAdSlot.divId && document.getElementById(gptAdSlot.divId)) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export function newConfig() {
}

const mergedConfig = Object.keys(obj).reduce((accum, key) => {
const prevConf = _getConfig(key)[key] || {};
const prevConf = _getConfig()[key] || {};
accum[key] = mergeDeep(prevConf, obj[key]);
return accum;
}, {});
Expand Down

0 comments on commit e239053

Please sign in to comment.