diff options
author | Andrew Dolgov <[email protected]> | 2010-11-13 18:48:56 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-13 18:48:56 +0300 |
commit | 428b704dbcd4d0869e5d3455eda9b7fbda5c221e (patch) | |
tree | 63259a235f35d8ed560a8d3df4d74916457f5501 /tt-rss.js | |
parent | a18a4f387ad74f158c8634adb3e2dfe976364d88 (diff) |
bring back update button, it makes async update request to the daemon
Diffstat (limited to 'tt-rss.js')
-rw-r--r-- | tt-rss.js | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -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); + } +} |