`;
-->
return template.content.textContent;
},
props: {
type: 'text/javascript',
},
},
// dtag
{
content: '',
props: {
type: 'text/javascript',
src: 'https://cdn.attn.tv/socksaddict/dtag.js',
},
},
{
content: () => {
const regex = /document\.addEventListener\(['|"]DOMContentLoaded['|"],\s*?function\(\)\s*?{/im;
const regex1 = /o\.addEventListener\("DOMContentLoaded",\s*?function\(\)\s*?{/im;
const regex2 = /}\)}\(document\)/im;
const regex3 = /previewBarInjector\.init\(\);\n?}\);(<|\\x3C)\/script>/im;
const regex4 = /if\(window\.attachEvent\).*\{(\n|.)*window\.addEventListener\('load', asyncLoad, false\)\;(\s|\n)*}/im
// exclude delay
const regex5 = /"[^"]*kiwi[^"]*",?/im;
return transformatedStr;
},
rawContent: true,
},
// Stamped
//{
// content: '',
// props: {
// type: 'text/javascript',
// src: 'https://cdn1.stamped.io/files/widget.min.js',
// async: true,
// 'data-api-key': 'pubkey-QqNV30a8hl5TfxoGR93y76Lz4My1hO',
// id: 'stamped-script-widget',
// },
//},
];
(function nextScriptsTimeout() {
if (!window.chunkedScripts) return;
var timeout;
var scriptsCount =
window.chunkedScripts.filter(function filterNoModuleScripts(script) {
return script.props && !script.props.noModule;
}).length - 1;
var scriptsLoadedCount = 0;
var scriptsInjected = false;
var clickEventNode;
function injectScripts() {
if (scriptsInjected) return;
// chunkedScripts var gets passed from CustomNextScript
window.chunkedScripts.forEach(function handleScript(script) {
if (!script || (!script.rawContent && !script.props)) return;
try {
if (script.rawContent) {
const content = script.content();
// console.log('raw', content);
const range = document.createRange();
range.selectNode(document.head); // required in Safari
const fragment = range.createContextualFragment(content);
document.head.appendChild(fragment);
return;
}
// eslint-disable-next-line vars-on-top
var tag = script.props.rel === 'stylesheet' ? 'link' : 'script';
var scriptTag = document.createElement(tag);
// eslint-disable-next-line no-restricted-syntax
for (var key in script.props) {
if (Object.prototype.hasOwnProperty.call(script.props, key)) {
scriptTag[key] = script.props[key];
}
}
// eslint-disable-next-line no-use-before-define
scriptTag.addEventListener('load', function() {
eval(script.props['data-onload']);
scriptLoadHandler();
});
if (script.content) {
scriptTag.innerHTML = typeof script.content === 'function' ? script.content() : script.content;
}
document.body.appendChild(scriptTag);
} catch (err) {
console.log(err);
}
});
scriptsInjected = true;
}
function scriptLoadHandler() {
if (scriptsLoadedCount !== scriptsCount) {
scriptsLoadedCount += 1;
return;
}
if (clickEventNode && document.body.contains(clickEventNode)) {
clickEventNode.dispatchEvent(new Event("click", { bubbles: true }));
}
removeListeners();
}
function onClickHandler(event) {
if (event.target.offsetParent !== null) clickEventNode = event.target;
}
var otherEvents = ["touchstart", "scroll", "keypress"];
function addListeners() {
if (window.pageYOffset > 0) injectScripts(); // if page is scrolled down, it's a refresh
timeout = setTimeout(injectScripts, 20000); // default mobile loading delay
window.addEventListener("click", onClickHandler);
otherEvents.forEach(function addEventListener(e) {
window.addEventListener(e, injectScripts);
});
}
function removeListeners() {
clearTimeout(timeout);
window.removeEventListener("click", onClickHandler);
otherEvents.forEach(function removeEventListener(e) {
window.removeEventListener(e, injectScripts);
});
}
addListeners();
})();
News, Resources & Sales | SocksAddict.com
0
Cart
Added to Cart
You have items in your cart
You have 1 item in your cart
Total
Our moms do it all, and they deserve a little extra appreciation this Mother’s Day. Show your mom you really care by getting a gift for her off our gift guide! Keep reading to see our favorite picks for mom.
Read more
Cycling is a popular and fun way to get some exercise. Whether you prefer hopping on a bike to cycle around town, or riding the stationary bikes at the gym, you’re going to need the right pair of socks. We compiled this list of the best socks for cycling, so keep reading to see our picks!
Read more
Since the weather has finally started warming up, it’s time to get outside and go for walks again! No walk is complete without the best socks, so keep reading to see our picks for the best socks for walking!
Read more
Merino wool is the perfect sock material- it's durable, lightweight, great for year-round wear, the list goes on in this blog! Keep reading to learn all about the benefits of Merino wool, and shop some of our favorite Merino wool socks!
Read more
While the weather is still chilly and there’s no end to winter in sight, you should stock up on some new winter gear . If you’re looking to add to your collection or replace something you currently have, keep reading to find exactly what you need!
Read more