CKEDITOR.plugins
Manages plugins registration and loading.
Note This object is an instance of CKEDITOR.resourceManager.
Filtering
Properties
-
The base directory containing all resources.
-
Contains references to all resources that have already been registered with addExternal.
Defaults to
{}
-
The name used for resource files.
-
Contains references to all resources that have already been loaded with load.
Defaults to
{}
-
The namespace containing a set of Page Break plugin helpers.
-
Contains references to all resources that have already been registered with add.
Defaults to
{}
-
A set of helper methods for the Widget Selection plugin.
-
Defaults to
{waitingList: {}}
-
Methods
-
constructor( basePath, fileName ) → resourceManager
CKEDITOR.plugins#constructor
Creates a resourceManager class instance.
Parameters
basePath : String
The path for the resources folder.
fileName : String
The name used for resource files.
Returns
resourceManager
-
Registers a resource.
CKEDITOR.plugins.add( 'sample', { ... plugin definition ... } );
Parameters
name : String
The resource name.
[ definition ] : Object
The resource definition. CKEDITOR.pluginDefinition
-
Registers one or more resources to be loaded from an external path instead of the core base path.
// Loads a plugin from '/myplugins/sample/plugin.js'. CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' ); // Loads a plugin from '/myplugins/sample/my_plugin.js'. CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/', 'my_plugin.js' ); // Loads a plugin from '/myplugins/sample/my_plugin.js'. CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/my_plugin.js', '' ); // Loads a plugin from '/myplugins/sample/my_plugin.js'. CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/my_plugin.js' );
Parameters
names : String
Comma-separated resource names.
path : String
The path of the folder containing the resource.
[ fileName ] : String
The resource file name. If not provided and the
path
argument ends with a slash (/
), the defaultplugin.js
filename is used. Otherwise, if not provided and thepath
argument does not end with a slash (/
) or if an empty string is provided, the function assumes that thepath
argument contains the full path.
-
Gets the definition of a specific resource.
var definition = CKEDITOR.plugins.get( 'sample' );
Parameters
name : String
The resource name.
Returns
Object
The registered object.
-
Get the file path for a specific loaded resource.
alert( CKEDITOR.plugins.getFilePath( 'sample' ) ); // '<editor path>/plugins/sample/plugin.js'
Parameters
name : String
The resource name.
Returns
String
-
Get the folder path for a specific loaded resource.
alert( CKEDITOR.plugins.getPath( 'sample' ) ); // '<editor path>/plugins/sample/'
Parameters
name : String
The resource name.
Returns
String
-
Loads one or more resources.
CKEDITOR.plugins.load( 'myplugin', function( plugins ) { alert( plugins[ 'myplugin' ] ); // object } );
Parameters
name : String | Array
The name of the resource to load. It may be a string with a single resource name, or an array with several names.
callback : Function
A function to be called when all resources are loaded. The callback will receive an array containing all loaded names.
[ scope ] : Object
The scope object to be used for the callback call.
-
setLang( pluginName, languageCode, languageEntries )
CKEDITOR.plugins#setLang
Loads a specific language file, or auto detect it. A callback is then called when the file gets loaded.
CKEDITOR.plugins.setLang( 'myPlugin', 'en', { title: 'My plugin', selectOption: 'Please select an option' } );
Parameters
pluginName : String
The name of the plugin to which the provided translation should be attached.
languageCode : String
The code of the language translation provided.
languageEntries : Object
An object that contains pairs of label and the respective translation.