summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-08-23 10:16:01 +0100
committerAndrew Dolgov <[email protected]>2005-08-23 10:16:01 +0100
commitcb0bd8bd0fc516a51867041a20909a56f631e20e (patch)
treea6e2b5f8b42889d4887f23b279ff6842017f5f2f /tt-rss.js
parenta20153510b9bc070a9efb3e5ab04832f26fa26b2 (diff)
broken a lot of feed update functionality :(
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js46
1 files changed, 27 insertions, 19 deletions
diff --git a/tt-rss.js b/tt-rss.js
index d4660d624..1ef840529 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -166,31 +166,39 @@ function catchupPage(feed) {
for (i = 0; i < content.rows.length; i++) {
var row_id = content.rows[i].id.replace("RROW-", "");
if (row_id.length > 0) {
- rows.push(row_id);
- content.rows[i].className = content.rows[i].className.replace("Unread", "");
+ if (content.rows[i].className.match("Unread")) {
+ rows.push(row_id);
+ content.rows[i].className = content.rows[i].className.replace("Unread", "");
+ }
}
}
- var feedr = document.getElementById("FEEDR-" + feed);
- var feedu = document.getElementById("FEEDU-" + feed);
-
- feedu.innerHTML = feedu.innerHTML - rows.length;
-
- if (feedu.innerHTML > 0 && !feedr.className.match("Unread")) {
- feedr.className = feedr.className + "Unread";
- } else if (feedu.innerHTML <= 0) {
- feedr.className = feedr.className.replace("Unread", "");
- }
-
- var query_str = "backend.php?op=rpc&subop=catchupPage&ids=" +
- param_escape(rows.toString());
+ if (rows.length > 0) {
- notify("Marking this page as read...");
+ var feedr = document.getElementById("FEEDR-" + feed);
+ var feedu = document.getElementById("FEEDU-" + feed);
+
+ feedu.innerHTML = feedu.innerHTML - rows.length;
+
+ if (feedu.innerHTML > 0 && !feedr.className.match("Unread")) {
+ feedr.className = feedr.className + "Unread";
+ } else if (feedu.innerHTML <= 0) {
+ feedr.className = feedr.className.replace("Unread", "");
+ }
+
+ var query_str = "backend.php?op=rpc&subop=catchupPage&ids=" +
+ param_escape(rows.toString());
+
+ notify("Marking this page as read...");
+
+ xmlhttp.open("GET", query_str, true);
+ xmlhttp.onreadystatechange=notify_callback;
+ xmlhttp.send(null);
- xmlhttp.open("GET", query_str, true);
- xmlhttp.onreadystatechange=notify_callback;
- xmlhttp.send(null);
+ } else {
+ notify("No unread items on this page.");
+ }
}
function catchupAllFeeds() {