PageSourceSearch

https://gruene-oal.de/wp-content/themes/sunflower26/assets/js/event-filter.js?ver=3.0.12

js gruene-oal.de collected 2026-10-03 00:36:23 UTC 1,871 bytes, 72 lines download raw bytes

1/* eslint-disable no-undef */
2
3function sunflowerRelayoutEventList() {
4	const eventList = document.querySelector( '.event-list' );
5
6	if ( ! eventList || typeof Masonry === 'undefined' ) {
7		return;
8	}
9
10	const masonry = Masonry.data( eventList );
11
12	if ( masonry ) {
13		masonry.options.itemSelector = '.event-list > .col-12:not(.d-none)';
14		masonry.reloadItems();
15		masonry.layout();
16	}
17}
18
19// Filter events by tags.
20jQuery( '.filter-button-group' ).on( 'click', 'button', function () {
21	const filterValue = jQuery( this ).attr( 'data-filter' );
22
23	const eventTag = filterValue.substring( 1 );
24
25	jQuery( '.event-list>*' ).addClass( 'd-none' );
26	jQuery( filterValue, '.event-list' ).parent().removeClass( 'd-none' );
27
28	jQuery( '.filter-active' ).removeClass( 'filter-active' );
29	jQuery( this ).addClass( 'filter-active' );
30
31	// append filter tag to ics download link
32	jQuery( ' .calendar-download' )
33		.attr( 'href', function ( index, href ) {
34			const params = new URLSearchParams( href.split( '?' )[ 1 ] );
35			if ( eventTag ) {
36				params.set( 'sunflower_tag', eventTag );
37			} else {
38				params.delete( 'sunflower_tag' );
39			}
40			return href.split( '?' )[ 0 ] + '?' + params.toString();
41		} )
42		.text( function () {
43			if ( eventTag && eventTag !== 'map' ) {
44				return (
45					sunflower.texts.icscalendar +
46					' (' +
47					eventTag.toUpperCase() +
48					')'
49				);
50			}
51			return sunflower.texts.icscalendar;
52		} );
53
54	window.location.hash = '#' + filterValue.substring( 1 );
55
56	if ( filterValue === '*' ) {
57		jQuery( '#leaflet' ).parent().addClass( 'd-none' );
58	}
59
60	window.requestAnimationFrame( sunflowerRelayoutEventList );
61} );
62
63// Open given filter on initial page load.
64jQuery( function () {
65	const hash = window.location.hash.substring( 1 );
66
67	if ( hash !== '' ) {
68		jQuery( 'button.filter[data-filter=".' + hash + '"]' ).click();
69	}
70} );
71
72/* eslint-enable no-undef */

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.