1// JQuery Document 2(function($) { 3 $( function() { 4 5 var urlParams = new URLSearchParams(window.location.search); 6 7 if ( urlParams.get('type') ) { 8 var uri = window.location.toString(); 9 if (uri.indexOf("?") > 0) { 10 var clean_uri = uri.substring(0, uri.indexOf("?")); 11 window.history.replaceState({}, document.title, clean_uri); 12 } 13 var filter = urlParams.get('type'); 14 filterProducts(filter); 15 16 } 17 18 $('#products').on('click', 'a[data-filter]', function( event ) { 19 20 if(event.preventDefault) { event.preventDefault(); } 21 22 $this = $(this); 23 24 var filter = $this.data('term-id'); 25 26 $('.product-type-title').html($this.data('title')); 27 28 if ($this.data('term-id') == '0') { 29 $('#featured-products').show(); 30 } else { 31 $('#featured-products').hide(); 32 } 33 34 if ($this.data('filter')) { 35 $this.closest('ul').find('.is-active').removeClass('is-active'); 36 $this.addClass('is-active'); 37 } 38 39 filterProducts(filter); 40 }); 41 42 $('.c-select select.products-filter').on('change', function(event) { 43 44 $this = $(this); 45 46 var filter = $this.find(":selected").data("term-id") 47 48 $('.product-type-title').html($this.find(':selected').data('title')); 49 50 if ( filter == '0') { 51 $('#featured-products').show(); 52 } else { 53 $('#featured-products').hide(); 54 } 55 56 filterProducts(filter); 57 58 }); 59 60 function filterProducts(value) { 61 if(value == ''){ 62 value = 'all'; 63 } 64 var list = $("#product-list .product-item"); 65 $(list).fadeOut("fast"); 66 if (value == "0") { 67 $("#product-list").find(".product-item").each(function (i) { 68 $(this).delay(200).slideDown("fast"); 69 }); 70 }else{ 71 $("#product-list").find(".product-item[data-type*=" + value + "]").each(function (i) { 72 $(this).delay(200).slideDown("fast"); 73 }); 74 } 75 } 76 77 }); 78 79})(jQuery);
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.