]> git.wh0rd.org - tt-rss.git/blobdiff - prefs.js
userDetails -> infoBox, feed infobox, user details improvements
[tt-rss.git] / prefs.js
index 4333aac1849819b654c339e37cebdaee98a5771c..89c314faf124f34ca763d1efb0736f837d42bed6 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -79,7 +79,7 @@ function labellist_callback() {
        if (xmlhttp.readyState == 4) {
                container.innerHTML=xmlhttp.responseText;
 
-               if (active_filter) {
+               if (active_label) {
                        var row = document.getElementById("LILRR-" + active_label);
                        if (row) {
                                if (!row.className.match("Selected")) {
@@ -101,23 +101,35 @@ function userlist_callback() {
        if (xmlhttp.readyState == 4) {
                container.innerHTML=xmlhttp.responseText;
 
-/*             if (active_filter) {
-                       var row = document.getElementById("ULRR-" + active_label);
+               if (active_user) {
+                       var row = document.getElementById("UMRR-" + active_user);
                        if (row) {
                                if (!row.className.match("Selected")) {
                                        row.className = row.className + "Selected";
                                }               
                        }
-                       var checkbox = document.getElementById("LICHK-" + active_label);
+                       var checkbox = document.getElementById("UMCHK-" + active_user);
                        
                        if (checkbox) {
                                checkbox.checked = true;
                        }
-               } */
+               } 
+
                p_notify("");
        }
 }
 
+function infobox_callback() {
+       var container = document.getElementById('infoBox');
+       if (xmlhttp.readyState == 4) {
+               if (container) {
+                       container.innerHTML=xmlhttp.responseText;
+                       container.style.display = "block";
+               }
+       }
+}
+
+
 function prefslist_callback() {
        var container = document.getElementById('prefContent');
        if (xmlhttp.readyState == 4) {
@@ -850,6 +862,11 @@ function resetSelectedUserPass() {
 
 function selectedUserDetails() {
 
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
        var rows = getSelectedUsers();
 
        if (rows.length == 0) {
@@ -864,9 +881,36 @@ function selectedUserDetails() {
 
        var id = rows[0];
 
-       var w = window.open("backend.php?op=user-details&id=" + id,
-               "User Details", 
-               "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no");
+       xmlhttp.open("GET", "backend.php?op=user-details&id=" + id, true);
+       xmlhttp.onreadystatechange=infobox_callback;
+       xmlhttp.send(null);
+
+}
+
+function selectedFeedDetails() {
+
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
+       var rows = getSelectedFeeds();
+
+       if (rows.length == 0) {
+               notify("No feeds are selected.");
+               return;
+       }
+
+       if (rows.length > 1) {
+               notify("Please select one feed.");
+               return;
+       }
+
+       var id = rows[0];
+
+       xmlhttp.open("GET", "backend.php?op=feed-details&id=" + id, true);
+       xmlhttp.onreadystatechange=infobox_callback;
+       xmlhttp.send(null);
 
 }
 
@@ -978,6 +1022,11 @@ function updatePrefsList() {
 
 function selectTab(id) {
 
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
        if (id == "feedConfig") {
                updateFeedList();
        } else if (id == "filterConfig") {
@@ -1051,4 +1100,7 @@ function dispOptionHelp(event, sender) {
 
 } */
 
-
+function closeInfoBox() {
+       var d = document.getElementById('infoBox');
+       d.style.display = "none";
+}