From: Andrew Dolgov Date: Fri, 26 Aug 2005 06:18:48 +0000 (+0100) Subject: disable btnCatchupPage when there is nothing to catchup X-Git-Tag: 1.0~9 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e1123aee35789042d768ca0597cbb04455b87496;p=tt-rss.git disable btnCatchupPage when there is nothing to catchup --- diff --git a/backend.php b/backend.php index 1ae88917..83d86458 100644 --- a/backend.php +++ b/backend.php @@ -293,6 +293,8 @@ feed_id = '$feed' ORDER BY updated DESC LIMIT ".HEADLINES_PER_PAGE." OFFSET $skip"); $lnum = 0; + + $num_unread = 0; while ($line = pg_fetch_assoc($result)) { @@ -300,12 +302,15 @@ if ($line["last_read_ts"] < $line["updated_ts"] && $line["unread"] == "f") { $update_pic = "\"Updated\""; + ++$num_unread; } else { $update_pic = " "; } - if ($line["unread"] == "t") + if ($line["unread"] == "t") { $class .= "Unread"; + ++$num_unread; + } $id = $line["id"]; $feed_id = $line["feed_id"]; @@ -365,9 +370,15 @@ print "  Mark as read: "; - print "This Page"; - print " "; + if ($num_unread > 0) { + print "This Page"; + print " "; + } else { + print "This Page"; + print " "; + } + print "All Posts"; diff --git a/tt-rss.js b/tt-rss.js index 422d14d0..a8766ad2 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -210,6 +210,11 @@ function catchupPage(feed) { param_escape(rows.toString()); notify("Marking this page as read..."); + + var button = document.getElementById("btnCatchupPage"); + + button.className = "disabledButton"; + button.href = ""; xmlhttp.open("GET", query_str, true); xmlhttp.onreadystatechange=notify_callback;