]> git.wh0rd.org - tt-rss.git/commitdiff
new shortcut: tab (selects article under cursor)
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 15:58:15 +0000 (16:58 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 May 2008 15:58:15 +0000 (16:58 +0100)
functions.php
help/3.php
tt-rss.js
viewfeed.js

index 2696f9f223ff94cb665a1d06bd7686b46bbeb09d..fcbfe40fb1c26dcb99569d9ffc3a03a51ef55577 100644 (file)
                                                                $line["feed_title"]."</a> $vf_catchup_link:</td></tr>";
                                                }
                                        }
-                                       
-                                       print "<tr class='$class' id='RROW-$id'>";
+
+                                       $mouseover_attrs = "onmouseover='postMouseIn($id)' 
+                                               onmouseout='postMouseOut($id)'";
+
+                                       print "<tr class='$class' id='RROW-$id' $mouseover_attrs>";
                
                                        print "<td class='hlUpdPic'>$update_pic</td>";
                
                                                $cdm_cstyle = "style=\"display : none\"";
                                        }
 
+                                       $mouseover_attrs = "onmouseover='postMouseIn($id)' 
+                                               onmouseout='postMouseOut($id)'";
+
                                        print "<div class=\"cdmArticle$add_class\" 
-                                               id=\"RROW-$id\" onmouseover='cdmMouseIn(this)' 
+                                               id=\"RROW-$id\"
                                                onclick='cdmClicked(this)'
-                                               onmouseout='cdmMouseOut(this)'>";
+                                               $mouseover_attrs'>";
 
                                        print "<div class=\"cdmHeader\">";
 
index 32004056870ddb1ec5de9f86a0112e8a47d0aab0..97f91439cb98f082d8bc3a98a737fd23b18b418c 100644 (file)
@@ -23,6 +23,8 @@
        <h2><?php echo __("Other actions") ?></h2>
 
        <table>
+               <tr><td class='n'>[tab]</td><td><?php echo __("Select article under mouse cursor") ?></td></tr>
+
                <tr><td class='n'>c f</td><td><?php echo __("Create filter") ?></td></tr>
                <tr><td class='n'>c s</td><td><?php echo __("Collapse sidebar") ?></td></tr>
                <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
index c8604584091f8726a50ce7ad96a45a04eab71f91..6dd3427457d3e9c34ad2877ae5c0a0a8c63eb3ab 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1012,13 +1012,15 @@ function hotkey_handler(e) {
 
                        if (keycode == 78 || keycode == 40) { // n, down
                                if (typeof moveToPost != 'undefined') {
-                                       return moveToPost('next');
+                                       moveToPost('next');
+                                       return false;
                                }
                        }
        
                        if (keycode == 80 || keycode == 38) { // p, up
                                if (typeof moveToPost != 'undefined') {
-                                       return moveToPost('prev');
+                                       moveToPost('prev');
+                                       return false;
                                }
                        }
 
@@ -1047,15 +1049,15 @@ function hotkey_handler(e) {
                                return;
                        }
 
-                       if (keycode == 84) { // t
+                       if (keycode == 84 && shift_key) { // T
                                var id = getActiveArticleId();
                                if (id) {
                                        editArticleTags(id, getActiveFeedId(), isCdmMode());
                                }
                        }
 
-/*                     if (keycode == 84) { // t
-                               var id = getActiveArticleId();
+                       if (keycode == 9) { // tab
+                               var id = getArticleUnderPointer();
                                if (id) {                               
                                        var cb = document.getElementById("RCHK-" + id);
 
@@ -1063,8 +1065,10 @@ function hotkey_handler(e) {
                                                cb.checked = !cb.checked;
                                                toggleSelectRowById(cb, "RROW-" + id);
                                        }
+
+                                       return false;
                                }
-                       } */
+                       }
 
                        if (keycode == 79) { // o
                                if (getActiveArticleId()) {
@@ -1346,4 +1350,3 @@ function hotkey_handler(e) {
        }
 }
 
-
index caaec2daa48a343fa16376df81cea0bde8c8807b..3bb121e25d553a18b8b7d5a3076563bfc330d25a 100644 (file)
@@ -18,6 +18,7 @@ var _cdm_wd_vishist = new Array();
 var article_cache = new Array();
 
 var vgroup_last_feed = false;
+var post_under_pointer = false;
 
 function catchup_callback() {
        if (xmlhttp_rpc.readyState == 4) {
@@ -1603,6 +1604,22 @@ function cdmClicked(elem) {
        } 
 }
 
+function postMouseIn(id) {
+       try {
+               post_under_pointer = id;
+       } catch (e) {
+               exception_error("postMouseIn", e);
+       }
+}
+
+function postMouseOut(id) {
+       try {
+               post_under_pointer = false;
+       } catch (e) {
+               exception_error("postMouseOut", e);
+       }
+}
+
 function cdmMouseIn(elem) {
 /*     try {
                if (elem.id && elem.id.match("RROW-")) {
@@ -1798,5 +1815,8 @@ function subtoolbarSearch() {
        } catch (e) {
                exception_error("subtoolbarSearch", e);
        }
+}
 
+function getArticleUnderPointer() {
+       return post_under_pointer;
 }