added rest of the graphs, and fixed event bubbling issues

This commit is contained in:
tmont 2009-07-01 05:48:53 +00:00
parent a283acd7be
commit 0557fc93dd
3 changed files with 32 additions and 15 deletions

View File

@ -345,6 +345,7 @@
$info .= '<td class="coverage-ratio" style="background-color: ' . $percentageData[1] . '">' . $subdata['cloc'] . ' / ' . ($subdata['loc'] - $subdata['dloc']) . '</td>';
$info .= "<td class=\"coverage-percentage\" style=\"background-color: $percentageData[1]\">$percentageData[0]%</td>";
$info .= "</tr>\n";
$info .= '<tr class="coverage-graph"><td colspan="3"><img alt="Code Coverage results" src="' . self::getDataUri($subdata['loc'], $subdata['dloc'], $subdata['cloc']) . '"/></td></tr>';
}
//regular files in current directory
@ -354,6 +355,7 @@
$info .= '<td class="coverage-ratio" style="background-color: ' . $percentageData[1] . '">' . $fileData['cloc'] . ' / ' . ($fileData['loc'] - $fileData['dloc']) . '</td>';
$info .= "<td class=\"coverage-percentage\" style=\"background-color: $percentageData[1]\">$percentageData[0]%</td>";
$info .= "</tr>\n";
$info .= '<tr class="coverage-graph"><td colspan="3"><img alt="Code Coverage results" src="' . self::getDataUri($fileData['loc'], $fileData['dloc'], $fileData['cloc']) . '"/></td></tr>';
}
$temp = str_replace(

View File

@ -21,7 +21,7 @@
<p>${file.link}</p>
</div>
<div id="directory-coverage">
<div id="summary">
<table>
<colgroup>
<col style="width:50%"/>

View File

@ -30,23 +30,25 @@
toggler.style.cursor = "pointer";
toggler.onmouseover = function() {
var child = this.firstChild;
do {
if (child.nodeName === "TD" || child.nodeName === "TH") {
child.style.backgroundColor = "#990099";
child.style.color = "#FFFFFF";
var th = this.getElementsByTagName("th")[0];
th.style.backgroundColor = "#990099";
th.style.color = "#FFFFFF";
var a = th.getElementsByTagName("a");
if (a.length > 0) {
a[0].style.backgroundColor = "#990099";
a[0].style.color = "#FFFFFF";
}
} while (child = child.nextSibling);
}
toggler.onmouseout = function() {
var child = this.firstChild;
do {
if (child.nodeName === "TD" || child.nodeName === "TH") {
child.style.backgroundColor = "";
child.style.color = "";
var th = this.getElementsByTagName("th")[0];
th.style.backgroundColor = "";
th.style.color = "";
var a = th.getElementsByTagName("a");
if (a.length > 0) {
a[0].style.backgroundColor = "";
a[0].style.color = "";
}
} while (child = child.nextSibling);
}
toggler.onclick = function() {
@ -54,6 +56,19 @@
this.nextSibling.nextSibling.style.display = (display === "none") ? "table-row" : "none";
}
//cancel event bubbling on the anchors
var a = toggler.getElementsByTagName("a");
for (var j = 0, jlen = a.length; j < jlen; j++) {
a[j].onclick = function(e) {
e = e || window.event;
if (e.stopPropagation) {
e.stopPropagation();
} else {
e.cancelBubble = true;
}
}
}
graphs[i].style.display = "none";
}
}