]> git.wh0rd.org - tt-rss.git/commitdiff
remove manual download dialog; make offline updates automatic
authorAndrew Dolgov <fox@bah.org.ru>
Tue, 3 Feb 2009 18:45:31 +0000 (21:45 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Tue, 3 Feb 2009 18:45:31 +0000 (21:45 +0300)
modules/backend-rpc.php
modules/popup-dialog.php
tt-rss.js

index 3b5b2d63f827d8f126e676d7435883b2e2c608d1..967e97aea349693209571658b1e6cc1654c0adc9 100644 (file)
                if ($subop == "download") {
                        $stage = (int) $_REQUEST["stage"];
                        $cid = db_escape_string($_REQUEST["cid"]);
-                       $amount = (int) $_REQUEST["amount"];
-                       $unread_only = db_escape_string($_REQUEST["unread_only"]);
+                       //$amount = (int) $_REQUEST["amount"];
+                       //$unread_only = db_escape_string($_REQUEST["unread_only"]);
+                       //if (!$amount) $amount = 50;
 
-                       if (!$amount) $amount = 50;
+                       $amount = 100;
+                       $unread_only = true;
 
                        print "<rpc-reply>";
 
index 8a1b2020937793cb9eea4dde4b54c9e4c2f73b6a..2ba0740c404c9887f5d435809066ceccc0b11bcf 100644 (file)
                        return;
                }
 
-               if ($id == "offlineDownload") {
+/*             if ($id == "offlineDownload") {
                        print "<div id=\"infoBoxTitle\">".__('Download articles')."</div>";
                        print "<div class=\"infoBoxContents\">";
 
                        print "</div>";
 
                        return;
-               }
+               } */
 
 
                print "<div id='infoBoxTitle'>Internal Error</div>
index ab62a85fa05c4aac63a11379013a4b6ab94ef8d2..b4f2d2adb2d5b87f72c9e0177531d906b05b7f68 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -670,10 +670,10 @@ function quickMenuGo(opid) {
                        resize_headlines();
                }
 
-               if (opid == "qmcDownload") {
+/*             if (opid == "qmcDownload") {
                        displayDlg("offlineDownload");
                        return;
-               }
+               } */
 
                if (opid == "qmcResetCats") {
 
@@ -1308,7 +1308,7 @@ function hotkey_handler(e) {
                                }
                        }
 
-                       if (keycode == 68 && shift_key) { // D
+/*                     if (keycode == 68 && shift_key) { // D
                                initiate_offline_download();
                                return false;
                        }
@@ -1316,7 +1316,7 @@ function hotkey_handler(e) {
                        if (keycode == 68) { // d
                                displayDlg("offlineDownload");
                                return false;
-                       }
+                       } */
 
                        if (keycode == 87) { // w
                                feeds_sort_by_unread = !feeds_sort_by_unread;
@@ -1532,8 +1532,7 @@ function init_gears() {
 
                        db.execute("CREATE TABLE if not exists articles (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text, added text)");
 
-                       var qmcDownload = document.getElementById("qmcDownload");
-                       if (qmcDownload) Element.show(qmcDownload);
+                       window.setTimeout("update_offline_data(0)", 100);
 
                }       
        
@@ -1583,7 +1582,7 @@ function offline_download_parse(stage, transport) {
                                                [id, title, has_icon]);
                                }
                
-                               window.setTimeout("initiate_offline_download("+(stage+1)+")", 50);
+                               window.setTimeout("update_offline_data("+(stage+1)+")", 50);
                        } else {
 
                                var articles = transport.responseXML.getElementsByTagName("article");
@@ -1610,10 +1609,10 @@ function offline_download_parse(stage, transport) {
                                }
 
                                if (articles_found > 0) {
-                                       window.setTimeout("initiate_offline_download("+(stage+1)+")", 50);
+                                       window.setTimeout("update_offline_data("+(stage+1)+")", 50);
                                } else {
-                                       notify_info("All done.");
-                                       closeInfoBox();
+//                                     notify_info("All done.");
+//                                     closeInfoBox();
                                }
                        }
 
@@ -1623,13 +1622,14 @@ function offline_download_parse(stage, transport) {
        }
 }
 
-function initiate_offline_download(stage, caller) {
+function update_offline_data(stage) {
        try {
 
                if (!stage) stage = 0;
-               if (caller) caller.disabled = true;
 
-               notify_progress("Loading, please wait... (" + stage +")", true);
+               debug("update_offline_data: stage " + stage);
+
+//             notify_progress("Loading, please wait... (" + stage +")", true);
 
                var query = "backend.php?op=rpc&subop=download&stage=" + stage;
 
@@ -1644,10 +1644,6 @@ function initiate_offline_download(stage, caller) {
                        query = query + "&cid=" + offline_dl_max_id;
                }
 
-               if (document.getElementById("download_ops_form")) {
-                       query = query + "&" + Form.serialize("download_ops_form");
-               }
-
                new Ajax.Request(query, {
                        onComplete: function(transport) { 
                                offline_download_parse(stage, transport);