PageSourceSearch

https://fg-bau.de/wp-content/themes/fgbau/blocks/person-directory/view.js?ver=7.1

js fg-bau.de collected 2026-09-24 23:10:09 UTC 2,111 bytes, 88 lines download raw bytes

1(function () {
2	function setActiveTab(directory, tab, updateUrl) {
3		if (!directory || !tab) {
4			return;
5		}
6
7		var panelId = tab.getAttribute('aria-controls');
8		var slug = tab.getAttribute('data-fgbau-person-tab-slug');
9
10		directory.querySelectorAll('[data-fgbau-person-tab]').forEach(function (item) {
11			item.setAttribute('aria-selected', item === tab ? 'true' : 'false');
12		});
13
14		directory.querySelectorAll('[data-fgbau-person-panel]').forEach(function (panel) {
15			var isActive = panel.id === panelId;
16
17			panel.classList.toggle('is-active', isActive);
18
19			if (isActive) {
20				panel.removeAttribute('hidden');
21			} else {
22				panel.setAttribute('hidden', '');
23			}
24		});
25
26		if (updateUrl && slug && window.history && window.history.replaceState) {
27			var url = new URL(window.location.href);
28
29			url.searchParams.set('team', slug);
30			window.history.replaceState({}, '', url.toString());
31		}
32	}
33
34	function getRequestedSlug() {
35		var url = new URL(window.location.href);
36		var requested = url.searchParams.get('team');
37
38		if (requested) {
39			return requested;
40		}
41
42		if (window.location.hash.indexOf('#team-') === 0) {
43			return window.location.hash.replace('#team-', '');
44		}
45
46		return '';
47	}
48
49	function activateRequestedTabs() {
50		var requested = getRequestedSlug();
51
52		if (!requested) {
53			return;
54		}
55
56		document.querySelectorAll('[data-fgbau-person-directory]').forEach(function (directory) {
57			var tab = null;
58
59			directory.querySelectorAll('[data-fgbau-person-tab-slug]').forEach(function (item) {
60				if (!tab && item.getAttribute('data-fgbau-person-tab-slug') === requested) {
61					tab = item;
62				}
63			});
64
65			if (tab) {
66				setActiveTab(directory, tab, false);
67			}
68		});
69	}
70
71	document.addEventListener('click', function (event) {
72		var tab = event.target.closest('[data-fgbau-person-tab]');
73
74		if (!tab) {
75			return;
76		}
77
78		var directory = tab.closest('[data-fgbau-person-directory]');
79
80		setActiveTab(directory, tab, true);
81	});
82
83	if (document.readyState === 'loading') {
84		document.addEventListener('DOMContentLoaded', activateRequestedTabs);
85	} else {
86		activateRequestedTabs();
87	}
88})();

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.