mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
chat: Move Alt-C handling to chat.js
This commit is contained in:
parent
92cd1feb8a
commit
870191f622
3 changed files with 16 additions and 9 deletions
|
@ -12,6 +12,12 @@
|
|||
"shutdown": "ep_etherpad-lite/node/utils/Minify"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "chat",
|
||||
"client_hooks": {
|
||||
"aceKeyEvent": "ep_etherpad-lite/static/js/chat"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "express",
|
||||
"hooks": {
|
||||
|
|
|
@ -2585,15 +2585,6 @@ function Ace2Inner(editorInfo, cssManagers) {
|
|||
firstEditbarElement.focus();
|
||||
evt.preventDefault();
|
||||
}
|
||||
if (!specialHandled && type === 'keydown' &&
|
||||
altKey && keyCode === 67 &&
|
||||
padShortcutEnabled.altC) {
|
||||
// Alt c focuses on the Chat window
|
||||
evt.target.blur();
|
||||
parent.parent.chat.show();
|
||||
parent.parent.chat.focus();
|
||||
evt.preventDefault();
|
||||
}
|
||||
if (!specialHandled && type === 'keydown' &&
|
||||
evt.ctrlKey && shiftKey && keyCode === 50 &&
|
||||
padShortcutEnabled.cmdShift2) {
|
||||
|
|
|
@ -296,3 +296,13 @@ exports.chat = (() => {
|
|||
},
|
||||
};
|
||||
})();
|
||||
|
||||
exports.aceKeyEvent = (hookName, {evt}) => {
|
||||
const {altC} = window.clientVars.padShortcutEnabled;
|
||||
if (evt.type !== 'keydown' || !evt.altKey || evt.keyCode !== 67 || !altC) return;
|
||||
evt.target.blur();
|
||||
exports.chat.show();
|
||||
exports.chat.focus();
|
||||
evt.preventDefault();
|
||||
return true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue