]> git.wh0rd.org - tt-rss.git/commitdiff
main: move to async infobox calls
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 24 Aug 2007 04:40:23 +0000 (05:40 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 24 Aug 2007 04:40:23 +0000 (05:40 +0100)
tt-rss.js

index 3beac28cf56095ac80c3d0a405772df98ddccac1..8665d29a60b7274a4bd652df407518efa4e15156 100644 (file)
--- 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);
        }
 }