From f8232151a0a4bdd430e928d742686a2330e99d68 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 Apr 2008 07:27:49 +0100 Subject: [PATCH] add hotkey to catchup all feeds, add optional warning to catchupAllFeeds() --- functions.js | 6 ++++++ localized_js.php | 2 +- tt-rss.js | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/functions.js b/functions.js index d30e6bee..8f58f353 100644 --- a/functions.js +++ b/functions.js @@ -347,6 +347,12 @@ function hotkey_handler(e) { } } + if (keycode == 81 && shift_key) { // shift + q + if (typeof catchupAllFeeds != 'undefined') { + return catchupAllFeeds(); + } + } + if (typeof localHotkeyHandler != 'undefined') { try { return localHotkeyHandler(e); diff --git a/localized_js.php b/localized_js.php index fbfdd412..6c1ff776 100644 --- a/localized_js.php +++ b/localized_js.php @@ -130,7 +130,7 @@ print T_js_decl("Publish article"); print T_js_decl("Unpublish article"); print T_js_decl("You can't clear this type of feed."); print T_js_decl("Erase all non-starred articles in %s?"); -#print T_js_decl( +print T_js_decl("Mark all articles as read?"); #print T_js_decl( #print T_js_decl( #print T_js_decl( diff --git a/tt-rss.js b/tt-rss.js index b7a6fca1..e165ec1c 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -219,20 +219,24 @@ function updateFeedList(silent, fetch) { function catchupAllFeeds() { - var query_str = "backend.php?op=feeds&subop=catchupAll"; + var str = __("Mark all articles as read?"); - notify_progress("Marking all feeds as read..."); + if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) { - debug("catchupAllFeeds Q=" + query_str); + var query_str = "backend.php?op=feeds&subop=catchupAll"; - new Ajax.Request(query_str, { - onComplete: function(transport) { - feedlist_callback2(transport); - } }); + notify_progress("Marking all feeds as read..."); - global_unread = 0; - updateTitle(""); + debug("catchupAllFeeds Q=" + query_str); + new Ajax.Request(query_str, { + onComplete: function(transport) { + feedlist_callback2(transport); + } }); + + global_unread = 0; + updateTitle(""); + } } function viewCurrentFeed(subop) { -- 2.39.2