https://swallowhillmusic.org/wp-content/plugins/Elevent-WordPress-…/js/showtime-list-venue-filter.js
1jQuery(document).ready(function ($) { 2 function applyFilter(lookup) { 3 let dates = $("[data-date]"); 4 dates.each(function (_, val) { 5 if (lookup === "all") { 6 $(val).show(); 7 } else if (lookup == val.dataset.date) { 8 $(val).show(); 9 } else { 10 $(val).hide(); 11 } 12 }); 13 14 // Hide parent venue if all dates are hidden 15 $(".venue").each(function () { 16 let venue = $(this); 17 let visibleDates = venue.find("[data-date]").filter(function () { 18 return $(this).css("display") !== "none"; 19 }); 20 21 if (visibleDates.length === 0) { 22 venue.hide(); 23 } else { 24 venue.show(); 25 } 26 }); 27 } 28 29 $(".single-event-venue-filter").on("change", function (event) { 30 let val = event.target.value; 31 $("[data-venue]").show(); 32 if (val != "all") { 33 $("[data-venue]").hide(); 34 $("[data-venue='" + val + "']").show(); 35 } 36 }); 37 38 $("[data-lookup]").on("click", function (event) { 39 $("[data-lookup]").removeClass("active"); 40 $(event.currentTarget).addClass("active"); 41 let lookup = event.currentTarget.dataset.lookup; 42 applyFilter(lookup); 43 }); 44 45 // Handle "More" button click for mobile 46 $(".list-view-dropdown-wrapper .more").on("click", function (event) { 47 event.preventDefault(); 48 $(this).closest(".list-view-dropdown-wrapper").toggleClass("active"); 49 }); 50 51 // Close the dropdown when clicking outside 52 $(document).on("click", function (event) { 53 if (!$(event.target).closest(".list-view-dropdown-wrapper").length) { 54 $(".list-view-dropdown-wrapper").removeClass("active"); 55 } 56 }); 57 58 // Trigger click event on the button with the active class on page load 59 let activeButton = $("[data-lookup].active"); 60 if (activeButton.length) { 61 let lookup = activeButton.data("lookup"); 62 applyFilter(lookup); 63 } 64});
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.