Project

General

Profile

Actions

Feature #14834

closed

Clipboard Paste in Firefox - without FF-extension (with patch)

Added by Guillaume Crico over 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2005-06-22
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

This patch enable Clipboard Paste in Firefox...
...ONLY with Keyboard Accelerator (ex: CTRL-V).

On paste button click, it keeps the standard behavior (confirm, etc...).

Todo : maybe works with Mozilla "Suite" => if so, change :
"navigator.userAgent.indexOf('Firefox') != -1"
to
"HTMLArea.is_gecko && !HTMLArea.is_safari"

Todo: tested with Firefox 1.0.4 on MsWindows => more browser testing

--- htmlarea.js
++ htmlarea.js
@ -1847,27 +1847,44 @
- if(HTMLArea.is_gecko && !HTMLArea.is_safari) {
- if(this.config.enableMozillaExtension) {
- if(typeof HTMLArea.I18N.msg["Moz-Extension"] == "undefined") {
- HTMLArea.I18N.msg["Moz-Extension"] =
- "Unprivileged scripts cannot access the clipboard programatically " +
- "for security reasons. Click OK to install a component that will " +
- "enable scripts from this TYPO3 site to access the clipboard.\n\n";
- }
- if(confirm(HTMLArea.I18N.msg["Moz-Extension"])) {
- if(InstallTrigger.enabled()) {
- function mozillaInstallCallback(url,returnCode) {
- if(returnCode == 0) {
- alert(HTMLArea.I18N.msg["Moz-Extension-Success"]);
- return;
- } else {
- alert(HTMLArea.I18N.msg["Moz-Extension-Failure"]);
- HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install return code was: " + returnCode + ".");
- return;
- }
- };
- var xpi = new Object();
- xpi["TYPO3 htmlArea RTE Preferences"] = "../uploads/tx_rtehtmlarea/typo3_rtehtmlarea_prefs.xpi";
- InstallTrigger.install(xpi, mozillaInstallCallback);
- } else {
- alert(HTMLArea.I18N.msg["Moz-Extension-Install-Not-Enabled"]);
- HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install was not enabled.");
- return;
if (navigator.userAgent.indexOf('Firefox') != 1 && UI != undefined) {
+ //*** Firefox lauch an exception, but can paste anyway on ctrl-V...
+ //*** UI is false on keyboard shortcut, and undefined on button click...
+ this._doc.execCommand(cmdID, UI, param);
+ if(this.config.killWordOnPaste) HTMLArea._wordClean(editor._doc.body);
+ } else{
+ if(HTMLArea.is_gecko && !HTMLArea.is_safari) {
+ if(this.config.enableMozillaExtension) {
+ if(typeof HTMLArea.I18N.msg["Moz-Extension"] == "undefined") {
+ HTMLArea.I18N.msg["Moz-Extension"] =
+ "Unprivileged scripts cannot access the clipboard programatically "
"for security reasons. Click OK to install a component that will "
"enable scripts from this TYPO3 site to access the clipboard.\n\n";
+ }
+ if(confirm(HTMLArea.I18N.msg["Moz-Extension"])) {
+ if(InstallTrigger.enabled()) {
+ function mozillaInstallCallback(url,returnCode) {
+ if(returnCode == 0) {
+ alert(HTMLArea.I18N.msg["Moz-Extension-Success"]);
+ return;
+ } else {
+ alert(HTMLArea.I18N.msg["Moz-Extension-Failure"]);
+ HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install return code was: " + returnCode + ".");
+ return;
+ }
+ };
+ var xpi = new Object();
+ xpi["TYPO3 htmlArea RTE Preferences"] = "../uploads/tx_rtehtmlarea/typo3_rtehtmlarea_prefs.xpi";
+ InstallTrigger.install(xpi, mozillaInstallCallback);
+ } else {
+ alert(HTMLArea.I18N.msg["Moz-Extension-Install-Not-Enabled"]);
+ HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install was not enabled.");
+ return;
+ }
+ }
+ } else {
+ if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
+ HTMLArea.I18N.msg["Moz-Clipboard"] =
+ "Unprivileged scripts cannot access Cut/Copy/Paste programatically "
"for security reasons. Click OK to see a technical note at mozilla.org "
"which shows you how to allow a script to access the clipboard.\n\n";
+ }
+ if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"])) {
+ window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
@ -1875,10 +1891,0 @
}
- } else {
- if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
- HTMLArea.I18N.msg["Moz-Clipboard"] =
- "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
- "for security reasons. Click OK to see a technical note at mozilla.org " +
- "which shows you how to allow a script to access the clipboard.\n\n";
- }
- if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"])) {
- window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");

(issue imported from #M1231)


Files

htmlarea.js.diff (1.79 KB) htmlarea.js.diff Administrator Admin, 2005-06-22 15:06
Actions

Also available in: Atom PDF