1 2var theLastedSwiper = new Swiper(".the-lasted-swipper", { 3 loop: true, 4 slidesPerView: 'auto', 5 spaceBetween: 16, 6 navigation: { 7 nextEl: ".the-lasted .swiper-button-next", 8 prevEl: ".the-lasted .swiper-button-prev" 9 }, 10 pagination: { 11 el: ".the-lasted .swiper-pagination", 12 clickable: true 13 }, 14 breakpoints: { 15 768: { 16 slidesPerView: 3, 17 } 18 } 19}); 20 21 22const categoryCheckboxes = document.querySelectorAll('input.specific-category'); 23 24function handleUnCheckCategories() { 25 $('.category-content').removeClass('hidden'); 26 $('.category-content').addClass('block'); 27 28 categoryCheckboxes.forEach((category) => { 29 category.checked = false; 30 }); 31} 32 33function getCheckedCategories() { 34 const checkedCategories = []; 35 $('input[name="categories[]"]:checked').each(function(){ 36 checkedCategories.push($(this).val()); 37 }); 38 return checkedCategories; 39} 40 41$('input[name="categories[]"]').on('change', function(){ 42 const checkedCategories = getCheckedCategories(); 43 44 if (checkedCategories.length == 0) { 45 // if no category is checked => still show all categories 46 ALL_SPECIFIC_CATEGORY_IDS.forEach((selectedCategory) => { 47 if ($(`#category-${selectedCategory}`).hasClass('hidden')) { 48 $(`#category-${selectedCategory}`).removeClass('hidden'); 49 $(`#category-${selectedCategory}`).addClass('block'); 50 } 51 }); 52 return; 53 } 54 else if($(this).val() === SELECT_ALL_CATEGORY && checkedCategories.includes(SELECT_ALL_CATEGORY)){ 55 // uncheck all checkboxes of categories - except "All" 56 handleUnCheckCategories(); 57 } 58 else { 59 // uncheck category "ALL" 60 $('#category-all').prop('checked', false); 61 62 // show checked categories 63 checkedCategories.forEach((selectedCategory) => { 64 if ($(`#category-${selectedCategory}`).hasClass('hidden')) { 65 $(`#category-${selectedCategory}`).removeClass('hidden'); 66 $(`#category-${selectedCategory}`).addClass('block'); 67 } 68 }); 69 70 // hide others 71 ALL_SPECIFIC_CATEGORY_IDS.forEach((categoryId) => { 72 if (!checkedCategories.includes(String(categoryId))) { 73 $(`#category-${categoryId}`).removeClass('block'); 74 $(`#category-${categoryId}`).addClass('hidden'); 75 } 76 }); 77 } 78}); 79 80$("input#input-search").on("input", function(){ 81 const searchKeyword = $(this).val(); 82 let checkedCategories = getCheckedCategories(); 83 checkedCategories = checkedCategories.length == 1 && checkedCategories.includes(SELECT_ALL_CATEGORY) ? ALL_SPECIFIC_CATEGORY_IDS : checkedCategories; 84 85 handleSearchBlogs({ searchKeyword, categories: checkedCategories.join(",") }) 86});
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.