@financial-times/o-ads
Advanced tools
Comparing version 10.2.4 to 10.3.0
@@ -70,3 +70,4 @@ "use strict"; | ||
const targetingApi = this.config().targetingApi; | ||
const validateAdsTraffic = this.config().validateAdsTraffic; // Don't need to fetch anything if no targeting or validateAdsTraffic configured. | ||
const validateAdsTraffic = this.config().validateAdsTraffic; | ||
this.utils.broadcast('startInitialisation'); // Don't need to fetch anything if no targeting or validateAdsTraffic configured. | ||
@@ -73,0 +74,0 @@ if (!targetingApi && !validateAdsTraffic) { |
@@ -68,3 +68,5 @@ "use strict"; | ||
_utils.default.attach('//www.googletagservices.com/tag/js/gpt.js', true, null, function (err) { | ||
_utils.default.attach('//www.googletagservices.com/tag/js/gpt.js', true, () => { | ||
_utils.default.broadcast('adServerLoadSuccess'); | ||
}, err => { | ||
_utils.default.broadcast('adServerLoadError', err); | ||
@@ -71,0 +73,0 @@ }); |
@@ -8,2 +8,6 @@ "use strict"; | ||
var _utils = _interopRequireDefault(require("../utils")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function Api() { | ||
@@ -39,2 +43,4 @@ this.data = []; | ||
Api.prototype.handleResponse = function (response) { | ||
_utils.default.broadcast('apiRequestsComplete'); | ||
this.data = response; | ||
@@ -41,0 +47,0 @@ |
@@ -8,2 +8,6 @@ "use strict"; | ||
var _utils = _interopRequireDefault(require("../utils")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
@@ -21,3 +25,3 @@ * we use a third party script from moat to determine invalid traffic. | ||
Moat.prototype.init = function () { | ||
return new Promise((resolve, reject) => { | ||
const promise = new Promise((resolve, reject) => { | ||
const intervalId = setInterval(() => { | ||
@@ -35,2 +39,9 @@ if (window.moatPrebidApi) { | ||
}); | ||
const fireCompleteEvent = () => { | ||
_utils.default.broadcast('moatIVTcomplete'); | ||
}; | ||
promise.then(fireCompleteEvent, fireCompleteEvent); | ||
return promise; | ||
}; | ||
@@ -37,0 +48,0 @@ |
"use strict"; | ||
// generated by genversion | ||
module.exports = '10.2.4'; | ||
module.exports = '10.3.0'; |
@@ -58,2 +58,4 @@ /* eslint valid-jsdoc: 0 */ | ||
this.utils.broadcast('startInitialisation'); | ||
// Don't need to fetch anything if no targeting or validateAdsTraffic configured. | ||
@@ -60,0 +62,0 @@ if(!targetingApi && !validateAdsTraffic) { |
@@ -25,3 +25,3 @@ { | ||
"name": "@financial-times/o-ads", | ||
"version": "10.2.4", | ||
"version": "10.3.0", | ||
"dependencies": { | ||
@@ -69,3 +69,3 @@ "dom-delegate": "^2.0.3", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^3.0.0", | ||
"karma": "^3.1.4", | ||
"karma-chrome-launcher": "^0.2.2", | ||
@@ -72,0 +72,0 @@ "karma-cli": "^0.1.1", |
@@ -49,5 +49,6 @@ /*globals googletag: true */ | ||
utils.attach('//www.googletagservices.com/tag/js/gpt.js', true, null, function(err) { | ||
utils.broadcast('adServerLoadError', err); | ||
}); | ||
utils.attach('//www.googletagservices.com/tag/js/gpt.js', true, | ||
() => { utils.broadcast('adServerLoadSuccess'); }, | ||
(err) => { utils.broadcast('adServerLoadError', err); } | ||
); | ||
} | ||
@@ -54,0 +55,0 @@ |
@@ -0,1 +1,2 @@ | ||
import utils from '../utils'; | ||
@@ -32,2 +33,3 @@ function Api() { | ||
Api.prototype.handleResponse = function(response) { | ||
utils.broadcast('apiRequestsComplete'); | ||
this.data = response; | ||
@@ -34,0 +36,0 @@ |
@@ -9,6 +9,8 @@ /** | ||
*/ | ||
import utils from '../utils'; | ||
const Moat = function() {}; // eslint-disable-line no-empty-function | ||
Moat.prototype.init = function() { | ||
return new Promise((resolve, reject) => { | ||
const promise = new Promise((resolve, reject) => { | ||
const intervalId = setInterval(() => { | ||
@@ -26,4 +28,9 @@ if(window.moatPrebidApi) { | ||
}); | ||
const fireCompleteEvent = () => { utils.broadcast('moatIVTcomplete'); }; | ||
promise.then( fireCompleteEvent, fireCompleteEvent ); | ||
return promise; | ||
}; | ||
export default new Moat(); |
// generated by genversion | ||
module.exports = '10.2.4'; | ||
module.exports = '10.3.0'; |
190530
5671