]> git.wh0rd.org - tt-rss.git/commitdiff
rework filter editor/add infobox layout, misc fixes
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 May 2006 04:35:20 +0000 (05:35 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 May 2006 04:35:20 +0000 (05:35 +0100)
backend.php
functions.js
prefs.js

index a3ba821d1d76bb913652642aee9c567a4d7e7d51..dd94a93b9feecaa4e8231334e6dd6a78a5cdc55b 100644 (file)
                        print "<tr><td>Match:</td>
                                <td><input onkeypress=\"return filterCR(event)\"
                                         onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
-                                       name=\"reg_exp\" size=\"30\" value=\"$reg_exp\">&nbsp;";
+                                       name=\"reg_exp\" class=\"iedit\" value=\"$reg_exp\">";
                        
-                       print_select_hash("filter_type", $filter_type, $filter_types);  
+                       print "</td><td>";
+                       
+                       print_select_hash("filter_type", $filter_type, $filter_types, "class=\"iedit\"");       
        
                        print "</td></tr>";
-                       print "<tr><td>Feed:</td><td>";
+                       print "<tr><td>Feed:</td><td colspan='2'>";
 
                        print_feed_select($link, "feed_id", $feed_id);
                        
        
                        print "<tr><td>Action:</td>";
        
-                       print "<td><select name=\"action_id\">";
+                       print "<td colspan='2'><select name=\"action_id\">";
        
                        $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions 
                                ORDER BY name");
                print "<input type=\"submit\" 
                        class=\"button\" 
                        onclick=\"javascript:displayDlg('quickAddFilter', false)\" 
+                       id=\"create_filter_btn\"
                        value=\"Create filter\">"; 
 
                $result = db_query($link, "SELECT 
        
                        print "<p id=\"filterOpToolbar\">";
        
-                       if ($subop == "edit") {
-                               print "Edit filter:
-                                       <input type=\"submit\" class=\"button\" 
-                                               onclick=\"javascript:filterEditSave()\" value=\"Save\">
-                                       <input type=\"submit\" class=\"button\" 
-                                               onclick=\"javascript:filterEditCancel()\" value=\"Cancel\">";
-                                               
-                       } else {
-       
-                               print "
+                       print "
                                        Selection:
                                <input type=\"submit\" class=\"button\" disabled=\"true\"
                                        onclick=\"javascript:editSelectedFilter()\" value=\"Edit\">
                                <input type=\"submit\" class=\"button\" disabled=\"true\"
                                        onclick=\"javascript:removeSelectedFilters()\" value=\"Remove\">";
-                       }                       
+
+                       print "</p>";
 
                } else {
 
                        print "<tr><td>Match:</td>
                                <td><input onkeypress=\"return filterCR(event)\"
                                         onkeyup=\"toggleSubmitNotEmpty(this, 'infobox_submit')\"
-                                       name=\"reg_exp\" size=\"30\">&nbsp;";
-                       
-                       print_select_hash("filter_type", 1, $filter_types);     
+                                       name=\"reg_exp\" class=\"iedit\">";             
+                       print "</td><td>";
+               
+                       print_select_hash("filter_type", 1, $filter_types, "class=\"iedit\"");  
        
                        print "</td></tr>";
-                       print "<tr><td>Feed:</td><td>";
+                       print "<tr><td>Feed:</td><td colspan='2'>";
 
                        print_feed_select($link, "feed_id");
                        
        
                        print "<tr><td>Action:</td>";
        
-                       print "<td><select name=\"action_id\">";
+                       print "<td colspan='2'><select name=\"action_id\">";
        
                        $result = db_query($link, "SELECT id,description FROM ttrss_filter_actions 
                                ORDER BY name");
index 89924fed6c3d4fad89579e7930d5916931aa97d8..46c812ed5d1ebe619bd398f5a7b3b56f177acf7f 100644 (file)
@@ -364,6 +364,11 @@ function disableContainerChildren(id, disable, doc) {
 
        var container = doc.getElementById(id);
 
+       if (!container) {
+               //alert("disableContainerChildren: element " + id + " not found");
+               return;
+       }
+
        for (var i = 0; i < container.childNodes.length; i++) {
                var child = container.childNodes[i];
 
index d7a616f37ff3d360891923d1a6eb51582408f2e5..53abc6501424e3752bf8fc04162a65c3f073bc7d 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -338,6 +338,8 @@ function editFilter(id) {
                return
        }
 
+       document.getElementById("create_filter_btn").disabled = true;
+
        selectTableRowsByIdPrefix('prefFilterList', 'FILRR-', 'FICHK-', false);
        selectTableRowById('FILRR-'+id, 'FICHK-'+id, true);
 
@@ -705,6 +707,8 @@ function filterEditCancel() {
                printLockingError();
                return
        }
+
+       document.getElementById("create_filter_btn").disabled = false;
        
        selectPrefRows('filter', false); // cleanup feed selection
        closeInfoBox();
@@ -760,7 +764,9 @@ function userEditSave() {
        }
        
        notify("Saving user...");
-       
+
+       closeInfoBox();
+
        var query = Form.serialize("user_edit_form");
        
        xmlhttp.open("GET", "backend.php?" + query, true);                      
@@ -789,6 +795,8 @@ function filterEditSave() {
 
        closeInfoBox();
 
+       document.getElementById("create_filter_btn").disabled = false;
+
        xmlhttp.open("GET", "backend.php?" + query, true);
        xmlhttp.onreadystatechange=filterlist_callback;
        xmlhttp.send(null);