Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Clickio 320*100 mobile sticky -->
- <script>
- (function(w){
- var showTime = 1;
- function getCookie(name) {
- let matches = document.cookie.match(new RegExp(
- "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
- ));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- }
- function setCookie(name, value, options = {}) {
- if (options.expires instanceof Date) {
- options.expires = options.expires.toUTCString();
- }
- let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
- for (let optionKey in options) {
- updatedCookie += "; " + optionKey;
- let optionValue = options[optionKey];
- if (optionValue !== true) {
- updatedCookie += "=" + optionValue;
- }
- }
- document.cookie = updatedCookie;
- }
- function showCode(p, c) {
- var div = document.createElement('div');
- div.innerHTML = c;
- p.appendChild(div);
- while (div.firstChild) p.insertBefore(div.firstChild, div);
- p.removeChild(div);
- var scripts = p.getElementsByTagName("script");
- Array.from(scripts).forEach(function(script, index, array) {
- var newScript = document.createElement('script');
- if(typeof script.src !== "undefined" && script.src && script.sr !== "")
- {
- newScript.src = script.src;
- newScript.className = script.className;
- p.appendChild(newScript);
- }
- else
- {
- var data = (script.text || script.textContent || script.innerHTML || "");
- newScript.className = script.className;
- newScript.type = script.type;
- newScript.appendChild(document.createTextNode(data));
- p.appendChild(newScript);
- }
- p.removeChild(script);
- });
- }
- var c = getCookie("lx_sticky_shown_m")
- if(!c || ( c && Number.parseInt(c, 10) < showTime ) )
- {
- var div = document.createElement("DIV");
- div.id = "lx_sticky_wrapper_m";
- var b = document.querySelector("body");
- b.appendChild(div);
- var code = "<script async type='text/javascript' src='//s.clickiocdn.com/t/common_258.js'><\/scr" + "ipt>" +
- "<script class='__lxGc__' type='text/javascript'>" +
- "((__lxGc__=window.__lxGc__||{'s':{},'b':0})['s']['_214500']=__lxGc__['s']['_214500']||{'b':{}})['b']['_662320']={'i':__lxGc__.b++};" +
- "<\/scr" + "ipt>";
- var parent = document.querySelector("#lx_sticky_wrapper_m");
- showCode(parent, code);
- var date = new Date();
- date.setDate(date.getDate() + 1);
- date.setHours(0,0,0,0);
- var cv = (c?Number.parseInt(c, 10):0) + 1;
- setCookie("lx_sticky_shown_m", cv, {secure: true, expires: date});
- }
- })(window);
- </script>
- <!-- Clickio 320*100 desktop sticky -->
- <script>
- (function(w){
- var showTime = 1;
- function getCookie(name) {
- let matches = document.cookie.match(new RegExp(
- "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
- ));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- }
- function setCookie(name, value, options = {}) {
- if (options.expires instanceof Date) {
- options.expires = options.expires.toUTCString();
- }
- let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value);
- for (let optionKey in options) {
- updatedCookie += "; " + optionKey;
- let optionValue = options[optionKey];
- if (optionValue !== true) {
- updatedCookie += "=" + optionValue;
- }
- }
- document.cookie = updatedCookie;
- }
- function showCode(p, c) {
- var div = document.createElement('div');
- div.innerHTML = c;
- p.appendChild(div);
- while (div.firstChild) p.insertBefore(div.firstChild, div);
- p.removeChild(div);
- var scripts = p.getElementsByTagName("script");
- Array.from(scripts).forEach(function(script, index, array) {
- var newScript = document.createElement('script');
- if(typeof script.src !== "undefined" && script.src && script.sr !== "")
- {
- newScript.src = script.src;
- newScript.className = script.className;
- p.appendChild(newScript);
- }
- else
- {
- var data = (script.text || script.textContent || script.innerHTML || "");
- newScript.className = script.className;
- newScript.type = script.type;
- newScript.appendChild(document.createTextNode(data));
- p.appendChild(newScript);
- }
- p.removeChild(script);
- });
- }
- var c = getCookie("lx_sticky_shown_d")
- if(!c || ( c && Number.parseInt(c, 10) < showTime ) )
- {
- var div = document.createElement("DIV");
- div.id = "lx_sticky_wrapper_d";
- var b = document.querySelector("body");
- b.appendChild(div);
- var code = "<script async type='text/javascript' src='//s.clickiocdn.com/t/common_258.js'><\/scr" + "ipt>" +
- "<script class='__lxGc__' type='text/javascript'>" +
- "((__lxGc__=window.__lxGc__||{'s':{},'b':0})['s']['_214500']=__lxGc__['s']['_214500']||{'b':{}})['b']['_662323']={'i':__lxGc__.b++};" +
- "<\/scr" + "ipt>";
- var parent = document.querySelector("#lx_sticky_wrapper_d");
- showCode(parent, code);
- var date = new Date();
- date.setDate(date.getDate() + 1);
- date.setHours(0,0,0,0);
- var cv = (c?Number.parseInt(c, 10):0) + 1;
- setCookie("lx_sticky_shown_d", cv, {secure: true, expires: date});
- }
- })(window);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement