CoreFiles by mySites.guru
tinymce.min.js4 lines, 2,716 bytes, from Joomla_6.1.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 6.0.0-alpha3
md5
8d80d76f0d06d4eab58452fd6a661a79
sha1
84b85dbe056df0b59a70f9ee943d9401e4d1d0fc
sha256
4bc5b58e730a572e40ccc6a8bb38b53c8dd8fe4cf30362abd9e0d98f5aac5b65
import{JoomlaEditor as c,JoomlaEditorDecorator as E}from"editor-api";/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */const f={},h=(o,t,s)=>{f[t.id]&&clearTimeout(f[t.id]),f[t.id]=setTimeout(()=>{o.remove(),c.unregister(t.id),Joomla.JoomlaTinyMCE.setupEditor(t,s)},500)};class k extends E{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 s=!1;return t||this.instance.isHidden()?(this.instance.show(),s=!0):this.instance.hide(),s}}Joomla.JoomlaTinyMCE={setupEditors:o=>{const t=o||document,s=Joomla.getOptions("plg_editor_tinymce",{});t.querySelectorAll(".js-editor-tinymce").forEach(a=>{const e=a.querySelector("textarea"),r=a.querySelector(".js-tiny-toggler-button"),d=r?r.querySelector(".icon-eye"):!1;Joomla.JoomlaTinyMCE.setupEditor(e,s),r&&r.removeAttribute("disabled"),a.addEventListener("click",m=>{c.setActive(e.id);const i=m.target.closest(".js-tiny-toggler-button"),l=c.getActive();if(i&&l){const n=l.toggle();d&&d.setAttribute("class",n?"icon-eye":"icon-eye-slash")}})})},setupEditor:(o,t)=>{if(c.get(o.id))return;const s=o?o.getAttribute("name").replace(/\[\]|\]/g,"").split("[").pop():"default",u=t?t.tinyMCE||{}:{},a=u.default||{};let e=u[s]?u[s]:a;e.joomlaMergeDefaults?e=Joomla.extend(Joomla.extend({},a),e):e=Joomla.extend({},e),o&&(e.selector=null,e.target=o);const r=e.skin_light,d=e.skin_dark;if(delete e.skin_light,delete e.skin_dark,e.skin=r,"colorSchemeOs"in document.documentElement.dataset){const n=window.matchMedia("(prefers-color-scheme: dark)");e.skin=n.matches?d:r,e.content_css=n.matches?"dark":"default"}else document.documentElement.dataset.colorScheme==="dark"&&(e.skin=d,e.content_css="dark");let m=!1;o&&(m=o.readOnly),e.setup=n=>{n.mode.set(m?"readonly":"design")},e.init_instance_callback=n=>{n.on("submit",()=>{n.isHidden()&&n.show()},!0)};const i=new tinyMCE.Editor(o.id,e,tinymce.EditorManager),l=new k(i,"tinymce",o.id);if(!i.inline){let n=!1,g=!1;const y=()=>{i.getContentAreaContainer().querySelector("iframe").addEventListener("load",()=>{h(i,o,t)})};i.on("load",()=>{n=!0,g&&y()}),i.on("PostRender",()=>{g=!0,n&&y()})}i.on("focus",()=>{c.setActive(l)}),i.render(),c.register(l)}},document.addEventListener("DOMContentLoaded",()=>{Joomla.JoomlaTinyMCE.setupEditors(document)}),document.addEventListener("joomla:updated",({target:o})=>Joomla.JoomlaTinyMCE.setupEditors(o));

The same content is in 4 releases, Joomla 6.0.1-rc1 to 6.1.0-alpha1. See them all, or every version of this file.