dot-store-iframe
Advanced tools
Comparing version 2.2.7 to 2.2.8
140
dist/dfp.js
@@ -8,2 +8,10 @@ "use strict"; | ||
var _slicedToArray2 = require("babel-runtime/helpers/slicedToArray"); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _getIterator2 = require("babel-runtime/core-js/get-iterator"); | ||
var _getIterator3 = _interopRequireDefault(_getIterator2); | ||
var _regenerator = require("babel-runtime/regenerator"); | ||
@@ -17,21 +25,13 @@ | ||
var _slicedToArray2 = require("babel-runtime/helpers/slicedToArray"); | ||
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | ||
var _getIterator2 = require("babel-runtime/core-js/get-iterator"); | ||
var _getIterator3 = _interopRequireDefault(_getIterator2); | ||
var createDfpSlot = exports.createDfpSlot = function () { | ||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(options) { | ||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(options) { | ||
var iframeId, prev, props, state, store, dfp, iframes, iframe, valid, divId, _iframe$dfp, oop, path, targets, unitId, unit, slot, sizeMap, key; | ||
return _regenerator2.default.wrap(function _callee$(_context) { | ||
return _regenerator2.default.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
iframeId = options.iframeId, prev = options.prev, props = options.props, state = options.state, store = options.store; | ||
dfp = state.dfp, iframes = state.iframes; | ||
_context.next = 4; | ||
_context2.next = 4; | ||
return store.onceExists("dfp.loaded"); | ||
@@ -44,7 +44,7 @@ | ||
if (!(!valid || props.length != 2 || prev)) { | ||
_context.next = 8; | ||
_context2.next = 8; | ||
break; | ||
} | ||
return _context.abrupt("return"); | ||
return _context2.abrupt("return"); | ||
@@ -85,10 +85,10 @@ case 8: | ||
case "end": | ||
return _context.stop(); | ||
return _context2.stop(); | ||
} | ||
} | ||
}, _callee, this); | ||
}, _callee2, this); | ||
})); | ||
return function createDfpSlot(_x) { | ||
return _ref2.apply(this, arguments); | ||
return function createDfpSlot(_x2) { | ||
return _ref3.apply(this, arguments); | ||
}; | ||
@@ -98,10 +98,10 @@ }(); | ||
var destroyDfpSlot = exports.destroyDfpSlot = function () { | ||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(_ref4) { | ||
var iframeId = _ref4.iframeId, | ||
store = _ref4.store; | ||
return _regenerator2.default.wrap(function _callee2$(_context2) { | ||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(_ref5) { | ||
var iframeId = _ref5.iframeId, | ||
store = _ref5.store; | ||
return _regenerator2.default.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_context2.next = 2; | ||
_context3.next = 2; | ||
return store.onceExists("dfp.loaded"); | ||
@@ -116,10 +116,10 @@ | ||
case "end": | ||
return _context2.stop(); | ||
return _context3.stop(); | ||
} | ||
} | ||
}, _callee2, this); | ||
}, _callee3, this); | ||
})); | ||
return function destroyDfpSlot(_x2) { | ||
return _ref3.apply(this, arguments); | ||
return function destroyDfpSlot(_x3) { | ||
return _ref4.apply(this, arguments); | ||
}; | ||
@@ -129,12 +129,12 @@ }(); | ||
var refreshDfpSlot = exports.refreshDfpSlot = function () { | ||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(_ref6) { | ||
var iframeId = _ref6.iframeId, | ||
state = _ref6.state, | ||
store = _ref6.store; | ||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(_ref7) { | ||
var iframeId = _ref7.iframeId, | ||
state = _ref7.state, | ||
store = _ref7.store; | ||
var iframes, divId; | ||
return _regenerator2.default.wrap(function _callee3$(_context3) { | ||
return _regenerator2.default.wrap(function _callee4$(_context4) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
switch (_context4.prev = _context4.next) { | ||
case 0: | ||
_context3.next = 2; | ||
_context4.next = 2; | ||
return store.onceExists("dfp.loaded"); | ||
@@ -147,7 +147,7 @@ | ||
if (slots[divId]) { | ||
_context3.next = 6; | ||
_context4.next = 6; | ||
break; | ||
} | ||
return _context3.abrupt("return"); | ||
return _context4.abrupt("return"); | ||
@@ -160,10 +160,10 @@ case 6: | ||
case "end": | ||
return _context3.stop(); | ||
return _context4.stop(); | ||
} | ||
} | ||
}, _callee3, this); | ||
}, _callee4, this); | ||
})); | ||
return function refreshDfpSlot(_x3) { | ||
return _ref5.apply(this, arguments); | ||
return function refreshDfpSlot(_x4) { | ||
return _ref6.apply(this, arguments); | ||
}; | ||
@@ -173,10 +173,10 @@ }(); | ||
var updateDfpTargets = exports.updateDfpTargets = function () { | ||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(_ref8) { | ||
var store = _ref8.store; | ||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(_ref9) { | ||
var store = _ref9.store; | ||
var targets, key; | ||
return _regenerator2.default.wrap(function _callee4$(_context4) { | ||
return _regenerator2.default.wrap(function _callee5$(_context5) { | ||
while (1) { | ||
switch (_context4.prev = _context4.next) { | ||
switch (_context5.prev = _context5.next) { | ||
case 0: | ||
_context4.next = 2; | ||
_context5.next = 2; | ||
return store.onceExists("dfp.loaded"); | ||
@@ -194,10 +194,10 @@ | ||
case "end": | ||
return _context4.stop(); | ||
return _context5.stop(); | ||
} | ||
} | ||
}, _callee4, this); | ||
}, _callee5, this); | ||
})); | ||
return function updateDfpTargets(_x4) { | ||
return _ref7.apply(this, arguments); | ||
return function updateDfpTargets(_x5) { | ||
return _ref8.apply(this, arguments); | ||
}; | ||
@@ -221,2 +221,4 @@ }(); | ||
function attachDfp(store) { | ||
var _this = this; | ||
if (!hasGpt) { | ||
@@ -229,7 +231,31 @@ return; | ||
window.googletag.pubads().addEventListener("slotRenderEnded", function (event) { | ||
var divId = event.slot.getSlotElementId(); | ||
store.set("iframes." + divId + ".rendered", true); | ||
}); | ||
window.googletag.pubads().addEventListener("slotRenderEnded", function () { | ||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(event) { | ||
var isEmpty, size, slot, divId; | ||
return _regenerator2.default.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
isEmpty = event.isEmpty, size = event.size, slot = event.slot; | ||
divId = slot.getSlotElementId(); | ||
store.set("iframes." + divId + ".rendered", { | ||
divId: divId, | ||
isEmpty: isEmpty, | ||
size: size | ||
}); | ||
case 3: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, _this); | ||
})); | ||
return function (_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}()); | ||
window.googletag.pubads().addEventListener("slotOnload", function (event) { | ||
@@ -242,5 +268,5 @@ var divId = event.slot.getSlotElementId(); | ||
function buildSizeMap(_ref) { | ||
var dfp = _ref.dfp, | ||
unit = _ref.unit; | ||
function buildSizeMap(_ref2) { | ||
var dfp = _ref2.dfp, | ||
unit = _ref2.unit; | ||
@@ -247,0 +273,0 @@ if (sizeMaps[unit.id]) { |
@@ -19,3 +19,3 @@ "use strict"; | ||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(options) { | ||
var iframeId, prev, props, state, store, iframes, iframe, divId, url, loaded, onLoad, el; | ||
var iframeId, prev, props, state, store, iframes, iframe, valid, divId, url, loaded, onLoad, el; | ||
return _regenerator2.default.wrap(function _callee$(_context) { | ||
@@ -28,5 +28,5 @@ while (1) { | ||
iframe = iframes[iframeId]; | ||
divId = iframe.divId, url = iframe.url; | ||
valid = iframe && !iframe.dfp; | ||
if (!(props.length != 2 || prev || !url)) { | ||
if (!(valid || props.length != 2 || prev)) { | ||
_context.next = 6; | ||
@@ -39,2 +39,3 @@ break; | ||
case 6: | ||
divId = iframe.divId, url = iframe.url; | ||
loaded = "iframes." + iframeId + ".loaded"; | ||
@@ -56,3 +57,3 @@ | ||
case 14: | ||
case 15: | ||
case "end": | ||
@@ -59,0 +60,0 @@ return _context.stop(); |
{ | ||
"name": "dot-store-iframe", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "Iframe controller integration for dot-store", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"babel-preset-stage-0": "^6.24.1", | ||
"dot-store": "^2.2.2", | ||
"dot-store": "^2.2.8", | ||
"fxtr": "1", | ||
@@ -38,0 +38,0 @@ "jest": "^22.4.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26613
316