Files
recipe-importer/kiskegyed-examples/kiskegyed1_files/ident.min.js.download
T
2026-02-24 18:41:11 +01:00

12 lines
5.2 KiB
Plaintext

__passportHeaderUtil={initFramework:function(){this.add_event_funct="addEventListener";this.event_type_prefix="";!document.addEventListener&&document.attachEvent&&(this.add_event_funct="attachEvent",this.event_type_prefix="on");this.polyIndexOf();this.polyCustomEvent();this.polyGetElementsByClassName()},polyIndexOf:function(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,c){var b=this.length>>>0,d=Number(c)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=b);d<b;d++)if(d in this&&this[d]===
a)return d;return-1})},polyCustomEvent:function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var d=document.createEvent("CustomEvent");d.initCustomEvent(a,b.bubbles,b.cancelable,b.detail);return d}if("function"===typeof window.CustomEvent)return!1;a.prototype=window.Event.prototype;window.CustomEvent=a},polyGetElementsByClassName:function(){function a(a){if(this.querySelectorAll)return this.querySelectorAll("."+a);var b=this.getElementsByTagName("*");a=RegExp("(?:\\s|^)"+a+"(?:\\s|$)");
var d=[],f,e;for(e=b.length;e--;)f=b[e],f.className.match(a)&&d.unshift(f);return d}document.getElementsByClassName||(window.Element.prototype.getElementsByClassName=document.constructor.prototype.getElementsByClassName=a)},addListener:function(a,c,b){var d=b;window.addEventListener||(d=function(a){a=a||window.event;a.target=a.target||a.srcElement;b.apply(this,[a])});a[this.add_event_funct](this.event_type_prefix+c,d,!1)},dispatchEvent:function(a,c,b){b=new CustomEvent(c,{detail:b});"function"==typeof a.dispatchEvent?
a.dispatchEvent(b):"function"==typeof a.fireEvent&&a.fireEvent("on"+c,b)},replaceClass:function(a,c,b){__passportHeaderUtil.removeClass(a,c);__passportHeaderUtil.addClass(a,b)},removeClass:function(a,c){__passportHeaderUtil.hasClass(a,c)&&(a.className=(" "+a.className+" ").replace(" "+c+" "," ").replace(/^\s+|\s+$|(\s)\s+/g,"$1"))},addClass:function(a,c){__passportHeaderUtil.hasClass(a,c)||(a.className=(a.className+" "+c).replace(/^\s+|\s+$|(\s)\s+/g,"$1"))},hasClass:function(a,c){return-1<(" "+a.className+
" ").indexOf(" "+c+" ")},cookie:function(a,c,b){if("undefined"!=typeof c){b=b||{};null===c&&(c="",b.expires=-1);var d="";b.expires&&("number"==typeof b.expires||b.expires.toUTCString)&&("number"==typeof b.expires?(d=new Date,d.setTime(d.getTime()+864E5*b.expires)):d=b.expires,d="; expires="+d.toUTCString());var f=b.path?"; path="+b.path:"",e=b.domain?"; domain="+b.domain:"";b=b.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(c),d,f,e,b].join("")}else{c=null;if(document.cookie&&""!=
document.cookie)for(b=document.cookie.split(";"),d=0;d<b.length;d++)if(f=b[d].replace(/^[ ]*/,""),f.substring(0,a.length+1)==a+"="){c=decodeURIComponent(f.substring(a.length+1));break}return c}},insertScript:function(a,c,b,d){if(c){c="__passportHeader-"+c;var f;(f=document.getElementById(c))&&f.parentNode.removeChild(f)}var e=document.createElement("script");e.type="text/javascript";e.async=!0;c&&(e.id=c);e.src=a;var g=document.getElementsByTagName("head")[0];if(b&&"function"==typeof b){var h=!1;
e.onload=e.onreadystatechange=function(){h||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(h=!0,b(),e.onload=e.onreadystatechange=null,g&&e.parentNode&&g.removeChild(e))}}d&&"function"==typeof d&&(e.onerror=d);g.appendChild(e)}};__passportEvent=function(a,c){a.config.IDENT_URL&&(this.header=a,this.cuid="undefined"==typeof c?null:c,this.cookieName="ident")};__passportEvent.prototype.getCookie=function(){return __passportHeaderUtil.cookie(this.cookieName)};
__passportEvent.prototype.send=function(a,c){var b=this.getCookie();if(b){var d=1E17*Math.random();if("ot"==a){b=this.header.config.IDENT_URL+"ident/ot.js?&cemp="+encodeURIComponent(b)+"&rnd="+d;this.cuid&&(b+="&cuid="+encodeURIComponent(this.cuid));for(var f in c)b+="&"+encodeURIComponent(f)+"="+encodeURIComponent(c[f]);__passportHeaderUtil.insertScript(b)}}};__passportIdent=function(a,c){if("object"==typeof a){if("undefined"!==typeof __passportHeader&&a instanceof __passportHeader){if(!a.config.IDENT_URL)return;this.IDENT_URL=a.config.IDENT_URL;this.tid=c;this.standalone=!1}else{if(!a.IDENT_URL)return;this.IDENT_URL=a.IDENT_URL;this.tid=a.tid;this.standalone=!0}this.cookieName="ident";this.cookieChecked=!1;this.tid&&(this.cookie=this.checkCookie())&&this.sendHit()}};
__passportIdent.prototype.checkCookie=function(){var a;if(void 0!==this.cookie)return this.cookie;if(a=__passportHeaderUtil.cookie(this.cookieName))return a;if(this.cookieChecked)return!1;__passportHeaderUtil.insertScript(this.IDENT_URL+"management/getcookie?jsonp="+encodeURIComponent((this.standalone?"passportIdent":"passportHeader.ident")+".setCookie"));this.cookieChecked=!0;return!1};
__passportIdent.prototype.setCookie=function(a){__passportHeaderUtil.cookie(this.cookieName,a,{path:"/",expires:14});this.cookie=a;this.sendHit()};__passportIdent.prototype.sendHit=function(a){if(this.tid||a){a||(a=this.tid);if(!this.cookie&&(this.tid=a,this.cookie=this.checkCookie(),!this.cookie))return;var c=1E17*Math.random();a=this.IDENT_URL+"ident/hit.js?tid="+encodeURIComponent(a)+"&cemp="+encodeURIComponent(this.cookie)+"&rnd="+c;__passportHeaderUtil.insertScript(a)}};
"object"==typeof __passportIdentConfig&&(passportIdent=new __passportIdent(__passportIdentConfig));