You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
11 KiB

5 years ago
window.edButtons=[],window.edAddTag=function(){},window.edCheckOpenTags=function(){},window.edCloseAllTags=function(){},window.edInsertImage=function(){},window.edInsertLink=function(){},window.edInsertTag=function(){},window.edLink=function(){},window.edQuickLink=function(){},window.edRemoveTag=function(){},window.edShowButton=function(){},window.edShowLinks=function(){},window.edSpell=function(){},window.edToolbar=function(){},function(){var t,e,r=function(t){var e,n,o,a;"undefined"!=typeof jQuery?jQuery(document).ready(t):((e=r).funcs=[],e.ready=function(){if(!e.isReady)for(e.isReady=!0,n=0;n<e.funcs.length;n++)e.funcs[n]()},e.isReady?t():e.funcs.push(t),e.eventAttached||(document.addEventListener?(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),e.ready()},document.addEventListener("DOMContentLoaded",o,!1),window.addEventListener("load",e.ready,!1)):document.attachEvent&&(o=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",o),e.ready())},document.attachEvent("onreadystatechange",o),window.attachEvent("onload",e.ready),(a=function(){try{document.documentElement.doScroll("left")}catch(t){return void setTimeout(a,50)}e.ready()})()),e.eventAttached=!0))},n=(e=new Date,t=function(t){var e=t.toString();return e.length<2&&(e="0"+e),e},e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"+00:00"),d=window.QTags=function(t){if("string"==typeof t)t={id:t};else if("object"!=typeof t)return!1;var e,n,o,a,i,s=this,l=t.id,u=document.getElementById(l),c="qt_"+l;if(!l||!u)return!1;s.name=c,s.id=l,s.canvas=u,s.settings=t,o="content"!==l||"string"!=typeof adminpage||"post-new-php"!==adminpage&&"post-php"!==adminpage?c+"_toolbar":(window.edCanvas=u,"ed_toolbar"),(e=document.getElementById(o))||((e=document.createElement("div")).id=o,e.className="quicktags-toolbar"),u.parentNode.insertBefore(e,u),s.toolbar=e,n=function(t){var e,n=(t=t||window.event).target||t.srcElement;(n.clientWidth||n.offsetWidth)&&/ ed_button /.test(" "+n.className+" ")&&(s.canvas=u=document.getElementById(l),e=n.id.replace(c+"_",""),s.theButtons[e]&&s.theButtons[e].callback.call(s.theButtons[e],n,u,s))},i=function(){window.wpActiveEditor=l},a=document.getElementById("wp-"+l+"-wrap"),e.addEventListener?(e.addEventListener("click",n,!1),a&&a.addEventListener("click",i,!1)):e.attachEvent&&(e.attachEvent("onclick",n),a&&a.attachEvent("onclick",i)),s.getButton=function(t){return s.theButtons[t]},s.getButtonElement=function(t){return document.getElementById(c+"_"+t)},s.init=function(){r(function(){d._buttonsInit(l)})},s.remove=function(){delete d.instances[l],e&&e.parentNode&&e.parentNode.removeChild(e)},(d.instances[l]=s).init()};function u(t){return(t=(t=t||"").replace(/&([^#])(?![a-z1-4]{1,8};)/gi,"&#038;$1")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}d.instances={},d.getInstance=function(t){return d.instances[t]},d._buttonsInit=function(t){var c=this;function e(t){var e,n,o,a,i,s,l,u;for(l in(i=c.instances[t]).canvas,e=i.name,o={},u=a="",(n=i.settings).buttons&&(u=","+n.buttons+","),edButtons)edButtons[l]&&(s=edButtons[l].id,u&&-1!==",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,".indexOf(","+s+",")&&-1===u.indexOf(","+s+",")||edButtons[l].instance&&edButtons[l].instance!==t||(o[s]=edButtons[l],edButtons[l].html&&(a+=edButtons[l].html(e+"_"))));u&&-1!==u.indexOf(",dfw,")&&(o.dfw=new d.DFWButton,a+=o.dfw.html(e+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(o.textdirection=new d.TextDirectionButton,a+=o.textdirection.html(e+"_")),i.toolbar.innerHTML=a,i.theButtons=o,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[i])}if(t)e(t);else for(t in c.instances)e(t);c.buttonsInitDone=!0},d.addButton=function(t,e,n,o,a,i,s,l,u){var c;if(t&&e){if(s=s||0,o=o||"",u=u||{},"function"==typeof n)(c=new d.Button(t,e,a,i,l,u)).callback=n;else{if("string"!=typeof n)return;c=new d.TagButton(t,e,n,o,a,i,l,u)}if(-1===s)return c;if(0<s){for(;void 0!