1document.addEventListener('DOMContentLoaded', function () { 2 const categoryFilter = document.getElementById('job_category_filter'); 3 const standortFilter = document.getElementById('job_standort_filter'); 4 const typeFilter = document.getElementById('job_type_filter'); 5 const removeAllButton = document.getElementById('remove-all'); 6 7 function applyFilters() { 8 const selectedCategory = categoryFilter ? categoryFilter.value : ''; 9 const selectedStandort = standortFilter ? standortFilter.value : ''; 10 const selectedJobType = typeFilter ? typeFilter.value : ''; 11 12 jQuery.ajax({ 13 url: ajax_object.ajax_url, 14 method: 'POST', 15 data: { 16 action: 'filter_jobs', 17 nonce: ajax_object.nonce, 18 job_category_filter: selectedCategory, 19 job_standort_filter: selectedStandort, 20 job_type_filter: selectedJobType, 21 }, 22 success: function (response) { 23 document.getElementById('job-listings').innerHTML = response; 24 } 25 }); 26 27 toggleRemoveAllButton(selectedCategory, selectedStandort, selectedJobType); 28 } 29 30 function toggleRemoveAllButton(category, standort, type) { 31 if (removeAllButton) { 32 if (category || standort || type) { 33 removeAllButton.style.display = 'inline-block'; 34 } else { 35 removeAllButton.style.display = 'none'; 36 } 37 } 38 } 39 40 if (categoryFilter) { 41 categoryFilter.addEventListener('change', applyFilters); 42 } 43 44 if (standortFilter) { 45 standortFilter.addEventListener('change', applyFilters); 46 } 47 48 if (typeFilter) { 49 typeFilter.addEventListener('change', applyFilters); 50 } 51 52 if (removeAllButton) { 53 removeAllButton.addEventListener('click', function () { 54 if (categoryFilter && !categoryFilter.disabled) { 55 categoryFilter.value = ''; 56 } 57 if (standortFilter) standortFilter.value = ''; 58 if (typeFilter) typeFilter.value = ''; 59 applyFilters(); 60 }); 61 } 62 63 // Initial check 64 const initialCategory = categoryFilter ? categoryFilter.value : ''; 65 const initialStandort = standortFilter ? standortFilter.value : ''; 66 const initialType = typeFilter ? typeFilter.value : ''; 67 toggleRemoveAllButton(initialCategory, initialStandort, initialType); 68});
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.