diff options
author | Andrew Dolgov <[email protected]> | 2012-08-21 14:09:51 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-08-21 14:09:51 +0400 |
commit | 23d2471c925ed31228e68210e7a55c836234645e (patch) | |
tree | ed61e74884f00cf72da42127e8794efa4c65532e /js | |
parent | 9da07c8ad232bb0d6ea8e74a7fb84cf5832aff44 (diff) |
expand error messages in subscribeToFeed(), provide proper error message
when URL download failed (refs #489)
Diffstat (limited to 'js')
-rw-r--r-- | js/functions.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/functions.js b/js/functions.js index 578172c77..da0f2ba28 100644 --- a/js/functions.js +++ b/js/functions.js @@ -866,7 +866,7 @@ function quickAddFeed() { var feed_url = this.attr('value').feed; - notify_progress(__("Subscribing to feed..."), true); + Element.show("feed_add_spinner"); new Ajax.Request("backend.php", { parameters: dojo.objectToQuery(this.attr('value')), @@ -875,13 +875,14 @@ function quickAddFeed() { var reply = JSON.parse(transport.responseText); - var rc = parseInt(reply['result']); + var rc = reply['result']; notify(''); + Element.hide("feed_add_spinner"); console.log("GOT RC: " + rc); - switch (rc) { + switch (parseInt(rc['code'])) { case 1: dialog.hide(); notify_info(__("Subscribed to %s").replace("%s", feed_url)); @@ -928,7 +929,8 @@ function quickAddFeed() { }); break; case 5: - alert(__("Couldn't download the specified URL.")); + alert(__("Couldn't download the specified URL: %s"). + replace("%s", rc['message'])); break; case 0: alert(__("You are already subscribed to this feed.")); |