PageSourceSearch

https://community.dryfta.com/media/system/js/multiselect.js

js dryfta.com collected 2026-09-24 09:26:12 UTC 1,142 bytes, 38 lines download raw bytes

1/**
2 * @copyright	Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
3 * @license		GNU General Public License version 2 or later; see LICENSE.txt
4 */
5
6/**
7 * JavaScript behavior to allow shift select in administrator grids
8 */
9(function() {
10	Joomla = Joomla || {};
11
12	Joomla.JMultiSelect = new Class({
13		initialize : function(table) {
14			this.table = document.id(table);
15			if (this.table) {
16				this.boxes = this.table.getElements('input[type=checkbox]');
17				this.boxes.addEvent('click', function(e){
18					this.doselect(e);
19				}.bind(this));
20			}
21		},
22
23		doselect: function(e) {
24			var current = document.id(e.target);
25			if (e.shift && typeOf(this.last) !== 'null') {
26				var checked = current.getProperty('checked') ? 'checked' : '';
27				var range = [this.boxes.indexOf(current), this.boxes.indexOf(this.last)].sort(function(a, b) {
28					//Shorthand to make sort() sort numerical instead of lexicographic
29					return a-b;
30				});
31				for (var i=range[0]; i <= range[1]; i++) {
32					this.boxes[i].setProperty('checked', checked);
33				}
34			}
35			this.last = current;
36		}
37	});
38})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.