diff options
author | Andrew Dolgov <[email protected]> | 2006-05-22 04:54:51 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-05-22 04:54:51 +0100 |
commit | 071644795cdaf97601ba96d9c89b7910b49ab617 (patch) | |
tree | 5d2bc6c681e247aaf61ca7febf1fd07c92ae02e5 /prefs.js | |
parent | eb4311d00fde9f38c2ee1d9b95a4baee6fed3b39 (diff) |
filter editor uses prototype
Diffstat (limited to 'prefs.js')
-rw-r--r-- | prefs.js | 43 |
1 files changed, 9 insertions, 34 deletions
@@ -1,7 +1,6 @@ var xmlhttp = false; var active_feed_cat = false; -var active_filter = false; var active_label = false; var active_tab = false; var feed_to_expand = false; @@ -54,22 +53,7 @@ function feedlist_callback() { function filterlist_callback() { var container = document.getElementById('prefContent'); if (xmlhttp.readyState == 4) { - container.innerHTML=xmlhttp.responseText; - - if (active_filter) { - var row = document.getElementById("FILRR-" + active_filter); - if (row) { - if (!row.className.match("Selected")) { - row.className = row.className + "Selected"; - } - } - var checkbox = document.getElementById("FICHK-" + active_filter); - - if (checkbox) { - checkbox.checked = true; - } - } notify(""); } } @@ -354,13 +338,12 @@ function editFilter(id) { return } - active_filter = id; + selectTableRowsByIdPrefix('prefFilterList', 'FILRR-', 'FICHK-', false); + selectTableRowById('FILRR-'+id, 'FICHK-'+id, true); - xmlhttp.open("GET", "backend.php?op=pref-filters&subop=edit&id=" + - param_escape(id), true); - xmlhttp.onreadystatechange=filterlist_callback; + xmlhttp.open("GET", "backend.php?op=pref-filters&subop=edit&id=" + param_escape(id), true); + xmlhttp.onreadystatechange=infobox_callback; xmlhttp.send(null); - } function editFeed(feed) { @@ -713,7 +696,6 @@ function userEditCancel() { } selectPrefRows('user', false); // cleanup feed selection - closeInfoBox(); } @@ -723,15 +705,9 @@ function filterEditCancel() { printLockingError(); return } - - active_filter = false; - -// notify("Operation cancelled."); - - xmlhttp.open("GET", "backend.php?op=pref-filters", true); - xmlhttp.onreadystatechange=filterlist_callback; - xmlhttp.send(null); - + + selectPrefRows('filter', false); // cleanup feed selection + closeInfoBox(); } function labelEditSave() { @@ -809,10 +785,10 @@ function filterEditSave() { notify("Saving filter..."); - active_filter = false; - var query = Form.serialize("filter_edit_form"); + closeInfoBox(); + xmlhttp.open("GET", "backend.php?" + query, true); xmlhttp.onreadystatechange=filterlist_callback; xmlhttp.send(null); @@ -1137,7 +1113,6 @@ function selectTab(id, noupdate) { // clean up all current selections, just in case active_feed_cat = false; - active_filter = false; active_label = false; if (id == "feedConfig") { |