mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Adds keyboard shortcut for refreshing all feeds
- Binds the 'R' key to trigger a refresh in the background for all feeds. - Updates the locale, using the same description as the link in the feeds page. Co-authored-by: Vitor Pellegrino <pellegrino@linux.com>
This commit is contained in:
parent
7e5157f218
commit
7fb0bdc9a5
17 changed files with 61 additions and 16 deletions
|
@ -167,11 +167,24 @@ function markEntryAsRead(element) {
|
|||
}
|
||||
}
|
||||
|
||||
// Send the Ajax request to refresh all feeds in the background
|
||||
function handleRefreshAllFeeds() {
|
||||
let url = document.body.dataset.refreshAllFeedsUrl;
|
||||
let request = new RequestBuilder(url);
|
||||
|
||||
request.withCallback(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
|
||||
request.withHttpMethod("GET");
|
||||
request.execute();
|
||||
}
|
||||
|
||||
// Send the Ajax request to change entries statuses.
|
||||
function updateEntriesStatus(entryIDs, status, callback) {
|
||||
let url = document.body.dataset.entriesStatusUrl;
|
||||
let request = new RequestBuilder(url);
|
||||
request.withBody({ entry_ids: entryIDs, status: status });
|
||||
request.withBody({entry_ids: entryIDs, status: status});
|
||||
request.withCallback(callback);
|
||||
request.execute();
|
||||
|
||||
|
@ -296,7 +309,7 @@ function openOriginalLink(openLinkInCurrentTab) {
|
|||
|
||||
let currentItem = document.querySelector(".current-item");
|
||||
// If we are not on the list of starred items, move to the next item
|
||||
if (document.location.href != document.querySelector('a[data-page=starred]').href){
|
||||
if (document.location.href != document.querySelector('a[data-page=starred]').href) {
|
||||
goToNextListItem();
|
||||
}
|
||||
markEntryAsRead(currentItem);
|
||||
|
|
3
ui/static/js/bootstrap.js
vendored
3
ui/static/js/bootstrap.js
vendored
|
@ -27,6 +27,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
keyboardHandler.on("s", () => handleSaveEntry());
|
||||
keyboardHandler.on("d", () => handleFetchOriginalContent());
|
||||
keyboardHandler.on("f", () => handleBookmark());
|
||||
keyboardHandler.on("R", () => handleRefreshAllFeeds());
|
||||
keyboardHandler.on("?", () => showKeyboardShortcuts());
|
||||
keyboardHandler.on("#", () => unsubscribeFromFeed());
|
||||
keyboardHandler.on("/", (e) => setFocusToSearchInput(e));
|
||||
|
@ -91,5 +92,5 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,6 +14,11 @@ class RequestBuilder {
|
|||
};
|
||||
}
|
||||
|
||||
withHttpMethod(method) {
|
||||
this.options.method = method;
|
||||
return this;
|
||||
}
|
||||
|
||||
withBody(body) {
|
||||
this.options.body = JSON.stringify(body);
|
||||
return this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue