mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
Keyboard shortcut legend
New: Show keybaord shortcuts with '?' New: ctrl+s will save settings
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'vent',
|
||||
'Hotkeys/HotkeysView'
|
||||
], function ($, vent, HotkeysView) {
|
||||
$(document).on('keydown', function (e) {
|
||||
if (e.ctrlKey && e.keyCode === 83) {
|
||||
vent.trigger(vent.Hotkeys.SaveSettings);
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.shiftKey && e.keyCode === 191) {
|
||||
vent.trigger(vent.Commands.OpenModalCommand, new HotkeysView());
|
||||
// vent.trigger(vent.Hotkeys.ShowHotkeys);
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(e.target).is('input') || $(e.target).is('textarea')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.ctrlKey || e.metaKey || e.altKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.keyCode === 84) {
|
||||
vent.trigger(vent.Hotkeys.NavbarSearch);
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'vent',
|
||||
'marionette'
|
||||
], function (vent, Marionette) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Hotkeys/HotkeysViewTemplate'
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Keyboard Shortcuts</h3>
|
||||
</div>
|
||||
<div class="modal-body hotkeys-modal">
|
||||
<div class="row hotkey-group">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-5 col-md-offset-1">
|
||||
<h3>Focus Search Box</h3>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<kbd class="hotkey">t</kbd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-md-offset-1">
|
||||
Pressing 't' puts the cursor in the search box below the navigation links
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hotkey-group">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-5 col-md-offset-1">
|
||||
<h3>Save Settings</h3>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<kbd class="hotkey">ctrl + s</kbd>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-md-offset-1">
|
||||
Pressing ctrl + 's' saves your settings (only in settings)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal">close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
.hotkeys-modal {
|
||||
h3 {
|
||||
margin-top : 0px;
|
||||
margin-botton : 0px;
|
||||
}
|
||||
|
||||
.hotkey-group {
|
||||
&:first-of-type {
|
||||
margin-top : 0px;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom : 0px;
|
||||
}
|
||||
|
||||
margin-top : 25px;
|
||||
margin-bottom : 25px;
|
||||
|
||||
.hotkey {
|
||||
font-size : 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user