copy library from master and use it
This commit is contained in:
parent
a74b7cb6d3
commit
c6a675b855
2 changed files with 16 additions and 8 deletions
17
index.html
17
index.html
|
@ -5,13 +5,7 @@
|
|||
|
||||
<title>Test page for Table Filter</title>
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
|
||||
<script src="https://github.com/hail2u/jquery.table-filter/raw/master/jquery.table-filter.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("table").addTableFilter();
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="http://hail2u.github.com/natural.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test page for Table Filter</h1>
|
||||
|
@ -23,7 +17,6 @@
|
|||
<th>Dolor Sit Amet</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Ut egestas consectetur elit</td>
|
||||
|
@ -127,5 +120,13 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
|
||||
<script src="jquery.table-filter.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("table").addTableFilter();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
7
jquery.table-filter.min.js
vendored
Normal file
7
jquery.table-filter.min.js
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
jQuery Plugin: Table Filter - version 0.2
|
||||
|
||||
LICENSE: http://hail2u.mit-license.org/2009
|
||||
*/
|
||||
(function(a){a.fn.addTableFilter=function(d){var b=a.extend({},a.fn.addTableFilter.defaults,d),c,e;this.is("table")&&(this.attr("id")||this.attr({id:"t-"+Math.floor(99999999*Math.random())}),c=this.attr("id"),d=c+"-filtering",e=a("<label/>").attr({"for":d}).append(b.labelText),b=a("<input/>").attr({id:d,type:"text",size:b.size}),a("<p/>").addClass("formTableFilter").append(e).append(b).insertBefore(this),a("#"+d).delayBind("keyup",function(){var b=a(this).val().toLowerCase().split(" ");a("#"+c+" tbody tr").each(function(){var d=
|
||||
a(this).html().toLowerCase().replace(/<.+?>/g,"").replace(/\s+/g," "),c=0;a.each(b,function(){if(0>d.indexOf(this))return c=1,!1});c?a(this).hide():a(this).show()})},300));return this};a.fn.addTableFilter.defaults={labelText:"Keyword(s): ",size:32};a.fn.delayBind=function(d,b,c,e){a.isFunction(b)&&(e=c,c=b,b=void 0);var g=this,f=null;return this.bind(d,b,function(b){clearTimeout(f);f=setTimeout(function(){c.apply(g,[a.extend({},b)])},e)})}})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue