| 1 |
document.addEventListener("DOMContentLoaded",function(){for(var a=document.querySelectorAll(".embed-privacy-overlay"),b=document.querySelectorAll(".embed-privacy-inner .embed-privacy-label"),c=0;c<a.length;c++)a[c].addEventListener("click",function(a){var b=a.currentTarget,c=b.nextElementSibling;b.style.display="none";var d=JSON.parse(window["_"+b.parentNode.id]);c.innerHTML=htmlentities_decode(d.embed);for(var e,f=c.querySelectorAll("script"),g=0;g<f.length;g++)e=document.createElement("script"),f[g].src?e.src=f[g].src:e.innerHTML=f[g].innerHTML,c.appendChild(e)});for(var c=0;c<b.length;c++)b[c].addEventListener("click",function(a){a.stopPropagation();var b=a.currentTarget,c=b.getAttribute("for"),d=b.getAttribute("data-embed-provider"),e=get_cookie("embed-privacy")?JSON.parse(get_cookie("embed-privacy")):"";document.getElementById(c).checked?null!==e&&0!==Object.keys(e).length&&e.constructor===Object?(e[d]=!0,set_cookie("embed-privacy",JSON.stringify(e))):set_cookie("embed-privacy","{\""+d+"\":true}",365):null!==e&&(delete e[d],0===Object.keys(e).length?remove_cookie("embed-privacy"):set_cookie("embed-privacy",JSON.stringify(e),365))})});function get_cookie(a){for(var b,d=a+"=",e=document.cookie.split(";"),f=0;f<e.length;f++){for(b=e[f];" "==b.charAt(0);)b=b.substring(1,b.length);if(0==b.indexOf(d))return b.substring(d.length,b.length)}return null}function htmlentities_decode(a){var b=document.createElement("textarea");return b.innerHTML=a,b.value}function remove_cookie(a){document.cookie=a+"=; expires=0; path=/"}function set_cookie(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*(60*(60*(24*c)))),d="; expires="+e.toUTCString()}document.cookie=a+"="+(b||"")+d+"; path=/"} |