Added feature #13608: htmlArea RTE: Make height of the context menu configurable
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 22 Feb 2010 14:54:22 +0000 (14:54 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 22 Feb 2010 14:54:22 +0000 (14:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6972 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/extensions/ContextMenu/class.tx_rtehtmlarea_contextmenu.php
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js

index 86a5ee5..edf6384 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-22  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #13608: htmlArea RTE: Make height of the context menu configurable
+
 2010-02-22  Dmitry Dulepov <dmitry.dulepov@gmail.com>
 
        * Fixed bug #12958: Catchable fatal error in indexed_search
index 483cc96..e36910b 100644 (file)
@@ -1,3 +1,7 @@
+2010-02-22  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Added feature #13608: htmlArea RTE: Make height of the context menu configurable
+
 2010-02-21  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #13580: htmlArea RTE: Extjize the RTE
index cd0b47d..1a6cd47 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 6563943..1c3bc51 100644 (file)
@@ -62,9 +62,9 @@ class tx_rtehtmlarea_contextmenu extends tx_rtehtmlareaapi {
         */
        public function buildJavascriptConfiguration($editorId) {
                $registerRTEinJavascriptString = '';
-               if (is_array( $this->thisConfig['contextMenu.'])) {
+               if (is_array($this->thisConfig['contextMenu.'])) {
                        $registerRTEinJavascriptString .= '
-       RTEarea['.$editorId.'].contextMenu = new Object();';
+       RTEarea['.$editorId.'].contextMenu =  ' . $this->htmlAreaRTE->buildNestedJSArray($this->thisConfig['contextMenu.']) . ';';
                        if ($this->thisConfig['contextMenu.']['showButtons']) {
                                $registerRTEinJavascriptString .= '
        RTEarea['.$editorId.'].contextMenu.showButtons = ' . json_encode(t3lib_div::trimExplode(',', $this->htmlAreaRTE->cleanList(t3lib_div::strtolower($this->thisConfig['contextMenu.']['showButtons'])), 1)) . ';';
index 11c95e8..0d2f0c8 100644 (file)
@@ -41,13 +41,14 @@ ContextMenu = HTMLArea.Plugin.extend({
         */
        configurePlugin : function(editor) {
                this.pageTSConfiguration = this.editorConfiguration.contextMenu;
-               if (this.pageTSConfiguration) {
-                       if (this.pageTSConfiguration.showButtons) {
-                               this.showButtons = this.pageTSConfiguration.showButtons;
-                       }
-                       if (this.pageTSConfiguration.hideButtons) {
-                               this.hideButtons = this.pageTSConfiguration.hideButtons;
-                       }
+               if (!this.pageTSConfiguration) {
+                       this.pageTSConfiguration = {};
+               }
+               if (this.pageTSConfiguration.showButtons) {
+                       this.showButtons = this.pageTSConfiguration.showButtons;
+               }
+               if (this.pageTSConfiguration.hideButtons) {
+                       this.hideButtons = this.pageTSConfiguration.hideButtons;
                }
                /*
                 * Registering plugin "About" information
@@ -69,9 +70,8 @@ ContextMenu = HTMLArea.Plugin.extend({
         */
        onGenerate: function() {
                        // Build the context menu
-               this.menu = new Ext.menu.Menu({
+               this.menu = new Ext.menu.Menu(Ext.applyIf({
                        cls: 'htmlarea-context-menu',
-                       height: 800,
                        defaultType: 'menuitem',
                        listeners: {
                                itemClick: {
@@ -88,9 +88,9 @@ ContextMenu = HTMLArea.Plugin.extend({
                                }
                        },
                        items: this.buildItemsConfig()
-               });
+               }, this.pageTSConfiguration));
                        // Monitor contextmenu clicks on the iframe
-               this.menu.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'contextmenu', this.show, this, {single: true});
+               this.menu.mon(Ext.get(this.editor.document.documentElement), 'contextmenu', this.show, this, {single: true});
        },
        /*
         * Create the menu items config
@@ -159,15 +159,15 @@ ContextMenu = HTMLArea.Plugin.extend({
         * Handler when the menu gets shown
         */
        onShow: function () {
-               this.menu.mun(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'contextmenu', this.show, this);
-               this.menu.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'mousedown', this.menu.hide, this.menu, {single: true});
+               this.menu.mun(Ext.get(this.editor.document.documentElement), 'contextmenu', this.show, this);
+               this.menu.mon(Ext.get(this.editor.document.documentElement), 'mousedown', this.menu.hide, this.menu, {single: true});
        },
        /*
         * Handler when the menu gets hidden
         */
        onHide: function () {
-               this.menu.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'contextmenu', this.show, this);
-               this.menu.mun(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'mousedown', this.menu.hide, this.menu);
+               this.menu.mon(Ext.get(this.editor.document.documentElement), 'contextmenu', this.show, this);
+               this.menu.mun(Ext.get(this.editor.document.documentElement), 'mousedown', this.menu.hide, this.menu);
        },
        /*
         * Handler to show the context menu