]> git.wh0rd.org - tt-rss.git/commitdiff
add placeholder mouse trap code, misc fixes
authorAndrew Dolgov <fox@bah.spb.su>
Mon, 19 May 2008 10:24:46 +0000 (11:24 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Mon, 19 May 2008 10:24:46 +0000 (11:24 +0100)
feedlist.js
functions.js
functions.php
tt-rss.js
viewfeed.js

index d5c15895227388fb13a2ec9a188790a0426f2ea7..62bfadb5a8ab98fb6d27049e10bab98accb51451 100644 (file)
@@ -1,6 +1,7 @@
 var _feed_cur_page = 0;
 var _infscroll_disable = 0;
 var _infscroll_request_sent = 0;
+var feed_under_pointer = undefined;
 
 function viewCategory(cat) {
        active_feed_is_cat = true;
@@ -327,6 +328,7 @@ function feedlist_init() {
                
                hideOrShowFeeds(document, getInitParam("hide_read_feeds") == 1);
                document.onkeydown = hotkey_handler;
+               document.onmousedown = mouse_handler;
                setTimeout("timeout()", 0);
 
 /*             debug("about to remove splash, OMG!");
@@ -460,7 +462,29 @@ function init_collapsable_feedlist(theme) {
 }
 
 function remove_splash() {
-       debug("about to remove splash, OMG!");
-       Element.hide("overlay");
-       debug("removed splash!");
+       if (Element.visible("overlay")) {
+               debug("about to remove splash, OMG!");
+               Element.hide("overlay");
+               debug("removed splash!");
+       }
+}
+
+function feedMouseIn(id) {
+       try {
+               if (feed_under_pointer != id) {
+                       feed_under_pointer = id;
+               }
+
+       } catch (e) {
+               exception_error("feedMouseIn", e);
+       }
 }
+
+function feedMouseOut(id) {
+       try {
+               feed_under_pointer = undefined;
+       } catch (e) {
+               exception_error("feedMouseOut", e);
+       }
+}
+
index 1e13d8e0ecf88882bf572d287e80cdb6668dab7a..997bcb13bbe72bdf9196408dc77d84294ce0b93c 100644 (file)
@@ -262,6 +262,8 @@ function getVisibleUnreadHeadlines() {
 
        var rows = new Array();
 
+       if (!content) return rows;
+
        for (i = 0; i < content.rows.length; i++) {
                var row_id = content.rows[i].id.replace("RROW-", "");
                if (row_id.length > 0 && content.rows[i].className.match("Unread")) {
@@ -277,6 +279,8 @@ function getVisibleHeadlineIds() {
 
        var rows = new Array();
 
+       if (!content) return rows;
+
        for (i = 0; i < content.rows.length; i++) {
                var row_id = content.rows[i].id.replace("RROW-", "");
                if (row_id.length > 0) {
index a2d1750c456f6c52f15cbf090c9e8559020834e6..0c333afc3b7116d02056879a0a34d8ea49ea5f5c 100644 (file)
                $feed = "<a title=\"$link_title\" id=\"FEEDL-$feed_id\" 
                        href=\"javascript:viewfeed('$feed_id', '', false, '', false, 0);\">$feed_title</a>";
 
-               print "<li id=\"FEEDR-$feed_id\" class=\"$class\">";
+               print "<li id=\"FEEDR-$feed_id\" class=\"$class\"
+                       onmouseover='feedMouseIn($feed_id)' onmouseout='feedMouseOut($feed_id)'>";
                if (get_pref($link, 'ENABLE_FEED_ICONS')) {
                        print "$feed_icon";
                }
index 6f8f29de7a8d41dfa1cecd50a1e95da85ee195c1..de7005bbc0654ea0d05de07395fc0dd569d8b461 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1409,3 +1409,17 @@ function hotkey_handler(e) {
        }
 }
 
+function mouse_handler(e) {
+       try {
+               var r_mouse = false;
+
+               if (window.event) {
+                       r_mouse = window.event.button == 2;
+               } else if (e) {
+                       r_mouse = e.which == 3;
+               }
+
+       } catch (e) {
+               exception_error("mouse_handler", e);
+       }
+}
index 24f3636fb4080a4c88468f5bda5feeecab82b282..77938c9d984d070238b1cd5096e630e1193db663 100644 (file)
@@ -1091,6 +1091,8 @@ function cdmGetVisibleArticles() {
        var sel_articles = new Array();
        var container = document.getElementById("headlinesInnerContainer");
 
+       if (!container) return sel_articles;
+
        for (i = 0; i < container.childNodes.length; i++) {
                var child = container.childNodes[i];