CoreFiles by mySites.guru
tinymce.min.js4 lines, 2,876 bytes, from Joomla_6.1.2-Stable-Full_Package.zip
Raw History Compare with 6.1.1
md5
9f8d2c0854ed84d3bff28c1cd57556f0
sha1
120eb76bbbd0ffe93fed221e874b2ea9163819ae
sha256
ef409c4c9dc67757247718c4eb3d99cf2059b36feb5ac0c3db4eb8a40a47391e
import{JoomlaEditor as a,JoomlaEditorDecorator as h}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={},y=(o,e,s)=>{f[e.id]&&clearTimeout(f[e.id]),f[e.id]=setTimeout(()=>{o.remove(),a.unregister(e.id),Joomla.JoomlaTinyMCE.setupEditor(e,s)},500)};class k extends h{getValue(){return this.instance.getContent()}setValue(e){return this.instance.setContent(e),this}getSelection(){return this.instance.selection.getContent({format:"text"})}replaceSelection(e){return this.instance.execCommand("mceInsertContent",!1,e),this}disable(e){return this.instance.setMode(e?"design":"readonly"),this}toggle(e){let s=!1;return e||this.instance.isHidden()?(this.instance.show(),s=!0):this.instance.hide(),s}}Joomla.JoomlaTinyMCE={setupEditors:o=>{const e=o||document,s=Joomla.getOptions("plg_editor_tinymce",{});e.querySelectorAll(".js-editor-tinymce").forEach(c=>{const t=c.querySelector("textarea"),r=c.querySelector(".js-tiny-toggler-button"),d=r?r.querySelector(".icon-eye"):!1;Joomla.JoomlaTinyMCE.setupEditor(t,s),r&&r.removeAttribute("disabled"),c.addEventListener("click",g=>{a.setActive(t.id);const i=g.target.closest(".js-tiny-toggler-button"),l=a.getActive();if(i&&l){const n=l.toggle();d&&d.setAttribute("class",n?"icon-eye":"icon-eye-slash")}})})},setupEditor:(o,e)=>{if(a.get(o.id))return;const s=o?o.getAttribute("name").replace(/\[\]|\]/g,"").split("[").pop():"default",m=e?e.tinyMCE||{}:{},c=m.default||{};let t=m[s]?m[s]:c;t.joomlaMergeDefaults?t=Joomla.extend(Joomla.extend({},c),t):t=Joomla.extend({},t),o&&(t.selector=null,t.target=o);const r=t.skin_light,d=t.skin_dark;if(delete t.skin_light,delete t.skin_dark,t.skin=r,"colorSchemeOs"in document.documentElement.dataset){const n=window.matchMedia("(prefers-color-scheme: dark)");t.skin=n.matches?d:r,n.matches&&(t.content_css=t.content_css?`${t.content_css},dark`:"dark")}else document.documentElement.dataset.colorScheme==="dark"&&(t.skin=d,t.content_css=t.content_css?`${t.content_css},dark`:"dark");let g=!1;o&&(g=o.readOnly),t.setup=n=>{n.mode.set(g?"readonly":"design")},t.init_instance_callback=n=>{n.on("submit",()=>{n.isHidden()&&n.show()},!0)};const i=new tinyMCE.Editor(o.id,t,tinymce.EditorManager),l=new k(i,"tinymce",o.id);if(!i.inline){let n=2;const E=()=>{if(n--,n)return;const u=i.getContentAreaContainer().querySelector("iframe");u.contentDocument.readyState!=="complete"?u.onload=()=>{u.onload=null,u.addEventListener("load",()=>y(i,o,e))}:u.addEventListener("load",()=>y(i,o,e))};i.on("load",E),i.on("init",E)}i.on("focus",()=>{a.setActive(l)}),i.render(),a.register(l)}},document.addEventListener("DOMContentLoaded",()=>{Joomla.JoomlaTinyMCE.setupEditors(document)}),document.addEventListener("joomla:updated",({target:o})=>Joomla.JoomlaTinyMCE.setupEditors(o));

The same content is in 30 releases, Joomla 6.0.4 to 6.3.0-alpha1. See them all, or every version of this file.