source: branches/stable/templates/widgets.js@ 739

Last change on this file since 739 was 649, checked in by Kris Deugau, 11 years ago

/branches/stable

Subtle bugfix merge! All changes from /trunk r589 through r648 merged.

File size: 980 bytes
Line 
1/*
2** Javascript helper bits
3** Note that these should be HELPERS, not DOESN'T WORK WITHOUT
4*/
5
6/* Select all domains on a page on the Bulk Domain Operations" page */
7// a handy place to store state
8var bulk_selstate = [];
9function bulk_selall() {
10 var x=document.getElementById("main");
11 var y=x.getElementsByTagName("input");
12
13 // snag the ALL EVARYTHING checkbox state
14 var newstate = document.getElementById("master").checked;
15 for (var i=0; i<y.length; i++) {
16 // only monkey with the dom/rev_nnnn checkboxes
17 if (y[i].name.substring(0,4) == 'dom_' || y[i].name.substring(0,4) == 'rev_') {
18 if (newstate == true) {
19 // if the master gets checkmarked, save the original state of
20 // the dom/rev_nnn checkbox, and force it to "true"
21 bulk_selstate[i] = y[i].checked;
22 y[i].checked = true;
23 } else {
24 // if the master gets unchecked, restore the previous state
25 y[i].checked = bulk_selstate[i];
26 }
27 }
28 }
29}
Note: See TracBrowser for help on using the repository browser.