Opened 11 years ago

Closed 11 years ago

#2458 closed New Feature (fixed)

V3: Plugins

Reported by: Frederico Caldeira Knabben Owned by: Frederico Caldeira Knabben
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: Confirmed V3ProtoCore Review+ Cc:

Description

The CKEditor prototype is strongly based on plugins. The intention is reducing the core code to the minimum, leaving all other features isolated on plugins. It makes it possible to create customized distributions containing only specific sets of features.

When the instance is created, all plugins listed in the <instance>.config.plugins setting are downloaded. Each plugin should call the CKEDITOR.plugins.add() function to register its "plugin definition". This definition is an object containing properties, as documented in the "core/plugindefinition.js" file.

As soon as all plugins are downloaded, the "beforeInit" and "init" function in their definitions are called, passing the editor instance to them. In this way, each plugin can make instance manipulations.

Each plugin is downloaded once, and shared among all instances. But, the "beforeInit" and "init" functions are only called for those instances which have the plugin defined in the settings. The plugins download and caching is managed by the CKEDITOR.resourceManager class (core/resourcemanager.js), which is used also by the theme system, and in the future by the adapters.

All plugins are downloaded from the "plugins" folder. The plugin name in the settings must match the plugin folder name. Each plugin must have the plugin.js file defined.

It is possible to configure the editor to download plugins from other folders. This can be done inpage, or in the custom configuration file, by calling the CKEDITOR.plugins.addExternal function. For example:

CKEDITOR.plugins.addExternal( 'myplugin', '/customplugin/' );

In the above case, if an instance uses the "myplugin" plugin, the "/customplugin/plugin.js" file will be downloaded.

Plugins may have dependencies which can be expressed by the "requires" property in their definitions. All required plugins are downloaded and executed. Check the "htmldataprocessor" for an example.

Change History (3)

comment:1 Changed 11 years ago by Frederico Caldeira Knabben

Keywords: Review? added
Owner: set to Frederico Caldeira Knabben
Status: newassigned

comment:2 Changed 11 years ago by Martin Kou

Keywords: Review+ added; Review? removed

comment:3 Changed 11 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy