summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-13 18:48:56 +0300
committerAndrew Dolgov <[email protected]>2010-11-13 18:48:56 +0300
commit428b704dbcd4d0869e5d3455eda9b7fbda5c221e (patch)
tree63259a235f35d8ed560a8d3df4d74916457f5501 /tt-rss.js
parenta18a4f387ad74f158c8634adb3e2dfe976364d88 (diff)
bring back update button, it makes async update request to the daemon
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/tt-rss.js b/tt-rss.js
index a3bfbde5d..35927fd42 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -1286,3 +1286,39 @@ function handle_rpc_reply(transport, scheduled_call) {
return true;
}
+function scheduleFeedUpdate() {
+ try {
+
+ if (!getActiveFeedId()) {
+ alert(__("Please select some feed first."));
+ return;
+ }
+
+ var query = "?op=rpc&subop=scheduleFeedUpdate&id=" +
+ param_escape(getActiveFeedId()) +
+ "&is_cat=" + param_escape(activeFeedIsCat());
+
+ console.log(query);
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+
+ if (transport.responseXML) {
+ var message = transport.responseXML.getElementsByTagName("message")[0];
+
+ if (message) {
+ notify_info(message.firstChild.nodeValue);
+ return;
+ }
+ }
+
+ notify_error("Error communicating with server.");
+
+ } });
+
+
+ } catch (e) {
+ exception_error("scheduleFeedUpdate", e);
+ }
+}