Skip to content

Commit

Permalink
new keyboard shortcuts.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Dec 5, 2024
1 parent e600475 commit 388e4d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions assets/js/uploader-keyboard.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @module uploader-keyboard
* This module provides keyboard shortcuts for handling file uploads.
* This module provides keyboard shortcuts for handling file uploads and jump to searches.
*/
import { focusModalById } from "./uploader.mjs";
export default keyboardShortcuts;
Expand Down Expand Up @@ -39,7 +39,10 @@ const demozoo = "d",
nfo = "n",
graphic = "g",
magazine = "m",
advanced = "a";
advanced = "a",
releasers = "r",
files = "f",
descriptions = "x";

/**
* Binds keyboard shortcuts to specific actions.
Expand Down Expand Up @@ -74,6 +77,18 @@ export function keyboardShortcuts() {
case advanced:
advancedModal.show();
break;
case releasers:
event.preventDefault();
window.location.href = "/search/releaser";
break;
case files:
event.preventDefault();
window.location.href = "/search/file";
break;
case descriptions:
event.preventDefault();
window.location.href = "/search/desc";
break;
}
});
}
Loading

0 comments on commit 388e4d5

Please sign in to comment.