Skip to content

Commit 329cd38

Browse files
author
Harman Goei
committed
Merge pull request #22 from header-bidder/APPS-12872
style(openx-neo): Fix formatting + adding back the missing call for a…
2 parents 8507f55 + 721bdf2 commit 329cd38

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

src/adapters/openx_neo.js

+41-41
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,56 @@ var utils = require('../utils.js');
77
var OpenxAdapter = function OpenxAdapter(options) {
88
const BIDDER_CODE = 'openx_neo';
99
var startTime;
10-
10+
1111
let pdNode = null;
1212

1313
$$PREBID_GLOBAL$$.oxARJResponse = function (oxResponseObj) {
1414
let adUnits = oxResponseObj.ads.ad;
15-
if (oxResponseObj.ads && oxResponseObj.ads.pixels) {
16-
makePDCall(oxResponseObj.ads.pixels);
17-
}
15+
if (oxResponseObj.ads && oxResponseObj.ads.pixels) {
16+
makePDCall(oxResponseObj.ads.pixels);
17+
}
1818

19-
if (!adUnits) {
20-
adUnits = [];
21-
}
19+
if (!adUnits) {
20+
adUnits = [];
21+
}
2222

23-
var bids = $$PREBID_GLOBAL$$._bidsRequested.find(bidSet => bidSet.bidderCode === 'openx_neo').bids;
24-
for (let i = 0; i < bids.length; i++) {
25-
let bid = bids[i];
26-
let auid = null;
27-
let adUnit = null;
28-
// find the adunit in the response
29-
for (let j = 0; j < adUnits.length; j++) {
30-
adUnit = adUnits[j];
31-
if (String(bid.params.unit) === String(adUnit.adunitid) && !adUnit.used) {
32-
auid = adUnit.adunitid;
33-
break;
34-
}
23+
var bids = $$PREBID_GLOBAL$$._bidsRequested.find(bidSet => bidSet.bidderCode === 'openx_neo').bids;
24+
for (let i = 0; i < bids.length; i++) {
25+
let bid = bids[i];
26+
let auid = null;
27+
let adUnit = null;
28+
// find the adunit in the response
29+
for (let j = 0; j < adUnits.length; j++) {
30+
adUnit = adUnits[j];
31+
if (String(bid.params.unit) === String(adUnit.adunitid) && adUnitHasValidSizeFromBid(adUnit,bid) && !adUnit.used) {
32+
auid = adUnit.adunitid;
33+
break;
3534
}
35+
}
3636

37-
let beaconParams = {
38-
bd: +(new Date()) - startTime,
39-
br: '0', // maybe 0, t, or p
40-
bt: pbjs.bidderTimeout, // mapping timeout
41-
bs: window.location.hostname
42-
};
37+
let beaconParams = {
38+
bd: +(new Date()) - startTime,
39+
br: '0', // maybe 0, t, or p
40+
bt: pbjs.bidderTimeout, // mapping timeout
41+
bs: window.location.hostname
42+
};
4343

44-
if (!auid) {
45-
addBidResponse(null, bid);
46-
continue;
47-
}
48-
adUnit.used = true;
49-
50-
if (adUnit.pub_rev) {
51-
beaconParams.br = beaconParams.bt < beaconParams.bd ? 't': 'p';
52-
beaconParams.bp = adUnit.pub_rev;
53-
beaconParams.ts = adUnit.ts;
54-
addBidResponse(adUnit, bid);
55-
} else { // no fill :(
56-
addBidResponse(null, bid);
57-
}
58-
buildBoPixel(adUnit.creative[0], beaconParams);
44+
if (!auid) {
45+
addBidResponse(null, bid);
46+
continue;
5947
}
48+
adUnit.used = true;
49+
50+
if (adUnit.pub_rev) {
51+
beaconParams.br = beaconParams.bt < beaconParams.bd ? 't' : 'p';
52+
beaconParams.bp = adUnit.pub_rev;
53+
beaconParams.ts = adUnit.ts;
54+
addBidResponse(adUnit, bid);
55+
} else { // no fill :(
56+
addBidResponse(null, bid);
57+
}
58+
buildBoPixel(adUnit.creative[0], beaconParams);
59+
}
6060
};
6161

6262
function getViewportDimensions(isIfr) {
@@ -201,7 +201,7 @@ var OpenxAdapter = function OpenxAdapter(options) {
201201
if (bids.length === 0) {
202202
return;
203203
}
204-
204+
205205
let delDomain = bids[0].params.delDomain;
206206

207207
startTime = new Date(params.start);

0 commit comments

Comments
 (0)