浏览代码

Made the dev version of CKEDITOR override the core one through module loading so the "ckeditor" module can be properly called from outside.

fredck 11 年之前
父节点
当前提交
e0ebc2c70c
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      ckeditor.js

+ 10 - 6
ckeditor.js

@@ -57,20 +57,24 @@
 		}
 	};
 
-	// Basic Require.js configuration.
+	// Basic Require.js configuration for the dev version.
 	requirejs.config( {
 		// Modules are generally relative to the core project.
 		baseUrl: CKEDITOR.basePath + 'node_modules/ckeditor5-core/src/',
 		paths: {
+			// Hide the core "ckeditor" under a different name.
+			"ckeditor-core": CKEDITOR.basePath + 'node_modules/ckeditor5-core/src/ckeditor',
+
 			// The RequireJS "plugin" plugin.
-			plugin: CKEDITOR.basePath + 'src/plugin'
+			"plugin": CKEDITOR.basePath + 'src/plugin'
 		}
 	} );
 
-	// Load the core CKEDITOR object and extend/override some of its methods with the above.
-	CKEDITOR.require( [ 'ckeditor', 'utils' ], function( CKEDITOR, utils ) {
-		utils.extend( CKEDITOR, root.CKEDITOR );
-		root.CKEDITOR = CKEDITOR;
+	// Define a new "ckeditor" module, which override the core one with dev version stuff.
+	define( 'ckeditor', [ 'ckeditor-core', 'utils' ], function( core, utils ) {
+		utils.extend( core, root.CKEDITOR );
+		root.CKEDITOR = core;
+		return core;
 	} );
 
 	function getBasePath() {