Commit a5b88033 authored by Stanislas Rolland's avatar Stanislas Rolland
Browse files

[BUGFIX] RTE: Installation of AllowClipboardHelper is not triggered

Problem: When using Firefox, if a copy/cut/paste button is hit and
access to the clipboard is not allowed, installation of Firefox add-on
AllowClipboardHelper should be triggered.

Solution: Report the exception raised by Firefox and take action.

Change-Id: I5eff1f4fba496a5b984db8e26e307f585ac0d985
Resolves: #39338
Releases: 4.7, 6.0
Reviewed-on: http://review.typo3.org/13214
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
parent eb90ef21
......@@ -4108,17 +4108,16 @@ HTMLArea.DOM.Selection = Ext.extend(HTMLArea.DOM.Selection, {
* @return boolean false
*/
execCommand: function (cmdID, UI, param) {
var success = true;
this.editor.focus();
switch (cmdID) {
default:
try {
this.document.execCommand(cmdID, UI, param);
} catch(e) {
this.editor.appendToLog('HTMLArea.DOM.Selection', 'execCommand', e + ' by execCommand(' + cmdID + ')', 'error');
}
try {
this.document.execCommand(cmdID, UI, param);
} catch (e) {
success = false;
this.editor.appendToLog('HTMLArea.DOM.Selection', 'execCommand', e + ' by execCommand(' + cmdID + ')', 'error');
}
this.editor.updateToolbar();
return false;
return success;
},
/*
* Handle backspace event on the current selection
......
......@@ -180,12 +180,9 @@ HTMLArea.CopyPaste = Ext.extend(HTMLArea.Plugin, {
* In the case of hot key, the browser does it automatically
*/
applyBrowserCommand: function (buttonId) {
try {
this.editor.getSelection().execCommand(buttonId, false, null);
} catch (e) {
if (Ext.isGecko) {
this.mozillaClipboardAccessException();
}
var success = this.editor.getSelection().execCommand(buttonId, false, null);
if (!success && Ext.isGecko) {
this.mozillaClipboardAccessException();
}
},
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment