diff options
Diffstat (limited to 'ui/static/js')
-rw-r--r-- | ui/static/js/app.js | 19 | ||||
-rw-r--r-- | ui/static/js/bootstrap.js | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/ui/static/js/app.js b/ui/static/js/app.js index 2b32e63..968045e 100644 --- a/ui/static/js/app.js +++ b/ui/static/js/app.js @@ -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) { diff --git a/ui/static/js/bootstrap.js b/ui/static/js/bootstrap.js index dd394f0..7b9e94d 100644 --- a/ui/static/js/bootstrap.js +++ b/ui/static/js/bootstrap.js @@ -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()); |