Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add ability to filter Html_basic reports' list of files

  • Loading branch information...
commit cbfb73f9251637b12283631400dfd5362b6d735e 1 parent 929b7fa
@DrHyde DrHyde authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 lib/Devel/Cover/Report/Html_basic.pm
View
23 lib/Devel/Cover/Report/Html_basic.pm
@@ -568,6 +568,27 @@ $Templates{summary} = <<'EOT';
</tr>
</table>
<div><br></br></div>
+
+<script language=javascript>
+
+ function filter_files(filter_by) {
+ var allelements = document.getElementsByTagName("tr");
+ var re_now = new RegExp(filter_by, 'i');
+ for(var i = 0; i < allelements.length; i++) {
+ if(allelements[i].className) {
+ if(filter_by == "" || allelements[i].className == "Total" || (filter_by.length && re_now.test(allelements[i].className))) {
+ allelements[i].style.display = "table-row";
+ } else if(filter_by.length && !re_now.test(allelements[i].className)) {
+ allelements[i].style.display = "none";
+ }
+ }
+ }
+ }
+
+</script>
+<form name=filterform action='javascript:filter_files(document.forms["filterform"]["filterfield"].value)'>Restrict to regex: <input type=text name=filterfield><input type=submit></form>
+<br />
+
<table class="sortable" id="coverage_table">
<thead>
<tr>
@@ -581,7 +602,7 @@ $Templates{summary} = <<'EOT';
<tfoot>
[% FOREACH file = files %]
- <tr align="center" valign="top">
+ <tr align="center" valign="top" class="[% file %]">
<td align="left">
[% IF R.exists.$file %]
<a href="[% R.filenames.$file %].html"> [% file %] </a>
Please sign in to comment.
Something went wrong with that request. Please try again.