2014-10-13 01:12:19 +02:00
|
|
|
function quicktags(a){return new QTags(a)}function edInsertContent(a,b){return QTags.insertContent(b)}function edButton(a,b,c,d,e){return QTags.addButton(a,b,c,d,e,"",-1)}var QTags,edCanvas,edButtons=[],edAddTag=function(){},edCheckOpenTags=function(){},edCloseAllTags=function(){},edInsertImage=function(){},edInsertLink=function(){},edInsertTag=function(){},edLink=function(){},edQuickLink=function(){},edRemoveTag=function(){},edShowButton=function(){},edShowLinks=function(){},edSpell=function(){},edToolbar=function(){};!function(){var a,b=function(a){var c,d,e,f;"undefined"!=typeof jQuery?jQuery(document).ready(a):(c=b,c.funcs=[],c.ready=function(){if(!c.isReady)for(c.isReady=!0,d=0;d<c.funcs.length;d++)c.funcs[d]()},c.isReady?a():c.funcs.push(a),c.eventAttached||(document.addEventListener?(e=function(){document.removeEventListener("DOMContentLoaded",e,!1),c.ready()},document.addEventListener("DOMContentLoaded",e,!1),window.addEventListener("load",c.ready,!1)):document.attachEvent&&(e=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",e),c.ready())},document.attachEvent("onreadystatechange",e),window.attachEvent("onload",c.ready),(f=function(){try{document.documentElement.doScroll("left")}catch(a){return void setTimeout(f,50)}c.ready()})()),c.eventAttached=!0))},c=function(){var a,b=new Date;return a=function(a){var b=a.toString();return b.length<2&&(b="0"+b),b},b.getUTCFullYear()+"-"+a(b.getUTCMonth()+1)+"-"+a(b.getUTCDate())+"T"+a(b.getUTCHours())+":"+a(b.getUTCMinutes())+":"+a(b.getUTCSeconds())+"+00:00"}();a=QTags=function(c){if("string"==typeof c)c={id:c};else if("object"!=typeof c)return!1;var d,e,f,g=this,h=c.id,i=document.getElementById(h),j="qt_"+h;return h&&i?(g.name=j,g.id=h,g.canvas=i,g.settings=c,"content"!==h||"string"!=typeof adminpage||"post-new-php"!==adminpage&&"post-php"!==adminpage?f=j+"_toolbar":(edCanvas=i,f="ed_toolbar"),d=document.createElement("div"),d.id=f,d.className="quicktags-toolbar",d.onclick=function(){window.wpActiveEditor=h},i.parentNode.insertBefore(d,i),g.toolbar=d,e=function(a){a=a||window.event;var b,c=a.target||a.srcElement,d=c.clientWidth||c.offsetWidth;d&&/ ed_button /.test(" "+c.className+" ")&&(g.canvas=i=document.getElementById(h),b=c.id.replace(j+"_",""),g.theButtons[b]&&g.theButtons[b].callback.call(g.theButtons[b],c,i,g))},d.addEventListener?d.addEventListener("click",e,!1):d.attachEvent&&d.attachEvent("onclick",e),g.getButton=function(a){return g.theButtons[a]},g.getButtonElement=function(a){return document.getElementById(j+"_"+a)},a.instances[h]=g,void(a.instances[0]||(a.instances[0]=a.instances[h],b(function(){a._buttonsInit()})))):!1},a.instances={},a.getInstance=function(b){return a.instances[b]},a._buttonsInit=function(){var b,c,d,e,f,g,h,i,j,k,l=this,m=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";for(g in l.instances)if(0!==g){h=l.instances[g],b=h.canvas,c=h.name,d=h.settings,f="",e={},k="",d.buttons&&(k=","+d.buttons+",");for(j in edButtons)edButtons[j]&&(i=edButtons[j].id,k&&-1!==m.indexOf(","+i+",")&&-1===k.indexOf(","+i+",")||edButtons[j].instance&&edButtons[j].instance!==g||(e[i]=edButtons[j],edButtons[j].html&&(f+=edButtons[j].html(c+"_"))));k&&-1!==k.indexOf(",fullscreen,")&&(e.fullscreen=new a.FullscreenButton,f+=e.fullscreen.html(c+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(e.textdirection=new a.TextDirectionButton,f+=e.textdirection.html(c+"_")),h.toolbar.innerHTML=f,h.theButtons=e}l.buttonsInitDone=!0},a.addButton=function(b,c,d,e,f,g,h,i){var j;if(b&&c){if(h=h||0,e=e||"","function"==typeof d)j=new a.Button(b,c,f,g,i),j.callback=d;else{if("string"!=typeof d)return;j=new a.TagButton(b,c,d,e,f,g,i)}if(-1===h)return j;if(h>0){for(;"undefined"!=typeof edButtons[h];)h++;edButtons[h]=j}else edButtons[edButtons.length]=j;this.buttonsInitDone&&this._buttonsInit()}},a.insertContent=function(a){var b,c,d,e,f,g=document.getElementById(wpActiveEditor);return g?(document.selection?(g.focus(),b=document.selection.createRange(),b.text=a,g.focus()):g.selectionStart||0===g.selectionStart?(f=g.value,c=g
|