summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-24 05:40:23 +0100
committerAndrew Dolgov <[email protected]>2007-08-24 05:40:23 +0100
commit2a8504cd39f9eed3b08a6562f321bd0a5efefad1 (patch)
tree730767648e08baf8a3b25daba94a459244c3ee66 /tt-rss.js
parentd395a94275b55a782dbeaca4e3318365b54b5f96 (diff)
main: move to async infobox calls
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js49
1 files changed, 25 insertions, 24 deletions
diff --git a/tt-rss.js b/tt-rss.js
index 3beac28cf..8665d29a6 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -645,34 +645,35 @@ function userSwitch() {
}
function editFeedDlg(feed) {
+ try {
- disableHotkeys();
-
- if (!feed) {
- alert(__("Please select some feed first."));
- return;
- }
-
- if ((feed <= 0 && feed > -10) || activeFeedIsCat() || tagsAreDisplayed()) {
- alert(__("You can't edit this kind of feed."));
- return;
- }
-
- if (xmlhttp_ready(xmlhttp)) {
-
+ disableHotkeys();
+
+ if (!feed) {
+ alert(__("Please select some feed first."));
+ return;
+ }
+
+ if ((feed <= 0 && feed > -10) || activeFeedIsCat() || tagsAreDisplayed()) {
+ alert(__("You can't edit this kind of feed."));
+ return;
+ }
+
+ var query = "";
+
if (feed > 0) {
- xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editfeed&id=" +
- param_escape(feed), true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
+ query = "backend.php?op=pref-feeds&subop=editfeed&id=" + param_escape(feed);
} else {
- xmlhttp.open("GET", "backend.php?op=pref-labels&subop=edit&id=" +
- param_escape(-feed-11), true);
- xmlhttp.onreadystatechange=infobox_callback;
- xmlhttp.send(null);
+ query = "backend.php?op=pref-labels&subop=edit&id=" + param_escape(-feed-11);
}
- } else {
- printLockingError();
+
+ new Ajax.Request(query, {
+ onComplete: function(transport) {
+ infobox_callback2(transport);
+ } });
+
+ } catch (e) {
+ exception_error("editFeedDlg", e);
}
}