1jQuery(function ($) { 2 $('#m_loadmore').click(function () { 3 $.ajax({ 4 url: loadmore_params.ajaxurl, 5 data: { 6 'action': 'loadmorebutton', 7 'query': loadmore_params.posts, 8 'page': loadmore_params.current_page 9 }, 10 type: 'POST', 11 beforeSend: function (xhr) { 12 $('#m_loadmore').text('ÐагÑÑзка...'); 13 $('.all_aht').show(); 14 }, 15 success: function (posts) { 16 if (posts) { 17 $('#m_loadmore').text('ÐоказаÑÑ ÐµÑе'); 18 var heightH = $('.page-blog__cards').outerHeight(); 19 $('.page-blog__cards').append(posts); 20 loadmore_params.current_page++; 21 $(document).scrollTop(heightH + 300); 22 $('.all_aht').hide(); 23 if (loadmore_params.current_page == loadmore_params.max_page) 24 $('#m_loadmore').hide(); 25 } else { 26 $('#m_loadmore').hide(); 27 } 28 $('.pagination').hide(); 29 } 30 }); 31 return false; 32 }); 33 $('.change_post').change(function () { 34 var filter = $('.filter'); 35 var thisTag = $(this).parent('.tag-p'); 36 $.ajax({ 37 url: loadmore_params.ajaxurl, 38 data: $('.filter').serialize(), 39 dataType: 'json', 40 type: 'POST', 41 beforeSend: function (xhr) { 42 $('#misha_filters').find('button').text('Filtering...'); 43 }, 44 success: function (data) { 45 // when filter applied: 46 // set the current page to 1 47 loadmore_params.current_page = 1; 48 // set the new query parameters 49 loadmore_params.posts = data.posts; 50 // set the new max page parameter 51 loadmore_params.max_page = data.max_page; 52 $(this).addClass('active'); 53 // insert the posts to the container 54 $('.page-blog__cards').html(data.content); 55 // hide load more button, if there are not enough posts for the second page 56 if (data.max_page < 2) { 57 $('#m_loadmore').hide(); 58 } else { 59 $('#m_loadmore').show(); 60 } 61 $('.tag-p').removeClass('changed'); 62 $(thisTag).addClass('changed'); 63 $('.main-post').hide(); 64 $('.pagination').hide(); 65 } 66 }); 67 return false; 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.