$op = $_GET["op"];
$fetch = $_GET["fetch"];
+
+ if ($op == "rpc") {
+
+ $subop = $_GET["subop"];
+ if ($subop == "catchupPage") {
+
+ $ids = split(",", $_GET["ids"]);
+
+ foreach ($ids as $id) {
+
+ pg_query("UPDATE ttrss_entries SET unread=false,last_read = NOW()
+ WHERE id = '$id'");
+
+ }
+
+ print "Marked active page as read.";
+ }
+
+ }
+
if ($op == "feeds") {
$subop = $_GET["subop"];
}
}
- print "<table class=\"headlines\" width=\"100%\">";
+ print "<table class=\"headlinesList\" id=\"headlinesList\" width=\"100%\">";
print "<tr><td class=\"search\" colspan=\"3\">
Search: <input onchange=\"javascript:search($feed,this);\"></td></tr>";
print " ";
print "<a class=\"button\"
href=\"javascript:viewfeed($feed, 0, 'ForceUpdate');\">Update</a>";
+
print " Mark as read: ";
+
print "<a class=\"button\"
- href=\"javascript:viewfeed($feed, $skip, 'MarkPageRead');\">This Page</a>";
+ href=\"javascript:catchupPage($feed);\">This Page</a>";
print " ";
print "<a class=\"button\"
href=\"javascript:viewfeed($feed, $skip, 'MarkAllRead');\">All Posts</a>";
}
}
+
function updateFeedList() {
document.getElementById("feeds").innerHTML = "Loading feeds, please wait...";
font-size : small;
}
-table.headlines td.search {
+table.headlinesList td.search {
font-size : small;
/* border-width : 0px 0px 1px 0px;
border-color : #d0d0d0;
padding-bottom : 3px; */
}
-table.headlines td.title {
+table.headlinesList td.title {
font-weight : bold;
font-size : large;
border-width : 0px 0px 1px 0px;
padding-bottom : 3px;
}
-table.headlines td.headlineUpdated {
+table.headlinesList td.headlineUpdated {
width : 200px;
-
}
input {
xmlhttp = new XMLHttpRequest();
}
+function notify_callback() {
+ var container = document.getElementById('notify');
+ if (xmlhttp.readyState == 4) {
+ container.innerHTML=xmlhttp.responseText;
+ }
+}
+
function feedlist_callback() {
var container = document.getElementById('feeds');
if (xmlhttp.readyState == 4) {
}
+function catchupPage(feed) {
+
+ var content = document.getElementById("headlinesList");
+
+ var rows = new Array();
+
+ 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", "");
+ }
+ }
+
+ 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);
+
+}
+
function catchupAllFeeds() {
var query_str = "backend.php?op=feeds&subop=catchupAll";