]> git.wh0rd.org - tt-rss.git/blobdiff - prefs.js
change label icon, tweak category-less feedlist
[tt-rss.git] / prefs.js
index 0debf270c93fdcb83fdb3a054cf1fc11065735ad..edd1627d1e21ce45d94ef0597db42d1f6ad4b099 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -144,14 +144,6 @@ function labellist_callback() {
        }
 }
 
-function labeltest_callback() {
-       var container = document.getElementById('label_test_result');
-       if (xmlhttp.readyState == 4) {
-               container.innerHTML=xmlhttp.responseText;
-               notify("");
-       }
-}
-
 function feed_browser_callback() {
        var container = document.getElementById('prefContent');
        if (xmlhttp.readyState == 4) {
@@ -215,6 +207,31 @@ function changepass_callback() {
        }
 }
 
+function infobox_feed_cat_callback() {
+       if (xmlhttp.readyState == 4) {
+               try {
+
+                       infobox_callback();
+
+                       if (document.getElementById("prefFeedCatList")) {
+                               var elems = document.getElementById("prefFeedCatList").getElementsByTagName("SPAN");
+
+                               for (var i = 0; i < elems.length; i++) {
+                                       if (elems[i].id && elems[i].id.match("FCATT-")) {
+                                               var cat_id = elems[i].id.replace("FCATT-", "");
+
+                                               new Ajax.InPlaceEditor(elems[i],
+                                                       'backend.php?op=pref-feeds&subop=editCats&action=save&cid=' + cat_id);
+                                       }
+                               }
+                       }
+
+               } catch (e) {
+                       exception_error("infobox_feed_cat_callback", e);
+               }
+       }
+}
+
 function updateFeedList(sort_key) {
 
        if (!xmlhttp_ready(xmlhttp)) {
@@ -761,25 +778,6 @@ function feedCatEditSave() {
 }
 
 
-function labelTest() {
-
-       var container = document.getElementById('label_test_result');
-       container.style.display = "block";
-       container.innerHTML = "<p>Loading, please wait...</p>";
-
-       var form = document.forms['label_edit_form'];
-
-       var sql_exp = form.sql_exp.value;
-       var description = form.description.value;
-
-       xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
-               param_escape(sql_exp) + "&descr=" + param_escape(description), true);
-
-       xmlhttp.onreadystatechange=labeltest_callback;
-       xmlhttp.send(null);
-
-       return false;
-}
 
 function displayHelpInfobox(topic_id) {
 
@@ -1642,7 +1640,7 @@ function editFeedCats() {
        }
 
        xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCats", true);
-       xmlhttp.onreadystatechange=infobox_callback;
+       xmlhttp.onreadystatechange=infobox_feed_cat_callback;
        xmlhttp.send(null);
 }