1(function ($) { 2 "use strict"; 3 4 $(document).ready(function () { 5 if (jQuery(".popular-classes-wrapper").length > 0) { 6 $('.popular-classes-wrapper').imagesLoaded(function () { 7 // init Isotope 8 var $container = $('.popular-classes-wrapper').isotope({ 9 itemSelector: '.popular-class-item', 10 layoutMode: 'fitRows', 11 }); 12 13 // bind filter button click 14 $('#filters').on('click', 'button', function () { 15 var filterValue = $(this).attr('data-filter'); 16 // use filterFn if matches value 17 $container.isotope({ 18 filter: filterValue 19 }); 20 }); 21 // change is-checked class on buttons 22 $('.popular-class-buttons').each(function (i, buttonGroup) { 23 var $buttonGroup = $(buttonGroup); 24 $buttonGroup.on('click', 'button', function () { 25 $buttonGroup.find('.active').removeClass('active'); 26 $(this).addClass('active'); 27 }); 28 }); 29 //**************************** 30 // Isotope Load more button 31 //**************************** 32 var initShow = 6; //number of items loaded on init & onclick load more button 33 var counter = initShow; //counter for load more button 34 var iso = $container.data('isotope'); // get Isotope instance 35 36 loadMore(initShow); //execute function onload 37 38 function loadMore(toShow) { 39 $container.find(".hidden").removeClass("hidden"); 40 41 var hiddenElems = iso.filteredItems.slice(toShow, iso.filteredItems.length).map(function (item) { 42 return item.element; 43 }); 44 $(hiddenElems).addClass('hidden'); 45 $container.isotope('layout'); 46 47 //when no more to load, hide show more button 48 if (hiddenElems.length == 0) { 49 jQuery("#see-load-more").hide(); 50 } else { 51 jQuery("#see-load-more").show(); 52 }; 53 54 } 55 //when load more button clicked 56 $("#see-load-more").on('click', function () { 57 if ($('#filters').data('clicked')) { 58 //when filter button clicked, set initial value for counter 59 counter = initShow; 60 $('#filters').data('clicked', false); 61 } else { 62 counter = counter; 63 }; 64 65 counter = counter + initShow; 66 67 loadMore(counter); 68 }); 69 70 //when filter button clicked 71 $("#filters").on('click', function () { 72 $(this).data('clicked', true); 73 74 loadMore(initShow); 75 }); 76 }); 77 78 } 79 80 81 82 //======================================================================= 83 // Ajax On Photo Gallary 84 //======================================================================= 85 if (jQuery(".gallery-images").length > 0) { 86 $('.gallery-images').imagesLoaded(function () { 87 var $containerg = $('.gallery-images').isotope({ 88 itemSelector: '.gallery-image', 89 }); 90 // bind filter button click 91 $('#controls').on('click', 'button', function () { 92 var filterValue = $(this).attr('data-filter'); 93 // use filterFn if matches value 94 $containerg.isotope({ 95 filter: filterValue 96 }); 97 }); 98 // change is-checked class on buttons 99 $('#controls').each(function (i, buttonGroup) { 100 var $buttonGroup = $(buttonGroup); 101 $buttonGroup.on('click', 'button', function () { 102 $buttonGroup.find('.active').removeClass('active'); 103 $(this).addClass('active'); 104 }); 105 }); 106 107 // Gallary Load more button 108 //**************************** 109 var initShowg = 6; //number of items loaded on init & onclick load more button 110 var counterg = initShowg; //counter for load more button 111 var isog = $containerg.data('isotope'); // get Isotope instance 112 113 loadMoreg(initShowg); //execute function onload 114 115 function loadMoreg(toShowg) { 116 $containerg.find(".hidden").removeClass("hidden"); 117 118 var hiddenElems = isog.filteredItems.slice(toShowg, isog.filteredItems.length).map(function (item) { 119 return item.element; 120 }); 121 $(hiddenElems).addClass('hidden'); 122 $containerg.isotope('layout'); 123 124 //when no more to load, hide show more button 125 if (hiddenElems.length == 0) { 126 jQuery("#load-photos").hide(); 127 } else { 128 jQuery("#load-photos").show(); 129 }; 130 131 } 132 //when load more button clicked 133 $("#load-photos").on('click', function () { 134 if ($('#controls').data('clicked')) { 135 //when filter button clicked, set initial value for counter 136 counterg = initShowg; 137 $('#controls').data('clicked', false); 138 } else { 139 counterg = counterg; 140 }; 141 142 counterg = counterg + initShowg; 143
144 loadMoreg(counterg); 145 }); 146 147 //when filter button clicked 148 $("#controls").on('click', function () { 149 $(this).data('clicked', true); 150 151 loadMoreg(initShowg); 152 }); 153 }); 154 } 155 156 //======================================================================= 157 // ajax curse page 158 //======================================================================= 159 160 if (jQuery(".grid-wrapper").length > 0) { 161 //Grid view 162 var items = $(".grid-wrapper .list-item"); 163 var numItems = items.length; 164 var perPage = 6; 165 var paginationItemNum = numItems; 166 items.slice(perPage).hide(); 167 $('.total-curse-count').text(numItems); 168 $('.pagination-container.has-paginate-grid').pagination({ 169 items: paginationItemNum, 170 itemsOnPage: perPage, 171 prevText: "<i class='icofont-long-arrow-left'>", 172 nextText: "<i class='icofont-long-arrow-right'>", 173 onPageClick: function (pageNumber) { 174 var showFrom = perPage * (pageNumber - 1); 175 var showTo = showFrom + perPage; 176 items.hide().slice(showFrom, showTo).show(); 177 178 } 179 }); 180 181 } 182 183 if (jQuery(".list-wrapper").length > 0) { 184 // list view 185 var itemsList = $(".list-wrapper .list-item"); 186 var numItemsList = itemsList.length; 187 var perPageList = 6; 188 var paginationItemNumList = numItemsList; 189 itemsList.slice(perPageList).hide(); 190 $('.pagination-container.has-paginate-list').pagination({ 191 items: paginationItemNumList, 192 itemsOnPage: perPageList, 193 prevText: "<i class='icofont-long-arrow-left'>", 194 nextText: "<i class='icofont-long-arrow-right'>", 195 onPageClick: function (pageNumber) { 196 var showFromList = perPageList * (pageNumber - 1); 197 var showToList = showFromList + perPageList; 198 itemsList.hide().slice(showFromList, showToList).show(); 199 } 200 }); 201 202 } 203 }); 204 205})(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.