From: Andrew Dolgov Date: Wed, 6 Aug 2008 08:08:26 +0000 (+0100) Subject: filter edit dialog: add remove button X-Git-Tag: 1.2.26~39 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a44db887de77a0d2284a375c8af6d765f8fc4eb9;p=tt-rss.git filter edit dialog: add remove button --- diff --git a/modules/pref-filters.php b/modules/pref-filters.php index 927cddcd..3946be5f 100644 --- a/modules/pref-filters.php +++ b/modules/pref-filters.php @@ -38,74 +38,6 @@ $filter_types[$line["id"]] = __($line["description"]); } -/* print ""; - - print " - "; - print ""; - - print ""; - - print ""; - - print ""; - - $param_disabled = ($action_id == 4 || $action_id == 6) ? "" : "disabled"; - - print ""; - - if ($enabled) { - $checked = "checked"; - } else { - $checked = ""; - } - - print "
".__('Match:').""; - - print "
".__('On field:').""; - - print_select_hash("filter_type", $filter_type, $filter_types, "class=\"_iedit\""); - - print "
".__('Feed:').""; - - print_feed_select($link, "feed_id", $feed_id); - - print "
".__('Action:').""; - - print "
".__('Params:')."
Options: - -
"; - - if ($inverse) { - $checked = "checked"; - } else { - $checked = ""; - } - - print " - "; - - print "
"; - - print ""; - - print "
"; */ - print "
".__("Match")."
"; print "
"; @@ -188,6 +120,14 @@ type=\"submit\" onclick=\"return filterEditCancel()\" value=\"".__('Cancel')."\">"; + $reg_exp = htmlspecialchars($reg_exp); // second escaping seems to be needed for javascript + + print "
"; + print " "; + print "
"; + print "
"; return; diff --git a/prefs.js b/prefs.js index c405a4f1..a5fc6c54 100644 --- a/prefs.js +++ b/prefs.js @@ -2156,3 +2156,29 @@ function rescore_all_feeds() { xmlhttp.send(null); } } + +function removeFilter(id, title) { + + if (!xmlhttp_ready(xmlhttp)) { + printLockingError(); + return + } + + var msg = __("Remove filter %s?").replace("%s", title); + + var ok = confirm(msg); + + if (ok) { + closeInfoBox(); + + notify_progress("Removing filter..."); + + xmlhttp.open("GET", "backend.php?op=pref-filters&subop=remove&ids="+ + param_escape(id), true); + xmlhttp.onreadystatechange=filterlist_callback; + xmlhttp.send(null); + } + + return false; +} +