JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / core / ckeditor.js
index 1faddd2..59f76b7 100644 (file)
@@ -69,6 +69,16 @@ CKEDITOR.remove = function( editor )
        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
@@ -96,8 +106,28 @@ CKEDITOR.TRISTATE_OFF = 2;
 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