CoreFiles by mySites.guru
editor-api.min.js1 lines, 1,758 bytes, from Joomla_5.0.0-Stable-Full_Package.zip
Raw History Compare with 4.4.14
md5
5fa80553e3ae913a9da146ced9d47251
sha1
752aa7a6798a6643037a59ff4333d50f4f54879e
sha256
93e3276efc3ecf18f759434e41b169df404aaa0457ce8a5fe78236321d80c829
import JoomlaEditorDecorator from"editor-decorator";export{default as JoomlaEditorDecorator}from"editor-decorator";const JoomlaEditor={instances:{},active:null,register(t){if(!(t instanceof JoomlaEditorDecorator))throw new Error("Unexpected editor instance");return this.instances[t.getId()]=t,Joomla.editors.instances[t.getId()]=t,this},unregister(t){let e;if(t instanceof JoomlaEditorDecorator)e=t.getId();else{if("string"!=typeof t)throw new Error("Unexpected editor instance or identifier");e=t}return this.active&&this.active===this.instances[e]&&(this.active=null),delete this.instances[e],delete Joomla.editors.instances[e],this},get(t){return this.instances[t]||!1},setActive(t){if(t instanceof JoomlaEditorDecorator)this.active=t;else{if(!this.instances[t])throw new Error("The editor instance not found or it is incorrect");this.active=this.instances[t]}return this},getActive(){return this.active}},JoomlaEditorButton={actions:{},registerAction(t,e){if(!t||!e)throw new Error("Missed values for Action registration");if(!(e instanceof Function))throw new Error(`Unexpected handler for action "${t}", expecting Function`);return this.actions[t]=e,this},getActionHandler(t){return this.actions[t]||!1},runAction(t,e,o){const i=this.getActionHandler(t);let r=JoomlaEditor.getActive();if(!i)throw new Error(`Handler for "${t}" action not found`);if(!r&&o){const t=o.closest("fieldset, div:not(.editor-xtd-buttons)"),e=!!t&&t.querySelector("textarea[id]");r=!(!e||!Joomla.editors.instances[e.id])&&Joomla.editors.instances[e.id],r&&console.warn("Legacy editors is deprecated. Set active editor instance with JoomlaEditor.setActive().")}if(!r)throw new Error("An active editor are not available");return i(r,e)}};export{JoomlaEditor,JoomlaEditorButton};

The same content is in 6 releases, Joomla 5.0.0-beta1 to 5.0.0. See them all, or every version of this file.