1jQuery(document).ready(function (jQuery) { 2 // The number of the next page to load (/page/x/). 3 var pageNum = parseInt(ragan_alp.startPage) + 1; 4 5 // The maximum number of pages the current query can return. 6 var max = parseInt(ragan_alp.maxPages); 7 8 // The link of the next page of posts. 9 var nextLink = ragan_alp.nextLink; 10 11 // Grab with JQuery class, id or tag. 12 var selectorforGrab = ragan_alp.selectorforGrab; 13 14 /** 15 * Replace the traditional navigation with our own, 16 * but only if there is at least one page of new posts to load. 17 */ 18 if (pageNum <= max) { 19 20 // Insert the "More Posts" link. 21 jQuery('#testajaxloadmore') 22 .append('<div class="ragan-alp-placeholder-' + pageNum + '"></div>') 23 .append('<p id="ragan-alp-load-posts"><a href="#">Load More ' + resultTypeText() + '</a></p>'); 24 } 25 // Remove the traditional navigation. 26 jQuery('nav.navigation').remove(); 27 28 29 /** 30 * Load new posts when the link is clicked. 31 */ 32 jQuery('#ragan-alp-load-posts a').click(function () { 33 34 // Are there more posts to load? 35 //console.log('Next link to load: ' + ragan_alp.nextLink); 36 //console.log('pageNum: ' + pageNum + ' | MAX: ' + max); 37 if (pageNum <= max) { 38 // Show that we're working. 39 jQuery(this).text('Loading ' + resultTypeText().toLowerCase() + '...'); 40 //alert(nextLink + ' .post'); 41 jQuery('.ragan-alp-placeholder-' + pageNum).load(nextLink + ' ' + selectorforGrab, 42 function (responseTxt, statusTxt, xhr) { 43 // Update page number and nextLink. 44 pageNum++; 45 nextLink = nextLink.replace(/\/page\/[0-9]?/, '/page/' + pageNum); 46 47 // Add a new placeholder, for when user clicks again. 48 jQuery('#ragan-alp-load-posts') 49 .before('<div class="ragan-alp-placeholder-' + pageNum + '"></div>'); 50 51 // Update the button message. 52 if (pageNum <= max) { 53 jQuery('#ragan-alp-load-posts a').text('Load More ' + resultTypeText()); 54 } else { 55 jQuery('#ragan-alp-load-posts a').text('No more ' + resultTypeText().toLowerCase() + ' to load.'); 56 jQuery('#ragan-alp-load-posts a').hide(); 57 } 58 // console.log('statusTxt: ' + statusTxt); 59 if(statusTxt == "success") 60 { 61 ragan_fillEmptyElementWithAd(jQuery('#main').children('.dfpAd:last'), '/6317174/RA_Leaderboard', [[728, 90],[320, 50]], {}); 62 } 63 } 64 ); 65 } else { 66 if (jQuery('#ragan-alp-load-posts a').text().replace(/[^.]/g, '').length < 10) { 67 jQuery('#ragan-alp-load-posts a').append('.'); 68 } 69 } 70 71 return false; 72 }); 73}); 74 75function resultTypeText() { 76 var resultTypeText; 77 var searchString = getQueryStringVar('s'); 78 if (jQuery('.post-type-archive-ragan_fd_archive').length) { 79 resultTypeText = 'Issues'; 80 } else if (jQuery('.post-type-archive-ragan_white_papers').length) { 81 resultTypeText = ''; 82 } else if (searchString !== null && searchString !== '') { 83 resultTypeText = 'Results'; 84 } else { 85 resultTypeText = 'Articles'; 86 } 87 88 return resultTypeText; 89}
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.