1(function(window, $) { 2 3 // USE STRICT 4 "use strict"; 5 6 var wbgSingleModal = document.getElementById('wbg-single-modal-id'); 7 var wbgSelectSort = document.getElementById('wbg-select-sort'); 8 var wbgSlide = document.getElementById('wbg-view-slide-id'); 9 var wbgWidget = document.getElementById('wbg-view-widget-id'); 10 var wbgSingleLoadMoreDetails = document.getElementById('wbgSingleLoadMoreDetails'); 11 var wbgurl = new URL(window.location.href); 12 13 // Display book info in modal 14 if (wbgSingleModal != null) { 15 $(".wbg-single-modal").iziModal({ 16 width: parseInt(wbgAdminScriptObj.modalWidth), 17 iframeHeight: 400, 18 height: 300, 19 }); 20 21 $(document).on('click', 'h3.wgb-item-link', function(event) { 22 event.preventDefault(); 23 $.ajax({ 24 url: wbgAdminScriptObj.ajaxurl, 25 type: "POST", 26 data: { 27 action: 'single_modal', 28 postId: $(this).data('post_id'), 29 }, 30 success: function(data) { 31 $('.iziModal-content').html(data); 32 $('.wbg-single-modal').iziModal('open'); 33 $('.iziModal-wrap').css('height', '300px !important'); 34 } 35 }); 36 }); 37 } 38 39 if (wbgSlide != null) { 40 var slides_to_show = $('#wbg-view-slide-id').data("slides"); 41 $('.wbg-view-slide').slick({ 42 speed: 300, 43 slidesToShow: slides_to_show, 44 slidesToScroll: 1, 45 autoplay: true, 46 infinite: true, 47 autoplaySpeed: 3000, 48 cssEase: 'ease', 49 dots: false, 50 dotsClass: 'slick-dots', 51 pauseOnHover: true, 52 arrows: true, 53 prevArrow: '<button type="button" data-role="none" class="slick-prev">Previous</button>', 54 responsive: [{ 55 breakpoint: 1024, 56 settings: { 57 slidesToShow: 3, 58 slidesToScroll: 3, 59 infinite: true, 60 dots: false 61 } 62 }, 63 { 64 breakpoint: 600, 65 settings: { 66 slidesToShow: 2, 67 slidesToScroll: 2 68 } 69 }, 70 { 71 breakpoint: 480, 72 settings: { 73 slidesToShow: 1, 74 slidesToScroll: 1 75 } 76 } 77 ], 78 }); 79 } 80 81 if (wbgWidget != null) { 82 $(wbgWidget).slick({ 83 speed: 300, 84 slidesToShow: 1, 85 slidesToScroll: 1, 86 autoplay: true, 87 infinite: true, 88 autoplaySpeed: 3000, 89 cssEase: 'ease', 90 dots: false, 91 dotsClass: 'slick-dots', 92 pauseOnHover: true, 93 arrows: false, 94 prevArrow: '<button type="button" data-role="none" class="slick-prev">Previous</button>', 95 }); 96 } 97 98 if (wbgSelectSort != null) { 99 100 $('select#wbg-select-sort').on('change', function() { 101 102 wbgurl.searchParams.set('orderby', $(this).val()); 103 window.location.href = wbgurl.href; 104 }); 105 } 106 107 $(document).on('click', '.wbg-item-sorting .select-column .wbg-select-view span.view', function(event) { 108 event.preventDefault(); 109 var url = new URL(window.location.href); 110 var urlParam = $(this).data('view_type'); 111 url.searchParams.set('layout', urlParam); 112 window.location.href = url.href; 113 }); 114 115 $(document).ready(function() { 116 117 if (wbgSingleLoadMoreDetails == null) { 118 $("span.wbg-single-book-info").css("display", "block"); 119 } 120 if ($("span.wbg-single-book-info").length > 8) { 121 $("#wbgSingleLoadMoreDetails").css("display", "block"); 122 } 123 $("span.wbg-single-book-info").slice(0, 8).css("display", "inline-block").show(); 124 $("#wbgSingleLoadMoreDetails").on("click", function(e) { 125 e.preventDefault(); 126 $("span.wbg-single-book-info:hidden").slice(0, 4).css("display", "inline-block").slideDown(); 127 if ($("span.wbg-single-book-info:hidden").length == 0) { 128 $("#wbgSingleLoadMoreDetails").text("No More Info Available").addClass("wbgNoMoreInfoAvailable"); 129 } 130 }); 131 });
132 133 // searchable dropdown select 134 $('div.wbg-search-item select.wbg-selectize').selectize(); 135 136})(window, jQuery);
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.