tinymce.AddOnManager

This class handles the loading of themes/plugins or other add-ons and their language packs.

Methods

name summary defined by
add() Adds a instance of the add-on by it's short name. tinymce.AddOnManager
addComponents() Add a set of components that will make up the add-on. Using the url of the add-on name as the base url. This should be used in development mode. A new compressor/javascript munger process will ensure that the components are put together into the plugin.js file and compressed correctly. tinymce.AddOnManager
get() Returns the specified add on by the short name. tinymce.AddOnManager
load() Loads an add-on from a specific url. tinymce.AddOnManager
requireLangPack() Loads a language pack for the specified add-on. tinymce.AddOnManager

Methods

add

add(id:String, addOn:tinymce.Theme):tinymce.Theme, tinymce.Plugin

Adds a instance of the add-on by it's short name.

Examples
// Create a simple plugin
tinymce.create('tinymce.plugins.TestPlugin', {
  TestPlugin: function(ed, url) {
  ed.on('click', function(e) {
     ed.windowManager.alert('Hello World!');
  });
  }
});

// Register plugin using the add method
tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin);

// Initialize TinyMCE
tinymce.init({
 ...
 plugins: '-test' // Init the plugin but don't try to load it
});
Parameters
Return value

addComponents

addComponents(pluginName:String, scripts:Array)

Add a set of components that will make up the add-on. Using the url of the add-on name as the base url. This should be used in development mode. A new compressor/javascript munger process will ensure that the components are put together into the plugin.js file and compressed correctly.

Parameters

get

get(name:String):tinymce.Theme, tinymce.Plugin

Returns the specified add on by the short name.

Parameters
Return value

load

load(name:String, addOnUrl:String, success:function, scope:Object, failure:function)

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
});
Parameters

requireLangPack

requireLangPack(name:String, languages:String)

Loads a language pack for the specified add-on.

Parameters

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.