1jQuery(($) => { 2 if (typeof FWP != "undefined") { 3 var noResourceMessage = facetwp_messages_vars.resource_center_no_posts || window.FWP_JSON.no_results_text; 4 $('.facetwp-template').parent().append('<h4 class="facetwp-no-posts" style="display:none;">' + noResourceMessage + '</h4>'); 5 $(document).on('facetwp-loaded', () => { 6 if ($('.bs-posts__list .bs-row .bs-column').length == 0) { 7 $('.facetwp-no-posts').show(); 8 // $('.facetwp-type-pager').hide(); 9 } else if (FWP.settings.pager.page >= FWP.settings.pager.total_pages) { 10 $('.facetwp-no-posts').hide(); 11 // $('.facetwp-type-pager').hide(); 12 } else { 13 $('.facetwp-no-posts').hide(); 14 } 15 }); 16 17 //active 'All' checkbox when reset button click 18 $('.reset-filters').on('click', function () { 19 $('.facet-checkbox-select-all').addClass('checked'); 20 }); 21 22 //on page load hide the reset button 23 if ($('.facetwp-selection-value').length <= 0) { 24 $('.reset-selection').hide(); 25 } 26 27 //handle 'All' check box functionality when click on sub checkboxes 28 $(document).on('click', '.facetwp-type-checkboxes .facetwp-checkbox:not(.disabled)', () => { 29 const facet = $(event.target).parent().data('name'); 30 const allCheckboxElement = $(`.facetwp-all-${facet}`); 31 if (facet) { 32 let isChecked = !$(event.target).hasClass('checked'); 33 if (isChecked) { 34 if (!$(event.target).siblings().hasClass('checked')) { 35 allCheckboxElement.addClass('checked'); 36 } 37 } else { 38 if (allCheckboxElement.hasClass('checked')) { 39 allCheckboxElement.removeClass('checked'); 40 } 41 } 42 } 43 }); 44 45 //'All' check box on click action 46 $(document).on('click', '.facet-checkbox-select-all', () => { 47 $(event.target).addClass('checked') 48 }); 49 50 //hide reset button when facet items are not selected 51 $(document).on('facetwp-loaded', () => { 52 let queryString = FWP.buildQueryString(); 53 if ('' === queryString) { // no facets are selected 54 $('.reset-selection').hide(); 55 } else { 56 $('.reset-selection').show(); 57 } 58 }); 59 60 61 const facets = FWP.facets; 62 //on page reload, when facet filter items applied, uncheck the relavent facet 'All' checkbox 63 $.each(facets, (key, facet) => { 64 if (facets[key].length) { 65 $(`.facetwp-all-${key}`).removeClass('checked'); 66 } 67 }); 68 } 69 70});
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.