PageSourceSearch

https://www.haumberger.at/wp2025/wp-content/themes/haum25/js/falkeScript.js?falkeTS=6ac43ac08b1e72026

js haumberger.at collected 2026-10-06 02:44:57 UTC 4,534 bytes, 107 lines download raw bytes

1jQuery(document).ready(function() {
2	// set to true to display console logs
3	const VERBOSE = false;
4
5	if (jQuery('body').hasClass('page-id-2273')) {
6        jQuery('.e-n-accordion-item').attr('open', 'open');
7
8    }
9
10	/* open Complianz cookie setting */
11	jQuery(document).on('click', '.falke-footer-nav a', function(e) {
12		const linkText = jQuery(this).text().trim();
13		if (linkText === 'Cookie-Einstellungen' || linkText === 'cookie settings') {
14			jQuery('.cmplz-manage-consent').each(function() {
15				jQuery(this).trigger('click');
16			});
17			e.preventDefault();
18		}
19	});
20
21	// automatic targets of links
22	jQuery('a:not([href*="mailto:"],[href*="tel:"],[target*="_self"],[target*="_blank"])').attr('target', function() {
23		if(this.host == location.host){
24			return '_self';
25		} else{
26			return '_blank';
27		}
28	});
29
30	// smooth scroll for anchor links (when staying on same site)
31	jQuery('body').on('click', 'a[href^="#"]', function(e) {
32		let href = jQuery(this).attr('href').split('/');
33		let selector = href[href.length - 1];
34		//not for empty links like menu-toggle and targets on other pages
35		if(selector != "#" && jQuery(selector).length > 0) {
36			e.preventDefault();
37			falke_scrollTo(selector);
38		}
39	});
40
41	// update: Chrome|Safari|Edge (not Firefox!) now support smooth scrolling natively -> avoid double scrolling
42	// smooth scroll and offset on anchor links when accessing from another site
43	// check if window is accessible and has a location object
44	// if(typeof window !== 'undefined' && window.location) {
45	// 	// check if a hash is present in the URL
46	// 	let hash = window.location.hash; // i.e. URL test.com/#anchor => hash = "#anchor"
47	// 	if(hash && hash != "") {
48	// 		// we want to go to an anchor => smooth scroll & adjust offset
49	// 		let target = document.querySelector(hash);
50	// 		// check if the target element exists
51	// 		if(target) {
52	// 			scrollTo(hash);
53	// 			if(VERBOSE) console.info("Smooth scrolled to target element: " + hash);
54	// 		} else {
55	// 			if(VERBOSE) console.error("Target element for hash not found: " + hash);
56	// 		}
57	// 	}
58	// } else {
59	// 	if(VERBOSE) console.error("Window object not accessible or no location object found");
60	// }
61
62	// add hidden screen reader text for external links
63	jQuery('a[target*="_blank"]').append('<span class="screen-reader-text"> (öffnet eine externe URL in einem neuen Fenster)<\span>');
64
65	// SCROLL TO TOP
66	// browser window scroll (in pixels) after which the "back to top" link is shown
67	let offset = 500,
68	// browser window scroll (in pixels) after which the "back to top" link opacity is reduced
69	offset_opacity = 1000,
70	// grab the "back to top" link
71	back_to_top = jQuery('.cd-top');
72
73	//hide or show the "back to top" link
74	jQuery(window).scroll(function() {
75		( jQuery(this).scrollTop() > offset ) ? back_to_top.addClass('cd-is-visible') : back_to_top.removeClass('cd-is-visible cd-fade-out');
76		if( jQuery(this).scrollTop() > offset_opacity ) {
77			back_to_top.addClass('cd-fade-out');
78		}
79	});
80});
81
82// can be re-used in other functionality as well
83function falke_scrollTo(selector){
84	jQuery('html, body').animate({ scrollTop: jQuery(selector).offset().top - 130}, 250, 'linear'); //130 = abstand nach oben z.b. bei fixer menu-bar; 250 = dauer in ms
85}
86
87// detect page scroll => offset needs to be adjusted, so it won't cause ugly jumps on header resize
88jQuery(window).on('scroll', function() {
89	falke_detectScroll();
90});
91function falke_detectScroll() {
92	if(jQuery(document).scrollTop() > 500) {
93		if(!(jQuery('html').hasClass('falkeScrolled'))) {
94			jQuery('html').addClass('falkeScrolled');
95		}
96	} else if(jQuery(document).scrollTop() < 50) {
97		if(jQuery('html').hasClass('falkeScrolled')) {
98			jQuery('html').removeClass('falkeScrolled');
99		}
100	}
101}
102
103// ie recognition
104if(~window.navigator.userAgent.indexOf('MSIE ') || ~window.navigator.userAgent.indexOf('Trident/') /*|| ~window.navigator.userAgent.indexOf('Edge/')*/){
105	jQuery('html').addClass('ie');
106	jQuery('body').append('<div id="falkeIEHint">Sie rufen diese Website mit einer veralteten Version von Internet Explorer auf. Wir können leider nicht garantieren, dass alle Funktionen und Darstellungen perfekt funktionieren und empfehlen Ihnen, auf einen modernen Browser umzusteigen: <a href="https://www.browser-update.org/de/update.html" title="Browser aktualisieren">Jetzt aktualisieren</a> oder <a href="#" class="hide">Hinweis ignorieren.</a></div><script>jQuery("#falkeIEHint a.hide").on("click", function(e){e.preventDefault(); jQuery("#falkeIEHint").remove();});</script>');
107}

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.