From: Andrew Dolgov Date: Mon, 28 Nov 2005 06:50:47 +0000 (+0100) Subject: add j,k bindings to subframes X-Git-Tag: schema_feature_freeze_for_1.1~48 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=63186cdb788724f02e8401e9f3b2f1d57ba438b3;p=tt-rss.git add j,k bindings to subframes --- diff --git a/feedlist.js b/feedlist.js index 499705b6..a974afdb 100644 --- a/feedlist.js +++ b/feedlist.js @@ -118,6 +118,20 @@ function localHotkeyHandler(keycode) { return parent.scheduleFeedUpdate(true); } + var feedlist = document.getElementById('feedList'); + + if (keycode == 74) { // j + var feed = getActiveFeedId(); + var new_feed = getRelativeFeedId(feedlist, feed, 'prev'); + if (new_feed) viewfeed(new_feed, 0, ''); + } + + if (keycode == 75) { // k + var feed = getActiveFeedId(); + var new_feed = getRelativeFeedId(feedlist, feed, 'next'); + if (new_feed) viewfeed(new_feed, 0, ''); + } + // alert("KC: " + keycode); } diff --git a/viewfeed.js b/viewfeed.js index 7f338240..4aa7f4f5 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -204,6 +204,21 @@ function localHotkeyHandler(keycode) { return parent.scheduleFeedUpdate(true); } + var f_doc = parent.frames["feeds-frame"].document; + var feedlist = f_doc.getElementById('feedList'); + + if (keycode == 74) { // j + var feed = getActiveFeedId(); + var new_feed = getRelativeFeedId(feedlist, feed, 'prev'); + if (new_feed) viewfeed(new_feed, 0, ''); + } + + if (keycode == 75) { // k + var feed = getActiveFeedId(); + var new_feed = getRelativeFeedId(feedlist, feed, 'next'); + if (new_feed) viewfeed(new_feed, 0, ''); + } + // FIXME // if (keycode == 85) { // return viewfeed(active_feed_id, active_offset, "ForceUpdate");