From cb0bd8bd0fc516a51867041a20909a56f631e20e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 23 Aug 2005 10:16:01 +0100 Subject: broken a lot of feed update functionality :( --- tt-rss.js | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'tt-rss.js') 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() { -- cgit v1.2.3