]> git.wh0rd.org - tt-rss.git/commitdiff
set N/P hotkeys to scroll active article (or headlines pane in CDM)
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 9 Sep 2008 07:08:47 +0000 (08:08 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 9 Sep 2008 07:08:47 +0000 (08:08 +0100)
help/3.php
tt-rss.js
viewfeed.js

index dadb627da3ee0bd556f0b710bf18273d4942af31..92c4be2efde797bb102f5fe52c1b7b1ae40a7549 100644 (file)
@@ -18,7 +18,9 @@
                <tr><td class='n'>u</td><td><?php echo __("Toggle unread") ?></td></tr>
                <tr><td class='n'>T</td><td><?php echo __("Edit tags") ?></td></tr>
                <tr><td class='n'>o</td><td><?php echo __("Open article in new window") ?></td></tr>
-               <tr><td class='n'>N/P</td><td><?php echo __("Mark articles below/above active one as read") ?></td></tr>
+               <tr><td class='n'>c n/c p</td><td><?php echo __("Mark articles below/above active one as read") ?></td></tr>
+               <tr><td class='n'>N/P</td><td><?php echo __("Scroll article content") ?></td></tr>
+
        </table>
 
        <h2><?php echo __("Other actions") ?></h2>
index 9a52354976f27bd8b91b129e4f93d1464b0e67bb..3cb07e1243ba18c0bc0879c80c6ca492a4dfd5fc 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1134,16 +1134,27 @@ function hotkey_handler(e) {
                                return;
                        }
 
-                       if (shift_key && (keycode == 78 || keycode == 40)) { // shift - n, down
+                       if (shift_key && keycode == 40) { // shift-down
                                catchupRelativeToArticle(1);
                                return;
                        }
 
-                       if (shift_key && (keycode == 80 || keycode == 38)) { // shift - p, up
+                       if (shift_key && keycode == 38) { // shift-up
                                catchupRelativeToArticle(0);
                                return;
                        }
 
+                       if (shift_key && keycode == 78) { // N
+                               scrollArticle(50);      
+                               return;
+                       }
+
+                       if (shift_key && keycode == 80) { // P
+                               scrollArticle(-50);     
+                               return;
+                       }
+
+
                        if (keycode == 78 || keycode == 40) { // n, down
                                if (typeof moveToPost != 'undefined') {
                                        moveToPost('next');
@@ -1332,6 +1343,17 @@ function hotkey_handler(e) {
                                }
                        }
 
+                       if (keycode == 78) { // n
+                               catchupRelativeToArticle(1);
+                               return;
+                       }
+
+                       if (keycode == 80) { // p
+                               catchupRelativeToArticle(0);
+                               return;
+                       }
+
+
                }
 
                /* Prefix g */
index 5813f413556a53fc229cc0c569370208dcf30a33..4b90f1d051ca069a9a936c2f70bdf6263bf6c298 100644 (file)
@@ -1903,3 +1903,22 @@ function zoomToArticle(id) {
                exception_error("zoomToArticle", e);
        }
 }
+
+function scrollArticle(offset) {
+       try {
+               if (!isCdmMode()) {
+                       var ci = document.getElementById("content-insert");
+                       if (ci) {
+                               ci.scrollTop += offset;
+                       }
+               } else {
+                       var hi = document.getElementById("headlinesInnerContainer");
+                       if (hi) {
+                               hi.scrollTop += offset;
+                       }
+
+               }
+       } catch (e) {
+               exception_error("scrollArticle", e);
+       }
+}