Fixed bug #17669: htmlArea RTE: Dialogue window positioning properties not honoured
authorstan <stan@709f56b5-9817-0410-a4d7-c38de5d9e867>
Mon, 21 Feb 2011 02:04:08 +0000 (02:04 +0000)
committerstan <stan@709f56b5-9817-0410-a4d7-c38de5d9e867>
Mon, 21 Feb 2011 02:04:08 +0000 (02:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10512 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index e184c26..b5d8199 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2011-02-20  Steffen Kamper  <steffen@typo3.org
 
        * Follow-up to #17592: ExtDirect API calls are splitted in single requests and slows down page loading
+       * Fixed bug #17669: htmlArea RTE: Dialogue window positioning properties not honoured
 
 2011-02-20  Stanislas Rolland  <typo3@sjbr.ca>
 
index 3b7be02..50a7f9c 100644 (file)
@@ -1,6 +1,7 @@
 2011-02-20  Stanislas Rolland  <typo3@sjbr.ca>
 
-       * Follow-up to issue #17677: htmlArea RTE: Classes configuration is loaded twice 
+       * Follow-up to issue #17677: htmlArea RTE: Classes configuration is loaded twice
+       * Fixed bug #17669: htmlArea RTE: Dialogue window positioning properties not honoured
 
 2011-02-19  Stanislas Rolland  <typo3@sjbr.ca>
 
index cd05979..56d83b7 100644 (file)
@@ -840,12 +840,15 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        RTEarea[editornumber].showTagFreeClasses = ' . (trim($this->thisConfig['showTagFreeClasses'])?'true':'false') . ';
                        RTEarea[editornumber].useHTTPS = ' . ((trim(stristr($this->siteURL, 'https')) || $this->thisConfig['forceHTTPS'])?'true':'false') . ';
                        RTEarea[editornumber].tceformsNested = ' . (is_object($this->TCEform) && method_exists($this->TCEform, 'getDynNestedStack') ? $this->TCEform->getDynNestedStack(true) : '[]') . ';
-                       RTEarea[editornumber].dialogueWindows = new Object();
-                       RTEarea[editornumber].dialogueWindows.defaultPositionFromTop = ' . (isset($this->thisConfig['dialogueWindows.']['defaultPositionFromTop'])? intval($this->thisConfig['dialogueWindows.']['defaultPositionFromTop']) : '100') . ';
-                       RTEarea[editornumber].dialogueWindows.defaultPositionFromLeft = ' . (isset($this->thisConfig['dialogueWindows.']['defaultPositionFromLeft'])? intval($this->thisConfig['dialogueWindows.']['defaultPositionFromLeft']) : '100') . ';
-                       RTEarea[editornumber].dialogueWindows.doNotResize = ' . (trim($this->thisConfig['dialogueWindows.']['doNotResize'])?'true':'false') . ';
-                       RTEarea[editornumber].dialogueWindows.doNotCenter = ' . (trim($this->thisConfig['dialogueWindows.']['doNotCenter'])?'true':'false') . ';';
-
+                       RTEarea[editornumber].dialogueWindows = new Object();';
+               if (isset($this->thisConfig['dialogueWindows.']['defaultPositionFromTop'])) {
+                       $configureRTEInJavascriptString .= '
+                       RTEarea[editornumber].dialogueWindows.positionFromTop = ' . intval($this->thisConfig['dialogueWindows.']['defaultPositionFromTop']) . ';';
+               }
+               if (isset($this->thisConfig['dialogueWindows.']['defaultPositionFromLeft'])) {
+                       $configureRTEInJavascriptString .= '
+                       RTEarea[editornumber].dialogueWindows.positionFromLeft = ' . intval($this->thisConfig['dialogueWindows.']['defaultPositionFromLeft']) . ';';
+               }
                        // The following properties apply only to the backend
                if (!$this->is_FE()) {
                        $configureRTEInJavascriptString .= '
index 651f88e..7070da4 100644 (file)
@@ -4500,30 +4500,26 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
         */
        getWindowDimensions: function (dimensions, buttonId) {
                        // Apply default dimensions
-               var dialogueWindowDimensions = {
+               this.dialogueWindowDimensions = {
                        width: 250,
-                       height: 250,
-                       top: this.editorConfiguration.dialogueWindows.defaultPositionFromTop,
-                       left: this.editorConfiguration.dialogueWindows.defaultPositionFromLeft
+                       height: 250
                };
+                       // Apply default values as per PageTSConfig
+               if (this.editorConfiguration.dialogueWindows) {
+                       Ext.apply(this.dialogueWindowDimensions, this.editorConfiguration.dialogueWindows);
+               }
                        // Apply dimensions as per button registration
                if (this.editorConfiguration.buttonsConfig[buttonId]) {
-                       Ext.apply(dialogueWindowDimensions, this.editorConfiguration.buttonsConfig[buttonId].dimensions);
+                       Ext.apply(this.dialogueWindowDimensions, this.editorConfiguration.buttonsConfig[buttonId].dimensions);
                }
                        // Apply dimensions as per call
-               Ext.apply(dialogueWindowDimensions, dimensions);
+               Ext.apply(this.dialogueWindowDimensions, dimensions);
                        // Overrride dimensions as per PageTSConfig
                var buttonConfiguration = this.editorConfiguration.buttons[this.editorConfiguration.convertButtonId[buttonId]];
                if (buttonConfiguration && buttonConfiguration.dialogueWindow) {
-                       Ext.apply(dialogueWindowDimensions, buttonConfiguration.dialogueWindow);
-                       if (buttonConfiguration.dialogueWindow.top) {
-                               dialogueWindowDimensions.top = buttonConfiguration.dialogueWindow.positionFromTop;
-                       }
-                       if (buttonConfiguration.dialogueWindow.left) {
-                               dialogueWindowDimensions.left = buttonConfiguration.dialogueWindow.positionFromLeft;
-                       }
+                       Ext.apply(this.dialogueWindowDimensions, buttonConfiguration.dialogueWindow);
                }
-               return dialogueWindowDimensions;
+               return this.dialogueWindowDimensions;
        },
        /**
         * Make url from module path
@@ -4579,6 +4575,9 @@ HTMLArea.Plugin = Ext.extend(HTMLArea.Plugin, {
                        // Close the window if the editor changes mode
                this.dialog.mon(this.editor, 'HTMLAreaEventModeChange', this.close, this, {single: true });
                this.saveSelection();
+               if (typeof(this.dialogueWindowDimensions) !== 'undefined') {
+                       this.dialog.setPosition(this.dialogueWindowDimensions.positionFromLeft, this.dialogueWindowDimensions.positionFromTop);
+               }
                this.dialog.show();
                this.restoreSelection();
        },