1var qsRegex; 2var buttonFilter; 3 4// init Isotope 5var $grid = $('.sorting').isotope({ 6 itemSelector: '.sorting-item', 7 layoutMode: 'fitRows', 8 filter: function(){ 9 var $this = $(this); 10 var searchResult = qsRegex ? $this.text().match( qsRegex ) : true; 11 var buttonResult = buttonFilter ? $this.is( buttonFilter ) : true; 12 return searchResult && buttonResult; 13 } 14}); 15 16// bind filter on radio click 17$('#filter').on( 'click', 'input', function() { 18 // get filter value from input value 19 //var filterValue = this.value; 20 buttonFilter = this.value; 21 $grid.isotope(); 22}); 23 24// bind filter on button click 25$(".filters").on( 'click', 'button', function() { 26 // get filter value from input value 27 //var filterValue = this.value; 28 buttonFilter = this.value; 29 $grid.isotope(); 30}); 31 32/// --- Sorting multiple --- /// 33$(".badge-field").click(function(){ 34 $(this).addClass("is-selected"); 35 $(".badge-field").not(this).removeClass("is-selected").addClass("not-selected"); 36}); 37$(".all-categories").click(function(){ 38 $(".badge-field").removeClass("not-selected").addClass("is-selected"); 39}); 40 41// use value of search field to filter 42var $quicksearch = $('#quicksearch').keyup( debounce( function() { 43 qsRegex = new RegExp( $quicksearch.val(), 'gi' ); 44 $grid.isotope(); 45}) ); 46 47 48// debounce so filtering doesn't happen every millisecond 49function debounce( fn, threshold ) { 50 var timeout; 51 threshold = threshold || 100; 52 return function debounced() { 53 clearTimeout( timeout ); 54 var args = arguments; 55 var _this = this; 56 function delayed() { 57 fn.apply( _this, args ); 58 } 59 timeout = setTimeout( delayed, threshold ); 60 }; 61}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.