]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
implement fallback _SIMPLE_UPDATE_MODE
[tt-rss.git] / js / tt-rss.js
index b97c052c1a0f6f82acddde86e582620ee7c72452..d59ba495caa1de4d4b5d318d188a02c349c00659 100644 (file)
@@ -379,6 +379,11 @@ function init_second_stage() {
 
                console.log("second stage ok");
 
+               if (getInitParam("simple_update")) {
+                       console.log("scheduling simple feed updater...");
+                       window.setTimeout("update_random_feed()", 30*1000);
+               }
+
        } catch (e) {
                exception_error("init_second_stage", e);
        }
@@ -1033,3 +1038,19 @@ function switchPanelMode(wide) {
                exception_error("switchPanelMode", e);
        }
 }
+
+function update_random_feed() {
+       try {
+               console.log("in update_random_feed");
+
+               new Ajax.Request("backend.php", {
+                       parameters: "op=rpc&method=updateRandomFeed",
+                       onComplete: function(transport) {
+                               handle_rpc_json(transport, true);
+                               window.setTimeout("update_random_feed()", 30*1000);
+                       } });
+
+       } catch (e) {
+               exception_error("update_random_feed", e);
+       }
+}