1(function () {
2 /**
3 * @typedef {Object} AdUnit
4 * @property {string} type
5 * @property {string|undefined} unitId
6 * @property {string} insert
7 * @property {string} autoSelector
8 * @property {string} selector
9 * @property {Object} settings
10 * @property {Element|undefined} element
11 */
12 var LOADING_TIMEOUT_MS = 10000
13 var EVENT_ERROR_LOADING_SCRIPT = 'error_loading_script'
14 var verbose = /[\?\&]verbose([\?|\&|\#]|$)/.test(window.location.search)
15 var checkTimeout = true
16 var logger = {
17 log: function () {
18 console.log.apply(null, arguments)
19 },
20 debug: function () {
21 if (verbose) {
22 console.log.apply(null, arguments)
23 }
24 },
25 warn: function () {
26 console.warn.apply(null, arguments)
27 },
28 error: function () {
29 console.error.apply(null, arguments)
30 }
31 }
32
33 /**
34 * @param {Element} el
35 * @return {number}
36 */
37 function calcOffsetTop(el) {
38 return (el.getBoundingClientRect().top + window.pageYOffset)
39 }
40
...
</html>