芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.9/plg_editors_tinymce/js/tinymce.min.js
((e,t,n,i)=>{t.JoomlaTinyMCE={setupEditors:e=>{const n=e||i,o=t.getOptions?t.getOptions("plg_editor_tinymce",{}):t.optionsStorage.plg_editor_tinymce||{};[].slice.call(n.querySelectorAll(".js-editor-tinymce")).forEach((e=>{const n=e.querySelector("textarea"),i=e.querySelector(".js-tiny-toggler-button"),s=e.querySelector(".icon-eye");t.JoomlaTinyMCE.setupEditor(n,o),i&&(i.removeAttribute("disabled"),i.addEventListener("click",(()=>{t.editors.instances[n.id].instance.isHidden()?(s.setAttribute("class","icon-eye"),t.editors.instances[n.id].instance.show()):(s.setAttribute("class","icon-eye-slash"),t.editors.instances[n.id].instance.hide())})))}))},setupEditor:(n,o)=>{if(t.editors.instances[n.id])return;const s=n?n.getAttribute("name").replace(/\[\]|\]/g,"").split("[").pop():"default",c=o&&o.tinyMCE||{},a=c.default||{};let d=c[s]?c[s]:a;d=d.joomlaMergeDefaults?t.extend(t.extend({},a),d):t.extend({},d),n&&(d.selector=null,d.target=n);const l=[],r=Object.keys(d.joomlaExtButtons.names).map((e=>d.joomlaExtButtons.names[e])),u={joomla:'
'};r.forEach((e=>{const t={};t.text=e.name,t.icon=e.icon,t.type="menuitem",e.iconSVG&&(u[t.icon]=e.iconSVG),e.href?t.onAction=()=>{i.getElementById(`${e.id}_modal`).open()}:t.onAction=()=>{new Function(e.click)()},l.push(t)}));let m=!1;n&&(m=n.readOnly),l.length?d.setup=e=>{e.settings.readonly=m,Object.keys(u).forEach((t=>{e.ui.registry.addIcon(t,u[t])})),e.ui.registry.addMenuButton("jxtdbuttons",{text:t.Text._("PLG_TINY_CORE_BUTTONS"),icon:"joomla",fetch:e=>e(l)})}:d.setup=e=>{e.settings.readonly=m},d.init_instance_callback=e=>{e.on("submit",(()=>{e.isHidden()&&e.show()}),!0)};const y=new e.Editor(n.id,d,tinymce.EditorManager);y.render(),t.editors.instances[n.id]={getValue:()=>t.editors.instances[n.id].instance.getContent(),setValue:e=>t.editors.instances[n.id].instance.setContent(e),getSelection:()=>t.editors.instances[n.id].instance.selection.getContent({format:"text"}),replaceSelection:e=>t.editors.instances[n.id].instance.execCommand("mceInsertContent",!1,e),disable:e=>t.editors.instances[n.id].instance.setMode(e?"readonly":"design"),id:n.id,instance:y}}},i.addEventListener("DOMContentLoaded",(()=>{t.JoomlaTinyMCE.setupEditors(i)})),i.addEventListener("joomla:updated",(({target:e})=>t.JoomlaTinyMCE.setupEditors(e)))})(window.tinyMCE,Joomla,window,document);