CoreFiles by mySites.guru
tinymce.min.js1 lines, 4,451 bytes, from Joomla_5.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 4.4.0-beta3
md5
9bd439c2295e75e265aafaa1319949ae
sha1
91436844b300bd66fb0fdc2142f5aef85cd23f1b
sha256
900c40a0ca01ff143937fa0e9f269fa584df43ff7a6408c310faa1e4bbd12ae7
import{JoomlaEditor,JoomlaEditorDecorator,JoomlaEditorButton}from"editor-api";const reInitQueue={},debounceReInit=(t,e,o)=>{reInitQueue[e.id]&&clearTimeout(reInitQueue[e.id]),reInitQueue[e.id]=setTimeout((()=>{t.remove(),JoomlaEditor.unregister(e.id),Joomla.JoomlaTinyMCE.setupEditor(e,o)}),500)};class TinyMCEDecorator extends JoomlaEditorDecorator{getValue(){return this.instance.getContent()}setValue(t){return this.instance.setContent(t),this}getSelection(){return this.instance.selection.getContent({format:"text"})}replaceSelection(t){return this.instance.execCommand("mceInsertContent",!1,t),this}disable(t){return this.instance.setMode(t?"design":"readonly"),this}toggle(t){let e=!1;return t||this.instance.isHidden()?(this.instance.show(),e=!0):this.instance.hide(),e}}Joomla.JoomlaTinyMCE={setupEditors:t=>{const e=t||document,o=Joomla.getOptions("plg_editor_tinymce",{});e.querySelectorAll(".js-editor-tinymce").forEach((t=>{const e=t.querySelector("textarea"),n=t.querySelector(".js-tiny-toggler-button"),i=n.querySelector(".icon-eye");Joomla.JoomlaTinyMCE.setupEditor(e,o),n&&n.removeAttribute("disabled"),t.addEventListener("click",(t=>{JoomlaEditor.setActive(e.id);const o=t.target.closest(".js-tiny-toggler-button"),n=JoomlaEditor.getActive();if(o&&n){const t=n.toggle();i&&i.setAttribute("class",t?"icon-eye":"icon-eye-slash")}}))}))},setupEditor:(t,e)=>{if(JoomlaEditor.get(t.id))return;const o=t?t.getAttribute("name").replace(/\[\]|\]/g,"").split("[").pop():"default",n=e&&e.tinyMCE||{},i=n.default||{};let r=n[o]?n[o]:i;r=r.joomlaMergeDefaults?Joomla.extend(Joomla.extend({},i),r):Joomla.extend({},r),t&&(r.selector=null,r.target=t);const a=[],s=Object.keys(r.joomlaExtButtons.names).map((t=>r.joomlaExtButtons.names[t])),c={joomla:'<svg viewBox="0 0 32 32" width="24" height="24"><path d="M8.313 8.646c1.026-1.026 2.688-1.026 3.713-0.001l0.245 0.246 3.159-3.161-0.246-0.246c-1.801-1.803-4.329-2.434-6.638-1.891-0.331-2.037-2.096-3.591-4.224-3.592-2.364 0-4.28 1.92-4.28 4.286 0 2.042 1.425 3.75 3.333 4.182-0.723 2.42-0.133 5.151 1.776 7.062l7.12 7.122 3.156-3.163-7.119-7.121c-1.021-1.023-1.023-2.691 0.006-3.722zM31.96 4.286c0-2.368-1.916-4.286-4.281-4.286-2.164 0-3.952 1.608-4.24 3.695-2.409-0.708-5.118-0.109-7.020 1.794l-7.12 7.122 3.159 3.162 7.118-7.12c1.029-1.030 2.687-1.028 3.709-0.006 1.025 1.026 1.025 2.691-0.001 3.717l-0.244 0.245 3.157 3.164 0.246-0.248c1.889-1.893 2.49-4.586 1.8-6.989 2.098-0.276 3.717-2.074 3.717-4.25zM28.321 23.471c0.566-2.327-0.062-4.885-1.878-6.703l-7.109-7.125-3.159 3.16 7.11 7.125c1.029 1.031 1.027 2.691 0.006 3.714-1.025 1.025-2.688 1.025-3.714-0.001l-0.243-0.243-3.156 3.164 0.242 0.241c1.922 1.925 4.676 2.514 7.105 1.765 0.395 1.959 2.123 3.431 4.196 3.431 2.363 0 4.28-1.917 4.28-4.285 0-2.163-1.599-3.952-3.679-4.244zM19.136 16.521l-7.111 7.125c-1.022 1.024-2.689 1.026-3.717-0.004-1.026-1.028-1.026-2.691-0.001-3.718l0.244-0.243-3.159-3.16-0.242 0.241c-1.836 1.838-2.455 4.432-1.858 6.781-1.887 0.446-3.292 2.145-3.292 4.172-0.001 2.367 1.917 4.285 4.281 4.285 2.034-0.001 3.737-1.419 4.173-3.324 2.334 0.58 4.906-0.041 6.729-1.867l7.109-7.124-3.157-3.163z"></path></svg>'};s.forEach((e=>{const o={};o.text=e.name,o.icon=e.icon,o.type="menuitem",e.iconSVG&&(c[o.icon]=e.iconSVG),o.onAction=()=>{JoomlaEditor.setActive(t.id),e.action?JoomlaEditorButton.runAction(e.action,e.options||{}):e.bsModal?document.getElementById(`${e.id}_modal`).open():e.click&&new Function(e.click)()},a.push(o)}));let l=!1;t&&(l=t.readOnly),a.length?r.setup=t=>{t.mode.set(l?"readonly":"design"),Object.keys(c).forEach((e=>{t.ui.registry.addIcon(e,c[e])})),t.ui.registry.addMenuButton("jxtdbuttons",{text:Joomla.Text._("PLG_TINY_CORE_BUTTONS"),icon:"joomla",fetch:t=>t(a)})}:r.setup=t=>{t.mode.set(l?"readonly":"design")},r.init_instance_callback=t=>{t.on("submit",(()=>{t.isHidden()&&t.show()}),!0)};const d=new tinyMCE.Editor(t.id,r,tinymce.EditorManager),m=new TinyMCEDecorator(d,"tinymce",t.id);if(!d.inline){let o=!1,n=!1;const i=()=>{d.getContentAreaContainer().querySelector("iframe").addEventListener("load",(()=>{debounceReInit(d,t,e)}))};d.on("load",(()=>{o=!0,n&&i()})),d.on("PostRender",(()=>{n=!0,o&&i()}))}d.on("focus",(()=>{JoomlaEditor.setActive(m)})),d.render(),JoomlaEditor.register(m)}},document.addEventListener("DOMContentLoaded",(()=>{Joomla.JoomlaTinyMCE.setupEditors(document)})),document.addEventListener("joomla:updated",(({target:t})=>Joomla.JoomlaTinyMCE.setupEditors(t)));

No other release has this exact content. See every version of this file.