mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Merge pull request #1229 from ether/control-s
catch control S and send an event to save a revision -- fixes #1128
This commit is contained in:
commit
ab148ebc1a
1 changed files with 7 additions and 2 deletions
|
@ -3562,7 +3562,7 @@ function Ace2Inner(){
|
||||||
inCallStackIfNecessary("handleKeyEvent", function()
|
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
|
// in IE, special keys don't send keypress, the keydown does the action
|
||||||
if (!outsideKeyPress(evt))
|
if (!outsideKeyPress(evt))
|
||||||
|
@ -3575,7 +3575,6 @@ function Ace2Inner(){
|
||||||
{
|
{
|
||||||
outsideKeyDown(evt);
|
outsideKeyDown(evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stopped)
|
if (!stopped)
|
||||||
{
|
{
|
||||||
var specialHandledInHook = hooks.callAll('aceKeyEvent', {
|
var specialHandledInHook = hooks.callAll('aceKeyEvent', {
|
||||||
|
@ -3614,6 +3613,12 @@ function Ace2Inner(){
|
||||||
}, 0);
|
}, 0);
|
||||||
specialHandled = true;
|
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))
|
if ((!specialHandled) && isTypeForSpecialKey && keyCode == 9 && !(evt.metaKey || evt.ctrlKey))
|
||||||
{
|
{
|
||||||
// tab
|
// tab
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue