Last change
on this file was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100644
|
File size:
822 bytes
|
Rev | Line | |
---|
[c5c522c] | 1 | // $Id: dspam.js,v 1.02 2009/12/25 03:00:40 sbajic Exp $ |
---|
| 2 | |
---|
| 3 | // Select intermediate checkboxes on shift-click |
---|
| 4 | var shifty = false; |
---|
| 5 | var lastcheckboxchecked = false; |
---|
| 6 | function checkboxclicked(checkbox) |
---|
| 7 | { |
---|
| 8 | var num = checkbox.id.split('-')[1]; |
---|
| 9 | |
---|
| 10 | if (lastcheckboxchecked && shifty) { |
---|
| 11 | var start = Math.min(num, lastcheckboxchecked) + 1; |
---|
| 12 | var end = Math.max(num, lastcheckboxchecked) - 1; |
---|
| 13 | var value = checkbox.checked; |
---|
| 14 | for (i=start; i <= end; ++i) { |
---|
| 15 | document.getElementById("checkbox-"+i).checked = value; |
---|
| 16 | } |
---|
| 17 | } |
---|
| 18 | lastcheckboxchecked = num; |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | function recordshiftiness(e) |
---|
| 22 | { |
---|
| 23 | if (!e) var e = window.event; |
---|
| 24 | shifty = e && ((typeof (e.shiftKey) != 'undefined' && e.shiftKey) || |
---|
| 25 | e.modifiers & event.SHIFT_MASK); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | if (window.event) document.captureEvents (event.MOUSEDOWN); |
---|
| 29 | document.onmousedown = recordshiftiness; |
---|
Note: See
TracBrowser
for help on using the repository browser.