From 2087fbfd96a42340e2a9057fe78cac4c3524b424 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Wed, 24 Sep 2008 17:27:20 +1000 Subject: [html] Add select-all checkbox for patch lists Signed-off-by: Jeremy Kerr --- htdocs/js/common.js | 19 +++++++++++++++++++ templates/patchwork/patch-list.html | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/htdocs/js/common.js b/htdocs/js/common.js index c87a5f9..f725693 100644 --- a/htdocs/js/common.js +++ b/htdocs/js/common.js @@ -4,3 +4,22 @@ function confirm_delete(type, name) return confirm("Are you sure you want to delete the " + type + " '" + name + "'?"); } + +function select_all(obj) +{ + var value = obj.checked; + var form = obj.form; + + select_all_checkbox = obj; + + for (var i = 0; i < form.elements.length; i++ ) { + var element = form.elements[i]; + if (element.type != 'checkbox') { + continue; + } + if (element.name.substring(0, 9) != 'patch_id:') { + continue; + } + element.checked = value; + } +} diff --git a/templates/patchwork/patch-list.html b/templates/patchwork/patch-list.html index 597806b..4c6b8a5 100644 --- a/templates/patchwork/patch-list.html +++ b/templates/patchwork/patch-list.html @@ -25,7 +25,9 @@ {% if user.is_authenticated %} - {% endif %}
+ + + -- cgit v1.2.3