Browse Source

Exposed the AMD API through the CKEDITOR namespace.

fredck 11 years ago
parent
commit
a23bda8975
1 changed files with 29 additions and 1 deletions
  1. 29 1
      ckeditor.js

+ 29 - 1
ckeditor.js

@@ -3,7 +3,7 @@
  * For licensing, see LICENSE.md.
  */
 
-/* global requirejs */
+/* global requirejs, define, require, window */
 
 'use strict';
 
@@ -12,3 +12,31 @@ requirejs.config( {
 	// Modules are generally relative to the core project.
 	baseUrl: '../node_modules/ckeditor-core/src/'
 } );
+
+( function( root ) {
+	if ( root.CKEDITOR ) {
+		return;
+	}
+
+	/**
+	 * The API entry point. It exposes the basic features necessary to integrate and extend CKEditor.
+	 * @class CKEDITOR
+	 * @singleton
+	 */
+	var CKEDITOR = root.CKEDITOR = {};
+
+	/**
+	 * Defines an AMD module.
+	 *
+	 * See https://github.com/ckeditor/ckeditor5-design/wiki/AMD for more details about our AMD API.
+	 */
+	CKEDITOR.define = CKEDITOR.define || define;
+
+	/**
+	 * Retrieves one or more AMD modules. Note that the CKEditor AMD API doesn't download modules on demand so be sure
+	 * to have their relative scripts available in the page.
+	 *
+	 * See https://github.com/ckeditor/ckeditor5-design/wiki/AMD for more details about our AMD API.
+	 */
+	CKEDITOR.require = CKEDITOR.require || require;
+} )( window );