add j,k bindings to subframes

This commit is contained in:
Andrew Dolgov 2005-11-28 07:50:47 +01:00
parent 7b433d8c02
commit 63186cdb78
2 changed files with 29 additions and 0 deletions

View File

@ -118,6 +118,20 @@ function localHotkeyHandler(keycode) {
return parent.scheduleFeedUpdate(true); 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); // alert("KC: " + keycode);
} }

View File

@ -204,6 +204,21 @@ function localHotkeyHandler(keycode) {
return parent.scheduleFeedUpdate(true); 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 // FIXME
// if (keycode == 85) { // if (keycode == 85) {
// return viewfeed(active_feed_id, active_offset, "ForceUpdate"); // return viewfeed(active_feed_id, active_offset, "ForceUpdate");