Skip to content

Commit

Permalink
fix for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Oct 18, 2011
1 parent c6ae686 commit 9ecdd93
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions static/js/multi-select-checkboxes.js
Expand Up @@ -11,25 +11,27 @@
Author: Jesse Ruderman - http://www.squarefree.com/
Suggested on http://69.90.152.144/collab/GreaseMonkeyUserScriptRequest at 2005-04-06 17:00:13 anonymously.
Features:
* Works with both mouse (shift+click) and keyboard (shift+space).
* Use to select or deselect.
* Use forwards or backwards.
Tested with:
* Hotmail, Yahoo! Mail, Google Personalized profile creation.
* HTML loose, HTML strict, XHTML (with the XHTML mime type).
*/


(function()
{

if (!document.documentElement.addEventListener) return;

var currentCheckbox = null;

function NSResolver(prefix)
function NSResolver(prefix)
{
if (prefix == 'html') {
return 'http://www.w3.org/1999/xhtml';
Expand All @@ -48,7 +50,7 @@ function selectCheckboxRange(start, end)
xpath = "//html:input[@type='checkbox']";
else // HTML
xpath = "//input[@type='checkbox']";

var checkboxes = document.evaluate(xpath, document, NSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

for (i = 0; (checkbox = checkboxes.snapshotItem(i)); ++i) {
Expand Down Expand Up @@ -101,5 +103,4 @@ function isCheckbox(elt)
// shift was held, we have to use onkeyup and onclick instead.
document.documentElement.addEventListener("keyup", handleChange, true);
document.documentElement.addEventListener("click", handleChange, true);

})();

0 comments on commit 9ecdd93

Please sign in to comment.