JS Checkboxes - Mimicks gmail's "shift-select" checkboxes feature that allows a long list of checkboxes to be easily checked/unchecked.

I know next to nothing about JS, but this is something I whipped up for my sites - rough-edged and doesn't work in IE at present [tested in FF and Opera fine..]. Primarily useful in the node admin/trackback and similar screens.

Don't know if this is good enough to get into this package, but here it is :)

Cheers
-K

CommentFileSizeAuthor
#1 js_checkboxes.js.txt1.85 KBZen
js_checkboxes.module523 bytesZen

Comments

Zen’s picture

StatusFileSize
new1.85 KB

and the JS file.

-K

nedjo’s picture

Thanks, we definitely need some checkbox handling. I'll give this a look over when I get a chance.

Steven posted the following related code to the development list:


function do_stuff(node, hooks) {
  // Loop through the hooks
  for (i = 0; hook = hooks[i]; i++) {
    // Find the relevant checkbox
    id = 'chkHook-' + hook;
    checkbox = document.getElementById(id);
    
    // Set the checkbox status to the status of the clicked one
    if (typeof checkbox.checkCount == 'undefined') {
      checkbox.checkCount = 0;
    }
    checkbox.checkCount += node.checked ? 1 : -1;
    checkbox.checked = checkbox.checkCount > 0;
  }
}

Zen’s picture

Component: Code » Proposed new addition
Status: Needs review » Closed (won't fix)