meta/assets/js/cache/js

35 lines
16 KiB
Plaintext

(function(){if("undefined"!==typeof document.querySelector){var f,e,d,c;f=function(a){c="undefined"===typeof a?"undefined"!==typeof f.el?f.el:document.documentElement:"object"!==typeof a?e(a):a;f.prototype.el=c;var a=d(f),b;for(b in a)"object"===typeof a[b]&&(a[b].el=c);a.el=c;return a};e=function(a,b){var c;if("string"!=typeof a||"undefined"===typeof a)return a;c=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);c=c.querySelectorAll(a);
return 1===c.length?c[0]:c};d=function(a){var b;if("undefined"!==typeof a){if("undefined"!==typeof Object.create)return Object.create(a);b=typeof a;if(!("object"!==b&&"function"!==b))return b=function(){},b.prototype=a,new b}};f.ext=function(a,b){b.el=c;f[a]=b};f.ext("each",function(a){if("undefined"!==typeof c.length&&c!==window)if("undefined"!==typeof Array.prototype.forEach)[].forEach.call(c,a);else{var b=c.length;if(0!==b)for(var d,e=0;e<b;e++)d=c.item(e)?c.item(e):c[e],a.call(d,d)}else a.call(c,
c)});f.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};f=window.$_=window.$_||f;f.$=e}})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});
"undefined"===typeof Event.preventDefault&&"undefined"!==typeof window.event&&(Event.prototype.preventDefault=function(){window.event.returnValue=!1},Event.prototype.stopPropagation=function(){window.event.cancelBubble=!0});"undefined"===typeof Array.isArray&&(Array.isArray=function(f){return"[object Array]"===Object.prototype.toString.apply(f)});
(function(){if("undefined"!==typeof window.XMLHttpRequest){var f={_do:function(e,d,c,a,b){var l=new XMLHttpRequest;"undefined"===typeof c&&(c=function(){});b=b?"POST":"GET";e+="GET"===b?"?"+this._serialize(d):"";l.open(b,e);l.onreadystatechange=function(){4===l.readyState&&(200===l.status?c.call(l.responseText,l.responseText):"undefined"!==typeof a&&a.call(l.status,l.status))};"POST"===b?(l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.send(this._serialize(d))):l.send(null)},
_serialize:function(e){var d,c,a=[];for(d in e)e.hasOwnProperty(d)&&"function"!==typeof e[d]&&(c=e[d].toString(),d=encodeURIComponent(d),c=encodeURIComponent(c),a.push(d+"="+c));return a.join("&")}};$_.ext("get",function(e,d,c,a){f._do(e,d,c,a,!1)});$_.ext("post",function(e,d,c,a){f._do(e,d,c,a,!0)});$_.ext("sse",function(e,d){var c;"undefined"!==typeof EventSource&&(c=new EventSource(e),c.onmessage=function(a){d.call(a.data,a.data)})})}})();
(function(){var f,e,d,c;"undefined"!==typeof document.addEventListener?(f=function(a,b,c){"undefined"!==typeof a.addEventListener&&a.addEventListener(b,c,!1)},e=function(a,b,c){"undefined"!==typeof a.removeEventListener&&a.removeEventListener(b,c,!1)}):"undefined"!==typeof document.attachEvent&&(f=function(a,b,c){function d(a){c.apply(a)}"undefined"!==typeof a.attachEvent&&(e(b,c),a.attachEvent("on"+b,d),a=a.KIS_0_6_0=a.KIS_0_6_0||{},a.listeners=a.listeners||{},a.listeners[b]=a.listeners[b]||[],a.listeners[b].push({callback:c,
_listener:d}))},e=function(a,b,c){if("undefined"!==typeof a.detachEvent){var d=a.KIS_0_6_0;if(d&&d.listeners&&d.listeners[b])for(var e=d.listeners[b],f=e.length,g=0;g<f;g++)if(e[g].callback===c){a.detachEvent("on"+b,e[g]._listener);e.splice(g,1);0===e.length&&delete d.listeners[b];break}}});d=function(a,b,c,i){var j,o;if(typeof a==="undefined")return null;if(b.match(/^([\w\-]+)$/))i===true?f(a,b,c):e(a,b,c);else{b=b.split(" ");o=b.length;for(j=0;j<o;j++)d(a,b[j],c,i)}};c=function(a,b,c,e){d(a,c,function(c){var d,
g,f,c=c||window.event;g=$_.$(b,a);for(d in g){f=c.target||c.srcElement;if(f==g[d]){e.call(g[d],c);c.stopPropagation()}}},true)};$_.ext("event",{add:function(a,b){$_.each(function(c){d(c,a,b,true)})},remove:function(a,b){$_.each(function(c){d(c,a,b,false)})},live:function(a,b,d){c(document.documentElement,a,b,d)},delegate:function(a,b,d){$_.each(function(e){c(e,a,b,d)})}})})();
"undefined"!==typeof document&&!("classList"in document.createElement("a"))&&function(f){var f=(f.HTMLElement||f.Element).prototype,e=Object,d=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},a=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},b=function(b,d){if(""===d)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(d))throw new a("INVALID_CHARACTER_ERR",
"String contains an invalid character");return c.call(b,d)},l=function(a){for(var b=d.call(a.className),b=b?b.split(/\s+/):[],c=0,e=b.length;c<e;c++)this.push(b[c]);this._updateClassName=function(){a.className=this.toString()}},i=l.prototype=[],j=function(){return new l(this)};a.prototype=Error.prototype;i.item=function(a){return this[a]||null};i.contains=function(a){return-1!==b(this,a+"")};i.add=function(a){a+="";-1===b(this,a)&&(this.push(a),this._updateClassName())};i.remove=function(a){a=b(this,
a+"");-1!==a&&(this.splice(a,1),this._updateClassName())};i.toggle=function(a){a+="";-1===b(this,a)?this.add(a):this.remove(a)};i.toString=function(){return this.join(" ")};if(e.defineProperty){i={get:j,enumerable:!0,configurable:!0};try{e.defineProperty(f,"classList",i)}catch(o){-2146823252===o.number&&(i.enumerable=!1,e.defineProperty(f,"classList",i))}}else e.prototype.__defineGetter__&&f.__defineGetter__("classList",j)}(self);
(function(){function f(d,c,a){var b,e;"undefined"!==typeof d.hasAttribute?(d.hasAttribute(c)&&(b=d.getAttribute(c)),e=!0):"undefined"!==typeof d[c]?(b=d[c],e=!1):"class"===c&&"undefined"!==typeof d.className&&(c="className",b=d.className,e=!1);if("undefined"===typeof b&&("undefined"===typeof a||null===a))return null;if("undefined"===typeof a)return b;"undefined"!==typeof a&&null!==a?!0===e?d.setAttribute(c,a):d[c]=a:null===a&&(!0===e?d.removeAttribute(c):delete d[c]);return"undefined"!==typeof a?
a:b}function e(d,c,a){var b,c=c.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")});b={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if("undefined"===typeof a&&"undefined"!==d.style[c])return d.style[c];if("undefined"===typeof a&&"undefined"!==d.style[b[c]])return d.style[b[c]];if("undefined"!==typeof d.style[c])return d.style[c]=a,null;if(d.style[b[c]])return d.style[b[c]]=a,null}$_.ext("dom",{addClass:function(d){$_.each(function(c){c.classList.add(d)})},
removeClass:function(d){$_.each(function(c){c.classList.remove(d)})},hide:function(){this.css("display","none")},show:function(d){"undefined"===typeof d&&(d="block");this.css("display",d)},attr:function(d,c){var a=this.el;if(1<a.length&&"undefined"===typeof c)return null;if(1<a.length&&"undefined"!==typeof c)$_.each(function(a){return f(a,d,c)});else return f(a,d,c)},text:function(d){var c,a,b;b=this.el;a="undefined"!==typeof b.textContent?"textContent":"undefined"!==typeof b.innerText?"innerText":
"innerHTML";c=b[a];return"undefined"!==typeof d?b[a]=d:c},css:function(d,c){if("undefined"===typeof c)return e(this.el,d);$_.each(function(a){e(a,d,c)})},append:function(d){"undefined"!==typeof document.insertAdjacentHTML?this.el.insertAdjacentHTML("beforeend",d):this.el.innerHTML+=d},prepend:function(d){"undefined"!==typeof document.insertAdjacentHTML?this.el.insertAdjacentHTML("afterbegin",d):this.el.innerHTML=d+this.el.innerHTML},html:function(d){"undefined"!==typeof d&&(this.el.innerHTML=d);return this.el.innerHTML}})})();
var TINY={};function T$(f){return document.getElementById(f)}function T$$$(){return document.all?1:0}
TINY.editor=function(){function f(c,a){this.n=c;window[c]=this;this.t=T$(a.id);this.obj=a;this.xhtml=a.xhtml;var b=document.createElement("div"),f=document.createElement("div"),i=document.createElement("div"),j=a.controls.length,o=0;this.i=document.createElement("iframe");this.i.frameBorder=0;this.i.width=a.width||"500";this.i.height=a.height||"250";this.ie=T$$$();i.className=a.rowclass||"teheader";b.className=a.cssclass||"te";b.style.width=this.i.width+"px";b.appendChild(i);for(o;o<j;o++){var g=
a.controls[o];if("n"==g)i=document.createElement("div"),i.className=a.rowclass||"teheader",b.appendChild(i);else if("|"==g){var h=document.createElement("div");h.className=a.dividerclass||"tedivider";i.appendChild(h)}else if("font"==g){var g=document.createElement("select"),k=a.fonts||["Verdana","Arial","Georgia"],m=k.length,h=0;g.className="tefont";g.onchange=new Function(this.n+'.ddaction(this,"fontname")');g.options[0]=new Option("Font","");for(h;h<m;h++){var n=k[h];g.options[h+1]=new Option(n,
n)}i.appendChild(g)}else if("size"==g){g=document.createElement("select");m=a.sizes||[1,2,3,4,5,6,7];k=m.length;h=0;g.className="tesize";g.onchange=new Function(this.n+'.ddaction(this,"fontsize")');for(h;h<k;h++)n=m[h],g.options[h]=new Option(n,n);i.appendChild(g)}else if("style"==g){g=document.createElement("select");m=a.styles||[["Style",""],["Paragraph","<p>"],["Header 1","<h1>"],["Header 2","<h2>"],["Header 3","<h3>"],["Header 4","<h4>"],["Header 5","<h5>"],["Header 6","<h6>"]];k=m.length;h=0;
g.className="testyle";g.onchange=new Function(this.n+'.ddaction(this,"formatblock")');for(h;h<k;h++)n=m[h],g.options[h]=new Option(n[0],n[1]);i.appendChild(g)}else e[g]&&(k=document.createElement("div"),h=e[g],n=h[2],m=h[0]*d,k.className=a.controlclass,k.style.backgroundPosition="0px "+m+"px",k.title=h[1],h="a"==n?'.action("'+h[3]+'",0,'+(h[4]||0)+")":'.insert("'+h[4]+'","'+h[5]+'","'+h[3]+'")',k.onclick=new Function(this.n+("print"==g?".print()":h)),k.onmouseover=new Function(this.n+".hover(this,"+
m+",1)"),k.onmouseout=new Function(this.n+".hover(this,"+m+",0)"),i.appendChild(k),this.ie&&(k.unselectable="on"))}this.t.parentNode.insertBefore(b,this.t);this.t.style.width=this.i.width+"px";f.appendChild(this.t);f.appendChild(this.i);b.appendChild(f);this.t.style.display="none";a.footer&&(f=document.createElement("div"),f.className=a.footerclass||"tefooter",a.toggle&&(i=a.toggle,j=document.createElement("div"),j.className=i.cssclass||"toggle",j.innerHTML=a.toggletext||"source",j.onclick=new Function(this.n+
".toggle(0,this);return false"),f.appendChild(j)),a.resize&&(i=a.resize,j=document.createElement("div"),j.className=i.cssclass||"resize",j.onmousedown=new Function("event",this.n+".resize(event);return false"),j.onselectstart=function(){return false},f.appendChild(j)),b.appendChild(f));this.e=this.i.contentWindow.document;this.e.open();b="<html><head>";f=a.bodyid?' id="'+a.bodyid+'"':"";a.cssfile&&(b+='<link rel="stylesheet" href="'+a.cssfile+'" />');a.css&&(b+='<style type="text/css">'+a.css+"</style>");
b+="</head><body"+f+">"+(a.content||this.t.value);this.e.write(b+"</body></html>");this.e.close();this.e.designMode="on";this.d=1;if(this.xhtml)try{this.e.execCommand("styleWithCSS",0,0)}catch(p){try{this.e.execCommand("useCSS",0,1)}catch(q){}}}var e=[],d=-30;e.cut=[1,"Cut","a","cut",1];e.copy=[2,"Copy","a","copy",1];e.paste=[3,"Paste","a","paste",1];e.bold=[4,"Bold","a","bold"];e.italic=[5,"Italic","a","italic"];e.underline=[6,"Underline","a","underline"];e.strikethrough=[7,"Strikethrough","a","strikethrough"];
e.subscript=[8,"Subscript","a","subscript"];e.superscript=[9,"Superscript","a","superscript"];e.orderedlist=[10,"Insert Ordered List","a","insertorderedlist"];e.unorderedlist=[11,"Insert Unordered List","a","insertunorderedlist"];e.outdent=[12,"Outdent","a","outdent"];e.indent=[13,"Indent","a","indent"];e.leftalign=[14,"Left Align","a","justifyleft"];e.centeralign=[15,"Center Align","a","justifycenter"];e.rightalign=[16,"Right Align","a","justifyright"];e.blockjustify=[17,"Block Justify","a","justifyfull"];
e.undo=[18,"Undo","a","undo"];e.redo=[19,"Redo","a","redo"];e.image=[20,"Insert Image","i","insertimage","Enter Image URL:","http://"];e.hr=[21,"Insert Horizontal Rule","a","inserthorizontalrule"];e.link=[22,"Insert Hyperlink","i","createlink","Enter URL:","http://"];e.unlink=[23,"Remove Hyperlink","a","unlink"];e.unformat=[24,"Remove Formatting","a","removeformat"];e.print=[25,"Print","a","print"];f.prototype.print=function(){this.i.contentWindow.print()};f.prototype.hover=function(c,a,b){c.style.backgroundPosition=
(b?"34px ":"0px ")+a+"px"};f.prototype.ddaction=function(c,a){this.action(a,c.options[c.selectedIndex].value)};f.prototype.action=function(c,a,b){b&&!this.ie?alert("Your browser does not support this function."):this.e.execCommand(c,0,a||null)};f.prototype.insert=function(c,a,b){c=prompt(c,a);null!=c&&""!=c&&this.e.execCommand(b,0,c)};f.prototype.setfont=function(){execCommand("formatblock",0,hType)};f.prototype.resize=function(c){this.mv&&this.freeze();this.i.bcs=TINY.cursor.top(c);this.mv=new Function("event",
this.n+".move(event)");this.sr=new Function(this.n+".freeze()");this.ie?(document.attachEvent("onmousemove",this.mv),document.attachEvent("onmouseup",this.sr)):(document.addEventListener("mousemove",this.mv,1),document.addEventListener("mouseup",this.sr,1))};f.prototype.move=function(c){c=TINY.cursor.top(c);this.i.height=parseInt(this.i.height)+c-this.i.bcs;this.i.bcs=c};f.prototype.freeze=function(){this.ie?(document.detachEvent("onmousemove",this.mv),document.detachEvent("onmouseup",this.sr)):(document.removeEventListener("mousemove",
this.mv,1),document.removeEventListener("mouseup",this.sr,1))};f.prototype.toggle=function(c,a){if(this.d){if(b=this.e.body.innerHTML,this.xhtml&&(b=b.replace(/<span class="apple-style-span">(.*)<\/span>/gi,"$1"),b=b.replace(/ class="apple-style-span"/gi,""),b=b.replace(/<span style="">/gi,""),b=b.replace(/<br>/gi,"<br />"),b=b.replace(/<br ?\/?>$/gi,""),b=b.replace(/^<br ?\/?>/gi,""),b=b.replace(/(<img [^>]+[^\/])>/gi,"$1 />"),b=b.replace(/<b\b[^>]*>(.*?)<\/b[^>]*>/gi,"<strong>$1</strong>"),b=b.replace(/<i\b[^>]*>(.*?)<\/i[^>]*>/gi,
"<em>$1</em>"),b=b.replace(/<u\b[^>]*>(.*?)<\/u[^>]*>/gi,'<span style="text-decoration:underline">$1</span>'),b=b.replace(/<(b|strong|em|i|u) style="font-weight: normal;?">(.*)<\/(b|strong|em|i|u)>/gi,"$2"),b=b.replace(/<(b|strong|em|i|u) style="(.*)">(.*)<\/(b|strong|em|i|u)>/gi,'<span style="$2"><$4>$3</$4></span>'),b=b.replace(/<span style="font-weight: normal;?">(.*)<\/span>/gi,"$1"),b=b.replace(/<span style="font-weight: bold;?">(.*)<\/span>/gi,"<strong>$1</strong>"),b=b.replace(/<span style="font-style: italic;?">(.*)<\/span>/gi,
"<em>$1</em>"),b=b.replace(/<span style="font-weight: bold;?">(.*)<\/span>|<b\b[^>]*>(.*?)<\/b[^>]*>/gi,"<strong>$1</strong>")),a&&(a.innerHTML=this.obj.toggletext||"wysiwyg"),this.t.value=b,!c)this.t.style.height=this.i.height+"px",this.i.style.display="none",this.t.style.display="block",this.d=0}else{var b=this.t.value;a&&(a.innerHTML=this.obj.toggletext||"source");this.xhtml&&!this.ie&&(b=b.replace(/<strong>(.*)<\/strong>/gi,'<span style="font-weight: bold;">$1</span>'),b=b.replace(/<em>(.*)<\/em>/gi,
'<span style="font-weight: italic;">$1</span>'));this.e.body.innerHTML=b;this.t.style.display="none";this.i.style.display="block";this.d=1}};f.prototype.post=function(){this.d&&this.toggle(1)};return{edit:f}}();TINY.cursor=function(){return{top:function(f){return T$$$()?window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop:f.clientY+window.scrollY}}}();
(function(){$_("fieldset dl").dom.hide();$_("fieldset legend").event.add("click",function(){var f=$_("fieldset dl").dom;"none"==f.css("display").trim()?f.show():f.hide()});$_("button.delete").event.add("click",function(){var f=this.parentNode.id,f=f.split("_");confirm("Are you sure you want to delete this "+f[0]+"? Deleting this item will delete all items under it. There is no undo.")});new TINY.editor.edit("editor",{id:"input",width:450,height:175,cssclass:"te",controlclass:"tecontrol",rowclass:"teheader",
dividerclass:"tedivider",controls:"bold italic underline | subscript superscript | orderedlist unorderedlist | leftalign centeralign rightalign | unformat | undo redo n image hr link unlink | cut copy paste print".split(" "),footer:!0,xhtml:!0,cssfile:"//github.timshomepage.net/meta/assets/css.php/g/css",bodyid:"editor",footerclass:"tefooter",toggle:{text:"source",activetext:"wysiwyg",cssclass:"toggle"},resize:{cssclass:"resize"}})})();