From 8c7939ec9f18da05bb58da0b43d805948c9cc9b9 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 28 Nov 2012 17:17:35 +0000 Subject: [PATCH 1/3] catch control S and send an event to save a revision --- src/static/js/ace2_inner.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index b3bc91a9..9290fd56 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3537,7 +3537,7 @@ function Ace2Inner(){ var keyCode = evt.keyCode; var which = evt.which; - // prevent ESC key + // prevent ESC key and Control S if (keyCode == 27) { evt.preventDefault(); @@ -3562,7 +3562,7 @@ function Ace2Inner(){ inCallStackIfNecessary("handleKeyEvent", function() { - if (type == "keypress" || (isTypeForSpecialKey && keyCode == 13 /*return*/ )) + if (type == "keypress" || (isTypeForSpecialKey && keyCode == 13 || keyCode == 83 /*return*/ )) { // in IE, special keys don't send keypress, the keydown does the action if (!outsideKeyPress(evt)) @@ -3575,7 +3575,6 @@ function Ace2Inner(){ { outsideKeyDown(evt); } - if (!stopped) { var specialHandledInHook = hooks.callAll('aceKeyEvent', { @@ -3614,6 +3613,12 @@ function Ace2Inner(){ }, 0); specialHandled = true; } + if ((!specialHandled) && isTypeForSpecialKey && keyCode == 83) + { + evt.preventDefault(); + parent.parent.pad.collabClient.sendMessage({"type":"SAVE_REVISION"}); /* The parent.parent part of this is BAD and I feel bad.. It may break something */ + specialHandled = true; + } if ((!specialHandled) && isTypeForSpecialKey && keyCode == 9 && !(evt.metaKey || evt.ctrlKey)) { // tab From 93e9d7c852be597b3793106069ef8adc5d80734c Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 28 Nov 2012 17:20:58 +0000 Subject: [PATCH 2/3] remove control S comment --- src/static/js/ace2_inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 9290fd56..da646b7e 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3537,7 +3537,7 @@ function Ace2Inner(){ var keyCode = evt.keyCode; var which = evt.which; - // prevent ESC key and Control S + // prevent ESC key if (keyCode == 27) { evt.preventDefault(); From d76100358840e24079a523b7b9c8d135370878ef Mon Sep 17 00:00:00 2001 From: John McLear Date: Fri, 30 Nov 2012 22:50:54 +0000 Subject: [PATCH 3/3] fix path to favicon resolves #1236 --- src/node/utils/Settings.js | 2 ++ src/templates/pad.html | 2 +- src/templates/timeslider.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 9caa2b0b..fb2a592c 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -38,6 +38,8 @@ exports.title = "Etherpad Lite"; * The app favicon fully specified url, visible e.g. in the browser window */ exports.favicon = "favicon.ico"; +exports.faviconPad = "../" + exports.favicon; +exports.faviconTimeslider = "../../" + exports.favicon; /** * The IP ep-lite should listen to diff --git a/src/templates/pad.html b/src/templates/pad.html index 3f3eee4f..c1300d5e 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -32,7 +32,7 @@ - +