CKEDITOR.resourceManager
Base class for resource managers, like plugins. This class is not intended to be used out of the CKEditor core code.
Filtering
Properties
basePath : StringCKEDITOR.resourceManager#basePathThe base directory containing all resources.
externals : ObjectCKEDITOR.resourceManager#externalsContains references to all resources that have already been registered with addExternal.
Defaults to
{}fileName : StringCKEDITOR.resourceManager#fileNameThe name used for resource files.
loaded : ObjectCKEDITOR.resourceManager#loadedContains references to all resources that have already been loaded with load.
Defaults to
{}registered : ObjectCKEDITOR.resourceManager#registeredContains references to all resources that have already been registered with add.
Defaults to
{}-
Defaults to
{waitingList: {}}
Methods
constructor( basePath, fileName ) → resourceManagerCKEDITOR.resourceManager#constructorCreates a resourceManager class instance.
Parameters
basePath : StringThe path for the resources folder.
fileName : StringThe name used for resource files.
Returns
resourceManager
add( name, [ definition ] )CKEDITOR.resourceManager#addRegisters a resource.
CKEDITOR.plugins.add( 'sample', { ... plugin definition ... } );Parameters
name : StringThe resource name.
[ definition ] : ObjectThe resource definition. CKEDITOR.pluginDefinition
addExternal( names, path, [ fileName ] )CKEDITOR.resourceManager#addExternalRegisters 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 : StringComma-separated resource names.
path : StringThe path of the folder containing the resource.
[ fileName ] : StringThe resource file name. If not provided and the
pathargument ends with a slash (/), the defaultplugin.jsfilename is used. Otherwise, if not provided and thepathargument does not end with a slash (/) or if an empty string is provided, the function assumes that thepathargument contains the full path.
get( name ) → ObjectCKEDITOR.resourceManager#getGets the definition of a specific resource.
var definition = CKEDITOR.plugins.get( 'sample' );Parameters
name : StringThe resource name.
Returns
ObjectThe registered object.
getFilePath( name ) → StringCKEDITOR.resourceManager#getFilePathGet the file path for a specific loaded resource.
alert( CKEDITOR.plugins.getFilePath( 'sample' ) ); // '<editor path>/plugins/sample/plugin.js'Parameters
name : StringThe resource name.
Returns
String
getPath( name ) → StringCKEDITOR.resourceManager#getPathGet the folder path for a specific loaded resource.
alert( CKEDITOR.plugins.getPath( 'sample' ) ); // '<editor path>/plugins/sample/'Parameters
name : StringThe resource name.
Returns
String
load( name, callback, [ scope ] )CKEDITOR.resourceManager#loadLoads one or more resources.
CKEDITOR.plugins.load( 'myplugin', function( plugins ) { alert( plugins[ 'myplugin' ] ); // object } );Parameters
name : String | ArrayThe name of the resource to load. It may be a string with a single resource name, or an array with several names.
callback : FunctionA function to be called when all resources are loaded. The callback will receive an array containing all loaded names.
[ scope ] : ObjectThe scope object to be used for the callback call.