diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index b3bc91a9f..9290fd567 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