Revert "[BUGFIX] RTE: Some toolbar elements may not be correctly initialized"
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 3 Feb 2012 18:52:37 +0000 (19:52 +0100)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 3 Feb 2012 18:56:41 +0000 (19:56 +0100)
This reverts commit f848f50ecc3331abedfaee8854303417dee6eb71

Change-Id: I530d5f2c78cdba9174978394669d53f16efa52f1
Reviewed-on: http://review.typo3.org/8832
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectFont/select-font.js
typo3/sysext/rtehtmlarea/htmlarea/plugins/TextIndicator/text-indicator.js

index b2fdab9..929302d 100644 (file)
@@ -124,27 +124,9 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
         * This function gets called when the editor is generated
         */
        onGenerate: function () {
-               var select = this.getButton('Language');
-               if (select.getStore().getCount() > 1) {
-                       this.addLanguageMarkingRules();
-               } else {
-                               // Monitor the language combo's store being loaded
-                       select.mon(select.getStore(), 'load', function () {
-                               this.addLanguageMarkingRules();
-                               var selection = this.editor.getSelection(),
-                                       selectionEmpty = selection.isEmpty(),
-                                       ancestors = selection.getAllAncestors(),
-                                       endPointsInSameBlock = selection.endPointsInSameBlock();
-                               this.onUpdateToolbar(select, this.getEditorMode(), selectionEmpty, ancestors, endPointsInSameBlock);
-                       }, this);
-               }
-       },
-       /*
-        * This function adds rules to the stylesheet for language mark highlighting
-        * Model: body.htmlarea-show-language-marks *[lang=en]:before { content: "en: "; }
-        * Works in IE8, but not in earlier versions of IE
-        */
-       addLanguageMarkingRules: function () {
+                       // Add rules to the stylesheet for language mark highlighting
+                       // Model: body.htmlarea-show-language-marks *[lang=en]:before { content: "en: "; }
+                       // Works in IE8, but not in earlier versions of IE
                var select = this.getButton('Language');
                if (select) {
                        var styleSheet = this.editor.document.styleSheets[0];
@@ -163,6 +145,8 @@ HTMLArea.Language = Ext.extend(HTMLArea.Plugin, {
                                }
                                return true;
                        }, this);
+                               // Monitor the combo's store being loaded
+                       select.mon(select.getStore(), 'load', function () { this.updateValue(select); }, this);
                }
        },
        /*
index 666cb37..99e6a80 100644 (file)
@@ -126,13 +126,7 @@ HTMLArea.SelectFont = Ext.extend(HTMLArea.Plugin, {
                Ext.each(this.dropDownList, function (dropDown) {
                        var select = this.getButton(dropDown[0]);
                        if (select) {
-                               select.mon(select.getStore(), 'load', function () {
-                                       var selection = this.editor.getSelection(),
-                                               selectionEmpty = selection.isEmpty(),
-                                               ancestors = selection.getAllAncestors(),
-                                               endPointsInSameBlock = selection.endPointsInSameBlock();
-                                       this.onUpdateToolbar(select, this.getEditorMode(), selectionEmpty, ancestors, endPointsInSameBlock);
-                               }, this);
+                               select.mon(select.getStore(), 'load', function () { select.setValue('none'); });
                        }
                }, this);       
        },
index 2ade052..1b92523 100644 (file)
@@ -59,33 +59,7 @@ HTMLArea.TextIndicator = Ext.extend(HTMLArea.Plugin, {
                this.registerText(textConfiguration);
                return true;
         },
-       /*
-        * This handler gets called when the editor is generated
-        */
-       onGenerate: function () {
-                       // Ensure text indicator is updated AFTER style sheets are loaded
-               var blockStylePlugin = this.getPluginInstance('BlockStyle');
-               if (blockStylePlugin && blockStylePlugin.blockStyles) {
-                               // Monitor css parsing being completed
-                       this.editor.iframe.mon(blockStylePlugin.blockStyles, 'HTMLAreaEventCssParsingComplete', this.onCssParsingComplete, this);
-               }
-               var textStylePlugin = this.getPluginInstance('TextStyle');
-               if (textStylePlugin && textStylePlugin.textStyles) {
-                               // Monitor css parsing being completed
-                       this.editor.iframe.mon(textStylePlugin.textStyles, 'HTMLAreaEventCssParsingComplete', this.onCssParsingComplete, this);
-               }
-       },
-       /*
-        * This handler gets called when parsing of css classes is completed
-        */
-       onCssParsingComplete: function () {
-               var button = this.getButton('TextIndicator'),
-                       selection = this.editor.getSelection(),
-                       selectionEmpty = selection.isEmpty(),
-                       ancestors = selection.getAllAncestors(),
-                       endPointsInSameBlock = selection.endPointsInSameBlock();
-               this.onUpdateToolbar(button, this.getEditorMode(), selectionEmpty, ancestors, endPointsInSameBlock);
-       },
+
        /*
         * This function gets called when the toolbar is updated
         */