mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Add comments link keyboard shortcut
This commit is contained in:
parent
e2315e6a54
commit
6ebb29cd22
18 changed files with 84 additions and 20 deletions
|
@ -304,6 +304,25 @@ function openOriginalLink(openLinkInCurrentTab) {
|
|||
}
|
||||
}
|
||||
|
||||
function openCommentLink(openLinkInCurrentTab) {
|
||||
if (!isListView()) {
|
||||
let entryLink = document.querySelector("a[data-comments-link]");
|
||||
if (entryLink !== null) {
|
||||
if (openLinkInCurrentTab) {
|
||||
window.location.href = entryLink.getAttribute("href");
|
||||
} else {
|
||||
DomHelper.openNewTab(entryLink.getAttribute("href"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
let currentItemCommentsLink = document.querySelector(".current-item a[data-comments-link]");
|
||||
if (currentItemCommentsLink !== null) {
|
||||
DomHelper.openNewTab(currentItemCommentsLink.getAttribute("href"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function openSelectedItem() {
|
||||
let currentItemLink = document.querySelector(".current-item .item-title a");
|
||||
if (currentItemLink !== null) {
|
||||
|
|
2
ui/static/js/bootstrap.js
vendored
2
ui/static/js/bootstrap.js
vendored
|
@ -20,6 +20,8 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
keyboardHandler.on("o", () => openSelectedItem());
|
||||
keyboardHandler.on("v", () => openOriginalLink());
|
||||
keyboardHandler.on("V", () => openOriginalLink(true));
|
||||
keyboardHandler.on("c", () => openCommentLink());
|
||||
keyboardHandler.on("C", () => openCommentLink(true));
|
||||
keyboardHandler.on("m", () => handleEntryStatus());
|
||||
keyboardHandler.on("A", () => markPageAsRead());
|
||||
keyboardHandler.on("s", () => handleSaveEntry());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue