1jQuery(document).ready(function($) { 2 var $container = $('.infinite-scroll-category'); 3 var $postsContainer = $container.find('.posts-container'); 4 var $loadingContainer = $container.find('.loading-container'); 5 var loading = false; 6 var page = 1; 7 8 // Ôóíêöèÿ çàãðóçêè çàïèñåé 9 function loadPosts() { 10 if (loading || $container.find('.no-more-posts').length) return; 11 12 loading = true; 13 $loadingContainer.show(); 14 15 $.ajax({ 16 url: infiniteScroll.ajaxurl, 17 type: 'POST', 18 data: { 19 action: 'load_more_category_posts', 20 security: infiniteScroll.nonce, 21 cat_id: $container.data('cat-id'), 22 per_page: $container.data('per-page'), 23 button_text: $container.data('button-text'), 24 show_image: $container.data('show-image'), 25 show_excerpt: $container.data('show-excerpt'), 26 show_date: $container.data('show-date'), 27 orderby: $container.data('orderby'), 28 order: $container.data('order'), 29 page: page + 1 30 }, 31 success: function(response) { 32 if (response.trim()) { 33 $postsContainer.append(response); 34 page++; 35 } else { 36 $container.append('<div class="no-more-posts">Çàïèñè çàêîí÷èëèñü</div>'); 37 } 38 loading = false; 39 $loadingContainer.hide(); 40 } 41 }); 42 } 43 44 // Ïîäãðóçêà ïðè ñêðîëëå 45 $(window).scroll(function() { 46 if ($(window).scrollTop() + $(window).height() > $(document).height() - 300) { 47 loadPosts(); 48 } 49 }); 50 51 // Ïåðâîíà÷àëüíàÿ çàãðóçêà 52 loadPosts(); 53});
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.