forked from AppScale/appscale-tools
/
rcov.js
42 lines (37 loc) · 1.1 KB
/
rcov.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function toggleCode( id ) {
if ( document.getElementById ) {
elem = document.getElementById( id );
} else if ( document.all ) {
elem = eval( "document.all." + id );
} else {
return false;
}
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block";
} else {
elemStyle.display = "none";
}
return true;
}
function restripe() {
i = 0;
$('table#report_table tbody tr').each(function(){
if (this.style.display != "none") {
i += 1;
classes = this.className.split(" ");
if ($.inArray("even",classes) != -1) {
classes.splice($.inArray("even",classes),1);
} else if ($.inArray("odd",classes) != -1) {
classes.splice($.inArray("odd",classes),1);
}
if (i % 2 === 0) {
this.className = classes.join(" ") + " odd";
} else {
this.className = classes.join(" ") + " even";
}
}
});
}
// Fix IE's lack of support for indexOf (!)
if (!Array.indexOf) { Array.prototype.indexOf = function(obj){ for(var i=0; i<this.length; i++){ if(this[i]==obj){return i;} } return -1; }}