Mimimum syndical pour en faire un produit zope / cmf.
[ckeditor.git] / skins / ckeditor / _source / core / ckeditor.js
diff --git a/skins/ckeditor/_source/core/ckeditor.js b/skins/ckeditor/_source/core/ckeditor.js
new file mode 100644 (file)
index 0000000..201c195
--- /dev/null
@@ -0,0 +1,141 @@
+/*\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+For licensing, see LICENSE.html or http://ckeditor.com/license\r
+*/\r
+\r
+/**\r
+ * @fileOverview Contains the third and last part of the {@link CKEDITOR} object\r
+ *             definition.\r
+ */\r
+\r
+// Remove the CKEDITOR.loadFullCore reference defined on ckeditor_basic.\r
+delete CKEDITOR.loadFullCore;\r
+\r
+/**\r
+ * Holds references to all editor instances created. The name of the properties\r
+ * in this object correspond to instance names, and their values contains the\r
+ * {@link CKEDITOR.editor} object representing them.\r
+ * @type {Object}\r
+ * @example\r
+ * alert( <b>CKEDITOR.instances</b>.editor1.name );  // "editor1"\r
+ */\r
+CKEDITOR.instances = {};\r
+\r
+/**\r
+ * The document of the window holding the CKEDITOR object.\r
+ * @type {CKEDITOR.dom.document}\r
+ * @example\r
+ * alert( <b>CKEDITOR.document</b>.getBody().getName() );  // "body"\r
+ */\r
+CKEDITOR.document = new CKEDITOR.dom.document( document );\r
+\r
+/**\r
+ * Adds an editor instance to the global {@link CKEDITOR} object. This function\r
+ * is available for internal use mainly.\r
+ * @param {CKEDITOR.editor} editor The editor instance to be added.\r
+ * @example\r
+ */\r
+CKEDITOR.add = function( editor )\r
+{\r
+       CKEDITOR.instances[ editor.name ] = editor;\r
+\r
+       editor.on( 'focus', function()\r
+               {\r
+                       if ( CKEDITOR.currentInstance != editor )\r
+                       {\r
+                               CKEDITOR.currentInstance = editor;\r
+                               CKEDITOR.fire( 'currentInstance' );\r
+                       }\r
+               });\r
+\r
+       editor.on( 'blur', function()\r
+               {\r
+                       if ( CKEDITOR.currentInstance == editor )\r
+                       {\r
+                               CKEDITOR.currentInstance = null;\r
+                               CKEDITOR.fire( 'currentInstance' );\r
+                       }\r
+               });\r
+};\r
+\r
+/**\r
+ * Removes an editor instance from the global {@link CKEDITOR} object. This function\r
+ * is available for internal use only. External code must use {@link CKEDITOR.editor.prototype.destroy}\r
+ * to avoid memory leaks.\r
+ * @param {CKEDITOR.editor} editor The editor instance to be removed.\r
+ * @example\r
+ */\r
+CKEDITOR.remove = function( editor )\r
+{\r
+       delete CKEDITOR.instances[ editor.name ];\r
+};\r
+\r
+/**\r
+ * Perform global clean up to free as much memory as possible\r
+ * when there are no instances left\r
+ */\r
+CKEDITOR.on( 'instanceDestroyed', function ()\r
+       {\r
+               if ( CKEDITOR.tools.isEmpty( this.instances ) )\r
+                       CKEDITOR.fire( 'reset' );\r
+       });\r
+\r
+// Load the bootstrap script.\r
+CKEDITOR.loader.load( 'core/_bootstrap' );             // @Packager.RemoveLine\r
+\r
+// Tri-state constants.\r
+\r
+/**\r
+ * Used to indicate the ON or ACTIVE state.\r
+ * @constant\r
+ * @example\r
+ */\r
+CKEDITOR.TRISTATE_ON = 1;\r
+\r
+/**\r
+ * Used to indicate the OFF or NON ACTIVE state.\r
+ * @constant\r
+ * @example\r
+ */\r
+CKEDITOR.TRISTATE_OFF = 2;\r
+\r
+/**\r
+ * Used to indicate DISABLED state.\r
+ * @constant\r
+ * @example\r
+ */\r
+CKEDITOR.TRISTATE_DISABLED = 0;\r
+\r
+/**\r
+ * The editor which is currently active (have user focus).\r
+ * @name CKEDITOR.currentInstance\r
+ * @type CKEDITOR.editor\r
+ * @see CKEDITOR#currentInstance\r
+ * @example\r
+ * function showCurrentEditorName()\r
+ * {\r
+ *     if ( CKEDITOR.currentInstance )\r
+ *         alert( CKEDITOR.currentInstance.name );\r
+ *     else\r
+ *         alert( 'Please focus an editor first.' );\r
+ * }\r
+ */\r
+\r
+/**\r
+ * Fired when the CKEDITOR.currentInstance object reference changes. This may\r
+ * happen when setting the focus on different editor instances in the page.\r
+ * @name CKEDITOR#currentInstance\r
+ * @event\r
+ * var editor;  // Variable to hold a reference to the current editor.\r
+ * CKEDITOR.on( 'currentInstance' , function( e )\r
+ *     {\r
+ *         editor = CKEDITOR.currentInstance;\r
+ *     });\r
+ */\r
+\r
+/**\r
+ * Fired when the last instance has been destroyed. This event is used to perform\r
+ * global memory clean up.\r
+ * @name CKEDITOR#reset\r
+ * @event\r
+ */\r