From: Andrew Dolgov Date: Wed, 16 Nov 2005 05:40:03 +0000 (+0100) Subject: some new hotkeys X-Git-Tag: schema_feature_freeze_for_1.1~305 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b623b3edcb79ab73febbfac17e6dddc76745bea1;p=tt-rss.git some new hotkeys --- diff --git a/backend.php b/backend.php index f571f8ba..77812b98 100644 --- a/backend.php +++ b/backend.php @@ -469,7 +469,7 @@ - "; + "; } if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) { @@ -1321,7 +1321,6 @@ Tiny Tiny RSS : Help - "; diff --git a/feedlist.js b/feedlist.js index 9e18489d..ef0c42c2 100644 --- a/feedlist.js +++ b/feedlist.js @@ -88,8 +88,27 @@ function viewfeed(feed, skip, subop, doc) { } -function init() { +function localHotkeyHandler(keycode) { - hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1); + if (keycode == 65) { // a + return parent.toggleDispRead(); + } + if (keycode == 85) { // u + if (parent.getActiveFeedId()) { + return viewfeed(parent.getActiveFeedId(), 0, "ForceUpdate"); + } + } + + if (keycode == 82) { // r + return parent.scheduleFeedUpdate(true); + } + +// alert("KC: " + keycode); + +} + +function init() { + hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1); + document.onkeydown = hotkey_handler; } diff --git a/tt-rss.js b/tt-rss.js index 0201e2a7..77f90303 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -264,12 +264,18 @@ function localHotkeyHandler(keycode) { return moveToPost('prev'); } */ - if (keycode == 82) { + if (keycode == 82) { // r return scheduleFeedUpdate(true); } - if (keycode == 85) { - return viewfeed(getActiveFeedId(), 0, "ForceUpdate"); + if (keycode == 85) { // u + if (getActiveFeedId()) { + return viewfeed(getActiveFeedId(), 0, "ForceUpdate"); + } + } + + if (keycode == 65) { // a + return toggleDispRead(); } // notify("KC: " + keycode); diff --git a/viewfeed.js b/viewfeed.js index 73ef4c97..45943483 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -177,14 +177,28 @@ function viewfeed(id) { function localHotkeyHandler(keycode) { - if (keycode == 78) { + if (keycode == 78) { // n return moveToPost('next'); } - if (keycode == 80) { + if (keycode == 80) { // p return moveToPost('prev'); } + if (keycode == 65) { // a + return parent.toggleDispRead(); + } + + if (keycode == 85) { // u + if (parent.getActiveFeedId()) { + return parent.viewfeed(parent.getActiveFeedId(), 0, "ForceUpdate"); + } + } + + if (keycode == 82) { // r + return parent.scheduleFeedUpdate(true); + } + // FIXME // if (keycode == 85) { // return viewfeed(active_feed_id, active_offset, "ForceUpdate"); @@ -193,3 +207,7 @@ function localHotkeyHandler(keycode) { // alert("KC: " + keycode); } + +function init() { + document.onkeydown = hotkey_handler; +}