From 1e357d3ced01db01ef53d61219f868b77864f2c9 Mon Sep 17 00:00:00 2001 From: Thiago Perrotta Date: Sun, 27 Feb 2022 21:33:53 -0500 Subject: [PATCH] Add '+' shortcut for new subscription page --- template/templates/common/layout.html | 2 ++ ui/static/js/app.js | 5 +++++ ui/static/js/bootstrap.js | 1 + 3 files changed, 8 insertions(+) diff --git a/template/templates/common/layout.html b/template/templates/common/layout.html index c81edc1d..0baaf4b4 100644 --- a/template/templates/common/layout.html +++ b/template/templates/common/layout.html @@ -47,6 +47,7 @@ @@ -128,6 +129,7 @@
  • {{ t "page.keyboard_shortcuts.go_to_categories" }} = g + c
  • {{ t "page.keyboard_shortcuts.go_to_settings" }} = g + s
  • {{ t "page.keyboard_shortcuts.show_keyboard_shortcuts" }} = ?
  • +
  • {{ t "menu.add_feed" }} = +
  • {{ t "page.keyboard_shortcuts.subtitle.items" }}

    diff --git a/ui/static/js/app.js b/ui/static/js/app.js index ab99a70d..a58fd499 100644 --- a/ui/static/js/app.js +++ b/ui/static/js/app.js @@ -612,3 +612,8 @@ function showToast(label, iconElement) { } } } + +/** Navigate to the new subscription page. */ +function goToAddSubscription() { + window.location.href = document.body.dataset.addSubscriptionUrl; +} diff --git a/ui/static/js/bootstrap.js b/ui/static/js/bootstrap.js index 6a1c9dbc..e21efc73 100644 --- a/ui/static/js/bootstrap.js +++ b/ui/static/js/bootstrap.js @@ -32,6 +32,7 @@ document.addEventListener("DOMContentLoaded", function () { keyboardHandler.on("F", () => goToFeed()); keyboardHandler.on("R", () => handleRefreshAllFeeds()); keyboardHandler.on("?", () => showKeyboardShortcuts()); + keyboardHandler.on("+", () => goToAddSubscription()); keyboardHandler.on("#", () => unsubscribeFromFeed()); keyboardHandler.on("/", (e) => setFocusToSearchInput(e)); keyboardHandler.on("Escape", () => ModalHandler.close());