Index: typo3/sysext/rtehtmlarea/extensions/ContextMenu/class.tx_rtehtmlarea_contextmenu.php =================================================================== --- typo3/sysext/rtehtmlarea/extensions/ContextMenu/class.tx_rtehtmlarea_contextmenu.php (révision 6971) +++ typo3/sysext/rtehtmlarea/extensions/ContextMenu/class.tx_rtehtmlarea_contextmenu.php (copie de travail) @@ -62,9 +62,9 @@ */ 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: typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js (révision 6971) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js (copie de travail) @@ -41,14 +41,15 @@ */ 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 @@ */ 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 @@ } }, 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 @@ * 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