Skip to content

Commit

Permalink
Finished print style sheet. Fixed validation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey committed Aug 23, 2009
1 parent 9ebedfc commit c51242f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
18 changes: 9 additions & 9 deletions lib/rcov/templates/index.html.erb
Expand Up @@ -44,6 +44,15 @@
<th class="left_align">Code Coverage</th>
</tr>
</thead>
<tfoot>
<tr>
<td class="left_align">TOTAL</td>
<td class='right_align'><tt><%= total.num_lines %></tt></td>
<td class='right_align'><tt><%= total.num_code_lines %></tt></td>
<td class="left_align"><%= code_coverage_html(total.total_coverage_for_report) %></td>
<td class="left_align"><%= code_coverage_html(total.code_coverage_for_report) %></td>
</tr>
</tfoot>
<tbody>
<% files.each do |f,i| %>
<tr class="all_files all_coverage <%= coverage_threshold_classes(f.code_coverage_for_report) %> <%= file_filter_classes(f.name) %>">
Expand All @@ -55,15 +64,6 @@
</tr>
<% end %>
</tbody>
<tfoot>
<tr>
<td class="left_align">TOTAL</td>
<td class='right_align'><tt><%= total.num_lines %></tt></td>
<td class='right_align'><tt><%= total.num_code_lines %></tt></td>
<td class="left_align"><%= code_coverage_html(total.total_coverage_for_report) %></td>
<td class="left_align"><%= code_coverage_html(total.code_coverage_for_report) %></td>
</tr>
</tfoot>
</table>

<p>Generated on <%= generated_on %> with <a href="<%= rcov::UPSTREAM_URL %>">rcov <%= rcov::VERSION %></a></p>
Expand Down
12 changes: 12 additions & 0 deletions lib/rcov/templates/print.css
@@ -0,0 +1,12 @@
/* Hide controls */

body {
color: #000000;
background-color: #ffffff;
}

/* Hide controls */

div.controls {
display: none;
}
33 changes: 17 additions & 16 deletions lib/rcov/templates/rcov.js
@@ -1,37 +1,38 @@
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;

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"
elemStyle.display = "block";
} else {
elemStyle.display = "none"
elemStyle.display = "none";
}

return true;
}

function restripe() {
i = 0
i = 0;
$('table#report_table tbody tr').each(function(){
if (this.style.display != "none") {
i += 1;
classes = this.className.split(" ")
classes = this.className.split(" ");
if ($.inArray("even",classes) != -1) {
classes.splice($.inArray("even",classes),1)
classes.splice($.inArray("even",classes),1);
} else if ($.inArray("odd",classes) != -1) {
classes.splice($.inArray("odd",classes),1)
classes.splice($.inArray("odd",classes),1);
}
if (i % 2 == 0) {
this.className = classes.join(" ") + " odd"
if (i % 2 === 0) {
this.className = classes.join(" ") + " odd";
} else {
this.className = classes.join(" ") + " even"
this.className = classes.join(" ") + " even";
}
}
});
Expand Down

0 comments on commit c51242f

Please sign in to comment.