webmail: don't bind to shortcuts ctrl-l, ctrl-u and ctrl-I

ctrl-l is commonly "focus on browser address bar".
ctrl-u is commonly "view source".
ctrl-I (shift i) is commonly "open developer console".

these keys are more useful to leave for the browser.  ctrl-l and ctrl-u (moving
to a message without opening it) can still be had by using also pressing shift.
the previous ctrl-shift-i (show all headers) is now just ctrl-i.

this has been requested in the past on irc/matrix (i forgot who).
This commit is contained in:
Mechiel Lukkien
2024-12-07 11:51:11 +01:00
parent 0a77bc5955
commit 4d3c4115f8
2 changed files with 33 additions and 6 deletions

View File

@ -1212,7 +1212,12 @@ const cmdHelp = async () => {
dom.tr(
dom.td('↓', ', j'),
dom.td('down one message'),
dom.td(attr.rowspan('6'), css('helpSideNote', {color: '#888', borderLeft: '2px solid', borderLeftColor: '#888', paddingLeft: '.5em'}), 'hold ctrl to only move focus', dom.br(), 'hold shift to expand selection'),
dom.td(
attr.rowspan('6'),
css('helpSideNote', {color: '#888', borderLeft: '2px solid', borderLeftColor: '#888', paddingLeft: '.5em'}),
dom.div('hold ctrl to only move focus', attr.title('ctrl-l and ctrl-u are left for the browser the handle')),
dom.div('hold shift to expand selection'),
),
),
[
[['↑', ', k'], 'up one message'],
@ -1273,7 +1278,7 @@ const cmdHelp = async () => {
['O', 'show raw message'],
['ctrl p', 'print message'],
['I', 'toggle internals'],
['ctrl I', 'toggle all headers'],
['ctrl i', 'toggle all headers'],
['alt k, alt ArrowUp', 'scroll up'],
['alt j, alt ArrowDown', 'scroll down'],
@ -3156,7 +3161,7 @@ const newMsgView = (miv: MsgitemView, msglistView: MsglistView, listMailboxes: l
v: cmdViewAttachments,
t: cmdShowText,
T: cmdShowHTMLCycle,
'ctrl I': cmdToggleHeaders,
'ctrl i': cmdToggleHeaders,
'alt j': cmdDown,
'alt k': cmdUp,
@ -4981,6 +4986,12 @@ const newMsglistView = (msgElem: HTMLElement, activeMailbox: () => api.Mailbox |
} else if (e.key === 'ArrowDown' || e.key === 'j' || e.key === 'J') {
moveclick(i+1, e.key === 'J')
} else if (e.key === 'PageUp' || e.key === 'h' || e.key === 'H' || e.key === 'PageDown' || e.key === 'l' || e.key === 'L') {
// Commonly bound to "focus to browser address bar", moving cursor to one page down
// without opening isn't useful enough.
if (e.key === 'l' && e.ctrlKey) {
return
}
if (msgitemViews.length > 0) {
let n = Math.max(1, Math.floor(scrollElemHeight()/mlv.itemHeight())-1)
if (e.key === 'PageUp' || e.key === 'h' || e.key === 'H') {
@ -5017,6 +5028,12 @@ const newMsglistView = (msgElem: HTMLElement, activeMailbox: () => api.Mailbox |
moveclick(msgitemViews.indexOf(thrmiv), true)
}
} else if (e.key === 'u' || e.key === 'U') {
// Commonly bound to "view source", moving cursor to next unread message without
// opening isn't useful enough.
if (e.key === 'u' && e.ctrlKey) {
return
}
for (i = i < 0 ? 0 : i+1; i < msgitemViews.length; i += 1) {
if (!msgitemViews[i].messageitem.Message.Seen || msgitemViews[i].collapsed && msgitemViews[i].findDescendant(miv => !miv.messageitem.Message.Seen)) {
moveclick(i, true)