1(function($) { 2 // This part remains unchanged 3 $('.search-field select').select2({ 4 searchField: ['text', 'value'], 5 persist: false, 6 create: false, 7 allowEmptyOption: true, 8 allowClear: true, 9 placeholder: "Search or select" 10 }); 11 12 $('#rswpbs-sort').change(function() { 13 var selectedSort = this.value; 14 $('#rswpbs-sortby').val(selectedSort); 15 var $searchForm = $('#rswpbs-books-search-form'); 16 if ($searchForm.length) { 17 $searchForm.find('#rswpbs-sortby').val(selectedSort); 18 $searchForm.submit(); 19 } else { 20 var $sortForm = $('#rswpbs-book-sort-form'); 21 if ($sortForm.length) { 22 $sortForm.find('#rswpbs-sortby').val(selectedSort); 23 $sortForm.submit(); 24 } 25 } 26 }); 27 28 $('.reset-search-form').click(function(event) { 29 event.preventDefault(); 30 history.pushState({}, "", window.location.pathname); 31 location.reload(); 32 }); 33 34})(jQuery); 35 36function rswpbsMasonryInit() { 37 if (typeof jQuery.fn.masonry !== 'undefined') { 38 jQuery('.masonry_layout_active_for_books').masonry({ 39 itemSelector: '.book-single-column', 40 }); 41 jQuery('.rswpbs-authors-masonry').masonry({ 42 itemSelector: '.rswpbs-author-col', 43 }); 44 } 45} 46 47function rswpbsTestimonialMasonryInit() { 48 if (typeof jQuery.fn.masonry !== 'undefined') { 49 jQuery('.rswpbs-testimonial-masonry').masonry({ 50 itemSelector: '.testimonial-item-col', 51 }); 52 } 53} 54 55jQuery(window).on('load', function() { 56 rswpbsMasonryInit(); 57 rswpbsTestimonialMasonryInit(); 58}); 59 60jQuery(document).ready(function($) { 61 rswpbsMasonryInit(); 62 rswpbsTestimonialMasonryInit(); 63 64 // --- NEW POPUP MODAL LOGIC --- 65 66 // Use event delegation for the "Read More" link. 67 // This ensures it works reliably, even with sliders or AJAX-loaded content. 68 $(document.body).on('click', '.rswpbs-testimonial-read-more', function(e) { 69 e.preventDefault(); 70 var modalId = $(this).data('modal-id'); 71 $('#' + modalId).fadeIn(200); 72 }); 73 74 // Use event delegation for the close button ('x'). 75 $(document.body).on('click', '.rswpbs-popup-close', function() { 76 $(this).closest('.rswpbs-review-popup').fadeOut(200); 77 }); 78 79 // Close the popup when clicking on the dark background overlay. 80 $(document).on('click', function(event) { 81 // The `is` check ensures we're clicking the background itself, 82 // not a child element within the popup content area. 83 if ($(event.target).is('.rswpbs-review-popup')) { 84 $(event.target).fadeOut(200); 85 } 86 }); 87 88 // Close the popup when the 'Escape' key is pressed. 89 $(document).on('keydown', function(event) { 90 if (event.key === "Escape") { 91 $('.rswpbs-review-popup').fadeOut(200); 92 } 93 }); 94 95 // --- END OF NEW LOGIC --- 96 97 if (window.acf) { 98 window.acf.addAction('render_block_preview/type=rswp-book-gallery', rswpbsMasonryInit); 99 } 100}); 101 102jQuery(window).on('scroll', function() { 103 rswpbsMasonryInit(); 104 rswpbsTestimonialMasonryInit(); 105});
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.