Fixed bug #14876: htmlArea RTE: SelectFont plugin may cause js error
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 26 Jun 2010 14:37:29 +0000 (14:37 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 26 Jun 2010 14:37:29 +0000 (14:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8063 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/SelectFont/select-font.js

index 13287cf..d78a7ee 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-26  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #14876: htmlArea RTE: SelectFont plugin may cause js error
+
 2010-06-25  Steffen Kamper  <info@sk-typo3.de>
 
        * Fixed bug #14870: typo in parameter type causes php error (Thanks to Jigal van Hemert)
index 4f85b9f..382acb5 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-26  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #14876: htmlArea RTE: SelectFont plugin may cause js error
+
 2010-06-21  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #14799: htmlArea RTE: Color dialogue may raise a js error in IE
index 833c706..a03b06e 100644 (file)
@@ -77,25 +77,27 @@ HTMLArea.SelectFont = HTMLArea.Plugin.extend({
                 */
                Ext.each(this.dropDownList, function (dropDown) {
                        var buttonId = dropDown[0];
-                       var dropDownConfiguration = {
-                               id: buttonId,
-                               tooltip: this.localize(buttonId.toLowerCase()),
-                               storeUrl: this.buttonsConfiguration[dropDown[2]].dataUrl,
-                               action: 'onChange',
-                               tpl: this.disablePCexamples ? '' : '<tpl for="."><div ext:qtip="{value}" style="' + dropDown[3] + '" class="x-combo-list-item">{text}</div></tpl>'
-                       };
-                       if (this.buttonsConfiguration[dropDown[2]]) {
-                               if (this.editorConfiguration.buttons[dropDown[2]].width) {
-                                       dropDownConfiguration.width = parseInt(this.editorConfiguration.buttons[dropDown[2]].width, 10);
-                               }
-                               if (this.editorConfiguration.buttons[dropDown[2]].listWidth) {
-                                       dropDownConfiguration.listWidth = parseInt(this.editorConfiguration.buttons[dropDown[2]].listWidth, 10);
-                               }
-                               if (this.editorConfiguration.buttons[dropDown[2]].maxHeight) {
-                                       dropDownConfiguration.maxHeight = parseInt(this.editorConfiguration.buttons[dropDown[2]].maxHeight, 10);
+                       if (this.isButtonInToolbar(buttonId)) {
+                               var dropDownConfiguration = {
+                                       id: buttonId,
+                                       tooltip: this.localize(buttonId.toLowerCase()),
+                                       storeUrl: this.buttonsConfiguration[dropDown[2]].dataUrl,
+                                       action: 'onChange',
+                                       tpl: this.disablePCexamples ? '' : '<tpl for="."><div ext:qtip="{value}" style="' + dropDown[3] + '" class="x-combo-list-item">{text}</div></tpl>'
+                               };
+                               if (this.buttonsConfiguration[dropDown[2]]) {
+                                       if (this.editorConfiguration.buttons[dropDown[2]].width) {
+                                               dropDownConfiguration.width = parseInt(this.editorConfiguration.buttons[dropDown[2]].width, 10);
+                                       }
+                                       if (this.editorConfiguration.buttons[dropDown[2]].listWidth) {
+                                               dropDownConfiguration.listWidth = parseInt(this.editorConfiguration.buttons[dropDown[2]].listWidth, 10);
+                                       }
+                                       if (this.editorConfiguration.buttons[dropDown[2]].maxHeight) {
+                                               dropDownConfiguration.maxHeight = parseInt(this.editorConfiguration.buttons[dropDown[2]].maxHeight, 10);
+                                       }
                                }
+                               this.registerDropDown(dropDownConfiguration);
                        }
-                       this.registerDropDown(dropDownConfiguration);
                        return true;
                }, this);
                return true;
@@ -127,10 +129,12 @@ HTMLArea.SelectFont = HTMLArea.Plugin.extend({
        onGenerate: function () {
                        // Load the dropdowns
                Ext.each(this.dropDownList, function (dropDown) {
-                       this.getButton(dropDown[0]).getStore().load({
-                               callback: function () { this.getButton(dropDown[0]).setValue('none'); },
-                               scope: this
-                       })
+                       if (this.getButton(dropDown[0])) {
+                               this.getButton(dropDown[0]).getStore().load({
+                                       callback: function () { this.getButton(dropDown[0]).setValue('none'); },
+                                       scope: this
+                               })
+                       }
                }, this);
        },
        /*