Last change
on this file since 599 was 590, checked in by Kris Deugau, 11 years ago |
/trunk
Add a touch of Javascript to the bulk domain changes page, for a
"Select them all!" checkbox.
|
File size:
934 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
|
---|
8 | var bulk_selstate = [];
|
---|
9 | function 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_nnnn checkboxes
|
---|
17 | if (y[i].name.substring(0,4) == 'dom_') {
|
---|
18 | if (newstate == true) {
|
---|
19 | // if the master gets checkmarked, save the original state of
|
---|
20 | // the dom_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.