Added feature #14067: htmlARea RTE: Eliminate namespace pollution
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Apr 2010 05:49:17 +0000 (05:49 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Apr 2010 05:49:17 +0000 (05:49 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7300 709f56b5-9817-0410-a4d7-c38de5d9e867

33 files changed:
ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/AboutEditor/about-editor.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockStyle/block-style.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CharacterMap/character-map.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultImage/default-image.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/default-inline.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultLink/default-link.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefinitionList/definition-list.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/EditorMode/editor-mode.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/FindReplace/find-replace.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InlineElements/inline-elements.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/InsertSmiley/insert-smiley.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/QuickTag/quick-tag.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectFont/select-font.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SpellChecker/spell-checker.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Color/typo3color.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Image/typo3image.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextIndicator/text-indicator.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextStyle/text-style.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UndoRedo/undo-redo.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/UserElements/user-elements.js

index e6d3045..6cc207d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Fixed bug #14062: Text Content element crashes (thanks to Jigal van Hemert)
        * Fixed bug #10629: class and title parameters of typolinks get broken
        * Fixed bug #14066: htmlArea RTE: Erratic handling of oncut and onpaste events
+       * Added feature #14067: htmlARea RTE: Eliminate namespace pollution
 
 2010-04-11  Francois Suter  <francois@typo3.org>
 
index f2d303c..1f8a255 100644 (file)
@@ -2,6 +2,7 @@
 
        * Fixed bug #14062: Text Content element crashes (thanks to Jigal van Hemert
        * Fixed bug #14066: htmlArea RTE: Erratic handling of oncut and onpaste events
+       * Added feature #14067: htmlARea RTE: Eliminate namespace pollution
 
 2010-04-10  Stanislas Rolland  <typo3@sjbr.ca>
 
index 723079b..8581441 100644 (file)
@@ -2502,6 +2502,46 @@ HTMLArea.Editor = Ext.extend(Ext.util.Observable, {
                }
        },
        /*
+        * Instantiate the specified plugin and register it with the editor
+        *
+        * @param       string          plugin: the name of the plugin
+        *
+        * @return      boolean         true if the plugin was successfully registered
+        */
+       registerPlugin: function (pluginName) {
+               var plugin = null;
+               if (Ext.isString(pluginName)) {
+                       /*******************************************************************************
+                        * USE OF PLUGIN NAME OUTSIDE HTMLArea NAMESPACE IS DEPRECATED AS OF TYPO3 4.4 *
+                        *******************************************************************************/
+                       try {
+                               plugin = eval(pluginName);
+                       } catch (e) {
+                               try {
+                                       plugin = eval('HTMLArea.' + pluginName);
+                               } catch (error) {
+                                       HTMLArea._appendToLog('ERROR [HTMLArea.Editor::registerPlugin]: Cannot register invalid plugin: ' + error);
+                                       return false;
+                               }
+                       }
+               }
+               if (!Ext.isFunction(plugin)) {
+                       HTMLArea._appendToLog('ERROR [HTMLArea.Editor::registerPlugin]: Cannot register undefined plugin.');
+                       return false;
+               }
+               var pluginInstance = new plugin(this, pluginName);
+               if (pluginInstance) {
+                       var pluginInformation = pluginInstance.getPluginInformation();
+                       pluginInformation.instance = pluginInstance;
+                       this.plugins[pluginName] = pluginInformation;
+                       HTMLArea._appendToLog('[HTMLArea.Editor::registerPlugin]: Plugin ' + pluginName + ' was successfully registered.');
+                       return true;
+               } else {
+                       HTMLArea._appendToLog("ERROR [HTMLArea.Editor::registerPlugin]: Can't register plugin " + pluginName + '.');
+                       return false;
+               }
+       },
+       /*
         * Generate registered plugins
         */
        generatePlugins: function () {
@@ -2674,45 +2714,6 @@ HTMLArea.util.TYPO3 = function () {
                }
        }
 }();
-/***************************************************
- *  PLUGINS, STYLESHEETS, AND IMAGE AND POPUP URL'S
- ***************************************************/
-/*
- * Instantiate the specified plugin and register it with the editor
- *
- * @param      string          plugin: the name of the plugin
- *
- * @return     boolean         true if the plugin was successfully registered
- */
-HTMLArea.Editor.prototype.registerPlugin = function(plugin) {
-       var pluginName = plugin;
-       if (typeof(plugin) === "string") {
-               try {
-                       var plugin = eval(plugin);
-               } catch(e) {
-                       HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Cannot register invalid plugin: " + e);
-                       return false;
-               }
-       }
-       if (typeof(plugin) !== "function") {
-               HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Cannot register undefined plugin.");
-               return false;
-       }
-       var pluginInstance = new plugin(this, pluginName);
-       if (pluginInstance) {
-               var pluginInformation = plugin._pluginInfo;
-               if(!pluginInformation) {
-                       pluginInformation = pluginInstance.getPluginInformation();
-               }
-               pluginInformation.instance = pluginInstance;
-               this.plugins[pluginName] = pluginInformation;
-               HTMLArea._appendToLog("[HTMLArea::registerPlugin]: Plugin " + pluginName + " was successfully registered.");
-               return true;
-       } else {
-               HTMLArea._appendToLog("ERROR [HTMLArea::registerPlugin]: Can't register plugin " + pluginName + ".");
-               return false;
-       }
-};
 /*
  * Load a stylesheet file
  ***********************************************
index f49a799..f3a642b 100644 (file)
@@ -31,7 +31,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-AboutEditor = HTMLArea.Plugin.extend({
+HTMLArea.AboutEditor = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index a6df65a..7e182cf 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-Acronym = HTMLArea.Plugin.extend({
+HTMLArea.Acronym = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index b8fe590..6622ba1 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-BlockElements = HTMLArea.Plugin.extend({
+HTMLArea.BlockElements = HTMLArea.Plugin.extend({
                
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index 191b8fe..5465ab8 100644 (file)
@@ -31,7 +31,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-BlockStyle = HTMLArea.Plugin.extend({
+HTMLArea.BlockStyle = HTMLArea.Plugin.extend({
                
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index bf7a987..9636a74 100644 (file)
@@ -33,7 +33,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-CharacterMap = HTMLArea.Plugin.extend({
+HTMLArea.CharacterMap = HTMLArea.Plugin.extend({
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index bc7fd49..6c78ef4 100644 (file)
@@ -32,7 +32,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-ContextMenu = HTMLArea.Plugin.extend({
+HTMLArea.ContextMenu = HTMLArea.Plugin.extend({
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index 2983c03..2a19549 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-CopyPaste = HTMLArea.Plugin.extend({
+HTMLArea.CopyPaste = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index 2cdc45b..a6c1c52 100644 (file)
@@ -28,7 +28,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-DefaultClean = HTMLArea.Plugin.extend({
+HTMLArea.DefaultClean = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index a153f60..13d4cc8 100644 (file)
@@ -31,7 +31,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-DefaultImage = HTMLArea.Plugin.extend({
+HTMLArea.DefaultImage = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index 6f41e98..eacc7cc 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-DefaultInline = HTMLArea.Plugin.extend({
+HTMLArea.DefaultInline = HTMLArea.Plugin.extend({
                
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index dd03ee7..4a7b85b 100644 (file)
@@ -31,7 +31,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-DefaultLink = HTMLArea.Plugin.extend({
+HTMLArea.DefaultLink = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index 718a72e..de9731e 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-DefinitionList = BlockElements.extend({
+HTMLArea.DefinitionList = HTMLArea.BlockElements.extend({
                
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index 261c1c4..71a51ad 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-EditorMode = HTMLArea.Plugin.extend({
+HTMLArea.EditorMode = HTMLArea.Plugin.extend({
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index 977a0b4..7015d4c 100644 (file)
@@ -32,7 +32,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-FindReplace = HTMLArea.Plugin.extend({
+HTMLArea.FindReplace = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index ac6e43f..325f842 100644 (file)
@@ -32,7 +32,7 @@
 /*
  * Creation of the class of InlineElements plugins
  */
-InlineElements = HTMLArea.Plugin.extend({
+HTMLArea.InlineElements = HTMLArea.Plugin.extend({
        /*
         * Let the base class do some initialization work
         */
index a696f9d..21d1aa4 100644 (file)
@@ -33,7 +33,7 @@
  * TYPO3 SVN ID: $Id$
  */
 
-InsertSmiley = HTMLArea.Plugin.extend({
+HTMLArea.InsertSmiley = HTMLArea.Plugin.extend({
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index cbbbf24..ae05ca5 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-Language = HTMLArea.Plugin.extend({
+HTMLArea.Language = HTMLArea.Plugin.extend({
 
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index d04ce4a..82fd1ad 100644 (file)
@@ -32,7 +32,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-QuickTag = HTMLArea.Plugin.extend({
+HTMLArea.QuickTag = HTMLArea.Plugin.extend({
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index f6ba76f..1a48ac1 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-RemoveFormat = HTMLArea.Plugin.extend({
+HTMLArea.RemoveFormat = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index a30f11f..b91408f 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-SelectFont = HTMLArea.Plugin.extend({
+HTMLArea.SelectFont = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index d8ad14d..f9f2931 100644 (file)
@@ -32,7 +32,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-SpellChecker = HTMLArea.Plugin.extend({
+HTMLArea.SpellChecker = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index ebd89fd..cd4dc72 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-TYPO3Color = HTMLArea.Plugin.extend({
+HTMLArea.TYPO3Color = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index c9bf2d3..4cf2492 100644 (file)
@@ -28,7 +28,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-TYPO3HtmlParser = HTMLArea.Plugin.extend({
+HTMLArea.TYPO3HtmlParser = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index baf25cd..4e2f852 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-TYPO3Image = HTMLArea.Plugin.extend({
+HTMLArea.TYPO3Image = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index db999ca..3fa2308 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-TYPO3Link = HTMLArea.Plugin.extend({
+HTMLArea.TYPO3Link = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },
index 48ebeff..35c85ed 100644 (file)
@@ -33,7 +33,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-TableOperations = HTMLArea.Plugin.extend({
+HTMLArea.TableOperations = HTMLArea.Plugin.extend({
                
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index 0d2218f..64f8487 100644 (file)
@@ -29,7 +29,7 @@
  *
  * TYPO3 SVN ID: $Id: text-indicator.js 6539 2009-11-25 14:49:14Z stucki $
  */
-TextIndicator = HTMLArea.Plugin.extend({
+HTMLArea.TextIndicator = HTMLArea.Plugin.extend({
                
        constructor : function(editor, pluginName) {
                this.base(editor, pluginName);
index 5e67935..c787c68 100644 (file)
@@ -32,7 +32,7 @@
 /*
  * Creation of the class of TextStyle plugins
  */
-TextStyle = HTMLArea.Plugin.extend({
+HTMLArea.TextStyle = HTMLArea.Plugin.extend({
        /*
         * Let the base class do some initialization work
         */
index ab52231..722ca1e 100644 (file)
@@ -31,7 +31,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-UndoRedo = HTMLArea.Plugin.extend({
+HTMLArea.UndoRedo = HTMLArea.Plugin.extend({
        constructor: function (editor, pluginName) {
                this.base(editor, pluginName);
        },
index 14a20eb..7a21a65 100644 (file)
@@ -28,7 +28,7 @@
  *
  * TYPO3 SVN ID: $Id$
  */
-UserElements = HTMLArea.Plugin.extend({
+HTMLArea.UserElements = HTMLArea.Plugin.extend({
        constructor: function(editor, pluginName) {
                this.base(editor, pluginName);
        },