PageSourceSearch

https://www.sp5d.com/cm/wp-content/themes/sphericalplate/js/res-script.js

js sp5d.com collected 2026-10-08 02:26:35 UTC 17,466 bytes, 563 lines download raw bytes

1jQuery(document).ready(function($) {
2
3	// RES Script 2.1.0
4    var viewportWidth = $(window).width();
5
6	
7		
8// external js: masonry.pkgd.js, imagesloaded.pkgd.js
9// init Masonry
10var $grid = $('.grid').masonry({
11  itemSelector: '.grid-item',
12  percentPosition: true,
13  columnWidth: '.grid-sizer'
14});
15// layout Masonry after each image loads
16$grid.imagesLoaded().progress( function() {
17  $grid.masonry();
18});
19
20setTimeout(function() {
21	$grid.masonry();
22}, 700);
23
24	
25	
26    //   Scroll to Links  #   
27    $('.res-nav .nav a[href^="#"], #navOnTop a[href^="#"], #Logo a[href^="#"], .scrollLink a[href^="#"], a[href^="#"].scrollLink, .scrollSkipper a[href^="#"], .page-overlayer-nav a[href^="#"], #pointerNav a[href^="#"], .subnavbar .nav a[href^="#"], #side-menu-navigation a[href^="#"]').bind('click.smoothscroll', function(e) {
28		e.preventDefault();
29            var target = this.hash,
30                $target = $(target);
31		if($target.length){
32			$('html, body').stop().animate({
33				'scrollTop': $target.offset().top - 85
34			}, 1500, 'easeInOutExpo', function() {
35				// window.location.hash = target;
36				history.pushState(null, null, target);
37			});
38		} 
39        });
40
41
42
43
44	//   Fixed Nav with fixed Logo
45	$(window).bind('scroll', function() {
46		$('.res-header').fixedNav({
47			$window: $(this)
48		});
49		
50	}); 
51	$.fn.extend({
52		fixedNav: function(options) {			
53			var $self = $(this),
54				self = this,
55				$window = options.$window,
56				offset = 80,
57				$fixedWrapper = $('#fixedNav'),
58				bg_img = $('#fixedNav #navbar-primary > .row > .logo > a > img'),
59				bg_src = bg_img.attr('bg-fixed');
60			
61			// set background image to one defined in backend
62			bg_img.attr('src', bg_src);			
63	
64			if ($window.scrollTop() >= offset && !$('#fixedNav').length && $(window).width() >= 970) {
65				$fixedWrapper = $('<div id="fixedNav"></div>').prependTo('body');
66				$fixedWrapper.append($self.clone(true)).find('nav').removeAttr('id');
67				$('#fixedNav .res-header').addClass('nav-up');
68
69
70				setTimeout(function() {
71					$fixedWrapper.find('nav').addClass('fixed');
72				}, 0);
73				
74			} else if ($fixedWrapper.length && $window.scrollTop() <= offset) {
75				$fixedWrapper.remove();
76			}
77			return self;
78		}
79	});
80	
81	//   Fixed SUBNAV 
82	$('#navbar-primary').append('<div id="subnav-row" class="row"></div>');
83	$('.subnavbar').clone().prependTo('#subnav-row').attr('id', 'subnavbar-fixed').addClass('hidden-xs');
84	$(document).scroll(function() {
85    	if($(document).scrollTop() >= 240 && $(window).width() > 992){	
86			$('#subnavbar-fixed').css('display','block');
87		} else if (($(document).scrollTop() <= 240)){
88			$('#subnavbar-fixed').css('display','none');
89		}
90	});	
91	$(window).on('resize', function(){
92		if($(window).width() <= 992){
93			$('#subnavbar-fixed').css('display','none');
94		}
95	});
96	
97	// page overlayer
98//	$("body").prepend('<button class="lines-button x" type="button"><span class="lines"></span></button>');
99	
100	
101    // Pointer Nav - nur bei Onepager		   
102//    if (viewportWidth < 1200) {
103//        $("#pointerNav").remove();
104//
105//    } else {
106//        if (!$("body > #pointerNav").length && $("nav .nav > li a").text() !== 'Add a menu') {
107//            $(".res-nav .navbar-collapse").clone(true, true).prependTo("body").attr('id', 'pointerNav');
108//
109//            $("body > .navbar-collapse li a").each(function() {
110//                $(this).attr('data-toggle', 'tooltip').attr('data-placement', 'left');
111//            });
112//            $(function() {
113//                $('[data-toggle="tooltip-off"]').tooltip();
114//            });
115//
116//        }
117//    }
118	
119    // Mobile Nav close-click	   
120		if (viewportWidth < 780) {
121			  //  mobile nav click close 
122				$('.res-nav .nav a').on('click', function(){
123				$(".navbar-toggle").click() 
124			  });                           
125		}
126	
127	// Mobile Nav Close onpeager
128		$("body button.lines-button").on('click', function() {
129				$(this).toggleClass("closebutton");
130				$("body").toggleClass("open");
131		});
132	
133	// schliesst side-menu wenn ein menüpunkt geclickt wird - fuer Onepager.
134//	$('.menu-item').on('click', function(){
135//		$('.closebutton').click();
136//	});
137	
138	
139    // lade Inhalt dynamisch in Modalbox mit site_url
140    $("a.load-content").click(function() {
141        var post_id = $(this).attr("data-id");
142        var reference = ('.singleContent');
143        var target = "#" + $(this).attr("data-target");
144        var loadUrl = site_url+"/?p=" + post_id;
145        $(target + " .modal-body").load(loadUrl + " " + reference, function() {
146            $(target).modal('show');
147        });
148        return false;
149    });
150	
151
152	// FadeIn X FadeOut Page  /  benötigt 2 Divs  #faderPage  #faderFooter 
153	var duration = 300; $('#faderPage, #faderFooter').fadeIn(duration).css('display', 'block'); $('nav a').click(function(e) {
154		e.preventDefault();
155		newLocation = this.href;
156		if (!(newLocation.indexOf("#") != -1)) {
157			$('#faderPage, #faderFooter').fadeOut(duration, function() {
158				window.location = newLocation;
159			});
160		}
161	});
162
163
164    //  Show footer arrow or hide  
165    var isVisible = false;
166    $(window).scroll(function() {
167        var shouldBeVisible = $(window).scrollTop() > 350;
168        if (shouldBeVisible && !isVisible) {
169            isVisible = true;
170            $('#navOnTop').fadeIn("slow");
171        } else if (isVisible && !shouldBeVisible) {
172            isVisible = false;
173            $('#navOnTop').fadeOut("slow");
174        }
175    });
176
177
178    //  active Main-Nav Home  
179    /*
180	$(function() {
181        $('.home .navbar-nav li').first().addClass("active");
182    });
183	*/
184
185	
186	// Datenschutz cookie v2 2019
187	if (typeof $.cookie('Datenschutz') === 'undefined'){
188		// No DS-Cookie
189		$('#cookies-close-x').on('click', function() {
190			$.cookie('Datenschutz', '42', { path: '/', expires: 30 });
191			$('#cookieContainer').fadeOut('fast');
192		});	
193	} else {
194		// has DS-Cookie
195		$('#cookieContainer').remove();
196	}
197
198
199	
200	
201//	//  PostMag Box Height
202	function boxHeightFix(){
203		if($(window).width() > 970){
204        	setTimeout(10000);
205			var maxHeight = 0;
206			var count = 0;
207			$(".postMag .postContent").each(function(){
208				count++;
209			   if ($(this).height() >= maxHeight) { 
210				   maxHeight = $(this).height(); 
211			   }
212			});	
213			$(".postMag .postContent").height(maxHeight);
214		}else{
215			$(".postMag .postContent").removeAttr('style');	
216		}
217	}
218	setTimeout(function() {
219		boxHeightFix();
220	}, 100);
221		
222	
223//	//  PostMag Box Height
224	function boxHeightFixPDF(){
225		if($(window).width() > 970){
226        	setTimeout(10000);
227			var maxHeight = 0;
228			var count = 0;
229			$(".pdf-preview .postImg").each(function(){
230				count++;
231			   if ($(this).height() >= maxHeight) { 
232				   maxHeight = $(this).height(); 
233			   }
234			});	
235			$(".pdf-preview .postImg").height(maxHeight);
236		}else{
237			$(".pdf-preview .postImg").removeAttr('style');	
238		}
239	}
240	setTimeout(function() {
241		boxHeightFixPDF();
242	}, 100);
243	
244
245
246	//  CTA Box Height
247	function boxHeightFixCta(){
248		if($(window).width() > 1200){
249			var maxHeightCta = 0;
250			$(".cta .postContent").each(function(){
251			   if ($(this).height() > maxHeightCta) { maxHeightCta = $(this).height(); }
252			});	
253			$(".cta .postContent").height(maxHeightCta);
254		}else{
255			$(".cta .postContent").removeAttr('style');	
256		}
257	}
258	setTimeout(function() {
259		boxHeightFixCta();
260	}, 100);
261	
262	
263	
264    //  active tabs  
265    $(function() {
266        $('.tabs .nav-tabs li').first().addClass("active");
267        $('.tabs .tab-content .tab-pane').first().addClass("active");
268        $('.secondNav .nav-tabs li').first().addClass("active");
269        $('.secondNav .tab-content .tab-pane').first().addClass("active");
270    });
271	
272	
273	// Rubrik / Category FILTER ------------------------------
274	// DESKTOP & MOBILE: ersten Filter setzen, wenn noch kein Button aktiv ist: erster Button auf aktiv, Icon anpassen; Inhalt filtern
275	if($('.filter-btn.active').length == 0)
276	{
277		// DESKTOP & MOBILE: Buttons markieren
278		$('.filter-btn').first().addClass('active').find('i').addClass('fas').removeClass('fal');
279
280        // MOBILE: Choice anpassen
281        $('#filter-nav-mobile').find('.choice').html($('.filter-btn.active').find('span').html());
282
283        // DESKTOP & MOBILE: Wenn Button-Status gesetzt ist, Inhalt filtern
284        res_filterContent();
285    }
286
287    // DESKTOP & MOBILE: Button-Action definieren
288	$('.filter-btn').on('click', function()
289	{
290		// wenn dieser Button noch nicht aktiv ist, dann aktivieren und Icon anpassen
291		if(!$(this).hasClass('active'))
292		{
293			// DESKTOP & MOBILE: alle anderen Buttons abwählen, Icon auf leer wechseln
294            $('.filter-btn').removeClass('active').find('i').removeClass('fas').addClass('fal');
295
296            // DESKTOP & MOBILE: Neuen Button aktivieren, Icon auf voll wechseln
297			$(this).addClass('active').find('i').addClass('fas').removeClass('fal');
298
299            // MOBILE: Choice anpassen
300            $('#filter-nav-mobile').find('.choice').html($('.filter-btn.active').find('span').html());
301		}
302
303		// DESKTOP & MOBILE: Wenn Button-Status gesetzt ist, Inhalt filtern
304		res_filterContent();
305	});
306
307    // Funktion für die Filterung des Inhalts. MUSS vorhanden sein, damit die Filterung funktioniert!
308    function res_filterContent()
309    {
310        // aktiver Filter
311        var filter = $('.filter-btn.active').attr('data-tax');
312
313        // Elemente ein- oder ausblenden
314        $('.taxonomy-filter').each(function()
315        {
316            if($(this).hasClass(filter)) $(this).fadeIn('400');
317            else $(this).hide();
318        });
319    }
320
321    // ?filter=... Abfrage ----------------------------------------------------
322    if (window.location.href.indexOf("?filter=") >= 0) {
323
324        // WICHTIG: Diese Funktion "findGetParameter" MUSS ebenfalls vorhanden sein. Sie akzeptiert nur einen Parameter.
325        var filter = findGetParameter('filter');
326
327        // DESKTOP: Filter-Menu markieren
328        var desktopButtons = $('.filter-nav').find('.filter-btn');
329        $(desktopButtons).each(function()
330        {
331            if($(this).attr('data-tax') === filter)
332            {
333                // DESKTOP: Alle anderen Buttons abwählen, Icon auf leer wechseln
334                $(desktopButtons).removeClass('active').find('i').removeClass('fas').addClass('fal');
335
336                // DESKTOP: Neuen Button aktivieren, Icon auf voll wechseln
337                $(this).addClass('active').find('i').addClass('fas').removeClass('fal');
338
339                // DESKTOP & MOBILE: Wenn Button-Status gesetzt ist, Inhalt filtern
340                res_filterContent();
341            }
342        });
343        // MOBILE: Filter-Menu markieren
344		var mobileButtons = $('#filter-mobile-dropdown').find('.filter-btn');
345        $(mobileButtons).each(function()
346        {
347            if($(this).attr('data-tax') === filter)
348            {
349                // MOBILE: Alle anderen Buttons abwählen, Icon auf leer wechseln
350                $(mobileButtons).removeClass('active').find('i').removeClass('fas').addClass('fal');
351
352                // MOBILE: Neuen Button aktivieren, Icon auf voll wechseln
353                $(this).addClass('active').find('i').addClass('fas').removeClass('fal');
354
355                // MOBILE: Choice anpassen
356                $('#filter-nav-mobile').find('.choice').html($('.filter-btn.active').find('span').html());
357
358                // DESKTOP & MOBILE: Wenn Button-Status gesetzt ist, Inhalt filtern
359                res_filterContent();
360            }
361        });
362    }
363
364    // Funktion, um Parameter in der URL zu finden
365    function findGetParameter(parameterName) {
366        var result = null,
367            tmp = [];
368        location.search
369            .substr(1)
370            .split("&")
371            .forEach(function (item) {
372                tmp = item.split("=");
373                if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
374            });
375        return result;
376    }
377	
378	
379
380	/** RES VIDEO HTML5 *****************************************/
381	var res_vid_overlay = $('.res-vid .res-vid-overlay'),
382		res_vid_reset_btn = $('.res-vid-reset-btn'),	
383		res_vid_playback_btn = $('.res-vid-playback-btn'),	
384		res_vid_mute_btn = $('.res-vid-mute-btn');	
385	
386	changeSource();
387	
388	// PLAY ---------------------------------------------
389	res_vid_overlay.on('click', function(){
390		var res_vid_video = $(this).parent().find('video.res-vid-main')[0],
391			res_vid_overlay_video = $(this).find('video')[0],
392			res_vid_controls = $(this).parent().find('.res-vid-control');
393		
394		if(res_vid_video.paused){
395			res_vid_video.play();
396			$(this).fadeOut();
397			res_vid_controls.fadeIn();
398			res_vid_overlay_video.pause();
399		}
400	});
401	
402	// RESET ---------------------------------------------
403	res_vid_reset_btn.on('click', function(){
404		var res_vid_video = $(this).parent().parent().find('video.res-vid-main')[0],
405			res_vid_controls = $(this).parent().parent().find('.res-vid-control'),
406			res_vid_overlay = $(this).parent().parent().find('.res-vid-overlay'),
407			res_vid_overlay_video = $(this).parent().parent().find('.res-vid-overlay video')[0];
408		res_vid_video.pause(); 
409		res_vid_controls.fadeOut();
410		res_vid_overlay.fadeIn();
411		res_vid_overlay_video.play();
412	});
413	
414	// PLAYBACK --------------------------------------------
415	res_vid_playback_btn.on('click', function(){
416		var res_vid_video = $(this).parent().parent().find('video.res-vid-main ')[0],
417			res_vid_playback_btn_i = $(this).parent().find('.res-vid-playback-btn i');
418		if(res_vid_video.paused){
419			res_vid_video.play();
420			res_vid_playback_btn_i.removeClass('fa-play');
421			res_vid_playback_btn_i.addClass('fa-pause');
422		}else{
423			res_vid_video.pause(); 			
424			res_vid_playback_btn_i.removeClass('fa-pause');
425			res_vid_playback_btn_i.addClass('fa-play');
426		}
427	});
428	
429	// MUTE ------------------------------------------------
430	res_vid_mute_btn.on('click', function(){
431		var res_vid_video = $(this).parent().parent().find('video.res-vid-main '),
432			res_vid_mute_btn_i = $(this).parent().find('.res-vid-mute-btn i');
433		if(res_vid_video.prop('muted')){
434			res_vid_video.prop('muted', false);
435			res_vid_mute_btn_i.removeClass('fa-volume-off');
436			res_vid_mute_btn_i.addClass('fa-volume-up');
437		}else{
438			res_vid_video.prop('muted', true);
439			res_vid_mute_btn_i.removeClass('fa-volume-up');
440			res_vid_mute_btn_i.addClass('fa-volume-off');
441		}
442	});
443	
444	// ON VIDEO ENDED -------------------------------
445	$('video.res-vid-main').on('ended',function(){
446    	var res_vid_overlay = $(this).parent().find('.res-vid-overlay'),
447			res_vid_controls = $(this).parent().parent().find('.res-vid-control');
448		res_vid_overlay.fadeIn();
449		res_vid_controls.fadeOut();
450    });
451	
452	$(window).on('resize', function(){
453		changeSource();
454	});
455	
456	function setSource(selector){
457		if($(this).width() < 970){
458			// MOBILE
459		  	selector.attr('src', selector.data('mobilesrc')); 	
460		}else{
461			// DESKTOP
462		   	selector.attr('src', selector.data('desktopsrc')); 	
463		}
464	}
465	
466	function changeSource(){
467		// Overlay video
468		$('.res-vid-overlay video').each(function(){
469			setSource($(this).find('source'));
470			$(this)[0].load();
471		});
472		
473		// Overlay image
474		$('.res-vid-overlay img').each(function(){
475			setSource($(this));
476		});
477		
478		// Video main
479		$('video.res-vid-main ').each(function(){
480			setSource($(this).find('source'));
481			$(this)[0].load();
482		});
483	}
484	// -----------------------------------------------------------------------
485	
486	
487	// html Video Button  ----------------------------------------------------
488	// Zeigt Button auf dem Video
489	var playBtn = $('.html-video-play-btn');
490	var video = $('video');
491	
492	// Click auf Play-Button
493	playBtn.on('click', function(){
494		var this_video = $(this).find('video')[0];
495		if(this_video.paused){
496			this_video.play();
497			$(this).addClass('html-video-play-handle');
498		}else{
499			this_video.pause(); // Wenn video Pausiert => play sonst pause	
500			$(this).removeClass('html-video-play-handle');
501		}
502	});
503	
504
505	// Falls der Kunde auf den Html Start knopf drückt
506	video.on('play', function(){
507		$(this).parent().addClass('html-video-play-handle');
508	});
509	
510	video.on('pause', function(){
511		$(this).parent().removeClass('html-video-play-handle');			
512	});
513	
514	
515	 //  Slider Starten
516	$(function() {
517		// Slider Starten
518        $('.carousel-inner .item').first().addClass("active");
519		// Slider Bullet point
520		$('.carousel-indicators li').first().addClass("active");
521    });
522	
523
524    
525	$('#carousel-generic-1').bind('slid', function (e) {
526  $('.item.active').find('iframe').contents().find('body').find('video')[0].play();
527});
528	
529	
530	$(document).ready(function () {
531    var ownVideos = $("iframe");
532    $.each(ownVideos, function (i, video) {                
533        var frameContent = $(video).contents().find('body').html();
534        if (frameContent) {
535            $(video).contents().find('body').html(frameContent.replace("controls", "autoplay loop preload"));
536        }
537    });
538});
539	
540	
541		/** Check current URL  */
542	var checkURL =['about-us'];
543	for(var p in checkURL){
544		if(window.location.pathname.indexOf(checkURL[p]) >= 1){
545			$('#menu-header-menu li:nth-child(6)').addClass('active');
546		}
547	}
548	
549
550	 
551//    $('#carousel-generic-1').on('slide.bs.carousel', function () {
552//        var ownVideos = $("iframe");
553//        $.each(ownVideos, function (i, video) {                
554//        var frameContent = $(video).contents().find('body').html();
555//        if (frameContent) {
556//            $(video).contents().find('body').html(frameContent.replace("controls", "autoplay loop preload"));
557//        } else {
558//            $(video).contents().find('body').html(frameContent.replace("controls", "stop pause ended"));
559//        }
560//    });   
561//})
562	
563});

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.