JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.2
[ckeditor.git] / _source / core / ckeditor.js
index 85da621..068da31 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
@@ -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
@@ -94,3 +104,10 @@ CKEDITOR.TRISTATE_OFF = 2;
  * @example\r
  */\r
 CKEDITOR.TRISTATE_DISABLED = 0;\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
+ */\r