From 79f3553b8b82e9b62b82456bdcdf74a4abe162fe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 20 May 2006 12:39:22 +0100 Subject: create filter dialog uses prototype --- functions.js | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'functions.js') diff --git a/functions.js b/functions.js index ee26d0a92..627eb287a 100644 --- a/functions.js +++ b/functions.js @@ -992,13 +992,15 @@ function displayDlg(id, param) { function infobox_submit_callback() { if (xmlhttp.readyState == 4) { - notify(xmlhttp.responseText); closeInfoBox(); // called from prefs, reload tab if (active_tab) { selectTab(active_tab, false); } + + notify(xmlhttp.responseText); + } } @@ -1024,29 +1026,11 @@ function qaddFilter() { return } - var regexp = document.getElementById("fadd_regexp"); - var match = document.getElementById("fadd_match"); - var feed = document.getElementById("fadd_feed"); - var action = document.getElementById("fadd_action"); - - if (regexp.value.length == 0) { - alert("Missing filter expression."); - } else { - notify("Adding filter..."); + var query = Form.serialize("filter_add_form"); - var v_match = match[match.selectedIndex].text; - var feed_id = feed[feed.selectedIndex].id; - var action_id = action[action.selectedIndex].id; - - xmlhttp.open("GET", "backend.php?op=pref-filters&quiet=1&subop=add®exp=" + - param_escape(regexp.value) + "&match=" + v_match + - "&fid=" + param_escape(feed_id) + "&aid=" + param_escape(action_id), true); - - xmlhttp.onreadystatechange=infobox_submit_callback; - xmlhttp.send(null); - - regexp.value = ""; - } + xmlhttp.open("GET", "backend.php?" + query, true); + xmlhttp.onreadystatechange=infobox_submit_callback; + xmlhttp.send(null); } -- cgit v1.2.3