X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=htdocs%2Fjs%2Fcommon.js;h=f7256933e79cca229cd4b3aaafaa0da69b1627a1;hb=508510d29aa7b0aaf946f6565e8040f9895f84c8;hp=c87a5f9ec34fee39f82f4ff9e94964581900001e;hpb=11bfcbc720bb39833efddc367ac671723f3944a2;p=patchwork 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; + } +}