diff options
author | Andrew Dolgov <[email protected]> | 2005-09-08 13:10:07 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-09-08 13:10:07 +0100 |
commit | 090e250b6905ecbc078cdc2f485f343a1d3a7bfc (patch) | |
tree | 709d6ac23c67969cde10ed94027c91e73509c648 /tt-rss.js | |
parent | a82065a18b430f808799634cf1132c9921a5f18b (diff) |
automagically updating labels with cute XML RPC
Diffstat (limited to 'tt-rss.js')
-rw-r--r-- | tt-rss.js | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -49,17 +49,37 @@ function feedlist_callback() { */ function refetch_callback() { - if (xmlhttp.readyState == 4) { document.title = "Tiny Tiny RSS"; notify("All feeds updated."); - updateFeedList(); - - } -} + var reply = xmlhttp.responseXML.firstChild; + + var f_document = window.frames["feeds-frame"].document; + + for (var l = 0; l < reply.childNodes.length; l++) { + var id = reply.childNodes[l].getAttribute("id"); + var ctr = reply.childNodes[l].getAttribute("counter"); + var feedctr = f_document.getElementById("FEEDCTR-" + id); + var feedu = f_document.getElementById("FEEDU-" + id); + var feedr = f_document.getElementById("FEEDR-" + id); + + feedu.innerHTML = ctr; + + if (ctr > 0) { + feedctr.className = "odd"; + if (id > 0 && !feedr.className.match("Unread")) { + feedr.className = feedr.className + "Unread"; + } + } else { + feedctr.className = "invisible"; + feedr.className = feedr.className.replace("Unread", ""); + } + } + } +} function updateFeed(feed_id) { |