MDL-12025, enable row markings via javascript to keep track of current row

This commit is contained in:
toyomoyo
2007-11-07 07:46:33 +00:00
parent a90058210b
commit cc95d22fd8
3 changed files with 28 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
/**
* enables highlight of rows in user grade tables
*
*/
function markRowsInit() {
// for every table row ...
var rows = document.getElementById('user-grades').getElementsByTagName('tr');
for ( var i = 0; i < rows.length; i++ ) {
// ... with the class 'odd' or 'even' ...
// ... and to mark the row on click ...
rows[i].onmousedown = function() {
if (this.className.search(/marked/) != -1) {
this.className = this.className.replace(' marked', '');
} else {
this.className += ' marked';
}
}
}
}
window.onload=markRowsInit;
+3 -1
View File
@@ -159,7 +159,9 @@ if (!empty($studentsperpage)) {
print_paging_bar($numusers, $report->page, $studentsperpage, $report->pbarurl);
}
$reporthtml = '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">';
$reporthtml = '<script src="functions.js" type="text/javascript"></script>';
$reporthtml .= '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">';
$reporthtml .= $report->get_headerhtml();
$reporthtml .= $report->get_rangehtml();
$reporthtml .= $report->get_studentshtml();
+4
View File
@@ -1,4 +1,8 @@
.grade-report-grader table#user-grades tr.marked td.cell {
background-color: #FFCC99 ;
}
.grade-report-grader table#user-grades .catlevel1 {
background-color: #ffffff;
}