]> git.wh0rd.org Git - tt-rss.git/commitdiff
some new hotkeys
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 Nov 2005 05:40:03 +0000 (06:40 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 Nov 2005 05:40:03 +0000 (06:40 +0100)
backend.php
feedlist.js
tt-rss.js
viewfeed.js

index f571f8ba0d8b2dad277204eef84d925c526db069..77812b981a5306ec2f5278e226d00682909fe738 100644 (file)
                                <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
                                <script type=\"text/javascript\" src=\"functions.js\"></script>
                                <script type=\"text/javascript\" src=\"viewfeed.js\"></script>
-                               </head><body>";
+                               </head><body onload='init()'>";
                }
 
                if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
                        <title>Tiny Tiny RSS : Help</title>
                        <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
                        <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\">
                        </head><body>";
 
index 9e18489d90f87f3679d29b67c135eeb92e3f9a1c..ef0c42c2f3a709fc97604c798ce66b696c42b6c3 100644 (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;
 }
index 0201e2a73fca62d5cb95bd2a1a76f6f098161536..77f90303fcdfb05e9e214276a4a8d4d9cb6a6481 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -264,12 +264,18 @@ function localHotkeyHandler(keycode) {
                return moveToPost('prev');
        } */
 
-       if (keycode == 82) {
+       if (keycode == 82) { // r
                return scheduleFeedUpdate(true);
        }
 
-       if (keycode == 85) {
-               return viewfeed(getActiveFeedId(), 0, "ForceUpdate");
+       if (keycode == 85) { // u
+               if (getActiveFeedId()) {
+                       return viewfeed(getActiveFeedId(), 0, "ForceUpdate");
+               }
+       }
+
+       if (keycode == 65) { // a
+               return toggleDispRead();
        }
 
 //     notify("KC: " + keycode);
index 73ef4c9739d845a61f0dfcbc8d6832f121a5189e..459434839366de2ff32c4fac0df1f32fe1e5675b 100644 (file)
@@ -177,14 +177,28 @@ function viewfeed(id) {
 
 function localHotkeyHandler(keycode) {
 
-       if (keycode == 78) {
+       if (keycode == 78) { // n
                return moveToPost('next');
        }
 
-       if (keycode == 80) {
+       if (keycode == 80) { // p
                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
 //     if (keycode == 85) {
 //             return viewfeed(active_feed_id, active_offset, "ForceUpdate");
@@ -193,3 +207,7 @@ function localHotkeyHandler(keycode) {
 //     alert("KC: " + keycode);
 
 }
+
+function init() {
+       document.onkeydown = hotkey_handler;
+}