1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Add a warning for undo/redo buttons in Firefox

This commit is contained in:
Jermolene 2016-04-24 09:32:06 +01:00
parent 3b49cd17fc
commit 3e9cc3e8fd

View File

@ -194,14 +194,24 @@ FramedEngine.prototype.executeTextOperation = function(operation) {
Execute a command
*/
FramedEngine.prototype.execCommand = function(command) {
var isFirefox = !!document.mozFullScreenEnabled,
msg = "Warning: the '" + command + "' button does not work in Firefox without installing the CodeMirror plugin.\n\n(Standard operating system keyboard shortcuts will work correctly)";
this.iframeNode.focus();
this.domNode.focus();
switch(command) {
case "undo":
this.iframeDoc.execCommand("undo", false, null);
if(isFirefox) {
alert(msg);
} else {
this.iframeDoc.execCommand("undo", false, null);
}
break;
case "redo":
this.iframeDoc.execCommand("redo", false, null);
if(isFirefox) {
alert(msg);
} else {
this.iframeDoc.execCommand("redo", false, null);
}
break;
}
};