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
console.log(Date.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
function when(selector, callback) { | |
var interval = window.setInterval(function () { | |
if (document.querySelectorAll(selector).length > 0) { | |
callback(); | |
window.clearInterval(interval); | |
} | |
}, 200); | |
} | |
when('#drawer h6', function () { |
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
Shopify = {} | |
Shopify.shop = "minijoops.myshopify.com"; |
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
(function () { | |
function getScriptURL() { | |
var scripts = document.getElementsByTagName('script'); | |
return scripts[scripts.length - 1].src; | |
} | |
function getParameterByName(name, url) { | |
var parser = document.createElement('a'); | |
parser.href = url; |
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 pixel = document.createElement('img'); | |
pixel.src = 'https://ct.pinterest.com/?tid=gzRugJJBQLL'; | |
pixel.width = 1; | |
pixel.height = 1; | |
document.body.appendChild(pixel); |
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
<script> | |
// To change what your customers would see if they try to | |
// add to cart without completing an option, edit the yellow text enclosed within the quotation marks. | |
var errorMessages = { | |
for_text_inputs : "Please add your personalized text before adding to cart.", | |
for_number_inputs: "Please enter a custom quantity.", | |
for_checkboxes : "Please select your options before adding to cart", | |
for_dropdowns : "Please select an option before adding to cart" | |
}; |
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
console.log("Running Gist at https://gist.github.com/robert-blankenship/b01ba24de2b060b8c89f"); | |
function when(selector, callback) { | |
var interval = window.setInterval(function () { | |
if (document.querySelectorAll(selector).length > 0) { | |
callback(); | |
window.clearInterval(interval); | |
} | |
}, 200); | |
} |
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
console.log("Running Gist at https://gist.github.com/robert-blankenship/bc1f262dca08943c00cb"); | |
function when(selector, callback) { | |
var interval = window.setInterval(function () { | |
if (document.querySelectorAll(selector).length > 0) { | |
var err = null; | |
function throwAfter() { | |
if (err) throw err; | |
} |
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
function createMailMunchScriptTag() { | |
var script = document.createElement('script'); | |
script.setAttribute('src', "//s3.amazonaws.com/mailmunch/static/site.js"); | |
script.setAttribute('id', "mailmunch-script"); | |
script.setAttribute('data-mailmunch-site-id', 147159); | |
script.setAttribute('async', "async"); | |
return script; | |
} |
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
function formatUrl(linkUrl) { | |
if (linkUrl[0] == "/") { | |
var append1 = "http://"; | |
var originalUrl = linkUrl; | |
var newUrl = linkUrl.replace("//", append1); // this doesn't actually change linkUrl | |
if (originalUrl !== newUrl) { | |
console.log("linkUrl: ", linkUrl); | |
console.log("originalUrl: ", originalUrl); |