* Follow-up for bug #10326: htmlArea RTE: Cleaning on paste broken in older versions of Mozilla/Firefox
* Fixed bug #9894: htmlArea RTE: copy/cut/paste with hotkeys does not work in some browsers/settings
+ * Fixed bug #10337: htmlArea RTE: Allow Clipboard Helper does not work with Firefox 3
2009-02-03 Francois Suter <francois@typo3.org>
* Follow-up for bug #10326: htmlArea RTE: Cleaning on paste broken in older versions of Mozilla/Firefox
* Fixed bug #9894: htmlArea RTE: copy/cut/paste with hotkeys does not work in some browsers/settings
+ * Fixed bug #10337: htmlArea RTE: Allow Clipboard Helper does not work with Firefox 3
2009-02-01 Stanislas Rolland <typo3@sjbr.ca>
_editor_debug_mode = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableDebugMode'] ? 'true' : 'false') . ';
_editor_compressed_scripts = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableCompressedScripts'] ? 'true' : 'false') . ';'
. (($this->client['BROWSER'] == 'gecko') ? ('
- _editor_mozAllowClipboard_url = "' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['mozAllowClipboardURL'] ? $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['mozAllowClipboardURL'] : '') . '";')
+ RTEarea[0].enableMozillaExtension = ' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableMozillaExtension'] ?'true' : 'false') . ';
+ RTEarea[0].mozillaAllowClipboardURL = "' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['mozAllowClipboardURL'] ? $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['mozAllowClipboardURL'] : '') . '";')
: '') . '
}
/*]]>*/
RTEarea[editornumber]["disablePCexamples"] = ' . (trim($this->thisConfig['disablePCexamples'])?'true':'false') . ';
RTEarea[editornumber]["showTagFreeClasses"] = ' . (trim($this->thisConfig['showTagFreeClasses'])?'true':'false') . ';
RTEarea[editornumber]["useHTTPS"] = ' . ((trim(stristr($this->siteURL, 'https')) || $this->thisConfig['forceHTTPS'])?'true':'false') . ';
- RTEarea[editornumber]["enableMozillaExtension"] = ' . (($this->client['BROWSER'] == 'gecko' && $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableMozillaExtension'])?'true':'false') . ';
RTEarea[editornumber].tceformsNested = ' . (is_object($this->TCEform) && method_exists($this->TCEform, 'getDynNestedStack') ? $this->TCEform->getDynNestedStack(true) : '[]') . ';
RTEarea[editornumber].dialogueWindows = new Object();
RTEarea[editornumber].dialogueWindows.defaultPositionFromTop = ' . (isset($this->thisConfig['dialogueWindows.']['defaultPositionFromTop'])? intval($this->thisConfig['dialogueWindows.']['defaultPositionFromTop']) : '100') . ';
enableCompressedScripts = 1
# cat=basic; type=string; label=Url of AllowClipboard Helper: Full absolute Url of the AllowClipboard Helper extension for Mozilla and Firefox.
-mozAllowClipboardURL =
\ No newline at end of file
+mozAllowClipboardURL = http://typo3.org/fileadmin/allowclipboardhelper-0.6.xpi
\ No newline at end of file
}, 50);
};
-/*
- * Paste exception handler
- */
-HTMLArea.prototype._mozillaPasteException = function(cmdID, UI, param) {
- // Mozilla lauches an exception, but can paste anyway on ctrl-V
- // UI is false on keyboard shortcut, and undefined on button click
- if(typeof(UI) != "undefined") {
- try { this._doc.execCommand(cmdID, UI, param); } catch(e) { }
- if (cmdID == "Paste" && this._toolbarObjects.CleanWord) {
- this._toolbarObjects.CleanWord.cmd(this, "CleanWord");
- }
- } else if (this.config.enableMozillaExtension) {
- if (confirm(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension"])) {
- if (InstallTrigger.enabled()) {
- HTMLArea._mozillaXpi = new Object();
- HTMLArea._mozillaXpi["AllowClipboard Helper"] = _editor_mozAllowClipboard_url;
- InstallTrigger.install(HTMLArea._mozillaXpi,HTMLArea._mozillaInstallCallback);
- } else {
- alert(HTMLArea.I18N.msg["Mozilla-Org-Install-Not-Enabled"]);
- HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install was not enabled.");
- return;
- }
- }
- } else if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"])) {
- window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
- }
-}
-
-HTMLArea._mozillaInstallCallback = function(url,returnCode) {
- if (returnCode == 0) {
- if (HTMLArea._mozillaXpi["TYPO3 htmlArea RTE Preferences"]) alert(HTMLArea.I18N.msg["Moz-Extension-Success"]);
- else alert(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension-Success"]);
- return;
- } else {
- alert(HTMLArea.I18N.msg["Moz-Extension-Failure"]);
- HTMLArea._appendToLog("WARNING [HTMLArea::execCommand]: Mozilla install return code was: " + returnCode + ".");
- return;
- }
-};
-
/*
* Backspace event handler
*/
* @return string the localization of the label
*/
localize : function (label) {
- return this.I18N[label] || HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label];
+ return this.I18N[label] || HTMLArea.I18N.dialogs[label] || HTMLArea.I18N.tooltips[label] || HTMLArea.I18N.msg[label];
},
/**
case "Paste":
if (buttonId == id) {
// If we are handling a button, not a hotkey
- this.applyBrowserCommand(buttonId, true);
+ this.applyBrowserCommand(buttonId);
}
// In FF3, the paste operation will indeed trigger the onPaste even; not in FF2; nor in Opera
if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 2008020514)) {
- var cleanLaterFunctRef = this.editor.getPluginInstance("DefaultClean") ? this.editor.getPluginInstance("DefaultClean").cleanLaterFunctRef : (this.editor.getPluginInstance("TYPO3HtmlParser") ? this.editor.getPluginInstance("TYPO3HtmlParser").cleanLaterFunctRef : null);
+ var cleanLaterFunctRef = this.getPluginInstance("DefaultClean") ? this.getPluginInstance("DefaultClean").cleanLaterFunctRef : (this.getPluginInstance("TYPO3HtmlParser") ? this.getPluginInstance("TYPO3HtmlParser").cleanLaterFunctRef : null);
if (cleanLaterFunctRef) {
window.setTimeout(cleanLaterFunctRef, 50);
}
}
},
- applyBrowserCommand : function (buttonId, buttonPress) {
+ applyBrowserCommand : function (buttonId) {
try {
this.editor._doc.execCommand(buttonId, false, null);
} catch (e) {
- if (buttonId == "Paste" && HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera) {
- this.editor._mozillaPasteException(buttonId, buttonPress, null);
+ if (HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera) {
+ this.mozillaClipboardAccessException();
}
}
},
}
}
}
+ },
+
+ /*
+ * Mozilla clipboard access exception handler
+ */
+ mozillaClipboardAccessException : function () {
+ if (RTEarea[0].enableMozillaExtension) {
+ if (confirm(this.localize("Allow-Clipboard-Helper-Extension"))) {
+ if (InstallTrigger.enabled()) {
+ var mozillaXpi = new Object();
+ mozillaXpi["AllowClipboard Helper"] = RTEarea[0].mozillaAllowClipboardURL;
+ var mozillaInstallCallback = this.makeFunctionReference("mozillaInstallCallback");
+ InstallTrigger.install(mozillaXpi, mozillaInstallCallback);
+ } else {
+ alert(this.localize("Mozilla-Org-Install-Not-Enabled"));
+ this.appendToLog("mozillaClipboardAccessException", "Mozilla install was not enabled.");
+ return;
+ }
+ }
+ } else if (confirm(this.localize("Moz-Clipboard"))) {
+ window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
+ }
+ },
+
+ /*
+ * Mozilla Add-on installer call back
+ */
+ mozillaInstallCallback : function (url, returnCode) {
+ if (returnCode == 0) {
+ alert(this.localize("Allow-Clipboard-Helper-Extension-Success"));
+ } else {
+ alert(this.localize("Moz-Extension-Failure"));
+ this.appendToLog("mozillaInstallCallback", "Mozilla install return code was: " + returnCode + ".");
+ }
+ return;
}
});