1jQuery(document).ready(function($) { 2 3 "use strict"; 4 5/*-----------------------------------------------------------------------------------*/ 6/* Load More Button 7/*-----------------------------------------------------------------------------------*/ 8core_getposts(); 9 //var dt = false; 10 11 function core_getposts(pageNum, max, nextLink, count) { 12 13 if(typeof core != 'undefined') { 14 15 jQuery('#load-more.disabled').click(function() { return false; }); 16 17 var content = ''; 18 19 if(jQuery('#ajax-container').hasClass('blog-grid-layout')) { 20 21 var content = '.blog-grid'; 22 23 } else { 24 25 var content = '.hentry'; 26 } 27 28 if(!pageNum) { 29 // The number of the next page to load (/page/x/). 30 var pageNum = parseInt(core.startPage) + 1; 31 } 32 33 if(!max) { 34 // The maximum number of pages the current query can return. 35 var max = parseInt(core.maxPages); 36 } 37 38 if(!nextLink) { 39 // The link of the next page of posts. 40 var nextLink = core.nextLink; 41 } 42 43 if(!count) { 44 var count = parseInt(jQuery('.count').text()); 45 } 46 47 /** 48 * Replace the traditional navigation with our own, 49 * but only if there is at least one page of new posts to load. 50 */ 51 52 53 if(pageNum <= max) { 54 55 56 // Remove the traditional navigation. 57 jQuery('.navigation').remove(); 58 59 } else { 60 61 jQuery('#load-more').addClass('disabled'); 62 63 } 64 65 /** 66 * Load new posts when the link is clicked. 67 */ 68 jQuery('#load-more').not('.disabled').click(function() { 69 70 //debug 71 //console.log('DEBUG INFO...'); 72 //console.log('The Next Link Number '+ nextLink); 73 //console.log('The Max Number of Pages '+ max); 74 //console.log('The Current Page Num '+ pageNum); 75 //console.log(content); 76 77 //jQuery(this).unbind('click', core_getposts()); 78 79 // Are there more posts to load? 80 if(pageNum <= max) { 81 82 if(jQuery('#ajax-container').hasClass('blog-grid-layout')) { 83 jQuery('#load-more-wrapper') 84 .before('<div id="ajax-container-new-'+ pageNum + '"class="row"></div>'); 85 console.log("content blog-grid" + content); 86 } 87 88 if(jQuery('#ajax-container').hasClass('blog-list-layout')) { 89 jQuery('#load-more') 90 .before('<div id="ajax-container-new-'+ pageNum + '"class=""></div>'); 91 console.log("content blog-grid" + content); 92 } 93 // Show that we're working. 94 jQuery('#load-more i').removeClass('fa-refresh').addClass('fa-refresh fa-spin'); 95 96 97 jQuery('#ajax-container-new-'+pageNum).load(nextLink + " " +content, 98 function() { 99 $( this ).hide().fadeIn(500); 100 101 // Update page number and nextLink. 102 pageNum++; 103 nextLink = nextLink.replace(/\/page\/[0-9]?/, '/page/'+ pageNum); 104 105 if(jQuery('#ajax-container').hasClass('blog-grid-layout')) { 106 jQuery('#load-more-wrapper') 107 .before('<div id="ajax-container-new-'+ pageNum + '"class="row"></div>'); 108 //console.log("content blog-grid" + content); 109 110 } 111 112 if(jQuery('#ajax-container').hasClass('blog-list-layout')) { 113 jQuery('#load-more-wrapper') 114 .before('<div id="ajax-container-new-'+ pageNum + '"class=""></div>'); 115 //console.log("content blog-list" + content); 116 } 117 118 119 // Update the button message. 120 if(pageNum <= max) { 121 122 jQuery('#load-more i').removeClass('fa-refresh fa-spin').addClass('fa-refresh'); 123 124 } else { 125 126 jQuery('#load-more').text('Fin de page'); 127 128 } 129 130 } 131 ); 132 } 133 134 return false; 135 136 }); 137 138 } 139 140 } 141});
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.