diff options
-rw-r--r-- | feedlist.js | 14 | ||||
-rw-r--r-- | viewfeed.js | 15 |
2 files changed, 29 insertions, 0 deletions
diff --git a/feedlist.js b/feedlist.js index 499705b63..a974afdb2 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 7f3382402..4aa7f4f5e 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"); |