mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Add support for left/right arrows on the movie details to navigate through movies
New: Add support for ctrl+home and ctrl+end to jump to the top and bottom of the movie index New: Add redirect to previous movie instead of index when deleting one
This commit is contained in:
@@ -20,18 +20,26 @@ function getShortcuts() {
|
||||
}
|
||||
|
||||
function getShortcutKey(combo, isOsx) {
|
||||
const comboMatch = combo.match(/(.+?)\+(.)/);
|
||||
const comboMatch = combo.match(/(.+?)\+(.*)/);
|
||||
|
||||
if (!comboMatch) {
|
||||
return combo;
|
||||
}
|
||||
|
||||
const modifier = comboMatch[1];
|
||||
const key = comboMatch[2];
|
||||
let key = comboMatch[2];
|
||||
let osModifier = modifier;
|
||||
|
||||
if (modifier === 'mod') {
|
||||
osModifier = isOsx ? 'cmd' : 'ctrl';
|
||||
osModifier = isOsx ? 'cmd' : 'Ctrl';
|
||||
}
|
||||
|
||||
if (key === 'home') {
|
||||
key = isOsx ? '↑' : 'Home';
|
||||
}
|
||||
|
||||
if (key === 'end') {
|
||||
key = isOsx ? '↓' : 'End';
|
||||
}
|
||||
|
||||
return `${osModifier} + ${key}`;
|
||||
|
@@ -1,31 +1,52 @@
|
||||
import Mousetrap from 'mousetrap';
|
||||
import React, { Component } from 'react';
|
||||
import getDisplayName from 'Helpers/getDisplayName';
|
||||
import translate from 'Utilities/String/translate';
|
||||
|
||||
export const shortcuts = {
|
||||
OPEN_KEYBOARD_SHORTCUTS_MODAL: {
|
||||
key: '?',
|
||||
name: 'Open This Modal'
|
||||
name: translate('OpenThisModal')
|
||||
},
|
||||
|
||||
CLOSE_MODAL: {
|
||||
key: 'Esc',
|
||||
name: 'Close Current Modal'
|
||||
name: translate('CloseCurrentModal')
|
||||
},
|
||||
|
||||
ACCEPT_CONFIRM_MODAL: {
|
||||
key: 'Enter',
|
||||
name: 'Accept Confirmation Modal'
|
||||
name: translate('AcceptConfirmationModal')
|
||||
},
|
||||
|
||||
MOVIE_SEARCH_INPUT: {
|
||||
key: 's',
|
||||
name: 'Focus Search Box'
|
||||
name: translate('FocusSearchBox')
|
||||
},
|
||||
|
||||
SAVE_SETTINGS: {
|
||||
key: 'mod+s',
|
||||
name: 'Save Settings'
|
||||
name: translate('SaveSettings')
|
||||
},
|
||||
|
||||
SCROLL_TOP: {
|
||||
key: 'mod+home',
|
||||
name: translate('MovieIndexScrollTop')
|
||||
},
|
||||
|
||||
SCROLL_BOTTOM: {
|
||||
key: 'mod+end',
|
||||
name: translate('MovieIndexScrollBottom')
|
||||
},
|
||||
|
||||
DETAILS_NEXT: {
|
||||
key: '→',
|
||||
name: translate('MovieDetailsNextMovie')
|
||||
},
|
||||
|
||||
DETAILS_PREVIOUS: {
|
||||
key: '←',
|
||||
name: translate('MovieDetailsPreviousMovie')
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user