diff options
author | Andrew Dolgov <[email protected]> | 2005-08-23 10:16:01 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-08-23 10:16:01 +0100 |
commit | cb0bd8bd0fc516a51867041a20909a56f631e20e (patch) | |
tree | a6e2b5f8b42889d4887f23b279ff6842017f5f2f /tt-rss.js | |
parent | a20153510b9bc070a9efb3e5ab04832f26fa26b2 (diff) |
broken a lot of feed update functionality :(
Diffstat (limited to 'tt-rss.js')
-rw-r--r-- | tt-rss.js | 46 |
1 files changed, 27 insertions, 19 deletions
@@ -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() { |