Fixed bug #17669: htmlArea RTE: Dialogue window positioning properties not honoured
authorstan <stan@709f56b5-9817-0410-a4d7-c38de5d9e867>
Mon, 21 Feb 2011 02:13:33 +0000 (02:13 +0000)
committerstan <stan@709f56b5-9817-0410-a4d7-c38de5d9e867>
Mon, 21 Feb 2011 02:13:33 +0000 (02:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-5@10513 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 56081ad..68bf595 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2011-02-20  Stanislas Rolland  <typo3@sjbr.ca>
 
        * 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-20  Jigal van Hemert  <jigal@xs4all.nl>
 
index dfc97a9..6cd5b49 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
+       * Fixed bug #17669: htmlArea RTE: Dialogue window positioning properties not honoured
 
 2011-02-19  Stanislas Rolland  <typo3@sjbr.ca>
 
index 21deb87..9743f7c 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 2c29c16..4d0bd44 100644 (file)
@@ -4764,30 +4764,26 @@ HTMLArea.Plugin = HTMLArea.Base.extend({
         */
        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;
        },
        /**
         ***********************************************
@@ -4855,6 +4851,9 @@ HTMLArea.Plugin = HTMLArea.Base.extend({
                        // 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();
        },