dot-store-iframe
Advanced tools
Comparing version 2.2.6 to 2.2.7
141
dist/dfp.js
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.destroyDfpSlot = exports.createDfpSlot = undefined; | ||
exports.updateDfpTargets = exports.refreshDfpSlot = exports.destroyDfpSlot = exports.createDfpSlot = undefined; | ||
@@ -27,3 +27,3 @@ var _regenerator = require("babel-runtime/regenerator"); | ||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(options) { | ||
var iframeId, prev, props, state, dfp, iframes, iframe, divId, _iframe$dfp, oop, path, targets, unitId, unit, slot, sizeMap, key; | ||
var iframeId, prev, props, state, store, dfp, iframes, iframe, valid, divId, _iframe$dfp, oop, path, targets, unitId, unit, slot, sizeMap, key; | ||
@@ -34,16 +34,13 @@ return _regenerator2.default.wrap(function _callee$(_context) { | ||
case 0: | ||
if (hasGpt) { | ||
_context.next = 2; | ||
break; | ||
} | ||
iframeId = options.iframeId, prev = options.prev, props = options.props, state = options.state, store = options.store; | ||
dfp = state.dfp, iframes = state.iframes; | ||
_context.next = 4; | ||
return store.onceExists("dfp.loaded"); | ||
return _context.abrupt("return"); | ||
case 2: | ||
iframeId = options.iframeId, prev = options.prev, props = options.props, state = options.state; | ||
dfp = state.dfp, iframes = state.iframes; | ||
case 4: | ||
iframe = iframes[iframeId]; | ||
valid = iframe && iframe.dfp; | ||
if (!(!iframe.dfp || props.length != 2 || prev)) { | ||
_context.next = 7; | ||
if (!(!valid || props.length != 2 || prev)) { | ||
_context.next = 8; | ||
break; | ||
@@ -54,3 +51,3 @@ } | ||
case 7: | ||
case 8: | ||
divId = iframe.divId; | ||
@@ -87,3 +84,3 @@ _iframe$dfp = iframe.dfp, oop = _iframe$dfp.oop, path = _iframe$dfp.path, targets = _iframe$dfp.targets, unitId = _iframe$dfp.unitId; | ||
case 14: | ||
case 15: | ||
case "end": | ||
@@ -103,3 +100,4 @@ return _context.stop(); | ||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(_ref4) { | ||
var iframeId = _ref4.iframeId; | ||
var iframeId = _ref4.iframeId, | ||
store = _ref4.store; | ||
return _regenerator2.default.wrap(function _callee2$(_context2) { | ||
@@ -109,9 +107,5 @@ while (1) { | ||
case 0: | ||
if (hasGpt) { | ||
_context2.next = 2; | ||
break; | ||
} | ||
_context2.next = 2; | ||
return store.onceExists("dfp.loaded"); | ||
return _context2.abrupt("return"); | ||
case 2: | ||
@@ -135,6 +129,77 @@ | ||
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 iframes, divId; | ||
return _regenerator2.default.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_context3.next = 2; | ||
return store.onceExists("dfp.loaded"); | ||
case 2: | ||
iframes = state.iframes; | ||
divId = iframes[iframeId].divId; | ||
if (slots[divId]) { | ||
_context3.next = 6; | ||
break; | ||
} | ||
return _context3.abrupt("return"); | ||
case 6: | ||
window.googletag.pubads().refresh([slots[divId]], { changeCorrelator: false }); | ||
case 7: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
}, _callee3, this); | ||
})); | ||
return function refreshDfpSlot(_x3) { | ||
return _ref5.apply(this, arguments); | ||
}; | ||
}(); | ||
var updateDfpTargets = exports.updateDfpTargets = function () { | ||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(_ref8) { | ||
var store = _ref8.store; | ||
var targets, key; | ||
return _regenerator2.default.wrap(function _callee4$(_context4) { | ||
while (1) { | ||
switch (_context4.prev = _context4.next) { | ||
case 0: | ||
_context4.next = 2; | ||
return store.onceExists("dfp.loaded"); | ||
case 2: | ||
targets = store.getSync("dfp.targets") || {}; | ||
for (key in targets) { | ||
window.googletag.pubads().setTargeting(key, targets[key] || ""); | ||
} | ||
case 4: | ||
case "end": | ||
return _context4.stop(); | ||
} | ||
} | ||
}, _callee4, this); | ||
})); | ||
return function updateDfpTargets(_x4) { | ||
return _ref7.apply(this, arguments); | ||
}; | ||
}(); | ||
exports.attachDfp = attachDfp; | ||
exports.buildSizeMap = buildSizeMap; | ||
exports.refreshDfpSlot = refreshDfpSlot; | ||
exports.updateDfpTargets = updateDfpTargets; | ||
@@ -211,30 +276,2 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
} | ||
function refreshDfpSlot(_ref5) { | ||
var iframeId = _ref5.iframeId, | ||
state = _ref5.state; | ||
var iframes = state.iframes; | ||
var divId = iframes[iframeId].divId; | ||
if (!hasGpt || !slots[divId]) { | ||
return; | ||
} | ||
window.googletag.pubads().refresh([slots[divId]], { changeCorrelator: false }); | ||
} | ||
function updateDfpTargets(_ref6) { | ||
var store = _ref6.store; | ||
if (!hasGpt) { | ||
return; | ||
} | ||
var targets = store.getSync("dfp.targets") || {}; | ||
for (var key in targets) { | ||
window.googletag.pubads().setTargeting(key, targets[key] || ""); | ||
} | ||
} | ||
//# sourceMappingURL=dfp.js.map |
{ | ||
"name": "dot-store-iframe", | ||
"version": "2.2.6", | ||
"version": "2.2.7", | ||
"description": "Iframe controller integration for dot-store", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
25310
293