PageSourceSearch

https://garten-des-gedenkens.de/wp-content/themes/stadtmarburg/js/functions.js

js garten-des-gedenkens.de collected 2026-10-06 16:53:25 UTC 9,281 bytes, 275 lines download raw bytes

1// navigation space for first entry
2function f_nav_space() {
3	/*
4	
5	Alte Programmierung von Florian, geändert von Lukas am 21.09.2012
6
7	Fix: Breite des ersten Menüpunkts muss nicht mehr über JavaScript
8	ausgelesen werden, Navigation wird nicht mehr verzögert eingeblendet
9
10
11	$arrPageItems = jQuery('#navigation .page-item');
12	$indexPageItems = $arrPageItems.length;
13	$count = 0;
14	
15	
16	setTimeout(function(){
17			
18		for ($i=0;$i<$indexPageItems;$i++){
19			$pageItemWidth = jQuery($arrPageItems[$i]).outerWidth();
20			if ($i>0) {
21				$count = $count+$pageItemWidth;
22			}
23			$firstEntrieWidth = 942-$count;
24			jQuery($arrPageItems[0]).css('width',$firstEntrieWidth+'px');
25		}
26		
27		jQuery('#navigation .page-item').css('visibility','visible');
28		
29		$arrPageItems = jQuery('#navigation_footer .page-item');
30		$indexPageItems = $arrPageItems.length;
31		$count = 0;
32		
33		for ($i=0;$i<$indexPageItems;$i++){
34			$pageItemWidth = jQuery($arrPageItems[$i]).outerWidth();
35			if ($i>0) {
36				$count = $count+$pageItemWidth;
37			}
38			$firstEntrieWidth = 942-$count;
39			jQuery($arrPageItems[0]).css('width',$firstEntrieWidth+'px');
40		}
41		
42		jQuery('#navigation_footer .page-item').css('visibility','visible');
43	
44	},200);*/
45}
46
47// set correct content border height
48function f_set_correct_content_height() {
49	setTimeout(function () {
50		$contentHeight = jQuery('#page').outerHeight() - 24;
51		jQuery('#column_left').css('height', $contentHeight + 'px');
52		jQuery('#column_middle').css('height', $contentHeight + 'px');
53	}, 200);
54}
55
56//-LIGHTBOX-----------------------------------------------------------------------------//
57
58function f_lightbox_resize() {
59	//-CONFIG--------//
60
61	// Distance between image and browser frame
62	$siteDistance = 250; //1/2
63	// min and max image width
64	$minImageWidth = 350;
65	$maxImageWidth = 800;
66
67	//-CONFIG-END----//
68
69	// Vars
70	$lightboxWindowHeight = $(window).height();
71	$lightboxWindowWidth = $(window).width();
72	$lightboxImageWidth = $('img[title=' + lightboxCurrentImageID + ']').width();
73	$lightboxImageHeight = $('img[title=' + lightboxCurrentImageID + ']').height();
74	lightboxImageAspectRatio = $lightboxImageWidth / $lightboxImageHeight;
75	$NewLightboxImageHeight = $lightboxWindowHeight - $siteDistance;
76	$NewLightboxImageWidth = Math.round($NewLightboxImageHeight * lightboxImageAspectRatio);
77
78	// set correct aspect ratio
79	if ($NewLightboxImageWidth > $lightboxWindowWidth - $siteDistance) {
80		lightboxImageAspectRatio = $lightboxImageHeight / $lightboxImageWidth;
81		$NewLightboxImageWidth = $lightboxWindowWidth - $siteDistance;
82		$NewLightboxImageHeight = Math.round($NewLightboxImageWidth * lightboxImageAspectRatio);
83	}
84
85	// set min image height
86	if ($NewLightboxImageWidth < $minImageWidth) {
87		lightboxImageAspectRatio = $lightboxImageHeight / $lightboxImageWidth;
88		$NewLightboxImageWidth = $minImageWidth;
89		$NewLightboxImageHeight = Math.round($NewLightboxImageWidth * lightboxImageAspectRatio);
90	}
91
92	// set max image height
93	if ($NewLightboxImageWidth > $maxImageWidth) {
94		lightboxImageAspectRatio = $lightboxImageHeight / $lightboxImageWidth;
95		$NewLightboxImageWidth = $maxImageWidth;
96		$NewLightboxImageHeight = Math.round($NewLightboxImageWidth * lightboxImageAspectRatio);
97	}
98
99	// set image dimensions
100	$('#lightbox_' + lightboxCurrentImageID).css({
101		width: $NewLightboxImageWidth + 'px',
102		height: $NewLightboxImageHeight + 'px',
103		position: 'absolute',
104		left: '50%',
105		top: '50%',
106		'margin-left': '-' + Math.round($NewLightboxImageWidth / 2) + 'px',
107		'margin-top': '-' + Math.round($NewLightboxImageHeight / 2) + 'px',
108	});
109}
110
111function f_lightbox(target) {
112	//-CONFIG--------//
113
114	// Effects, Fade Speed, Delay
115	$lightboxFadeSpeed = 250;
116	$lightboxFadeInDelay = 500;
117
118	//-CONFIG-END----//
119
120	$lightboxWindowHeight = $(window).height();
121	$lightboxWindowWidth = $(window).width();
122
123	$lightboxCurrentImageUrl = jQuery(target).attr('src');
124	$ArrayLightboxCurrentImageUrl = $lightboxCurrentImageUrl.split('/');
125	$ArrayLightboxCurrentImageUrlIdnex = $ArrayLightboxCurrentImageUrl.length;
126	$SplitLightboxCurrentImageUrl = $ArrayLightboxCurrentImageUrl[$ArrayLightboxCurrentImageUrlIdnex - 1];
127	$RplLightboxCurrentImageUrl = $lightboxCurrentImageUrl.replace($SplitLightboxCurrentImageUrl, '');
128	$ArraySuffixLightboxCurrentImageUrl =
129		$ArrayLightboxCurrentImageUrl[$ArrayLightboxCurrentImageUrlIdnex - 1].split('.');
130	$SplitSuffixLightboxCurrentImageUrl = $ArraySuffixLightboxCurrentImageUrl[1];
131	// $NewLightboxCurrentImageUrl =
132	// 	$RplLightboxCurrentImageUrl + jQuery(target).attr('title') + '.' + $SplitSuffixLightboxCurrentImageUrl;
133	lightboxCurrentImageID = jQuery(target).attr('original-title');
134	$NewLightboxCurrentImageUrl = jQuery(target).attr('image-url');
135
136	$('#lightbox').html('<img id="lightbox_' + lightboxCurrentImageID + '" src="' + $NewLightboxCurrentImageUrl + '" />');
137	$('#lightbox_background').delay(300).fadeIn(100);
138	$('#loader').fadeIn(0);
139	$('#lightbox_' + lightboxCurrentImageID).bind('load', {}, function () {
140		$('#loader').fadeOut(0, 0);
141		$('#lightbox').delay($lightboxFadeInDelay).fadeIn($lightboxFadeSpeed);
142		f_lightbox_resize();
143	});
144}
145
146function f_lightbox_hide() {
147	$('#lightbox').hide();
148	$('#lightbox_background').hide();
149}
150//--------------------------------------------------------------------------------------//
151
152//-RESET-WP-ATTACHEMENT-LINK------------------------------------------------------------//
153function f_reset_wp_attachement_link() {
154	$("a[rel^='attachment']").prop('href', 'javascript:void(0);');
155	$("a[rel^='attachment']").css('cursor', 'default');
156}
157//--------------------------------------------------------------------------------------//
158
159function f_resize_page_div() {
160	$pageServiceNavHeight = $('#service-navigation').outerHeight();
161	$pageNavHeight = $('#navigation').outerHeight();
162	$pageheaderImageHeight = $('#header_image').outerHeight();
163	$pageHeadHeight = $pageServiceNavHeight + $pageNavHeight + $pageheaderImageHeight;
164	$pageHeight = $('#page').outerHeight();
165	$windowHeight = $(window).height();
166	//alert(($pageHeadHight+$pageHeight)+' / '+$windowHeight);
167	if ($pageHeadHeight + $pageHeight < $windowHeight) {
168		$('#page').css({
169			height: $windowHeight - ($pageHeadHeight + 5) + 'px',
170		});
171	} else {
172		$('#page').css({
173			height: 'auto',
174		});
175	}
176	f_set_correct_content_height();
177}
178
179// fix submenu position
180function f_fix_subnavi_position() {
181	$windowOffsetTop = $(window).scrollTop();
182	$headHeight = 655;
183	$windowHeight = jQuery(window).height();
184	$subNavHeight = jQuery('#column_right').outerHeight();
185
186	if ($windowOffsetTop > $headHeight) {
187		// if browser window is to small
188		if ($windowHeight < $subNavHeight) {
189			$('#column_right').css({
190				position: 'relative',
191				top: '0',
192				width: '168px',
193				marginLeft: '0',
194			});
195		} else {
196			$('#column_right').css({
197				position: 'fixed',
198				top: '-41px',
199				width: '168px',
200				marginLeft: '807px',
201			});
202		}
203	} else {
204		$('#column_right').css({
205			position: 'relative',
206			marginLeft: '0',
207			top: '0',
208		});
209	}
210}
211
212//-NAVIGATION-2013----------------------------------------------------------------------//
213function f_nav_2013(status) {
214	if (status == 'enter') {
215		jQuery('#navigation2013').removeClass('nav2013inactive');
216		jQuery('#navigation2013').addClass('nav2013active');
217		jQuery('#navigation2013 .page-item').css({ visibility: 'visible' });
218	} else {
219		setTimeout(function () {
220			jQuery('#navigation2013').removeClass('nav2013active');
221		}, 100);
222		jQuery('#navigation2013').addClass('nav2013inactive');
223		jQuery('#navigation2013 .page-item').css({ visibility: 'hidden' });
224	}
225}
226//--------------------------------------------------------------------------------------//
227
228//-POSITION-COLUMN-RIGHT----------------------------------------------------------------//
229function f_position_column_right() {
230	//alert('fire');
231}
232//--------------------------------------------------------------------------------------//
233
234jQuery(document).ready(function () {
235	//-LIGHTBOX-EVENTS----------------------------------------------------------------------//
236	jQuery('#page img').bind('click', {}, function () {
237		f_lightbox(this);
238	});
239	jQuery('#lightbox').bind('click', {}, function () {
240		f_lightbox_hide();
241	});
242	//--------------------------------------------------------------------------------------//
243
244	//-NAV-2013-EVENTS----------------------------------------------------------------------//
245	/*
246	jQuery('#nav2013link').bind('mouseenter',{},function(){ f_nav_2013('enter'); });
247	jQuery('#nav2013link').bind('mouseleave',{},function(){ f_nav_2013('leave'); });
248	jQuery('#navigation2013').bind('mouseenter',{},function(){ f_nav_2013('enter'); });
249	jQuery('#navigation2013').bind('mouseleave',{},function(){ f_nav_2013('leave'); });
250	*/
251	//--------------------------------------------------------------------------------------//
252
253	jQuery(window).bind('load', function () {
254		f_nav_space();
255		f_reset_wp_attachement_link();
256		f_resize_page_div();
257		f_set_correct_content_height();
258	});
259
260	jQuery(document.documentElement).keyup(function (event) {
261		// handle cursor keys
262		if (event.keyCode == 27) {
263			f_lightbox_hide();
264		}
265	});
266
267	jQuery(window).bind('resize', {}, function () {
268		f_fix_subnavi_position();
269		f_lightbox_resize();
270	});
271
272	jQuery(window).bind('scroll', {}, function () {
273		f_fix_subnavi_position();
274	});
275});

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.