1/* Custom JS File */ 2 3(function($) { 4 5 "use strict"; 6 7 jQuery(document).ready(function() { 8 if ($('.ajax-pagination').length > 0) { 9 10 11 //infinite pagination 12 /*new pagination style*/ 13 var paged = parseInt(mag_and_news_ajax.paged) + 1; 14 var max_num_pages = parseInt(mag_and_news_ajax.max_num_pages); 15 var next_posts = mag_and_news_ajax.next_posts; 16 17 $(document).on('click', '.show-more', function (event) { 18 event.preventDefault(); 19 var show_more = $(this); 20 var click = show_more.attr('data-click'); 21 if ((paged - 1) >= max_num_pages) { 22 show_more.html(mag_and_news_ajax.no_more_posts) 23 } 24 if (click == 0 || (paged - 1) >= max_num_pages) { 25 return false; 26 } 27 show_more.html('<i class="fa fa-spinner fa-spin fa-fw"></i>'); 28 show_more.attr("data-click", 0); 29 var page = parseInt(show_more.attr('data-number')); 30 31 $('#free-temp-post').load(next_posts + ' .mag-and-news-article-wrapper article.post, .ct-post-list article.post ', function () { 32 /*http://stackoverflow.com/questions/17780515/append-ajax-items-to-masonry-with-infinite-scroll*/ 33 paged++;/*next page number*/ 34 next_posts = next_posts.replace(/(\/?)page(\/|d=)[0-9]+/, '$1page$2' + paged); 35 var html = $('#free-temp-post').html(); 36 $('#free-temp-post').html(''); 37 38 // Make jQuery object from HTML string 39 var $moreBlocks = $(html).filter('article.post'); 40 // Append new blocks to container 41 $('.mag-and-news-article-wrapper, .ct-post-list').append($moreBlocks).imagesLoaded(function () { 42 // Have Masonry position new blocks 43 $('.mag-and-news-article-wrapper, .ct-post-list').masonry('appended', $moreBlocks); 44 }); 45 46 show_more.attr("data-number", page + 1); 47 show_more.attr("data-click", 1); 48 show_more.html("<i class='fa fa-refresh'></i>" + mag_and_news_ajax.show_more) 49 }); 50 return false; 51 }); 52 53 var maxHeight = 0; 54 jQuery('.two-column article.two-column').each(function () { 55 if (jQuery(this).height() > maxHeight) { 56 maxHeight = jQuery(this).height(); 57 } 58 }); 59 jQuery('.two-column article.two-column').height(maxHeight); 60 //end pagination 61 } 62 }); 63})(jQuery); 64
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.