PageSourceSearch

https://www.landkreis-miltenberg.de/assets/js/seo_scripts_2970.js?v=17972

js landkreis-miltenberg.de collected 2026-10-02 14:58:18 UTC 17,972 bytes, 802 lines download raw bytes

1
2
3jQuery(document).ready(function() 
4{
5	jQuery('.mmenu_trigger').click(function(e) 
6	{
7		var elem = jQuery('#header');
8		if( jQuery('body').hasClass('fixed-header') )
9		{
10			elem = jQuery('#stickyheader');
11		}
12		var delta = elem.position('body').top + elem.height();
13		jQuery('#mmenu').css(
14		{
15			'top':delta,
16			'transform':'translateY(calc(-100% - '+delta+'px))',
17			'height': 'calc(100% - '+delta+'px)'
18		});
19	});
20});
21
22 
23
24jQuery(document).ready(function()
25{
26 	var swiper_164813 = new Swiper('#swiper_164813', {
27	 	effect: 'slide',
28	 	fadeEffect: {crossFade: true},
29	 	speed: 350,
30	 	grabCursor: true,
31		keyboard: {
32			enabled: true,
33			onlyInViewport: false
34		},
35	 	direction: 'horizontal',
36	 		 		 	autoplay: {
37        	delay: 3500,
38			disableOnInteraction: false,
39      	},
40	  		 		 	navigation: {
41        	nextEl: '#swiper-button-next_164813',
42			prevEl: '#swiper-button-prev_164813',
43		},
44		        breakpoints: {
45        10: {
46          slidesPerView: 1,
47          spaceBetween: 0,
48        },
49        768: {
50          slidesPerView: 3,
51          spaceBetween: 30,
52        },
53      },
54	});
55	
56	swiper_164813.on('touchStart',function(elem,event)
57	{
58		jQuery('#swiper_164813').addClass('mousedown');
59	});
60	
61	swiper_164813.on('touchEnd',function(elem,event)
62	{
63		jQuery('#swiper_164813').removeClass('mousedown');
64	});
65	
66	jQuery('#swiper_164813 .swiper-wrapper').on('mouseover mouseout',function(event)
67	{
68		var _this = jQuery('#swiper_164813');
69		if( event.type == 'mouseover' )
70		{
71			_this.addClass('mouseover');
72		}
73		else
74		{
75			_this.removeClass('mouseover');
76		}
77	});
78	
79		var circle = jQuery('#swiper_164813 .circle');
80	var eventStarted = false;
81	jQuery('#swiper_164813').on('mouseover mouseout',function(event)
82	{
83		var _this = jQuery(this);
84		if( event.type == 'mouseover' && eventStarted === false )
85		{
86			eventStarted = true;
87			
88			jQuery(document).on('mousemove',function(e)
89			{
90				var x = e.pageX - _this.offset().left;
91				var y = e.pageY - _this.offset().top;
92				circle.css( { left: x, top: y } );
93			});	
94		}
95		else
96		{
97			jQuery(document).unbind('mousemove');
98			eventStarted = false;
99		}
100	});
101	
102});
103
104 
105
106jQuery(document).ready(function()
107{
108	// add hide_optin body class when on imprint or privacy page
109		
110	//--- opt out remove token
111	jQuery('#privacy_optout_link').click(function(e)
112	{
113		e.preventDefault();
114		PrivacyManager.optout(document.location.origin+document.location.pathname);
115	});
116	jQuery('#privacy_optout_link').on('keypress',function(e)
117	{
118		if( e.key == "Enter" || e.keyCode == 13 )
119		{
120			jQuery(this).click();
121		}
122	});
123	
124	if(window.location.search.indexOf('clear_privacy_settings') >= 0)
125	{
126		PrivacyManager.optout(document.location.origin+document.location.pathname);
127	}
128	//--
129	
130	var privacy = localStorage.getItem('user_privacy_settings');
131	var expires = Number( localStorage.getItem('user_privacy_settings_expires') );
132	// check lease time
133	var now = new Date().setDate(new Date().getDate());
134	if( now >= expires )
135	{
136		expires = 0;
137	}
138	
139	if(privacy == undefined || privacy == '' || expires <= 0 )
140	{
141		jQuery('#privacy_optin_695').addClass('open');
142		// set privacy level to 0
143		privacy = '0';
144	}
145
146	// set a body class
147	jQuery('body').addClass('privacy_setting_'+privacy.toString().split(',').join('-'));
148	
149	// hide the info
150	jQuery('#ajax_info_695').hide();
151
152	var form = jQuery('#user_privacy_settings_695');
153	var isValid = false;
154	
155	// set focus to first checkbox
156	jQuery('.privacy_checkmark').on('keypress',function(e)
157	{
158		// Enter, Space
159		if( (e.key == "Enter" || e.keyCode == 13 || e.keyCode == 32) || (e.key === " ") )
160		{
161			e.preventDefault();
162			let _this = jQuery(this);
163			let checkbox = _this.siblings("input[type='checkbox']");
164			// toggle checked property
165			checkbox.prop("checked", !checkbox.prop("checked") );
166			checkbox.trigger('change');
167			_this.attr('aria-checked', function(_, attr) { return !(attr == 'true') });
168		}
169	});
170
171	jQuery('.privacy_checkmark').on('click',function(e)
172	{
173		jQuery(this).attr('aria-checked', function(_, attr) { return !(attr == 'true') });
174	});
175	
176	// remove readonly from submit when user changes its selection
177	form.find('input[type="checkbox"]').change(function(e)
178	{
179		isValid = false;
180		// required field changed
181		if( form.find('input[required].mandatory').is(':checked') === true )
182		{
183			isValid = true;
184		}
185
186		form.find('input[name="save_settings"]').addClass('readonly');
187		form.find('input[name="save_settings"]').prop('disabled', true);
188		
189		if( isValid === true )
190		{
191			form.find('input[name="save_settings"]').removeClass('readonly');
192			form.find('input[name="save_settings"]').prop('disabled', false);
193		}
194	});
195
196	// allow all
197	form.find('input[name="save_all_settings"]').click(function(e) 
198	{
199		e.preventDefault();
200		// check all checkboxes for user feedback
201		form.find('input[type="checkbox"]').prop('checked',true);
202		// all good
203		isValid = true;
204		// fire save
205		form.find('input[name="save_settings"]').trigger('click');
206	});
207
208	// tech only all
209	form.find('input[name="save_tech_settings"]').click(function(e) 
210	{
211		e.preventDefault();
212		// check required checkbox for user feedback
213		//form.find('#cookiebar_privacy_1').prop('checked',true);
214		// all good
215		isValid = true;
216		// fire save
217		form.find('input[name="save_settings"]').trigger('click');
218	});
219
220
221		
222	form.find('input[name="save_settings"]').click(function(e)
223	{
224		e.preventDefault();
225
226		// check if a required field is still not set
227		if( isValid === false )
228		{
229			return false;
230		}
231
232		// show ajax info
233		jQuery('#ajax_info_695').fadeIn(50);
234		
235		// get the user selection
236		var privacy = PrivacyManager.getUserSelectionFromFormData( form.serializeArray() ).join(',');
237		
238		if( privacy == undefined || privacy == '' )
239		{
240			privacy = '1';
241		}
242		
243		// set local storage
244		localStorage.setItem('user_privacy_settings',privacy);
245		// set lease time
246		var expires = new Date().setDate(new Date().getDate() + 30);
247		localStorage.setItem('user_privacy_settings_expires',expires);
248		// set a body class
249		jQuery('body').addClass('privacy_setting_'+privacy.toString().split(',').join('-'));
250		// remove negative body class
251		jQuery('body').removeClass('privacy_setting_0');
252		setTimeout(function()
253		{
254			// fire JS event
255			jQuery(document).trigger('Privacy.changed',{'level':privacy});
256
257			// fire form as usal to catch it via php
258			//form.submit();
259		}, 500);
260	});
261});
262
263
264// listen to Privacy event
265jQuery(document).on('Privacy.changed',function(event,params)
266{
267	if( PrivacyManager.hasAccess(params.level) )
268	{
269		jQuery('#privacy_optin_695').removeClass('open');
270		// send ajax for log file
271		jQuery.ajax(
272		{
273			url:location.href,
274			data:{'user_privacy_settings':params.level,'tstamp':Math.round(new Date().getTime()/1000)}
275		});
276	}
277});
278
279// Opt-out listener
280jQuery(document).ready(function()
281{
282	jQuery('.privacy_optout_click, .privacy_optout_link').click(function()
283	{
284		PrivacyManager.optout();
285	});
286});
287
288// accessbility focus
289jQuery(document).ready(function() 
290{
291	jQuery("#privacy_checkmark_privacy_1").focus();
292});
293
294// Cookie details
295jQuery(document).ready(function() 
296{
297	let element = jQuery('#privacy_optin_695 .privacy_help_link');
298    let popup = jQuery('#privacy_optin_695 .privacy_popup');
299	element.click(function (e) 
300	{
301		e.preventDefault();
302		jQuery("html, body").animate({ scrollTop: 0 });
303		popup.toggleClass('view_help');
304	});
305
306    element.on('keypress', function (e) 
307    {
308		if( (e.key == "Enter" || e.keyCode == 13 || e.keyCode == 32) || (e.key === " ") )
309		{
310			// reload page when view_help is active
311			if( popup.hasClass('view_help') )
312			{
313				window.location.reload();
314				return false;
315			}
316			jQuery(this).click();
317		}
318    });
319});
320
321 
322
323jQuery(document).ready(function() 
324{
325	// focus
326	jQuery('#search_698 input[name="keywords"]').on('keydown',function(e)
327	{
328		if (e.key == 'Enter' || e.keyCode == 13)
329		{
330			jQuery('.ce_search_label').click();
331		}
332	});
333
334	jQuery('.ce_search_label').click(function()
335	{
336		// focus on input
337		jQuery('#search_698 input[name="keywords"]').focus();
338	});
339	
340	let close_button = jQuery('#close_search_698');
341	close_button.click(function()
342	{
343		jQuery('body').removeClass('search_overlay');
344	});
345	
346	jQuery("#search_overlay_698").click(function()
347	{
348    	close_button.click();
349	});
350});
351
352jQuery(document).keyup(function(e) 
353{
354	// ESC
355	if (e.keyCode === 27 && jQuery('body').hasClass('search_overlay') ) 
356	{
357		jQuery('#close_search_698').click();
358	}
359});
360
361 
362
363jQuery(document).ready(function() 
364{
365	jQuery('nav.mobile_horizontal .trail').addClass('open');
366	jQuery('nav.mobile_horizontal .trail').parent('li').siblings('li').addClass('hidden')
367	jQuery('nav.mobile_horizontal li.submenu > a').append('<span class="opener"></span>');
368	jQuery('nav.mobile_horizontal li.submenu .opener, nav.mobile_horizontal li.submenu a.forward:not(.click-default), nav.mobile_horizontal li.submenu a.pct_megamenu').click(function(e)
369	{ 
370		e.preventDefault();
371		e.stopImmediatePropagation();
372		
373		var _this = jQuery(this);
374		var parent = _this.parent('li');
375		
376		// opener div
377		var isOpener = _this.hasClass('opener');
378		if( isOpener )
379		{
380			var parent = _this.parent('a').parent('li');
381		}
382		
383		if( isOpener  )
384		{
385			_this.siblings('a').toggleClass('open');
386		}
387		
388		_this.toggleClass('open');
389		parent.toggleClass('open');
390		parent.siblings('li').toggleClass('hidden');
391
392		var trail = _this.parents('li');
393		if( trail[1] )
394		{
395			jQuery(trail[1]).toggleClass('trail');
396			jQuery(trail[1]).find('> a').toggleClass('trail');
397		}
398		else
399		{
400			parent.removeClass('trail');
401		}
402	});
403});
404
405 
406
407jQuery(document).ready(function() 
408{
409	jQuery('nav.mobile_vertical .trail').addClass('open');
410	jQuery('nav.mobile_vertical li.submenu > a').append('<span class="opener"></span>');
411	jQuery('nav.mobile_vertical a.submenu').not('.open').parent('li').children('ul').hide();
412	jQuery('nav.mobile_vertical li.submenu .opener, nav.mobile_vertical li.submenu a.forward:not(.click-default), nav.mobile_vertical li.submenu a.pct_megamenu').click(function(e)
413	{ 
414		e.preventDefault();
415		e.stopImmediatePropagation();
416		
417		var _this = jQuery(this);
418		
419		// close open siblings
420		if( jQuery(this).parents('nav.mobile_vertical').hasClass('collapse') )
421		{
422			var siblings = _this.parents('li').siblings('li.open');
423			siblings.children('ul').slideUp(
424			{
425				duration:300,
426				complete: function()
427				{
428					siblings.removeClass('open');
429					siblings.children('a').removeClass('open');
430				}
431			});
432		}
433		
434		var parent = _this.parent('li');
435		
436		// opener div
437		var isOpener = _this.hasClass('opener');
438		if( isOpener )
439		{
440			var parent = _this.parent('a').parent('li');
441		}
442		
443		if(parent.hasClass('open') )
444		{
445			parent.children('ul').slideUp(
446			{
447				duration:300,
448				complete: function()
449				{
450					if( isOpener )
451					{
452						_this.siblings('a').removeClass('open');
453					}
454					_this.removeClass('open');
455					parent.removeClass('open');
456				}
457			});
458			
459		}
460		else
461		{
462			if( isOpener )
463			{
464				_this.siblings('a').toggleClass('open');	
465			}
466			_this.toggleClass('open');
467			parent.toggleClass('open');
468			parent.children('ul').slideToggle({duration:300});
469		}
470	});
471});
472
473 
474
475jQuery(document).ready(function()  {
476    jQuery('a[data-lightbox]').map(function() 
477    {
478      jQuery(this).colorbox(
479      {
480        // Put custom options here
481        loop: false,
482        rel: jQuery(this).attr('data-lightbox'),
483        maxWidth: '95%',
484        maxHeight: '95%'
485      });
486   });
487
488    jQuery(document).bind('cbox_complete', function(e)
489    {
490        if( jQuery.colorbox == undefined )
491        {
492          return;
493        }
494        var text = jQuery.colorbox.element().next('.caption').text();
495        if( text )
496        {
497          var caption = jQuery('#cboxBottomLeft').append('<div id="cboxCaption">'+text+'</div>');
498          jQuery('#colorbox').height( jQuery('#colorbox').height() + caption.height()  );
499        }
500    });
501  });
502
503
504// iframe lightbox
505jQuery(document).ready(function()  
506{
507  jQuery('a[data-lightbox-iframe]').map(function() 
508  {
509    jQuery(this).colorbox(
510    {
511        iframe:true, 
512        innerWidth:"80%", 
513        innerHeight:"56%", 
514        maxWidth:"95%",
515        maxHeight:'95%',
516    });
517  });
518});
519
520// lightbox 50% 50%
521jQuery(document).ready(function() 
522{
523  jQuery('.lightbox50-50 a, a.lightbox50-50').colorbox(
524    {
525      // Put custom options here
526      loop: false,
527      rel: jQuery(this).attr('data-lightbox'),
528      width: '50%',
529      height: '50%'
530    });
531});
532// lightbox 60% 40%
533jQuery(document).ready(function() 
534{
535  jQuery('.lightbox60-40 a, a.lightbox60-40').colorbox(
536    {
537      // Put custom options here
538      loop: false,
539      rel: jQuery(this).attr('data-lightbox'),
540      width: '60%',
541      height: '40%'
542    });
543});
544// lightbox 960px 575px
545jQuery(document).ready(function() 
546{
547  jQuery('.lightbox960 a, a.lightbox960').colorbox(
548    {
549      // Put custom options here
550      loop: false,
551      rel: jQuery(this).attr('data-lightbox'),
552      width: '960px',
553      height: '575px'
554    });
555});
556
557 
558
559/**
560 * PrivacyManager
561 */
562var PrivacyManager =
563{
564	/**
565	 * The privacy localStorage key
566	 * @var string
567	 */
568	privacy_session : 'user_privacy_settings',
569
570	/**
571	 * Get the selected privacy checkbox values from a formular array
572	 * @param array 
573	 * @return array
574	 */
575	getUserSelectionFromFormData: function (arrSubmitted)
576	{
577		if (arrSubmitted == null || arrSubmitted == undefined)
578		{
579			return [];
580		}
581
582		var arrReturn = [];
583		for (var k in arrSubmitted)
584		{
585			var v = arrSubmitted[k];
586			if (v['name'] == 'privacy')
587			{ 
588				arrReturn.push(v['value']);
589			}
590		}
591		return arrReturn;
592	},
593
594
595	/**
596	 * Access control
597	 * @param string
598	 */
599	hasAccess : function (varSelection)
600	{
601		var token = localStorage.getItem( this.privacy_session );
602		if( token == undefined )
603		{
604			return false;
605		}
606
607		// convert to string
608		if( typeof(varSelection) == 'number' )
609		{
610			varSelection = varSelection.toString();
611		}
612		// convert to array
613		if( typeof(varSelection) == 'string' )
614		{
615			varSelection = varSelection.split(',');
616		}
617
618		for(i in varSelection)
619		{
620			var value = varSelection[i].toString().replace(' ','');
621			if( token.indexOf( value ) >= 0 )
622			{
623				return true;
624			}
625		}
626		return false;
627	},
628
629
630	/**
631	 * Clear privacy settings and redirect page
632	 * @param boolean
633	 */
634	optout: function (strRedirect)
635	{
636		// clear local storage
637		localStorage.removeItem(this.privacy_session);
638		localStorage.removeItem(this.privacy_session+'_expires');
639		// fire event
640		jQuery(document).trigger('Privacy.clear_privacy_settings',{});
641		// log
642		console.log('Privacy settings cleared');
643		// redirect
644		if (strRedirect != undefined)
645		{
646			location.href = strRedirect;
647		}
648		else
649		{
650			location.reload();
651		}
652	},
653
654
655	/**
656	 * Clear all cookies and localstorage
657	 */
658	clearAll: function()
659	{
660		var host = window.location.hostname;
661		var domain = host.substring( host.indexOf('.') , host.length);
662		// clear all cookies
663		document.cookie.split(";").forEach(function(c) 
664		{ 
665			document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"+ ";domain="+host); 
666			document.cookie = c.replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"+ ";domain="+domain); 
667		});
668		// clear whole localstorage
669		window.localStorage.clear();
670		for (var i = 0; i <= localStorage.length; i++) 
671		{
672		   localStorage.removeItem(localStorage.key(i));
673		}
674		// log
675		console.log('Cookies and localstorage cleared');
676	}
677};
678
679
680
681/**
682 * Univerasl optin protection
683 * @param string	Type of element to be protected e.g. img or iframe etc.
684 */
685PrivacyManager.optin = function(strElementType)
686{
687	if(strElementType == undefined || strElementType == '')
688	{
689		return;
690	}
691	// user settings not applied yet
692	if(localStorage.getItem(this.privacy_session) == undefined || localStorage.getItem(this.privacy_session) == '' || localStorage.getItem(this.privacy_session) <= 0)
693	{
694		return
695	}
696
697	// find all scripts having a data-src attribute
698	var targets = jQuery(strElementType+'[data-src]');	
699	
700	if(targets.length > 0)
701	{
702		jQuery.each(targets,function(i,e)
703		{
704			var privacy = jQuery(e).data('privacy');
705			if(privacy == undefined)
706			{
707				privacy = 0;
708			}
709			
710			var attr = 'src';
711			if(strElementType == 'link')
712			{
713				attr = 'href';
714			}
715			else if(strElementType == 'object')
716			{
717				attr = 'data';
718			}
719			
720			if(localStorage.getItem('user_privacy_settings').indexOf(privacy) >= 0)
721			{
722				jQuery(e).attr(attr,jQuery(e).data('src') );
723			}
724		});
725	}
726}
727
728jQuery(document).on('Privacy.changed', function() 
729{
730	PrivacyManager.optin('script');
731	PrivacyManager.optin('link');
732	PrivacyManager.optin('iframe');
733	PrivacyManager.optin('object');
734	PrivacyManager.optin('img');
735});
736
737jQuery(document).ready(function()
738{
739	PrivacyManager.optin('script');
740	PrivacyManager.optin('link');
741	PrivacyManager.optin('iframe');
742	PrivacyManager.optin('object');
743	PrivacyManager.optin('img');
744});
745
746 
747
748jQuery(document).ready(function()  
749{
750    //var e = document.querySelectorAll('.content-slider, .slider-control');
751    let SLIDERS = [];
752	jQuery('.content-slider').each(function(i,elem) 
753    {
754	    var config = jQuery(elem).attr('data-config');
755	   	if( config )
756	    {
757		    var menu = jQuery(elem).next('.slider-control');
758		    c = config.split(',');
759		    var options = 
760		    {
761			    'auto': parseInt(c[0]),
762		        'speed': parseInt(c[1]),
763		        'startSlide': parseInt(c[2]),
764		        'continuous': parseInt(c[3])
765		    }
766		    // menu
767		    if ( menu )
768		    {
769			    // replace # with slahs
770			    menu.find('a').attr('href','/');
771			    options.menu = menu[0];
772		    }
773			
774			var api = new Swipe(elem, options);
775			SLIDERS.push(api);
776		}
777      });
778	  
779	jQuery(document).on('keydown', function (e)
780	{ 
781		switch (e.keyCode)
782		{
783			// left arrow key <= 
784			case 37:
785				jQuery.each(SLIDERS, function (i,elem)
786				{ 
787					elem.prev();
788				});
789				break;
790			// right arrow key => 
791			case 39:
792				jQuery.each(SLIDERS, function (i,elem)
793				{ 
794					elem.next();
795				});
796				break;
797			default:
798				break;
799		}
800	});
801});
802

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.