PageSourceSearch

https://www.ak-berlin.de/_assets/400d8c558747abb44da88b52d843617b/…/JavaScript/Frontend/T3ddy.js?1727193574

js ak-berlin.de collected 2026-09-24 18:36:38 UTC 2,992 bytes, 84 lines download raw bytes

1(function($) {
2	$(function() {
3		function getActiveItemIndex($container) {
4			var activeItemIndex = 0;
5			if ($container.find('.t3ddy-item.focus').length > 0) {
6				activeItemIndex = $container.find('.t3ddy-item').index($container.find('.t3ddy-item.focus').eq(0));
7			}
8			if (location.hash) {
9				var $anchoredContentElement = $container.find(location.hash);
10				var parentT3ddyItem = $anchoredContentElement.closest('.t3ddy-item');
11				activeItemIndex = $container.find('.t3ddy-item').index(parentT3ddyItem);
12			}
13			if ($container.hasClass('leave-all-items-closed')) {
14				activeItemIndex = true;
15			}
16			return activeItemIndex;
17		}
18
19		$('.t3ddy-tabContainer').each(function() {
20			var $tabContainer = $(this);
21			var $tabs = $tabContainer.find('>ul > li');
22			$tabs.each(function(){
23				var $tab = $(this);
24				$tab.find('> .t3ddy-item').appendTo($tabContainer);
25			});
26
27			$tabs.find('a').each(function(){
28				var $link = $(this);
29				var section = $link.attr('href').replace(/.*(#.*)/gi, '$1');
30				var newLink = location.pathname + location.search + section;
31				$link.attr('href', newLink);
32			});
33
34			$tabContainer.tabs({
35				active: getActiveItemIndex($tabContainer)
36			});
37		});
38
39
40		$('.t3ddy-accordion').each(function() {
41			var $accordionContainer = $(this);
42
43			var heightStyle = 'auto';
44			if ($accordionContainer.hasClass('height-style-fill')) {
45				heightStyle = 'fill';
46			} else if ($accordionContainer.hasClass('height-style-content')) {
47				heightStyle = 'content';
48			}
49
50			$accordionContainer.accordion({
51				active: getActiveItemIndex($accordionContainer),
52				heightStyle: heightStyle,
53				collapsible: $accordionContainer.hasClass('collapsible') || !$accordionContainer.hasClass('single-page-mode'),
54
55				beforeActivate: function(event, ui) {
56					if ($accordionContainer.hasClass('single-page-mode')) {
57						return true;
58					}
59					// The accordion believes a panel is being opened
60					var currHeader  = ui.oldHeader;
61					var currContent = currHeader.next('.ui-accordion-content');
62					if (ui.newHeader[0]) {
63						currHeader  = ui.newHeader;
64						currContent = currHeader.next('.ui-accordion-content');
65					}
66					// Since we've changed the default behavior, this detects the actual status
67					var isPanelSelected = currHeader.attr('aria-selected') == 'true';
68
69					// Toggle the panel's header
70					currHeader.toggleClass('ui-corner-all',isPanelSelected).toggleClass('accordion-header-active ui-state-active ui-corner-top',!isPanelSelected).attr('aria-selected',((!isPanelSelected).toString()));
71
72					// Toggle the panel's icon
73					currHeader.children('.ui-icon').toggleClass('ui-icon-triangle-1-e',isPanelSelected).toggleClass('ui-icon-triangle-1-s',!isPanelSelected);
74
75					// Toggle the panel's content
76					currContent.toggleClass('accordion-content-active',!isPanelSelected)
77					if (isPanelSelected) { currContent.slideUp(); }  else { currContent.slideDown(); }
78
79					return false; // Cancel the default action
80				}
81			});
82		});
83	});
84})(jQuery);

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.