From d76a3b036c8863ae023686f08e36b11dc9e8ce2e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 21 Aug 2005 14:46:43 +0100 Subject: basic functionality pass 1 --- tt-rss.js | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'tt-rss.js') diff --git a/tt-rss.js b/tt-rss.js index 6d3a2f342..627ad0c5d 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -47,20 +47,26 @@ function notify(msg) { } function feedlist_callback() { + var container = document.getElementById('feeds'); if (xmlhttp.readyState == 4) { - document.getElementById('feeds').innerHTML=xmlhttp.responseText; + container.innerHTML=xmlhttp.responseText; + } else { } } function viewfeed_callback() { + var container = document.getElementById('headlines'); if (xmlhttp.readyState == 4) { - document.getElementById('headlines').innerHTML=xmlhttp.responseText; + container.innerHTML = xmlhttp.responseText; + } else { } } function view_callback() { + var container = document.getElementById('content'); if (xmlhttp.readyState == 4) { - document.getElementById('content').innerHTML=xmlhttp.responseText; + container.innerHTML=xmlhttp.responseText; + } else { } } @@ -73,22 +79,32 @@ function update_feed_list() { } -function viewfeed(feed) { +function viewfeed(feed, skip) { notify("view-feed: " + feed); - xmlhttp.open("GET", "backend.php?op=viewfeed&feed=" + param_escape(feed) , true); + document.getElementById('headlines').innerHTML='Loading headlines, please wait...'; + + xmlhttp.open("GET", "backend.php?op=viewfeed&feed=" + param_escape(feed) + + "&skip=" + skip, true); xmlhttp.onreadystatechange=viewfeed_callback; xmlhttp.send(null); } -function view(feed, post) { +function view(id) { + + var crow = document.getElementById("RROW-" + id); + + if (crow) { + crow.className = crow.className.replace("Unread", ""); + } + + notify(crow.className); - notify("view: " + feed + ", " + post); + document.getElementById('content').innerHTML='Loading, please wait...'; - xmlhttp.open("GET", "backend.php?op=view&feed=" + param_escape(feed) + - "&post=" + post, true); + xmlhttp.open("GET", "backend.php?op=view&id=" + param_escape(id), true); xmlhttp.onreadystatechange=view_callback; xmlhttp.send(null); -- cgit v1.2.3