summaryrefslogtreecommitdiff
path: root/sitestatic/archweb.js
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-01-03 14:18:22 -0600
committerDan McGee <dan@archlinux.org>2012-01-03 14:18:22 -0600
commit3b545d23b6ddb0ee843e9f792863615d69ceca5f (patch)
treedbf177cc11dc9fb1d23869cf1c1feb828c6d6cc4 /sitestatic/archweb.js
parent64da32a3f3312331537eb34ab704eec7ebf14221 (diff)
Add checkbox range selection to stale relations page
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitestatic/archweb.js')
-rw-r--r--sitestatic/archweb.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js
index 151d0f81..248be7a6 100644
--- a/sitestatic/archweb.js
+++ b/sitestatic/archweb.js
@@ -123,6 +123,26 @@ if (typeof $.tablesorter !== 'undefined') {
});
}
+(function($) {
+ $.fn.enableCheckboxRangeSelection = function() {
+ var lastCheckbox = null;
+ var lastElement = null;
+
+ var spec = this;
+ spec.unbind("click.checkboxrange");
+ spec.bind("click.checkboxrange", function(e) {
+ if (lastCheckbox != null && e.shiftKey) {
+ spec.slice(
+ Math.min(spec.index(lastCheckbox), spec.index(e.target)),
+ Math.max(spec.index(lastCheckbox), spec.index(e.target)) + 1
+ ).attr({checked: e.target.checked ? "checked" : ""});
+ }
+ lastCheckbox = e.target;
+ });
+
+ };
+})(jQuery);
+
/* news/add.html */
function enablePreview() {
$('#news-preview-button').click(function(event) {