+++ /dev/null
-/*\r
- * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
- * Copyright (C) 2003-2009 Frederico Caldeira Knabben\r
- *\r
- * == BEGIN LICENSE ==\r
- *\r
- * Licensed under the terms of any of the following licenses at your\r
- * choice:\r
- *\r
- * - GNU General Public License Version 2 or later (the "GPL")\r
- * http://www.gnu.org/licenses/gpl.html\r
- *\r
- * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
- * http://www.gnu.org/licenses/lgpl.html\r
- *\r
- * - Mozilla Public License Version 1.1 or later (the "MPL")\r
- * http://www.mozilla.org/MPL/MPL-1.1.html\r
- *\r
- * == END LICENSE ==\r
- *\r
- * FCKIECleanup Class: a generic class used as a tool to remove IE leaks.\r
- */\r
-\r
-var FCKIECleanup = function( attachWindow )\r
-{\r
- // If the attachWindow already have a cleanup object, just use that one.\r
- if ( attachWindow._FCKCleanupObj )\r
- this.Items = attachWindow._FCKCleanupObj.Items ;\r
- else\r
- {\r
- this.Items = new Array() ;\r
-\r
- attachWindow._FCKCleanupObj = this ;\r
- FCKTools.AddEventListenerEx( attachWindow, 'unload', FCKIECleanup_Cleanup ) ;\r
-// attachWindow.attachEvent( 'onunload', FCKIECleanup_Cleanup ) ;\r
- }\r
-}\r
-\r
-FCKIECleanup.prototype.AddItem = function( dirtyItem, cleanupFunction )\r
-{\r
- this.Items.push( [ dirtyItem, cleanupFunction ] ) ;\r
-}\r
-\r
-function FCKIECleanup_Cleanup()\r
-{\r
- if ( !this._FCKCleanupObj || ( FCKConfig.MsWebBrowserControlCompat && !window.FCKUnloadFlag ) )\r
- return ;\r
-\r
- var aItems = this._FCKCleanupObj.Items ;\r
-\r
- while ( aItems.length > 0 )\r
- {\r
-\r
- // It is important to remove from the end to the beginning (pop()),\r
- // because of the order things get created in the editor. In the code,\r
- // elements in deeper position in the DOM are placed at the end of the\r
- // cleanup function, so we must cleanup then first, otherwise IE could\r
- // throw some crazy memory errors (IE bug).\r
- var oItem = aItems.pop() ;\r
- if ( oItem )\r
- oItem[1].call( oItem[0] ) ;\r
- }\r
-\r
- this._FCKCleanupObj = null ;\r
-\r
- if ( CollectGarbage )\r
- CollectGarbage() ;\r
-}\r