From ec630524407882c27a7a8dceee8dc3eaafa0ebb4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 31 Aug 2012 12:38:45 +0400 Subject: [PATCH] implement select all/none in filterEditDlg --- js/functions.js | 20 ++++++++++++++++++++ js/prefs.js | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/js/functions.js b/js/functions.js index f2c5e3bf..284b2cc5 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1105,6 +1105,26 @@ function quickAddFilter() { id: "filterEditDlg", title: __("Create Filter"), style: "width: 600px", + selectRules: function(select) { + $$("#filterDlg_Matches input[type=checkbox]").each(function(e) { + e.checked = select; + if (select) + e.parentNode.addClassName("Selected"); + else + e.parentNode.removeClassName("Selected"); + }); + }, + selectActions: function(select) { + $$("#filterDlg_Actions input[type=checkbox]").each(function(e) { + e.checked = select; + + if (select) + e.parentNode.addClassName("Selected"); + else + e.parentNode.removeClassName("Selected"); + + }); + }, editRule: function(e) { var li = e.parentNode; var rule = li.getElementsByTagName("INPUT")[1].value; diff --git a/js/prefs.js b/js/prefs.js index 1fbbc55a..72d253a9 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -136,6 +136,26 @@ function editFilter(id) { id: "filterEditDlg", title: __("Edit Filter"), style: "width: 600px", + selectRules: function(select) { + $$("#filterDlg_Matches input[type=checkbox]").each(function(e) { + e.checked = select; + if (select) + e.parentNode.addClassName("Selected"); + else + e.parentNode.removeClassName("Selected"); + }); + }, + selectActions: function(select) { + $$("#filterDlg_Actions input[type=checkbox]").each(function(e) { + e.checked = select; + + if (select) + e.parentNode.addClassName("Selected"); + else + e.parentNode.removeClassName("Selected"); + + }); + }, editRule: function(e) { var li = e.parentNode; var rule = li.getElementsByTagName("INPUT")[1].value;