Skip to content

Instantly share code, notes, and snippets.

@shermozle
Last active June 27, 2016 05:15
Show Gist options
  • Save shermozle/82fcf5d9cc5ee603d8dbfd084746708e to your computer and use it in GitHub Desktop.
Save shermozle/82fcf5d9cc5ee603d8dbfd084746708e to your computer and use it in GitHub Desktop.
/*
* SuperTag v3.5.9
* http://supert.ag
*
* Copyright (c) 2016 SuperTag Pty Ltd.
*
* Date: 27-06-2016 11:29:51 +1000 (Mon, 27 Jun 2016)
*/
(function(e, t, n, r) {
n.version = 4;
n.company = "leader-newspaper";
n.project = "diamond-valley-lea-1";
n.sites = [];
n.brandKeywords = [];
n.campaignQueryParameter = "";
n.an = {
tags: [],
containers: [],
rules: [],
mtm: {},
pushTag: function(e) {
n.an.tags.push(e)
},
pushContainer: function(e) {
n.an.containers.push(e)
},
startMonitoring: function(e, t) {
i.push(e);
if (typeof t === r) {
t = e
}
n.an.mtm[t] = {
start: (new Date).getTime()
};
return true
},
finishMonitoring: function(e) {
if (typeof n.an.mtm[e] !== r) {
n.an.mtm[e].end = (new Date).getTime()
}
}
};
n.tagFiredIds = [];
var i = n.tagFiredIds;
n.fireTag = function(e, t, r, a, o) {
if (!o) i.push(e);
try {
return t.apply(a ? a : this, r ? r : [])
} catch (s) {
typeof n.processError == "function" && n.processError(s, e, 1);
throw s
}
};
n.fireBaseContainer = function(e, t, i, a) {
if (typeof n.an.mtm[t] !== r && !a) {
return
}
n.an.startMonitoring(e, t);
n.fireTag(e, i, null, null, 1);
n.an.finishMonitoring(t)
};
n.getCookie = function(e, n) {
var r = new RegExp(e + "=([^;]+)", n);
var i = r.exec(t.cookie || "");
return i && unescape(i[1]) || ""
};
n.getExpiryDate = function(e, t) {
var n = null,
r;
if (typeof e === "string") {
parsedArgDate = parseFloat(e);
if (isNaN(parsedArgDate)) {
n = null
} else {
r = parsedArgDate
}
} else if (typeof e === "number" || typeof e === "float") {
r = e
} else if (typeof e === "undefined") {
n = null
}
if (typeof r != "undefined" && r !== null) {
if (!t) {
var t = new Date
}
n = new Date(t.getTime() + r * 1440 * 6e4)
}
return n
};
n.getPrimaryDomain = function() {
var e, n = t.domain,
r = n.split("."),
i = r.length,
a = "",
o;
while (i--) {
if (typeof r[i] != "undefined") {
a = "." + r[i] + a;
t.cookie = "superT_te=1; domain=" + a;
o = t.cookie.match(/superT_te=1;?/) !== null;
t.cookie = "superT_te=; domain=" + a + "; expires=" + new Date(0);
if (o) {
e = a;
break
}
}
}
return e
};
n.setCookie = function(e, r, i, a) {
var o = "";
a = a || n.getPrimaryDomain();
if (i instanceof Date) {
expireDate = i
} else {
expireDate = n.getExpiryDate(i)
}
o += e + "=" + escape(r);
if (a) {
o += ";domain=" + a
}
o += ";path=/" + (expireDate === null ? "" : ";expires=" + expireDate.toGMTString());
t.cookie = o
};
n.getHost = function(t) {
t = t || e.location.href;
if (t.indexOf("javascript:") == 0) return "";
if (t.indexOf("#") == 0) return "";
if (t.indexOf("://") >= 0) t = t.substring(t.indexOf("://") + 3, t.length);
if (t.indexOf("/") >= 0) t = t.substring(0, t.indexOf("/"));
if (t.indexOf("?") >= 0) t = t.substring(0, t.indexOf("?"));
if (t.indexOf(":") >= 0) t = t.substring(0, t.indexOf(":"));
return t
};
n.Object = {
each: function(e, t, n) {
for (var r in e) {
if ("function" === typeof e.hasOwnProperty && e.hasOwnProperty(r)) {
if (t.call(n || e, r, e[r], e) === false) {
return
}
}
}
}
};
n.apply = function(e, t, r) {
if (r) {
n.apply(e, r)
}
if (e && typeof t === "object") {
for (var i in t) {
e[i] = t[i]
}
}
return e
};
n.an.ssb = function(e) {
if (e !== undefined && e !== null && e !== "") {
e = e.replace(/(\s+)/g, "-").replace(/[^0-9a-zA-Z_\-\.]/g, "").toLowerCase()
}
return e
};
n.trim = function(e) {
if (e !== undefined && e !== null && typeof e === "string") {
return e.replace(/^\s+|\s+$/g, "")
}
return e
};
n.Array = {
each: function(e, t, n, r) {
var i, a = e.length;
if (r !== true) {
for (i = 0; i < a; i++) {
if (t.call(n || e[i], e[i], i, e) === false) {
return i
}
}
} else {
for (i = a - 1; i > -1; i--) {
if (t.call(n || e[i], e[i], i, e) === false) {
return i
}
}
}
return true
},
contains: function(e, t) {
var n, r;
for (n = 0, r = e.length; n < r; n++) {
if (e[n] === t) {
return true
}
}
return false
},
isArray: function(e) {
return Object.prototype.toString.call(e) === "[object Array]"
},
isIterable: function(e) {
var t = Object.prototype.toString.call(e);
return t === "[object Array]" || t === "[object HTMLCollection]" || t === "[object NodeList]"
}
};
n.genId = function() {
var e = (new Date).getTime(),
t = Math.floor(Math.random() * 1e6),
n = e + "." + t;
return n
};
var a;
n.getFingerprintJS = function() {
if (!a) {
a = (new n.Fingerprint).get()
}
return a
};
(function(e, t, n) {
t[e] = n()
})("Fingerprint", n, function() {
"use strict";
var n = function(e) {
var t, n;
t = Array.prototype.forEach;
n = Array.prototype.map;
this.each = function(e, n, r) {
if (e === null) {
return
}
if (t && e.forEach === t) {
e.forEach(n, r)
} else if (e.length === +e.length) {
for (var i = 0, a = e.length; i < a; i++) {
if (n.call(r, e[i], i, e) === {}) return
}
} else {
for (var o in e) {
if (e.hasOwnProperty(o)) {
if (n.call(r, e[o], o, e) === {}) return
}
}
}
};
this.map = function(e, t, r) {
var i = [];
if (e == null) return i;
if (n && e.map === n) return e.map(t, r);
this.each(e, function(e, n, a) {
i[i.length] = t.call(r, e, n, a)
});
return i
};
if (typeof e == "object") {
this.hasher = e.hasher;
this.screen_resolution = e.screen_resolution;
this.canvas = e.canvas;
this.ie_activex = e.ie_activex
} else if (typeof e == "function") {
this.hasher = e
}
};
n.prototype = {
get: function() {
var n = [];
n.push(navigator.userAgent);
n.push(navigator.language);
n.push(screen.colorDepth);
if (this.screen_resolution) {
var r = this.getScreenResolution();
if (typeof r !== "undefined") {
n.push(this.getScreenResolution().join("x"))
}
}
n.push((new Date).getTimezoneOffset());
n.push(this.hasSessionStorage());
n.push(this.hasLocalStorage());
n.push(!!e.indexedDB);
if (t.body) {
n.push(typeof t.body.addBehavior)
} else {
n.push(typeof undefined)
}
n.push(typeof e.openDatabase);
n.push(navigator.cpuClass);
n.push(navigator.platform);
n.push(navigator.doNotTrack);
n.push(this.getPluginsString());
if (this.canvas && this.isCanvasSupported()) {
n.push(this.getCanvasFingerprint())
}
if (this.hasher) {
return this.hasher(n.join("###"), 31)
} else {
return this.murmurhash3_32_gc(n.join("###"), 31)
}
},
murmurhash3_32_gc: function(e, t) {
var n, r, i, a, o, s, l, f;
n = e.length & 3;
r = e.length - n;
i = t;
o = 3432918353;
s = 461845907;
f = 0;
while (f < r) {
l = e.charCodeAt(f) & 255 | (e.charCodeAt(++f) & 255) << 8 | (e.charCodeAt(++f) & 255) << 16 | (e.charCodeAt(++f) & 255) << 24;
++f;
l = (l & 65535) * o + (((l >>> 16) * o & 65535) << 16) & 4294967295;
l = l << 15 | l >>> 17;
l = (l & 65535) * s + (((l >>> 16) * s & 65535) << 16) & 4294967295;
i ^= l;
i = i << 13 | i >>> 19;
a = (i & 65535) * 5 + (((i >>> 16) * 5 & 65535) << 16) & 4294967295;
i = (a & 65535) + 27492 + (((a >>> 16) + 58964 & 65535) << 16)
}
l = 0;
switch (n) {
case 3:
l ^= (e.charCodeAt(f + 2) & 255) << 16;
case 2:
l ^= (e.charCodeAt(f + 1) & 255) << 8;
case 1:
l ^= e.charCodeAt(f) & 255;
l = (l & 65535) * o + (((l >>> 16) * o & 65535) << 16) & 4294967295;
l = l << 15 | l >>> 17;
l = (l & 65535) * s + (((l >>> 16) * s & 65535) << 16) & 4294967295;
i ^= l
}
i ^= e.length;
i ^= i >>> 16;
i = (i & 65535) * 2246822507 + (((i >>> 16) * 2246822507 & 65535) << 16) & 4294967295;
i ^= i >>> 13;
i = (i & 65535) * 3266489909 + (((i >>> 16) * 3266489909 & 65535) << 16) & 4294967295;
i ^= i >>> 16;
return i >>> 0
},
hasLocalStorage: function() {
try {
return !!e.localStorage
} catch (t) {
return true
}
},
hasSessionStorage: function() {
try {
return !!e.sessionStorage
} catch (t) {
return true
}
},
isCanvasSupported: function() {
var e = t.createElement("canvas");
return !!(e.getContext && e.getContext("2d"))
},
isIE: function() {
if (navigator.appName === "Microsoft Internet Explorer") {
return true
} else if (navigator.appName === "Netscape" && /Trident/.test(navigator.userAgent)) {
return true
}
return false
},
getPluginsString: function() {
if (this.isIE() && this.ie_activex) {
return this.getIEPluginsString()
} else {
return this.getRegularPluginsString()
}
},
getRegularPluginsString: function() {
return this.map(navigator.plugins, function(e) {
var t = this.map(e, function(e) {
return [e.type, e.suffixes].join("~")
}).join(",");
return [e.name, e.description, t].join("::")
}, this).join(";")
},
getIEPluginsString: function() {
if (e.ActiveXObject) {
var t = ["ShockwaveFlash.ShockwaveFlash", "AcroPDF.PDF", "PDF.PdfCtrl", "QuickTime.QuickTime", "rmocx.RealPlayer G2 Control", "rmocx.RealPlayer G2 Control.1", "RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)", "RealVideo.RealVideo(tm) ActiveX Control (32-bit)", "RealPlayer", "SWCtl.SWCtl", "WMPlayer.OCX", "AgControl.AgControl", "Skype.Detection"];
return this.map(t, function(e) {
try {
new ActiveXObject(e);
return e
} catch (t) {
return null
}
}).join(";")
} else {
return ""
}
},
getScreenResolution: function() {
return [screen.height, screen.width]
},
getCanvasFingerprint: function() {
var e = t.createElement("canvas");
var n = e.getContext("2d");
var r = "http://valve.github.io";
n.textBaseline = "top";
n.font = "14px 'Arial'";
n.textBaseline = "alphabetic";
n.fillStyle = "#f60";
n.fillRect(125, 1, 62, 20);
n.fillStyle = "#069";
n.fillText(r, 2, 15);
n.fillStyle = "rgba(102, 204, 0, 0.7)";
n.fillText(r, 4, 17);
return e.toDataURL()
}
};
return n
});
n.bind = function(t, r, i, a) {
if (t !== undefined && t !== null) {
if (t === e && "load" === r && true === n.isReady) {
i()
} else {
if (t.addEventListener) {
a = a || false;
t.addEventListener(r, i, a)
} else if (t.attachEvent) {
t.attachEvent("on" + r, function() {
i.call(event.srcElement, event)
})
}
}
}
};
var o = [],
s = n.isReady = false;
n.whenLoad = function(e, t) {
var r = function() {
n.fireTag(t, function() {
e()
})
};
if (s) {
r()
} else {
o.push(r)
}
};
function l() {
if (s) {
return
}
s = n.isReady = true;
for (var e = 0; e < o.length; e++) {
o[e]()
}
o = null
}
if (t.readyState === "complete") {
l()
} else {
function f() {
if (t.addEventListener) {
e.removeEventListener("load", f, false)
} else {
e.detachEvent("onload", f)
}
l()
}
n.bind(e, "load", f)
}
var u = [],
c = false;
isReadyBound = false;
n.whenReady = function(r) {
if (c || n.isReady) {
r()
} else {
u.push(r);
if (!isReadyBound) {
isReadyBound = true;
function i() {
if (c) {
return
}
if (!t.body) {
return setTimeout(i)
}
c = true;
for (var e = 0; e < u.length; e++) {
u[e]()
}
u = null
}
function a() {
if (c) {
return
}
if (t.addEventListener || event.type === "load" || t.readyState === "complete") {
o();
i()
}
}
function o() {
if (t.addEventListener) {
t.removeEventListener("DOMContentLoaded", a, false)
} else {
t.detachEvent("onreadystatechange", a)
}
}
if (t.addEventListener) {
t.addEventListener("DOMContentLoaded", a, false)
} else {
t.attachEvent("onreadystatechange", a);
var s = false;
try {
s = e.frameElement == null && t.documentElement
} catch (l) {}
if (s && s.doScroll) {
(function f() {
if (c) {
try {
s.doScroll("left")
} catch (e) {
return setTimeout(f, 50)
}
o();
i()
}
})()
}
}
n.whenLoad(a)
}
}
};
n.path = [];
n.an.d1 = n.an.d2 = n.an.d3 = "";
if (e.location.pathname.length > 3) {
n.path = e.location.pathname.split("/");
n.an.d1 = n.path[1] = n.an.ssb(n.path[1]);
n.an.d2 = n.path[2] = n.an.ssb(n.path[2]);
n.an.d3 = n.path[3] = n.an.ssb(n.path[3])
}
n.triggerEvent = function(e, n, r) {
var i;
if (t.createEvent) {
i = new Event(n);
i.data = r;
e.dispatchEvent(i)
} else {
i = t.createEventObject();
i.data = r;
e.fireEvent("on" + n, i)
}
};
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(e) {
var t = this.length;
var n = Number(arguments[1]) || 0;
n = n < 0 ? Math.ceil(n) : Math.floor(n);
if (n < 0) n += t;
for (; n < t; n++) {
if (n in this && this[n] === e) return n
}
return -1
}
}
n.buildUri = function(e, t) {
if (typeof e !== "string") return "";
var r = function(e) {
var t = e.charAt(e.length - 1);
return t === "?" || t === "&" ? e : e.indexOf("?") === -1 ? e += "?" : e += "&"
};
e = r(e);
n.Object.each(t, function(t, i) {
var a = n.buildURLVal(i);
if (typeof a === "string") {
e = r(e + encodeURIComponent(t) + "=" + a)
}
});
return e.substring(0, e.length - 1)
};
n.buildURLVal = function(e) {
switch (typeof e) {
case "function":
try {
return n.buildURLVal(e())
} catch (t) {}
break;
case "string":
case "number":
return encodeURIComponent(e);
case "boolean":
return e ? "1" : "0"
}
};
n._proxyInit = function() {
var e = "superT_proxy_" + Math.floor(Math.random() * 1e7 + 1),
r = e + "_form",
i = n._proxy = {};
i.container = t.createElement("div");
i.container.innerHTML = '<iframe name="' + e + '"></iframe>' + '<form method="post" target="' + e + '" id="' + r + '"></form>';
n.apply(i.container.style, {
position: "absolute",
width: "0px",
height: "0px",
visibility: "hidden",
overflow: "hidden"
});
t.body.appendChild(i.container);
i.form = t.getElementById(r);
n._proxy = i;
return i
};
n.post = function(e, r) {
var i = n._proxyInit(),
a = i.form,
o, s, l;
for (o in r) {
if (r[o] instanceof Array && o.length) {
for (s = 0; s < r[o].length; s++) {
l = t.createElement("input");
l.type = "checkbox";
l.name = o;
l.checked = "checked";
l.value = decodeURIComponent(n.buildURLVal(r[o][s]));
a.appendChild(l)
}
} else {
l = t.createElement("input");
l.type = "text";
l.name = o;
l.value = decodeURIComponent(n.buildURLVal(r[o]));
a.appendChild(l)
}
}
a.action = e;
a.submit()
};
n.buildUriWithArray = function(e, t) {
if (typeof e !== "string") return "";
var r = function(e) {
var t = e.charAt(e.length - 1);
return t === "?" || t === "&" ? e : e.indexOf("?") === -1 ? e += "?" : e += "&"
};
e = r(e);
n.Object.each(t, function(t, i) {
if (i instanceof Array && i.length) {
for (var a in i) {
var o = i[a];
if (typeof o === "string") {
e = r(e + encodeURIComponent(t) + "=" + encodeURIComponent(o))
}
}
return
}
var s = n.buildURLVal(i);
if (typeof s === "string") {
e = r(e + encodeURIComponent(t) + "=" + s)
}
});
return e.substring(0, e.length - 1)
};
var p = "superT_v1",
h = "superT_s1",
d = .5 * (1 / 24),
g = function() {
return n.getCookie(p)
},
v = function(e, t, r, i) {
n.setCookie(p, e + ":" + t + ":" + r + ":" + i, 365)
},
m = function() {
return n.getCookie(h)
},
y = function() {
n.setCookie(h, n.genId(), d)
};
if ("" === g()) {
n.an.nr = "new";
n.an.id = n.genId();
n.an.vi = 1;
n.an.pa = 1;
n.an.pv = 1;
v(n.an.id, 1, 1, 1);
y()
} else {
n.an.nr = "repeat";
var b = g().split(":"),
_ = b[0],
x = b[1],
C = b[2],
E = b[3];
if ("" === m()) {
y();
typeof x !== r ? x++ : x = 1;
C = 0
} else {
n.setCookie(h, m(), d)
}
typeof C !== r ? C++ : C = 1;
typeof E !== r ? E++ : E = 1;
n.an.id = _;
n.an.vi = x;
n.an.pv = C;
n.an.pa = E;
v(n.an.id, x, C, E)
}
n.an.vc = m();
n.webEventCallDC = "function" === typeof n.webEventCallDC ? n.webEventCallDC : function(e, t, r) {
var i = {
"c.pr": n.optimahubProjectToken ? n.optimahubProjectToken : n.project.replace(/\./gi, "_"),
"c.ch": "website",
"c.ve": 0,
"es.ty": "async",
"s.id": n.an.vc,
"s.co": n.an.pv,
"pic.s1": n.an.id,
"pib.fj": n.getFingerprintJS(),
"ss.li": n.liveTesting ? "true" : "false",
"ss.us": n.liveTesting === true ? n.liveTestingUsername : "",
"ss.co": n.liveTesting === true ? n.version + "-test" : n.version
};
n.apply(t, i);
if (r) n.apply(t, r);
var a = n.buildUriWithArray(e, t);
a.length < 2e3 ? (new Image).src = a : n.post(e, t)
};
! function(t) {
if (t.originalOnerror) {
return
}
var n = 0,
r;
function a(e) {
if (typeof superTCode === "undefined") {
return
}
var t = superTCode.toString(),
n = t.indexOf(typeof e === "string" ? e : e.toString());
if (n > -1) {
t = t.slice(0, n);
return t.split("\n").length
}
return
}
function o(e, t) {
var n = /function\s+([\w$]+)\s*\(?/,
r = [],
i = 0,
o, s, l;
while (t && i < 10) {
o = t.toString();
l = o.match(n) !== null ? RegExp.$1 : "(anonymous)";
s = a(o);
r.push("at " + l + ":" + s);
if (e.line === undefined) {
e.line = s
}
t = t.caller;
i++
}
e.stack = r.join("\n")
}
function s(e, t) {
var n = /(?:@| \()([a-zA-Z]+:\/\/.+?):([0-9]+)(?:\:([0-9]+))?\)?$/,
r = t.split("\n"),
i = 0;
while (r[i].match(n) === null) i++;
if (e.file === undefined) {
e.file = RegExp.$1
}
if (e.line === undefined) {
e.line = RegExp.$2
}
if (e.col === undefined) {
e.col = RegExp.$3
}
}
t.originalOnerror = function() {};
t.apply(t, {
maxErrors: 10,
errors: [],
errorsOrigin: [],
logError: function(e) {
e.lastTagId = e.lastTagId || i[i.length - 1];
t.errors.push(e);
n++;
typeof t.errorCallback == "function" && t.errorCallback(e)
},
processError: function(e, i, a) {
if (a) r = 1;
if (n > t.maxErrors) {
return
}
for (var l in t.errorsOrigin) {
if (t.errorsOrigin[l] === e) return
}
t.errorsOrigin.push(e);
var f = {
handler: "trycatch",
msg: e.message,
lastTagId: i
};
if (e.lineNumber !== undefined) {
f.line = e.lineNumber
}
if (e.columnNumber !== undefined) {
f.col = e.columnNumber
}
if (e.fileName !== undefined) {
f.file = e.fileName
}
if (e.stack) {
f.stack = e.stack;
if (!e.file || !e.line || !e.col) {
s(f, e.stack)
}
} else {
o(f, arguments.callee.caller)
}
t.logError(f)
},
onError: function(e, i, a, o, s) {
if (r) {
r = 0;
return
}
if (n > t.maxErrors) {
return
}
var l = {
handler: "onerror",
msg: e,
file: i,
line: a,
col: o
};
if (s) {
l.stack = s.stack
}
t.logError(l);
typeof t.originalOnerror === "function" && t.originalOnerror.apply(this, arguments)
},
bindOnError: function() {
if (typeof e.onerror === "function") {
if (e.onerror === t.onError) return;
t.originalOnerror = e.onerror
}
e.onerror = t.onError
}
});
t.bindOnError()
}(n);
e.console = e.console || {};
var w = e.console,
T = function() {};
w.debug = w.debug || T, w.log = w.log || T, w.error = w.error || T, w.groupCollapsed = w.groupCollapsed || T, w.groupEnd = w.groupEnd || T;
n.select = function(e, t) {
return n.selectMultiple(e, t)[0] || null
};
n.selectMultiple = function(e, r) {
if (r === null) return [];
var i;
r = r || t;
e = e.match(/^([#\.])?(.*)/);
i = "getElement" + (e[1] ? e[1] == "#" ? "ById" : "sByClassName" : "sByTagName");
if (typeof r[i] != "undefined") {
e = r[i](e[2])
} else if (i == "getElementsByClassName" && r.getElementsByTagName) {
var a = r.getElementsByTagName("*"),
o = [];
for (var s = 0; s < a.length; s++) {
var l = a[s].className.split(" ");
for (var f = 0; f < l.length; f++) {
if (l[f] == e[2]) {
o.push(a[s]);
break
}
}
}
return o
}
e = e === null ? [] : e.nodeType ? [e] : e;
if (n.Array.isArray(e)) {
return e
}
try {
return Array.prototype.slice.call(e)
} catch (u) {
var c = [],
p = e.length;
while (p--) c[p] = e[p];
return c
}
};
n.text = function(e, t) {
var r = "",
t = t || " | ";
if (typeof e === "string") {
n.Array.each(n.selectMultiple(e), function(e, i) {
r += n.text(e, t) + t
});
r = r.substr(0, r.length - 2)
} else if (e) {
var i = e;
if (i.nodeType == 3 || i.nodeType == 4) {
r += i.nodeValue
} else if (i.nodeType != 8) {
if (i.nodeName === "SELECT") {
var a = i.options[i.selectedIndex];
if (a) {
r += a.text
}
} else if (i.childNodes.length) {
for (var o = 0; o < i.childNodes.length; ++o) {
r += n.text(i.childNodes[o])
}
} else if (i.nodeName === "INPUT" && i.value) {
r += i.value
}
}
}
return n.trim(r)
};
n.heading = function() {
var e = t.getElementsByTagName("h1"),
r = "";
if (e.length) {
r = n.text(e[0])
}
return r
}
})(window, document, superT, "undefined");
superT.an.startMonitoring(157747, "i");
! function(e, t, n) {
n.an.startMonitoring(157748, "fn");
n.t = function(r) {
n.fireBaseContainer(157749, "t", function() {
n.topTime = (new Date).getTime();
(function() {
n.comScore = n.comScore || {};
var e = /^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/,
r = '{\n "2015/04/02": "Apr-14",\n "2015/09/25": "Oct-14"\n}',
i = function(e) {
var t = e.getFullYear().toString();
var n = (e.getMonth() + 1).toString();
var r = e.getDate().toString();
return t + "/" + (n[1] ? n : "0" + n[0]) + "/" + (r[1] ? r : "0" + r[0])
},
a = i(new Date),
o = "";
if (r !== "") {
r = JSON.parse(r);
for (var s in r) {
if (e.test(s) && a > s) {
o = r[s]
} else {
break
}
}
}
var l = {
publisher: "Leader Newspaper",
site: "Diamond Valley Leader",
name: [n.getHost(), n.an.d1 || "home", n.heading() || t.title].join(":").toLowerCase().replace(/[^\w:]/g, "_").replace(/_+/g, "_"),
digital_version: "Replica",
category: "",
drid: n.getFingerprintJS()
};
if (o) {
l.issue = o
}
for (var f in l) {
if (l.hasOwnProperty(f)) {
n.comScore[f] = l[f]
}
}
})();
function r(n) {
var r = "comScore=",
i = t,
a = i.cookie,
o = "",
s = "indexOf",
l = "substring",
f = "length",
u = 2048,
c, p = "&ns_",
h = "&",
d, g, v, m, y = e,
b = y.encodeURIComponent || escape;
if (a[s](r) + 1)
for (v = 0, g = a.split(";"), m = g[f]; v < m; v++) d = g[v][s](r), d + 1 && (o = h + unescape(g[v][l](d + r[f])));
n += p + "_t=" + +new Date + p + "c=" + (i.characterSet || i.defaultCharset || "") + "&c8=" + b(i.title) + o + "&c7=" + b(i.URL) + "&c9=" + b(i.referrer), n[f] > u && n[s](h) > 0 && (c = n[l](0, u - 8).lastIndexOf(h), n = (n[l](0, c) + p + "cut=" + b(n[l](c + 1)))[l](0, u)), i.images && (d = new Image, y.ns_p || (ns_p = d), d.src = n)
}
r(n.buildUri("//" + "int.sitestat.com/amaa/amaa/s", n.comScore || {}))
}, r)
};
n.b = function(r) {
n.fireBaseContainer(157750, "b", function() {
n.locationHash = e.location.hash;
e.setInterval(function() {
if (location.hash !== n.locationHash) {
n.t(true);
n.locationHash = location.hash
}
}, 100);
(function(e, n, r) {
var i = function(e) {
this._options = {
loopCheckTime: 50,
loopMaxNumber: 5,
baitClass: "pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",
baitStyle: "width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;"
};
this._var = {
bait: null,
checking: false,
loop: null,
loopNumber: 0,
event: {
detected: [],
notDetected: []
}
}
};
i.prototype._options = null;
i.prototype._var = null;
i.prototype._bait = null;
i.prototype._creatBait = function() {
var n = t.createElement("div");
n.setAttribute("class", this._options.baitClass);
n.setAttribute("style", this._options.baitStyle);
this._var.bait = e.document.body.appendChild(n);
this._var.bait.offsetParent;
this._var.bait.offsetHeight;
this._var.bait.offsetLeft;
this._var.bait.offsetTop;
this._var.bait.offsetWidth;
this._var.bait.clientHeight;
this._var.bait.clientWidth
};
i.prototype._destroyBait = function() {
e.document.body.removeChild(this._var.bait);
this._var.bait = null
};
i.prototype.check = function(e) {
if (e === r) {
e = true
}
if (this._var.checking) {
return false
}
this._var.checking = true;
if (this._var.bait === null) {
this._creatBait()
}
var t = this;
this._var.loopNumber = 0;
if (e === true) {
this._var.loop = setInterval(function() {
t._checkBait(e)
}, this._options.loopCheckTime)
}
setTimeout(function() {
t._checkBait(e)
}, 1);
return true
};
i.prototype._checkBait = function(t) {
var n = false;
if (this._var.bait === null) {
this._creatBait()
}
if (e.document.body.getAttribute("abp") !== null || this._var.bait.offsetParent === null || this._var.bait.offsetHeight == 0 || this._var.bait.offsetLeft == 0 || this._var.bait.offsetTop == 0 || this._var.bait.offsetWidth == 0 || this._var.bait.clientHeight == 0 || this._var.bait.clientWidth == 0) {
n = true
}
if (e.getComputedStyle !== r) {
var i = e.getComputedStyle(this._var.bait, null);
if (i && (i.getPropertyValue("display") == "none" || i.getPropertyValue("visibility") == "hidden")) {
n = true
}
}
if (t === true) {
this._var.loopNumber++;
if (this._var.loopNumber >= this._options.loopMaxNumber) {
this._stopLoop()
}
}
if (n === true) {
this._stopLoop();
this._destroyBait();
this.emitEvent(true);
if (t === true) {
this._var.checking = false
}
} else if (this._var.loop === null || t === false) {
this._destroyBait();
this.emitEvent(false);
if (t === true) {
this._var.checking = false
}
}
};
i.prototype._stopLoop = function(e) {
clearInterval(this._var.loop);
this._var.loop = null;
this._var.loopNumber = 0
};
i.prototype.emitEvent = function(e) {
var t = this._var.event[e === true ? "detected" : "notDetected"];
for (var n in t) {
if (t.hasOwnProperty(n)) {
t[n]()
}
}
this.clearEvent();
return this
};
i.prototype.clearEvent = function() {
this._var.event.detected = [];
this._var.event.notDetected = []
};
i.prototype.on = function(e, t) {
this._var.event[e ? "detected" : "notDetected"].push(t);
return this
};
var a = new i;
a.on(true, function() {
n.adBlockDetected = true;
n.triggerEvent(t, "adblockdetector.finished", {
detected: true
})
});
a.on(false, function() {
n.adBlockDetected = false;
n.triggerEvent(t, "adblockdetector.finished", {
detected: false
})
});
a.check()
})(e, n);
n.bind(t, "adblockdetector.finished", function r(e) {
if (n.getCookie("superT_ad_block_detected") == 1) {
return
}
var t = {
"e.ty": "page",
"em.de": "pageView",
adbl: e.data.detected,
"sts.fu": screen.width + "x" + screen.height
};
n.setCookie("superT_ad_block_detected", "1");
n.webEventCallDC("//dc.optimahub.com", t, {
"c.pr": "66666666"
})
});
"function" === typeof n.events && n.events();
if ("undefined" !== typeof n.topTime) {
n.an.tb = (new Date).getTime() - n.topTime
}
}, r)
};
n.b2 = function(e) {
n.fireBaseContainer(157751, "b2", function() {}, e)
};
n.fireB2OnReady = false;
n.events = function(e) {
return n.fireBaseContainer(157752, "e", function() {}, e)
};
if (typeof n.t === "function") {
n.t()
}
n.whenReady(function() {
if (typeof n.b === "function") {
n.b()
}
});
if (true === n.fireB2OnReady) {
n.whenReady(function() {
if (typeof n.b === "function") {
n.b2()
}
})
} else {
n.whenLoad(function() {
if (typeof n.b === "function") {
n.b2()
}
})
}
}(window, document, superT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment