• Jump To … +
    Arte.js Commands.js Configuration.js PluginManager.js TextArea.js Util.js jquery-dom-cleanup.js jquery-dom-manipulation.js jquery-dom-traversal.js rangy-blockElementApplier.js rangy-elementApplierOptions.js rangy-extensions.js rangy-inlineElementApplier.js richtextCommandApplier.js InsertCommand.js StateDetector.js UndoManager.js keyboardEventHandler.js pasteHandler.js Button.js ButtonWithDialog.js ButtonWithDropDown.js Configuration.js SelectionManager.js toolbar.js
  • PluginManager.js

  • ¶
    /**
     * @fileoverview manages the plugins for Arte
     */
    (function($) {
        $.Arte = $.Arte || {};
        $.Arte.pluginManager = {
            plugins: {},
            /**
             * Register a plugin
             * @param {string} name of the plugin
             * @param {function} constructor function of the plugin
             */
            register: function(name, plugin) {
                this.plugins[name] = plugin;
            },
            /*
             * Initializes the plugin
             * @param {Arte} an instance of Arte
             */
            init: function(richTextEditor) {
                richTextEditor.pluginInstances = richTextEditor.pluginInstances || [];
                for (var pluginName in this.plugins) {
                    var pluginInstanse = new this.plugins[pluginName]();
                    pluginInstanse.init(richTextEditor);
                    richTextEditor.pluginInstances.push(pluginInstanse);
                }
            }
        };
    })(jQuery);