PageSourceSearch

https://www.guerbe-muesche.ch/themes/wasserbauverband/js/javascript.js

js guerbe-muesche.ch collected 2026-09-25 11:55:54 UTC 7,863 bytes, 252 lines download raw bytes

1(function ($) {
2		   
3	$(window).resize(function() {
4
5		
6	});
7		   
8    $(document).ready(function () {
9
10		var is_mobile = false;
11		if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
12			is_mobile = true;       
13		}
14		
15		$('#navTop ul li').hover(function(){
16			if ($(window).width() > 768) {
17				$(this).children('ul').stop(true, true).animate({
18					height:  'toggle',
19					opacity: 'toggle'
20				}, 200);
21			}
22		}, function () {
23			if ($(window).width() > 768) {
24				$(this).children('ul').hide();
25			}
26		});
27		
28		$('#navMobileButton, #navClose').click(function(e) {
29			e.preventDefault();
30			slideMobileNavigation();
31			
32			if ($('#navMobileButton').attr('class') == 'close') {
33				$('#navMobileButton').removeClass('close')
34				$('#navMobile').removeClass('open');
35			} else {
36				$('#navMobileButton').addClass('close');
37				$('#navMobile').addClass('open');
38			}
39			/*
40			if ($('#navMobile').attr('class') == 'open') {
41				$('#navMobile').removeClass('open');
42			} else {
43				$('#navMobile').addClass('open');
44			}
45			*/
46		});
47		$('#navMobile li.level-1 > .openSubmenu').bind('click', function () {
48			$('#navMobile li.level-1 > .openSubmenu').removeClass('minus');
49			$('#navMobile li.level-1 > .openSubmenu').addClass('plus');
50			var elmClicked     = $(this);
51			var elmThisSubmenu = $(this).parent().find('.menu').first();
52			if (elmThisSubmenu.css('display') != 'block') {
53				$('#navMobile li.level-1 > ul.menu').each(function (index) {
54					var elmOtherSubmenu = $(this);
55					elmOtherSubmenu.slideUp();
56				});
57				elmClicked.removeClass('plus');
58				elmClicked.addClass('minus');		
59				elmThisSubmenu.slideDown();
60			} else {
61				elmThisSubmenu.slideUp();
62			}
63		});
64
65
66		$("a[href$='.pdf']:not(:has(img))").addClass("pdf");
67		$("a[href$='.xls']:not(:has(img))").addClass("xls");
68		$("a[href$='.xlsx']:not(:has(img))").addClass("xls");
69		$("a[href$='.doc']:not(:has(img))").addClass("doc");
70		$("a[href$='.docx']:not(:has(img))").addClass("doc");
71		$("a[href$='.ppt']:not(:has(img))").addClass("ppt");
72		$("a[href$='.pptx']:not(:has(img))").addClass("ppt");
73		$("a[href^='http://']").attr("target","_blank");
74		$("a[href^='https://']").attr("target","_blank");
75		$("a[href$='.pdf']").attr("target","_blank");
76		$("a[href$='.xls']").attr("target","_blank");
77		$("a[href$='.doc']").attr("target","_blank");
78		$("a[href$='.ppt']").attr("target","_blank");
79		
80		$(window).scroll(function(){
81			var scrollTop = $(window).scrollTop();
82			if (scrollTop >= 300){
83				$('#goUp').fadeIn();
84				$('#copyright').fadeOut();
85				/*
86				$('#copyright').css('bottom','100px');
87				*/
88			} else {
89				$('#goUp').fadeOut();
90				if ($(window).width() > 580) {			
91					$('#copyright').fadeIn();
92				}
93				/*
94				$('#copyright').css('bottom','20px');
95				*/
96			}
97		});
98	
99		// GoUp scrollTop
100		$('#goUp').click(function(){
101			$('body,html').animate({scrollTop : 0}, 800);
102				return false;
103		});
104	
105	
106		//email spam protection - Example Markup: <span class="email">
106name[at]domain[dot]com</span>
107		$('.email').each(function() {
108			var email = $(this);
109			var address = email.text()
110			.replace(/\s*\[at\]\s*/, '@')
111			.replace(/\s*\[dot\]\s*/g, '.');
112			email.html('<a href="mailto:' + address + '">'+ address +'</a>');
113		});
114	
115	
116		if ($('#headerImg').length > 0) {
117			$(window).scroll(function(){
118				var yPos = $(window).scrollTop() / $('#headerImg').data('speed');
119				/*$('#teaser').css('background-position','center calc(50% + ' + yPos + 'px)');*/
120				$('#headerImg').css('background-position','center ' + yPos + 'px');
121			});
122		}
123
124
125		// Slide		
126		$('#slide h3').click(function(){
127			if (!$(this).hasClass('active')) {
128				$('.accordion-content').slideUp();			
129				$('#slide h3').removeClass('active');
130				$(this).addClass('active');
131				$(this).next('.accordion-content').slideDown();
132			}
133		});
134		
135
136		$('a#more_1').click(function(e) {
137			e.preventDefault();
138			$('#moreFrame_2').slideUp(800);
139			$('#moreFrame_3').slideUp(800);
140			$('#moreFrame_4').slideUp(800);
141			$('#moreFrame_1').slideToggle(800);
142		});
143		$('a#more_2').click(function(e) {
144			e.preventDefault();		
145			$('#moreFrame_3').slideUp(800);
146			$('#moreFrame_4').slideUp(800);
147			$('#moreFrame_2').slideToggle(800);
148		});
149		$('a#more_3').click(function(e) {
150			e.preventDefault();
151			$('#moreFrame_4').slideUp(800);				
152			$('#moreFrame_3').slideToggle(800);
153		});
154		$('a#more_4').click(function(e) {
155			e.preventDefault();			
156			$('#moreFrame_4').slideToggle(800);
157		});
158
159	});
160
161    function slideMobileNavigation() {
162        if ($('#navMobile').hasClass('open')) {
163            $('html, body').css('overflowY', 'visible');
164            $('#open-mobile-navigation').fadeIn();
165            $('#close-mobile-navigation').hide();
166        } else {
167            $('body').css('overflowY', 'hidden');
168            if ($("#navMobile .starter_active").length != 0) {
169                $("#navMobile .starter_active .openSubmenu").addClass('minus');
170                $("#navMobile .starter_active .openSubmenu").removeClass('plus');
171            }
172            $("#navMobile .starter_active .openSubmenu")
173            $('#navMobile li.level-1').each(function (index) {
174                if ($(this).find('ul.menu').length == 0) {
175                    $(this).find('.openSubmenu').hide();
176                }
177            });
178            $('#open-mobile-navigation').hide();
179            $('#close-mobile-navigation').fadeIn();
180        }
181    }
182
183	function showMap(is_mobile) {
184	 
185		var latlng = is_mobile ? new google.maps.LatLng(46.890519,7.320647) : new google.maps.LatLng(46.890519,7.320647);
186		
187		var myOptions = {
188			zoom: 15,
189			center: latlng,
190			mapTypeId: google.maps.MapTypeId.ROADMAP,
191			navigationControl: false,
192			streetViewControl: false,	
193			mapTypeControl: false,
194			scaleControl: false
195		};
196	
197		var map = new google.maps.Map($("#map-layer")[0], myOptions);
198		
199		var modernStyle = [
200			{featureType: "all", stylers: [{saturation: -100}]}
201		];
202	
203		
204		map.setOptions({styles: modernStyle});
205		
206		var myLatlng = new google.maps.LatLng(46.890519,7.320647);
207		var marker = {
208			url: '/themes/etica/images/map-marker.png',
209			scaledSize: new google.maps.Size(26,40),
210			origin: new google.maps.Point(0,0),
211			anchor: new google.maps.Point(13,40)
212		};
213		var marker = new google.maps.Marker({
214			position: myLatlng,
215			map: map,
216			animation: google.maps.Animation.DROP,
217			clickable: true,
218			title: 'Etica Druck, Bernstrasse 41, 3175 Flamatt',
219			icon: marker,
220			url: 'https://goo.gl/maps/e97nBLGqj9S2'		
221		});
222		google.maps.event.addListener(marker, 'click', function() {
223		  window.open(marker.url);
224		});
225		
226	}	
227	
228})(jQuery);
229
230
231document.addEventListener("DOMContentLoaded", function() {
232    // If multiple events are in the same month we need to hide repeating headers
233    let lastHeaderDate = "";
234    for (const dateHeaderEl of document.querySelectorAll(".date-header")) {
235        const currentHeaderDate = dateHeaderEl.dataset.date;
236        if (lastHeaderDate == currentHeaderDate) {
237            dateHeaderEl.remove();
238        }
239        lastHeaderDate = currentHeaderDate;
240    }
241    
242    // If same day hide end date, otherwise show short date format
243    for (const dateStartEl of document.querySelectorAll(".date-start")) {
244        const dateEndEl = dateStartEl.parentElement.querySelector(".date-end");
245        if (dateStartEl.dataset.date == dateEndEl.dataset.date) {
246            dateEndEl.remove();
247        } else if (dateStartEl.dataset.dateShort !== undefined) {
248            dateStartEl.innerHTML = dateStartEl.dataset.dateShort;
249            dateEndEl.innerHTML = dateEndEl.dataset.dateShort;
250        }
251    }
252});

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.