JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2
[ckeditor.git] / _source / core / resourcemanager.js
index ebf6be3..a38433e 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -86,7 +86,8 @@ CKEDITOR.resourceManager.prototype =
                if ( this.registered[ name ] )\r
                        throw '[CKEDITOR.resourceManager.add] The resource name "' + name + '" is already registered.';\r
 \r
-               this.registered[ name ] = definition || {};\r
+               CKEDITOR.fire( name + CKEDITOR.tools.capitalize( this.fileName ) + 'Ready',\r
+                               this.registered[ name ] = definition || {} );\r
        },\r
 \r
        /**\r
@@ -126,7 +127,7 @@ CKEDITOR.resourceManager.prototype =
                var external = this.externals[ name ];\r
                return CKEDITOR.getUrl(\r
                                this.getPath( name ) +\r
-                               ( ( external && external.file ) || ( this.fileName + '.js' ) ) );\r
+                               ( ( external && ( typeof external.file == 'string' ) ) ? external.file : this.fileName + '.js' ) );\r
        },\r
 \r
        /**\r
@@ -135,13 +136,17 @@ CKEDITOR.resourceManager.prototype =
         * @param {String} names The resource names, separated by commas.\r
         * @param {String} path The path of the folder containing the resource.\r
         * @param {String} [fileName] The resource file name. If not provided, the\r
-        *              default name is used.\r
+        *              default name is used; If provided with a empty string, will implicitly indicates that {@param path}\r
+        *              is already the full path.\r
         * @example\r
         * // Loads a plugin from '/myplugin/samples/plugin.js'.\r
         * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/' );\r
         * @example\r
         * // Loads a plugin from '/myplugin/samples/my_plugin.js'.\r
         * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/', 'my_plugin.js' );\r
+        * @example\r
+        * // Loads a plugin from '/myplugin/samples/my_plugin.js'.\r
+        * CKEDITOR.plugins.addExternal( 'sample', '/myplugins/sample/my_plugin.js', '' );\r
         */\r
        addExternal : function( names, path, fileName )\r
        {\r