From 3e9cc3e8fd20af7603bb8fc6bea5b55b7e352b91 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 24 Apr 2016 09:32:06 +0100 Subject: [PATCH] Add a warning for undo/redo buttons in Firefox --- core/modules/editor/engines/framed.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js index 5747737b1..e7eecb5fe 100644 --- a/core/modules/editor/engines/framed.js +++ b/core/modules/editor/engines/framed.js @@ -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; } };