1 <a id="all" href="#">all</a>
2 <a id="none" href="#">none</a>
4 <input type=text name=filter_regex>
5 <a id="included" href="#">included</a>
6 <a id="excluded" href="#">excluded</a>
9 <script type="text/javascript">
11 $('a#all').click( function(){
12 $("input[type='checkbox']:not([disabled='disabled'])").attr('checked', true);
15 $('a#none').click( function(){
16 $("input[type='checkbox']:not([disabled='disabled'])").attr('checked', false);
19 $('a#included').click( function(){
20 $("label.included input[type='checkbox']:not([disabled='disabled'])").attr('checked', true);
23 $('a#excluded').click( function(){
24 $("label.excluded input[type='checkbox']:not([disabled='disabled'])").attr('checked', true);
27 $('input[name=filter_regex]').change( function(e) {
28 console.debug( this, e );
29 var r = new RegExp( this.value ,'i');
32 $("input[type='checkbox']:not([disabled='disabled'])").each( function(i,element){
33 if ( r.test( this.value ) ) {
34 $(this).parent().removeClass('excluded').addClass('included');
37 $(this).parent().removeClass('included').addClass('excluded');
42 $('a#included').text('+' + included).show();
43 $('a#excluded').text('-' + excluded).show();