From 63186cdb788724f02e8401e9f3b2f1d57ba438b3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Nov 2005 07:50:47 +0100 Subject: [PATCH] add j,k bindings to subframes --- feedlist.js | 14 ++++++++++++++ viewfeed.js | 15 +++++++++++++++ 2 files changed, 29 insertions(+) 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"); -- 2.39.5