Permalink
Browse files

Merge pull request #17 from janmarek/master

filter field
  • Loading branch information...
2 parents e9e662d + 9b7c776 commit f4db2d8ed5ece3147250b10ccea8f079a7c314a9 @juzna committed Mar 9, 2012
Showing with 25 additions and 1 deletion.
  1. +25 −1 app/templates/Homepage/default.latte
@@ -12,7 +12,31 @@
<h1>Generated documentations <small>Projects already having API docs generated by ApiGen</small></h1>
</div>
- <table n:if="$repos" class="table table-striped table-bordered">
+ {if $repos}
+ <script>
+ function filterRepos(text) {
+ $("#repos tbody tr").each(function () {
+ var tr = $(this);
+
+ if (text === '') {
+ tr.show();
+ return;
+ }
+
+ if (tr.find('td:eq(0), td:eq(1)').text().toLowerCase().indexOf(text.toLowerCase()) !== -1) {
+ tr.show();
+ } else {
+ tr.hide();
+ }
+ });
+ }
+ </script>
+ <form>
+ <p>Filter: <input type="text" id="filter" onkeyup="filterRepos(this.value)"></p>
+ </form>
+ {/if}
+
+ <table n:if="$repos" class="table table-striped table-bordered" id="repos">
<thead><tr>
{* <th>#</th> *}
<th>Project name</th>

0 comments on commit f4db2d8

Please sign in to comment.