]> git.wh0rd.org - tt-rss.git/commitdiff
feed cat editor uses prototype
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 20 May 2006 12:51:39 +0000 (13:51 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 20 May 2006 12:51:39 +0000 (13:51 +0100)
backend.php
prefs.js
tt-rss.css

index 267cc7dc92763bcb26d5876a4263412f9724ec6d..d203af3fa8786ca17d856775e422b9a1a0038e19 100644 (file)
 
                        if (db_num_rows($result) != 0) {
        
+                               print "<form id=\"feed_cat_edit_form\">";
+                               
                                print "<p><table width=\"100%\" class=\"prefFeedCatList\" 
                                        cellspacing=\"0\" id=\"prefFeedCatList\">";
 
                
                                        $edit_cat_id = $_GET["id"];
                
-                                       if ($subop == "editCat" && $cat_id != $edit_cat_id) {
-                                               $class .= "Grayed";
-                                               $this_row_id = "";
+                                       if ($subop == "editCat") {
+                                               if ($cat_id != $edit_cat_id) {
+                                                       $class .= "Grayed";
+                                                       $this_row_id = "";
+                                               } else {
+                                                       $class .= "Selected";
+                                               }
                                        } else {
                                                $this_row_id = "id=\"FCATR-$cat_id\"";
                                        }
                
                                        } else if ($cat_id != $edit_cat_id) {
                
-                                               print "<td><input disabled=\"true\" type=\"checkbox\" 
+                                               print "<td align='center'><input disabled=\"true\" type=\"checkbox\" 
                                                        id=\"FRCHK-".$line["id"]."\"></td>";
                
                                                print "<td>$edit_title</td>";           
                
                                        } else {
                
-                                               print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
+                                               print "<td align='center'><input disabled=\"true\" type=\"checkbox\" checked>";
+                                               
+                                               print "<input type=\"hidden\" name=\"id\" value=\"$cat_id\">";
+                                               print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
+                                               print "<input type=\"hidden\" name=\"subop\" value=\"saveCat\">";
+                                       
+                                               print "</td>";
                
-                                               print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
+                                               print "<td><input name=\"title\" class=\"iedit\" value=\"$edit_title\"></td>";
                                                
                                        }
                                        
                                }
        
                                print "</table>";
+
+                               print "</form>";
        
                                print "<p id=\"catOpToolbar\">";
        
                                if ($subop == "editCat") {
                                        print "Edit category:&nbsp;
                                                <input type=\"submit\" class=\"button\"
-                                                       onclick=\"javascript:feedCatEditCancel()\" value=\"Cancel\">
+                                                       onclick=\"javascript:feedCatEditSave()\" value=\"Save\">
                                                <input type=\"submit\" class=\"button\"
-                                                       onclick=\"javascript:feedCatEditSave()\" value=\"Save\">";
+                                                       onclick=\"javascript:feedCatEditCancel()\" value=\"Cancel\">";
                                        } else {
                
                                        print "
index ec65e839924b53acd8f40e4e71dd198ac53a12ee..c98dbcc8d20bee61e5b59f5647e545782d8bfa3c 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -719,11 +719,11 @@ function feedCatEditSave() {
 
        notify("Saving category...");
 
-       var cat_title = document.getElementById("iedit_title").value;
+//     var cat_title = document.getElementById("iedit_title").value;
 
-       xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=saveCat&id=" +
-               param_escape(active_feed_cat) + "&title=" + param_escape(cat_title), 
-               true);
+       var query = Form.serialize("feed_cat_edit_form");
+
+       xmlhttp.open("GET", "backend.php?" + query, true);
        xmlhttp.onreadystatechange=feedlist_callback;
        xmlhttp.send(null);
 
index f9e109df65859d272a32dfa7d219486e560ce725..a59779737543ea2265f35a61a681f55b05b5e508 100644 (file)
@@ -287,11 +287,15 @@ a:hover {
        background-color : #f0fff0;
 }
 
-.iedit {
+input.iedit {
        width : 100%;
        padding-left : 2px;
 }
 
+select.iedit {
+       width : 100%;
+}
+
 input.editbox {
        width : 200px;
        padding-left : 2px;