It would be nice if one could select a range of checkboxes by using the shoft key. This is possible in GMail (just try it!)
Method: Select a checkbox hold shift and select a checkbox 10 rows lower. All 11 rows should be checked now.
The following code will produce the effect. File phpmyadmin/js/functions.js (Revision 11695) Replace lines 521 to 550
// ... and to mark the row on click ... rows[i].onmousedown = function(event) { var unique_id; var checkbox; var table;
console.log\('onclick', this.rowIndex\);
checkbox = this.getElementsByTagName( 'input' )[0]; if ( checkbox && checkbox.type == 'checkbox' ) { unique_id = checkbox.name + checkbox.value; } else if ( this.id.length > 0 ) { unique_id = this.id; } else { return; }
if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) { marked_row[unique_id] = true; } else { marked_row[unique_id] = false; }
if ( marked_row[unique_id] ) { this.className += ' marked'; } else { this.className = this.className.replace(' marked', ''); }
if ( checkbox && checkbox.disabled == false ) { checkbox.checked = marked_row[unique_id]; if(typeof(event) == 'object') { table = this.parentNode; i = 0; while(table.tagName.toLowerCase() != 'table' && i < 20) { i++; table = table.parentNode; }
if\(event.shiftKey == true && table.lastClicked \!= undefined\) \{ event.preventDefault\(\); i = table.lastClicked; if\(i < this.rowIndex\) i++; else i--; while\(i \!= this.rowIndex\) \{ table.rows\[i\].onmousedown\(\); if\(i < this.rowIndex\) i++; else i--; \} \} table.lastClicked = this.rowIndex; \}
} }
Patchfile (Forgot to remove a console.log)
Moved to patches.
This patch has been committed after fixing the compatibility with IE 8 and doing a little code cleanup.
Svn revision: 13182 http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/trunk/phpMyAdmin/js/functions.js?r1=13126&r2=13182
The following code will produce the effect.
File phpmyadmin/js/functions.js (Revision 11695)
Replace lines 521 to 550
// ... and to mark the row on click ...
rows[i].onmousedown = function(event) {
var unique_id;
var checkbox;
var table;
checkbox = this.getElementsByTagName( 'input' )[0];
if ( checkbox && checkbox.type == 'checkbox' ) {
unique_id = checkbox.name + checkbox.value;
} else if ( this.id.length > 0 ) {
unique_id = this.id;
} else {
return;
}
if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
marked_row[unique_id] = true;
} else {
marked_row[unique_id] = false;
}
if ( marked_row[unique_id] ) {
this.className += ' marked';
} else {
this.className = this.className.replace(' marked', '');
}
if ( checkbox && checkbox.disabled == false ) {
checkbox.checked = marked_row[unique_id];
if(typeof(event) == 'object') {
table = this.parentNode;
i = 0;
while(table.tagName.toLowerCase() != 'table' && i < 20) {
i++;
table = table.parentNode;
}
}
}
Patchfile (Forgot to remove a console.log)
Moved to patches.
This patch has been committed after fixing the compatibility with IE 8 and doing a little code cleanup.
Svn revision: 13182
http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/trunk/phpMyAdmin/js/functions.js?r1=13126&r2=13182