tinymce.AddOnManager
This class handles the loading of add-ons and their language packs. ThemeManager and PluginManager are instances of AddOnManager, and manage themes and plugins.
Summary
Methods
add()
add(id: String, addOn: tinymce.Theme | tinymce.Plugin): tinymce.Theme | tinymce.Plugin
Adds a instance of the add-on by it’s short name.
Examples
// Create a simple plugin
const TestPlugin = (ed, url) => {
ed.on('click', (e) => {
ed.windowManager.alert('Hello World!');
});
};
// Register plugin using the add method
tinymce.PluginManager.add('test', TestPlugin);
// Initialize TinyMCE
tinymce.init({
...
plugins: '-test' // Init the plugin but don't try to load it
});
get()
get(name: String): tinymce.Theme | tinymce.Plugin
Returns the specified add on by the short name.
load()
load(name: String, addOnUrl: String): Promise
Loads an add-on from a specific url.
Examples
// Loads a plugin from an external URL
tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js');
// Initialize TinyMCE
tinymce.init({
...
plugins: '-myplugin' // Don't try to load it again
});