Project

General

Profile

Feature #22156 ยป rtehtmlarea_feature_13608.patch

Administrator Admin, 2010-02-22 15:47

View differences:

typo3/sysext/rtehtmlarea/extensions/ContextMenu/class.tx_rtehtmlarea_contextmenu.php (copie de travail)
*/
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)) . ';';
typo3/sysext/rtehtmlarea/htmlarea/plugins/ContextMenu/context-menu.js (copie de travail)
*/
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
*/
......
*/
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: {
......
}
},
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
......
* 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
    (1-1/1)