]> git.wh0rd.org - tt-rss.git/commitdiff
scheduleFeedUpdate behaviour changed (force when Update clicked, use MIN_UPDATE_TIME...
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 23 Aug 2005 06:30:20 +0000 (07:30 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 23 Aug 2005 06:30:20 +0000 (07:30 +0100)
backend.php
tt-rss.js

index fc91ed1535fc905cf8e85fdcd2f86d1d437e12a5..71dc030cb835b1311aa37b24e429abb686b4e8b3 100644 (file)
 
                print "<p align=\"center\">All feeds: 
                        <a class=\"button\" 
-                               href=\"javascript:scheduleFeedUpdate()\">Update</a>";
+                               href=\"javascript:scheduleFeedUpdate(true)\">Update</a>";
 
                print "&nbsp;<a class=\"button\" 
                                href=\"javascript:catchupAllFeeds()\">Mark as read</a></p>";
index 392ec70d8f53df647ecee526377aa6c5f85788e8..e3f1fc906ab724d160a35b6b5e2e91974473916b 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -54,7 +54,7 @@ function feedlist_callback() {
                }
 
                if (first_run) {
-                       scheduleFeedUpdate();
+                       scheduleFeedUpdate(false);
                        first_run = false;
                } else {
                        notify("");
@@ -103,17 +103,21 @@ function view_callback() {
 
 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);
@@ -259,7 +263,7 @@ function view(id,feed_id) {
 
 function timeout() {
 
-       scheduleFeedUpdate();
+       scheduleFeedUpdate(true);
 
        setTimeout("timeout()", 1800*1000);