mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Merge pull request #5548 from SimonBrandner/add-search-shortcut
Add optional search shortcut
This commit is contained in:
commit
5431dc7331
6 changed files with 26 additions and 0 deletions
|
@ -168,6 +168,12 @@ const shortcuts: Record<Categories, IShortcut[]> = {
|
||||||
key: Key.U,
|
key: Key.U,
|
||||||
}],
|
}],
|
||||||
description: _td("Upload a file"),
|
description: _td("Upload a file"),
|
||||||
|
}, {
|
||||||
|
keybinds: [{
|
||||||
|
modifiers: [CMD_OR_CTRL],
|
||||||
|
key: Key.F,
|
||||||
|
}],
|
||||||
|
description: _td("Search (must be enabled)"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -425,6 +425,14 @@ class LoggedInView extends React.Component<IProps, IState> {
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case Key.F:
|
||||||
|
if (ctrlCmdOnly && SettingsStore.getValue("ctrlFForSearch")) {
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'focus_search',
|
||||||
|
});
|
||||||
|
handled = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Key.BACKTICK:
|
case Key.BACKTICK:
|
||||||
// Ideally this would be CTRL+P for "Profile", but that's
|
// Ideally this would be CTRL+P for "Profile", but that's
|
||||||
// taken by the print dialog. CTRL+I for "Information"
|
// taken by the print dialog. CTRL+I for "Information"
|
||||||
|
|
|
@ -766,6 +766,9 @@ export default class RoomView extends React.Component<IProps, IState> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'focus_search':
|
||||||
|
this.onSearchClick();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
||||||
'showImages',
|
'showImages',
|
||||||
'showChatEffects',
|
'showChatEffects',
|
||||||
'Pill.shouldShowPillAvatar',
|
'Pill.shouldShowPillAvatar',
|
||||||
|
'ctrlFForSearch',
|
||||||
];
|
];
|
||||||
|
|
||||||
static GENERAL_SETTINGS = [
|
static GENERAL_SETTINGS = [
|
||||||
|
|
|
@ -799,6 +799,8 @@
|
||||||
"Enable big emoji in chat": "Enable big emoji in chat",
|
"Enable big emoji in chat": "Enable big emoji in chat",
|
||||||
"Send typing notifications": "Send typing notifications",
|
"Send typing notifications": "Send typing notifications",
|
||||||
"Show typing notifications": "Show typing notifications",
|
"Show typing notifications": "Show typing notifications",
|
||||||
|
"Use Command + F to search": "Use Command + F to search",
|
||||||
|
"Use Ctrl + F to search": "Use Ctrl + F to search",
|
||||||
"Use Command + Enter to send a message": "Use Command + Enter to send a message",
|
"Use Command + Enter to send a message": "Use Command + Enter to send a message",
|
||||||
"Use Ctrl + Enter to send a message": "Use Ctrl + Enter to send a message",
|
"Use Ctrl + Enter to send a message": "Use Ctrl + Enter to send a message",
|
||||||
"Automatically replace plain text Emoji": "Automatically replace plain text Emoji",
|
"Automatically replace plain text Emoji": "Automatically replace plain text Emoji",
|
||||||
|
@ -2708,6 +2710,7 @@
|
||||||
"Dismiss read marker and jump to bottom": "Dismiss read marker and jump to bottom",
|
"Dismiss read marker and jump to bottom": "Dismiss read marker and jump to bottom",
|
||||||
"Jump to oldest unread message": "Jump to oldest unread message",
|
"Jump to oldest unread message": "Jump to oldest unread message",
|
||||||
"Upload a file": "Upload a file",
|
"Upload a file": "Upload a file",
|
||||||
|
"Search (must be enabled)": "Search (must be enabled)",
|
||||||
"Jump to room search": "Jump to room search",
|
"Jump to room search": "Jump to room search",
|
||||||
"Navigate up/down in the room list": "Navigate up/down in the room list",
|
"Navigate up/down in the room list": "Navigate up/down in the room list",
|
||||||
"Select room from the room list": "Select room from the room list",
|
"Select room from the room list": "Select room from the room list",
|
||||||
|
|
|
@ -331,6 +331,11 @@ export const SETTINGS: {[setting: string]: ISetting} = {
|
||||||
displayName: _td("Show typing notifications"),
|
displayName: _td("Show typing notifications"),
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
"ctrlFForSearch": {
|
||||||
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
|
displayName: isMac ? _td("Use Command + F to search") : _td("Use Ctrl + F to search"),
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
"MessageComposerInput.ctrlEnterToSend": {
|
"MessageComposerInput.ctrlEnterToSend": {
|
||||||
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
|
||||||
displayName: isMac ? _td("Use Command + Enter to send a message") : _td("Use Ctrl + Enter to send a message"),
|
displayName: isMac ? _td("Use Command + Enter to send a message") : _td("Use Ctrl + Enter to send a message"),
|
||||||
|
|
Loading…
Reference in a new issue