print "<p align=\"center\">All feeds:
<a class=\"button\"
- href=\"javascript:scheduleFeedUpdate()\">Update</a>";
+ href=\"javascript:scheduleFeedUpdate(true)\">Update</a>";
print " <a class=\"button\"
href=\"javascript:catchupAllFeeds()\">Mark as read</a></p>";
}
if (first_run) {
- scheduleFeedUpdate();
+ scheduleFeedUpdate(false);
first_run = false;
} else {
notify("");
function refetch_callback() {
if (xmlhttp_rpc.readyState == 4) {
- // feeds are updated in background
- updateFeedList(false, false);
-// notify("All feeds updated");
+ updateFeedList(true, false);
}
}
-function scheduleFeedUpdate() {
+function scheduleFeedUpdate(force) {
notify("Updating feeds in background...");
- var query_str = "backend.php?op=rpc&subop=forceUpdateAllFeeds";
+ var query_str = "backend.php?op=rpc&subop=";
+
+ if (force) {
+ query_str = query_str = "forceUpdateAllFeeds";
+ } else {
+ query_str = query_str = "updateAllFeeds";
+ }
if (xmlhttp_rpc.readyState == 4 || xmlhttp_rpc.readyState == 0) {
xmlhttp_rpc.open("GET", query_str, true);
function timeout() {
- scheduleFeedUpdate();
+ scheduleFeedUpdate(true);
setTimeout("timeout()", 1800*1000);