PageSourceSearch

https://www.b30-enzisreute-gaisbeuren.de/wp-content/themes/buero-cc/inc/content/ajax/js/ajax.js?ver=1.0.0

js b30-enzisreute-gaisbeuren.de collected 2026-10-08 18:44:08 UTC 2,234 bytes, 87 lines download raw bytes

1'use strict';
2
3var $ = window.jQuery;
4
5// General reading options - posts per page
6var ppp = BUERO_CC_AJAX.ppp;
7// Number of pages for query - 'max_num_pages'
8// @see inc/content/ajax-load-more.php
9var totalPages = BUERO_CC_AJAX.ajaxpages;
10var totalP = +totalPages - 1;
11// prepare selectors
12var container = $( BUERO_CC_AJAX.ajaxcontainer );
13var button = $( BUERO_CC_AJAX.ajaxbutton );
14// Prepare counters for pages and clicks
15var pageNumber = 1;
16var buttonClick = 0;
17
18//WINDOW ONLOAD
19$(window).load(function() {
20
21	var ajax_container = $( container );
22
23	// masonry has problem calculating image size loaded with ajax which causes
24	// items to overlap
25	// defining 'itemSelector' again in ajax call seems to fix the issue
26	// @link https://github.com/desandro/masonry/issues/369#issuecomment-41149679
27	ajax_container.imagesLoaded( function() {
28		ajax_container.isotope({
29			itemSelector: '.grid-item',
30			masonry: {
31				gutter: '.gutter-sizer'
32			}
33		});
34	});
35});
36
37//ON DOCUMENT READY
38$(document).ready(function() {
39
40	// AJAX load posts
41	function load_posts() {
42		pageNumber++;
43		var str = '&pageNumber=' + pageNumber + '&ppp' + ppp + '&action=' + BUERO_CC_AJAX.ajaxaction;
44
45		$.ajax({
46			type: "POST",
47			dataType: "html",
48			url: BUERO_CC_AJAX.ajaxurl,
49			data: str,
50			success: function( data ) {
51				var ajax_container = $( container );
52				var loadedData = $( data );
53
54				// load images before isotope is called
55				// so that items don't overlap
56				ajax_container.append( loadedData ).imagesLoaded( function() {
57					ajax_container.isotope( 'appended', loadedData, function () {
58						ajax_container.isotope( 'reLayout' );
59					});
60				});
61
62			}, // success
63			error: function( jqXHR, textStatus, errorThrown ) {
64				$loader.html( jqXHR + " :: " + textStatus + " :: " + errorThrown );
65			} // error
66		}); // $.ajax
67
68		return false;
69	} // load_posts()
70
71	// Finally click the button
72	$( button ).on( 'click', function() {
73
74		// Count clicks on button
75		buttonClick++;
76
77		// Hide/disable the button if no more 'pages'
78		// (total number of pages - 1 is equal to number of clicks)
79		if ( buttonClick === totalP ) {
80			$( button ).attr( 'disabled', true );
81		}
82
83		// Load more posts
84		load_posts();
85	}); // $( '#more_posts' ).on
86
87});

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.