PageSourceSearch

https://www.kst.sk/wp-content/plugins/spiffy-calendar/js/spiffy_frontend_utility.js?ver=1781076822

js kst.sk collected 2026-10-02 09:56:56 UTC 3,270 bytes, 85 lines download raw bytes

1/*
2**	Spiffy Calendar utility scripts on front end
3**
4**  Version 2.0
5*/
6
7jQuery(document).ready(function($){
8	// Maintain scroll position
9	if (sessionStorage.scrollTop != "undefined") {
10		$(window).scrollTop(sessionStorage.scrollTop);
11		sessionStorage.scrollTop = 0;
12	}
13	
14
15	
16	// Toggle grid/list on full calendar display
17	$( ".calendar-toggle-button" ).on( "click", function () {
18		if ($(".calendar-toggle-button").text() == $(".calendar-toggle-button").attr('data-list')) {
19			//
20			// Toggling to list mode
21			//
22			$(".calendar-toggle-button").text($(".calendar-toggle-button").attr('data-grid'));
23			$(".spiffy.bigcal").addClass("spiffy-listed");
24			$("<span class='spiffy-month-name'></span>" ).insertBefore( ".spiffy.bigcal .day-number" );
25			$(".spiffy-month-name").text($(".calendar-toggle-button").attr('data-month'));
26			$("[name='grid-list-toggle']").val('list');
27			$("a.spiffy-calendar-arrow").attr('href', function(i,a){ 
28				return a.replace( /(grid-list-toggle=)[a-z]+/ig, '$1'+'list' );	
29			});
30		} else {
31			//
32			// Toggling to grid mode
33			//
34			$(".calendar-toggle-button").text($(".calendar-toggle-button").attr('data-list'));
35			$(".spiffy-month-name").remove();
36			$(".spiffy.bigcal").removeClass("spiffy-listed");			
37			$("[name='grid-list-toggle']").val('grid');
38			$("a.spiffy-calendar-arrow").attr('href', function(i,a){ 
39				return a.replace( /(grid-list-toggle=)[a-z]+/ig, '$1'+'grid' );	
40			});
41		}
42	});
43	
44	// Category filter
45	$(".spiffy-category-filter-button").on( "click", function () {
46		$the_cat = $(this).attr('data-category');
47		if ($(this).hasClass("spiffy-active")) {
48			// Turn off the category filter
49			$(".spiffy-category-filter-button").removeClass("spiffy-active");
50			$(".spiffy-category-filter-button").removeClass("spiffy-inactive");		
51			$('[class^="calnk category_"]').removeClass("spiffy-inactive");
52			$(".category_"+$the_cat).removeClass("spiffy-active");
53			$(".spiffy.bigcal").removeClass("spiffy-filtered");			
54			
55		} else {
56			// Turn on the category filter
57			$(".spiffy-category-filter-button").addClass("spiffy-inactive");			
58			$(this).removeClass("spiffy-inactive");			
59			$(this).addClass("spiffy-active");			
60			$('[class^="calnk category_"]').removeClass("spiffy-active").addClass("spiffy-inactive");
61			$(".category_"+$the_cat).removeClass("spiffy-inactive").addClass("spiffy-active");
62			$(".spiffy.bigcal").addClass("spiffy-filtered");			
63		}
64		
65		// Mark date so it can be hidden on this listed calendar style if all events below are inactive
66		$(".day-with-date").each(function() {
67			if ($(this).find(".spiffy-active").length !== 0) {
68				$(this).removeClass("spiffy-inactive");		// filter is on and this date has active events
69			} else if ($(this).find(".spiffy-inactive").length !== 0) {
70				$(this).addClass("spiffy-inactive");		// filter is on and this date has no active events			
71			} else {
72				$(this).removeClass("spiffy-inactive");		// filter is off
73			}
74		});
75	});
76	
77	// Show custom field headings if followed by field data
78	$('[class*="spiffy-custom-field-view-"]').prev().css( "display", "block" );
79	
80});
81
82
83// Support hover/click on iOS
84jQuery( document.body ).on( 'touchstart', function( e ) {
85});

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.