Skip to content

Commit

Permalink
feat: p hotkey for learning path
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamiell committed Dec 25, 2024
1 parent 5e34d9d commit 107ac06
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion static/js/hotkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,19 @@ function navigateForwards() {

function goToSpecificLevel() {
// eslint-disable-next-line no-alert
const levelString = prompt("Enter the level that you want to go to:");
const levelString = prompt(
"Enter the level that you want to go to (or p for the learning path):",
);
if (levelString === null || levelString === "") {
return;
}

// "p" is short for "Learning Path".
if (levelString.toLowerCase() === "p") {
globalThis.location.href = "/learning-path/";
return;
}

const level = parseIntSafe(levelString);
if (level === undefined) {
// eslint-disable-next-line no-alert
Expand Down

0 comments on commit 107ac06

Please sign in to comment.