tinymce.Plugin

Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional.

Examples

// Create a new plugin class
tinymce.create('tinymce.plugins.ExamplePlugin', {
    init : function(ed, url) {
        // Register an example button
        ed.addButton('example', {
            title : 'example.desc',
            onclick : function() {
                 // Display an alert when the user clicks the button
                 ed.windowManager.alert('Hello world!');
            },
            'class' : 'bold' // Use the bold icon from the theme
        });
    }
});

// Register plugin with a short name
tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);

// Initialize TinyMCE with the new plugin and button
tinyMCE.init({
   ...
   plugins : '-example', // - means TinyMCE will not try to load it
   theme_advanced_buttons1 : 'example' // Add the new example button to the toolbar
});

Methods

Method Defined By
Initialization function for the plugin.
tinymce.Plugin
Meta info method, this method gets executed when TinyMCE wants to present information about the plugin for example in th...
tinymce.Plugin
Gets called when a new control instance is created.
tinymce.Plugin