mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Add a warning for undo/redo buttons in Firefox
This commit is contained in:
parent
3b49cd17fc
commit
3e9cc3e8fd
@ -194,14 +194,24 @@ FramedEngine.prototype.executeTextOperation = function(operation) {
|
|||||||
Execute a command
|
Execute a command
|
||||||
*/
|
*/
|
||||||
FramedEngine.prototype.execCommand = function(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.iframeNode.focus();
|
||||||
this.domNode.focus();
|
this.domNode.focus();
|
||||||
switch(command) {
|
switch(command) {
|
||||||
case "undo":
|
case "undo":
|
||||||
|
if(isFirefox) {
|
||||||
|
alert(msg);
|
||||||
|
} else {
|
||||||
this.iframeDoc.execCommand("undo", false, null);
|
this.iframeDoc.execCommand("undo", false, null);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "redo":
|
case "redo":
|
||||||
|
if(isFirefox) {
|
||||||
|
alert(msg);
|
||||||
|
} else {
|
||||||
this.iframeDoc.execCommand("redo", false, null);
|
this.iframeDoc.execCommand("redo", false, null);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user