1$(document).ready(function () { 2 3 if ($('.blog-results').length) { 4 // Loading Div - Constant 5 var blogLoadingClass = 'blog-loading'; 6 var blogLoading = `<div class="${blogLoadingClass}"><div class="swiper-lazy-preloader"></div></div>`; 7 8 // Blog - Infinite Scroll Ajax Posts 9 var isLoading = false; 10 var scrollArea = $(window); 11 $(scrollArea).on('scroll', function (e) { 12 var form = $('#scrollForm'); 13 var currentPage = parseInt(form.find('[name=page]').val()); 14 var bottomResult = $('#bottomOfResults'); 15 var position = bottomResult.position().top; 16 var scllwidth = $(scrollArea).scrollTop() + $(scrollArea).height(); 17 if (scllwidth > position) { 18 var totalRecord = parseInt(bottomResult.attr('data-count')); 19 var totalPage = $('.cms-blog-grid-wrap [name^=page][name$=postIDs]').length; 20 if (currentPage < totalPage && !isLoading) { 21 if (!$('.blog-results + .blog-loading').length) { 22 bottomResult.before(blogLoading); 23 } 24 var newpage = currentPage + 1; 25 form.find('[name=page]').val(newpage); 26 form.find('[name=postIDs]').val($('#page' + newpage + 'postIDs').val()); 27 if (!isLoading) { 28 isLoading = true; 29 $.ajax({ 30 type: 'POST', 31 url: siteFolder + 'ajax/blog/scroll', 32 data: form.serialize(), 33 success: function (data) { 34 setTimeout(function () { 35 isLoading = false; 36 // Remove Loading Bar 37 $('.blog-results + .blog-loading').remove(); 38 // Append new results 39 $('.blog-results').append(data); 40 //console.log('This is from the infinite scroll ajax'); 41 }, 400); 42 } 43 }); 44 } 45 } 46 } 47 }); 48 } 49 50});
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.