This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if the element exists, returns the innerText, otherwise an empty string | |
function getInnerText(ele) { | |
if (ele) { | |
return ele.innerText; | |
} | |
return ""; | |
} | |
// executes the query selectors and builds the output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tiq toggle debug | |
(document.cookie.indexOf("utagdb=true") > -1) ? document.cookie = "utagdb=false" : document.cookie = "utagdb=true"; | |
// bookmarklet: javascript:(function()%7B(document.cookie.indexOf("utagdb%3Dtrue")>-1)%3Fdocument.cookie%3D"utagdb%3Dfalse":document.cookie%3D"utagdb%3Dtrue"%3B%7D)()%3B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s.registerPreTrackCallback(function(requestUrl, allowList, hostname) { | |
var doTrack = (allowList.indexOf(hostname) > -1); | |
console.log(allowList, hostname, doTrack); | |
}, ['sandbox.test.com'], document.location.hostname); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var govScroll = { | |
measurements: { | |
initial: {}, | |
current: {}, | |
max: {}, | |
}, | |
config: { | |
hasMilestoneOccurred: { | |
25: false, // false indicates it has not fired, but should; true indicates it already has (or shouldn't) | |
50: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// default the flag to false (it gets set to true in registerPostTrackCallback) | |
var flag = false; | |
// wait for flag=true (set in registerPostTrackCallback) to fire the s.tl() call | |
var waitForFlag = setInterval(function() { | |
if(flag) { | |
console.log("fire s.tl() here"); | |
clearInterval(waitForFlag); | |
} | |
}, 50); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = { | |
regexEscapes: function (str) { | |
str = str.replace(/\//g, "\\/"); | |
str = str.replace(/\?/g, "\\?"); | |
return str; | |
} | |
} | |
var val = x.regexEscapes("/test/this/here?for=now"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.videos = {}; | |
wistiaEmbeds.forEach(function (vid) { | |
window.videos[vid.hashedId()] = { | |
id: vid.hashedId(), | |
name: vid.name(), | |
duration: vid.duration(), | |
status: { | |
step_play: false, | |
step_25: false, | |
step_50: false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* builds a single campaign identifier (CID) string out of a collection of utm_ parameters | |
* payload is required, but all properties of payload are optional | |
*/ | |
function buildCIDfromUTM(payload) { | |
var delimiter = payload.delimiter || '_'; | |
var cid = payload.cid || [ | |
payload.medium, | |
payload.source, | |
payload.campaign, |
NewerOlder