PageSourceSearch

https://kiuruvesi.fi/wp-content/themes/generatepress_child/assets/js/custom.js

js kiuruvesi.fi collected 2026-10-02 12:36:46 UTC 3,509 bytes, 123 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function () {
2	const headers = document.querySelectorAll('.accordion-header');
3
4	headers.forEach(header => {
5		const indicator = header.querySelector('.accordion-indicator');
6		const submenu = header.nextElementSibling;
7
8		if (indicator && submenu) {
9			indicator.addEventListener('click', function (e) {
10				e.preventDefault();
11				const isOpen = submenu.style.display === 'block';
12
13				submenu.style.display = isOpen ? 'none' : 'block';
14				indicator.classList.toggle('active', !isOpen);
15				header.parentElement.classList.toggle('active', !isOpen);
16				indicator.textContent = isOpen ? '+' : '−';
17			});
18		}
19	});
20});
21
22
23
24jQuery(document).ready(function () {
25	// Initialize the MMenu plugin
26	jQuery("#mmenu").mmenu();
27
28	// Allow dummy parent links to click into their child menu in mmenu
29	jQuery("#mmenu li.dummy > a.mm-btn_next").each(function (index) {
30		var dummyUrl = jQuery(this).attr('href');
31		jQuery(this).prev('a').attr('href', dummyUrl);
32	});
33});
34
35
36jQuery(document).ready(function ($) {
37	// Wait for mmenu.js to initialize
38	setTimeout(function () {
39		if ($('.mm-page').length && $('.site-header').length) {
40			$('.mm-page').prepend($('.site-header'));
41		}
42	}, 300); // Adjust delay if needed depending on your load speed
43});
44
45
46
47/*
48document.addEventListener('DOMContentLoaded', function () {
49	const searchInput = document.getElementById('section-search');
50	//const sections = document.querySelectorAll('.searchable-section');
51	
52	const sections = document.querySelectorAll('.searchable-section tr');
53	
54	const sections2 = document.querySelectorAll('.searchable-section h2');
55	
56	searchInput.addEventListener('input', function () {
57		const query = this.value.toLowerCase();
58
59		sections.forEach(function (section) {
60			const content = section.textContent.toLowerCase();
61			if (content.includes(query)) {
62				section.style.display = '';
63			} else {
64				section.style.display = 'none';
65			}
66		});
67		
68		sections2.forEach(function (section2) {
69			const content2 = section2.textContent.toLowerCase();
70			if (content2.includes(query)) {
71				section2.style.display = '';
72			} else {
73				section2.style.display = 'none';
74			}
75		});
76		
77	});
78});
79*/
80
81
82document.addEventListener('DOMContentLoaded', function () {
83  const searchInput = document.getElementById('section-search');
84  const sections = document.querySelectorAll('.searchable-section');
85
86  searchInput.addEventListener('input', function () {
87    const query = this.value.toLowerCase();
88
89    sections.forEach(function (section) {
90      const rows = section.querySelectorAll('tbody tr');
91      let anyRowVisible = false;
92
93      rows.forEach(function (row) {
94        const rowText = row.textContent.toLowerCase();
95        if (rowText.includes(query)) {
96          row.style.display = '';
97          anyRowVisible = true;
98        } else {
99          row.style.display = 'none';
100        }
101      });
102
103      // Show/hide the whole section based on row visibility
104      section.style.display = anyRowVisible ? '' : 'none';
105    });
106  });
107});
108
109
110document.addEventListener("DOMContentLoaded", function () {
111	const openBtn = document.getElementById("open-popup");
112	const closeBtn = document.getElementById("close-popup");
113
114	if (openBtn && closeBtn) {
115		openBtn.addEventListener("click", function () {
116			document.getElementById("lang-fullscreen-popup").style.display = "block";
117		});
118
119		closeBtn.addEventListener("click", function () {
120			document.getElementById("lang-fullscreen-popup").style.display = "none";
121		});
122	}
123});

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.