]> git.ozlabs.org Git - patchwork/blob - htdocs/js/common.js
[html] Add select-all checkbox for patch lists
[patchwork] / htdocs / js / common.js
1
2 function confirm_delete(type, name)
3 {
4         return confirm("Are you sure you want to delete the " + type +
5                         " '" + name + "'?");
6 }
7
8 function select_all(obj)
9 {
10         var value = obj.checked;
11         var form = obj.form;
12
13         select_all_checkbox = obj;
14
15         for (var i = 0; i < form.elements.length; i++ ) {
16                 var element = form.elements[i];
17                 if (element.type != 'checkbox') {
18                         continue;
19                 }
20                 if (element.name.substring(0, 9) != 'patch_id:') {
21                         continue;
22                 }
23                 element.checked = value;
24         }
25 }