1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Add keyboard shortcut to jump to an item's feed page

This commit is contained in:
Richard Schneider 2020-10-06 20:06:12 -05:00 committed by GitHub
parent 7da72cf89a
commit 93f90dae68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -390,13 +390,24 @@ function goToNext() {
}
function goToFeedOrFeeds() {
if (isEntry()) {
goToFeed();
} else {
goToPage('feeds');
}
}
function goToFeed() {
if (isEntry()) {
let feedAnchor = document.querySelector("span.entry-website a");
if (feedAnchor !== null) {
window.location.href = feedAnchor.href;
}
} else {
goToPage('feeds');
let currentItemFeed = document.querySelector(".current-item a[data-feed-link]");
if (currentItemFeed !== null) {
window.location.href = currentItemFeed.getAttribute("href");
}
}
}

View file

@ -27,6 +27,7 @@ document.addEventListener("DOMContentLoaded", function () {
keyboardHandler.on("s", () => handleSaveEntry());
keyboardHandler.on("d", () => handleFetchOriginalContent());
keyboardHandler.on("f", () => handleBookmark());
keyboardHandler.on("F", () => goToFeed());
keyboardHandler.on("R", () => handleRefreshAllFeeds());
keyboardHandler.on("?", () => showKeyboardShortcuts());
keyboardHandler.on("#", () => unsubscribeFromFeed());