PageSourceSearch

https://www.thedenizen.co.nz/wp-content/plugins/pbd-ajax-load-posts/js/load-posts.js?ver=1.0

js thedenizen.co.nz collected 2026-10-02 05:36:17 UTC 1,810 bytes, 69 lines download raw bytes

1jQuery(document).ready(function($) {
2	
3	// The number of the next page to load (/page/x/).
4	var pageNum = parseInt(pbd_alp.startPage) + 1;
5	
6	// The maximum number of pages the current query can return.
7	var max = parseInt(pbd_alp.maxPages);
8	
9	// The link of the next page of posts.
10	var nextLink = pbd_alp.nextLink;
11	
12	//alert(nextLink);
13	/**
14	 * Replace the traditional navigation with our own,
15	 * but only if there is at least one page of new posts to load.
16	 */
17	if(pageNum <= max) {
18		// Insert the "More Posts" link.
19		if($('#stories').length) $('#stories').append('<div class="pbd-alp-placeholder-'+ pageNum +'"></div>');
20		
21	}else{
22		$('#loadmore').css("display","none");
23	}
24	
25	/**
26	 * Load new posts when the link is clicked.
27	 */
28	$('#loadmore a').click(function() {
29		console.log("click");
30		// Are there more posts to load?
31		if(pageNum <= max) {
32		
33			// Show that we're working.
34			$(this).text('LOADING...');
35			
36			//console.log("nextLink",nextLink);
37				
38			$('.pbd-alp-placeholder-'+ pageNum).load(nextLink + ' .story',
39				function() {
40					// Update page number and nextLink.
41					pageNum++;
42					
43					//window.history.pushState("object or string", "Title", nextLink);
44					nextLink = nextLink.replace(/\/page\/[0-9]*/, '/page/'+ pageNum);
45
46					// Add a new placeholder, for when user clicks again.
47					$('#stories').append('<div class="pbd-alp-placeholder-'+ pageNum +'"></div>')
48
49					// Update the button message.
50					if(pageNum <= max) {
51						$('#loadmore a').html('MORE STORIES &#8595;');
52					} else {
53						$('#loadmore').css("display","none");
54					}
55					console.log("reflow");
56					//jQuery(document).foundation();
57					//jQuery(document).foundation('interchange', 'reflow');
58				}
59			);
60			
61			
62			
63		} else {
64			$('#loadmore').append('');
65		}	
66		
67		return false;
68	});
69});

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.