some new hotkeys

This commit is contained in:
Andrew Dolgov 2005-11-16 06:40:03 +01:00
parent cce41088c0
commit b623b3edcb
4 changed files with 51 additions and 9 deletions

View File

@ -469,7 +469,7 @@
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<script type=\"text/javascript\" src=\"functions.js\"></script> <script type=\"text/javascript\" src=\"functions.js\"></script>
<script type=\"text/javascript\" src=\"viewfeed.js\"></script> <script type=\"text/javascript\" src=\"viewfeed.js\"></script>
</head><body>"; </head><body onload='init()'>";
} }
if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) { if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
@ -1321,7 +1321,6 @@
<title>Tiny Tiny RSS : Help</title> <title>Tiny Tiny RSS : Help</title>
<link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\"> <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
<script type=\"text/javascript\" src=\"functions.js\"></script> <script type=\"text/javascript\" src=\"functions.js\"></script>
<script type=\"text/javascript\" src=\"feedlist.js\"></script>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
</head><body>"; </head><body>";

View File

@ -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;
}

View File

@ -264,13 +264,19 @@ function localHotkeyHandler(keycode) {
return moveToPost('prev'); return moveToPost('prev');
} */ } */
if (keycode == 82) { if (keycode == 82) { // r
return scheduleFeedUpdate(true); return scheduleFeedUpdate(true);
} }
if (keycode == 85) { if (keycode == 85) { // u
if (getActiveFeedId()) {
return viewfeed(getActiveFeedId(), 0, "ForceUpdate"); return viewfeed(getActiveFeedId(), 0, "ForceUpdate");
} }
}
if (keycode == 65) { // a
return toggleDispRead();
}
// notify("KC: " + keycode); // notify("KC: " + keycode);

View File

@ -177,14 +177,28 @@ function viewfeed(id) {
function localHotkeyHandler(keycode) { function localHotkeyHandler(keycode) {
if (keycode == 78) { if (keycode == 78) { // n
return moveToPost('next'); return moveToPost('next');
} }
if (keycode == 80) { if (keycode == 80) { // p
return moveToPost('prev'); 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 // FIXME
// if (keycode == 85) { // if (keycode == 85) {
// return viewfeed(active_feed_id, active_offset, "ForceUpdate"); // return viewfeed(active_feed_id, active_offset, "ForceUpdate");
@ -193,3 +207,7 @@ function localHotkeyHandler(keycode) {
// alert("KC: " + keycode); // alert("KC: " + keycode);
} }
function init() {
document.onkeydown = hotkey_handler;
}