PageSourceSearch

https://dot-coworking.at/wp-content/themes/bootstrap-DOT-child/rkp.js?ver=7.1.2

js dot-coworking.at collected 2026-10-06 02:09:06 UTC 16,035 bytes, 538 lines download raw bytes

1
2rkp_defer_events = { // global object
3	resize_defer_time : 300,
4	resize_timeout : null
5};
6
7jQuery(window).on('resize', function(){
8	jQuery(this).trigger('get_vals');
9
10	  clearTimeout(rkp_defer_events.resize_timeout);
11	  rkp_defer_events.resize_timeout = setTimeout(function(){
12		  jQuery(window).trigger('rkp_deferred_resize');
13	  }, rkp_defer_events.resize_defer_time);
14});
15
16window.ww = window.innerWidth;
17  // window.wh = window.innerHeight;
18
19jQuery(window).on('get_vals', function(){
20	  window.ww = window.innerWidth;
21	  window.wh = window.innerHeight;
22
23});
24
25function isInViewport(el) {
26    const rect = el.getBoundingClientRect();
27    return (
28        rect.top < (window.wh - 90) &&
29        rect.bottom > (window.wh - 90)
30
31
32    );
33}
34
35/*dom ready*/
36jQuery(function($){
37
38	$page_header = $('#masthead');
39	// $sections = $('.bg-white, .bg-dark, .bg-text');
40	$sections = $('section.rot-section');
41
42	$('button.navbar-toggler').on('click',function(){
43		$page_header.toggleClass('nav-showing');
44	});
45
46	$('.navbar-collapse a').on('click',function(e){
47		if($(this).closest('.navbar-collapse').hasClass('show')){
48			console.log('clicked');
49			$('button.navbar-toggler').trigger('click');
50		}
51	});
52
53
54
55	$(window).on('scroll', function(e){
56
57		var scroll_pos = jQuery(window).scrollTop();
58		var scrolled = scroll_pos > 260;
59			$('body').toggleClass('scrolled',scrolled);
60		// Boundingbox
61		if(!$sections.length){
62			return false;
63		}
64		$sections.each(function(){
65			var $this = $(this);
66			var bbox = this.getBoundingClientRect();
67
68			// console.log(isInViewport($this));
69			var wh = wh?wh:window.wh;
70
71			// if((bbox.top < 66 && bbox.bottom > 66) && $this.hasClass('bg-white')){
72			// 	if(!($page_header.hasClass('whitened'))){
73			// 		$page_header.addClass('whitened',!$page_header.hasClass('whitened'));
74			// 		console.log('hat er net');
75			// 	}
76			// }else{
77			// 	if($page_header.hasClass('whitened')){
78			// 	// $page_header.removeClass('whitened',($page_header.hasClass('whitened')&&!$this.hasClass('bg-white')))
79			// 		$page_header.removeClass('whitened');
80			// 	}
81			// }
82			if(bbox.top < (wh - 240) && bbox.bottom > 240){
83				$this.addClass('been-in-scope');
84				$this.addClass('in-scope',!$this.hasClass('in-scope'));
85				if(bbox.bottom < (wh - 140)){
86					$this.addClass('trigger-indicator');
87				}
88
89			}else{
90				$this.removeClass('in-scope',$this.hasClass('in-scope'));
91			}
92
93			// console.log('top:' + bbox.top);
94			// console.log('bottom:' + bbox.bottom);
95			// console.log('wh - 90:' + (wh - 90));
96			// if(bbox.top < (wh - 90)){
97			// 	$this.addClass('been-in-scope');
98			// 	if(bbox.bottom > (wh - 90)){
99			// 		if(!$this.hasClass('in-scope')){
100			// 			$this.toggleClass('in-scope');
101			// 		}
102			// 	}else{
103			// 		$this.removeClass('in-scope');
104			// 	};
105			// }
106		});
107	});
108
109
110
111
112	window.ww = window.innerWidth;
113	// window.wh = window.innerHeight;
114
115	$(window).on('get_vals', function(){
116		window.ww = window.innerWidth;
117		window.wh = window.innerHeight;
118
119	});
120
121
122
123	$('.accordion .acc-trigger').on('click' , function(e){
124		e.preventDefault();
125		var $acc_wrap = $(this).closest('.accordion');
126		$acc_wrap.siblings('.accordion').removeClass('active');
127		var $acc_trigger_dad = $(this).closest('.item-heading');
128		var $rot_panel =  $acc_trigger_dad.next('.item-content');
129		//only with img-col
130		// var wrap = $(this).closest('.acc-img-row');
131		// var figure = wrap.find('figure');
132		// var src = $(this).attr('data-img-src');
133		if(!($(this).hasClass('active'))){
134			// figure.append('<img class="new_img" src="'+src+'"/>');
135			setTimeout(function(){
136				// figure.find('img.new_img').removeClass('new_img').addClass('changed_img');
137			},100);
138			setTimeout(function(){
139				// figure.find('img:first').remove();
140			},1000);
141		}
142		$acc_wrap.toggleClass('active');
143
144		$acc_wrap.siblings('.accordion').find('.panel').slideUp(500);
145		$rot_panel.slideToggle(500);
146	});
147
148
149	$('.wpcf7-response-output').on('click', function(){
150		$(this).css('display' , 'none');
151		$(this).closest('.da_popup').removeClass('d-flex');
152		// $(window).trigger('load');
153	});
154	$('.wpcf7-form').on('submit', function(){
155		$(this).find('.wpcf7-response-output').css('display' , 'block');
156		// $(this).closest('.da_popup').removeClass('d-flex');
157		// $(window).trigger('load');
158	});
159
160
161
162	// Scrolling for anchor links in within the same page
163	jQuery('a[href*="#"]:not([href="#"])').click(function(){
164		var _hash = this.hash;
165
166		if($(this).hasClass('close-nav-link')){
167			$('button.navbar-toggler').trigger('click');
168		}
169
170		setTimeout( function() {
171			_scroll_it( _hash );
172		}, 200 );
173
174	});
175
176	jQuery('a[href*="#"]:not([href="#"])').on('click', function(){
177		var _hash = this.hash;
178		_scroll_it( _hash );
179	});
180
181	var _hash = window.location.hash;
182	if( _hash.length > 0 ){
183		window.scrollTo(0, 0);
184
185		setTimeout( function() {
186			_scroll_it( _hash );
187		}, 2200 );
188	}
189
190	function _scroll_it( _hash ){
191		if(!jQuery(_hash).length){
192			return;
193		}
194		jQuery('html,body').stop().animate({
195			scrollTop: (jQuery( _hash ).offset().top) - 150 +'px'
196
197		}, 800, 'swing' );
198	}
199
200
201
202
203	$('._brlbs-bar .col-sm-9').removeClass('col-sm-9').addClass('col-lg-9');
204	$('._brlbs-bar .col-sm-3').removeClass('col-sm-3').addClass('col-lg-3');
205
206
207
208	//product links ghostlink
209	$('.rot-cpt-item .ghostlink').on('mouseenter',function(){
210		$(this).stop().closest('.rot-cpt-item').addClass('active');
211		// console.log('sidenav-item wäre jetzt gehovert');
212	})
213	.on('mouseleave',function(){
214		$(this).stop().closest('.rot-cpt-item').removeClass('active');
215
216	})
217	//TIMELINE
218	var elem = document.getElementById('rkp-timeline');
219	// console.log(elem);
220	// if(elem){
221	// 	new HorizontalTimeline(elem);
222	// }
223	if(elem){
224		$(elem).timeline({
225			mode:'horizontal',
226			forceVerticalMode: 652,// 768px
227			visibleItems:3,//no effect! hardcoded in timeline.js line 131
228			// visibleItemsXL:5
229		});
230	}
231
232	//tabs
233	$('.rot-tabs').next('.rot-cpt-items').children('article').hide();
234	$('.rot-tabs .rot-tab').first().addClass('tab-active');
235	// $('.rot-tabs').closes.children('article').first().addClass('tab-active');
236	$('.rot-tabs .rot-tab').each(function(){
237		let $this = $(this);
238		let data_id = $this.attr('data-tab-id');
239		let $targets = $this.closest('.rot-tabs').next('.rot-cpt-items');
240		$targets.children('article').first().addClass('tab-active').slideDown();
241		$this.on('click',function(e){
242			e.preventDefault();
243			var target = $targets.find('article[data-item-id="'+data_id+'"]');
244			$this.addClass('tab-active');
245			$this.siblings().removeClass('tab-active');
246
247			$targets.children('article[data-item-id!="'+data_id+'"]').removeClass('tab-active').slideUp();
248			target.addClass('tab-active').slideDown();
249
250			// console.log(target);
251			// console.log(data_id);
252		});
253
254	});
255	$('a[data-nolink="nolink"]').on('click',function(e){
256		e.preventDefault();
257	});
258
259
260
261	//rot COPY URL to clipboard
262	$('#rot-copy-url').on('click',function(e){
263		e.preventDefault();
264		let url = document.location.href
265		$(this).addClass('copied');
266		navigator.clipboard.writeText(url).then(function() {
267			// console.log(url);
268
269			// console.log('Copied!');
270		}, function() {
271			console.log('Copy error')
272		});
273	});
274
275
276
277	//SPOERK ACCORDION
278
279	// $('.accordion.acc-leistungen:not(.active)').get(0).addClass('active');
280	$('.accordion.acc-leistungen:not(.active)').on('click' , function(){
281        $(this).siblings('.accordion').removeClass('active');
282        //only with img-col
283        var wrap = $(this).closest('.acc-img-row');
284        var icon_index = $(this).attr('data-icon-index');
285		var target_target = wrap.find('.acc-target[data-icon-index='+icon_index+']');
286		var target_icon = wrap.find('figure[data-icon-index='+icon_index+']');
287        var target_panel = wrap.find('.panel[data-icon-index='+icon_index+']');
288		//if 2panels, one attached to the trigger (e.g. to show in mobile)
289		var own_panel = $(this).find('.panel');
290
291		// var data_title = target_panel.data('acc-content')[0];
292		// var data_content = target_panel.data('acc-content')[1];
293		// target_panel.append('<h3>'+data_title+'</h3>');
294		// target_panel.append('<div>'+data_content+'</div>');
295		// console.log(data_title);
296
297        // var figure = wrap.find('figure');
298        if(!($(this).hasClass('active'))){
299            // figure.append('<img class="new_img" src="'+src+'"/>');
300            setTimeout(function(){
301				target_icon.addClass('active');
302				target_icon.siblings().removeClass('active');
303                // figure.find('img.new_img').removeClass('new_img').addClass('changed_img');
304            },100);
305            // setTimeout(function(){
306            //     // figure.find('img:first').remove();
307			// 	wrap.find('figure.x-active').removeClass('x-active');
308            // },1000);
309			target_target.siblings('.acc-target').slideUp(500);
310			$(this).siblings('.rot-acc').find('.panel').slideUp(500);
311			target_target.slideToggle(500);
312			setTimeout(function(){
313				target_panel.closest('.acc-target').siblings('.acc-target').find('.panel').slideUp(500);
314				target_panel.slideToggle(500);
315			},600);
316        }
317        $(this).addClass('active');
318    });
319	//set first element active
320	let first= $('.accordion.acc-leistungen:not(.active)').get(0);
321	$(first).trigger('click');
322	// console.log($(first));
323
324
325
326	/* da_popup*/
327    $('a[data-popup-close]').on('click', function(e){
328        e.preventDefault();
329        $('.da_popup').fadeOut(500);
330
331        $.removeCookie("popup_closed");
332        $.cookie("popup_closed", "closed popup", {expires: 14, path: '/'});
333    });
334    // $('.nl-anmeldung').on('click', function(e){
335    //     e.preventDefault();
336    //     $('.da_popup').css('display', 'flex').hide(0).fadeIn(500);
337
338    // });
339    // //fetch mailsent event /Jürgi
340    // var wpcf7Elm = document.querySelector( '.wpcf7' );
341    // wpcf7Elm.addEventListener( 'wpcf7mailsent', function( event ) {
342    //     console.log(event);
343    //     setTimeout(function(){
344    //         $('.close-it').trigger('click');
345    //     },1000);
346    //     // alert( "Fire!" );
347    // }, false );
348
349
350	$('a[data-toggle-modal]').on('click',function(e){
351		e.preventDefault();
352
353		var $this = $(this);
354		var modal_id = $this.attr('data-toggle-modal');
355		var $modals_container = $('.rot-modals');
356		if($modals_container.length){
357			var $current_modal = $modals_container.find('#'+modal_id).fadeIn(700).addClass('showing');
358
359		}
360	});
361	$('.close-it').on('click',function(e){
362		e.preventDefault();
363		$(this).closest('.rot-modal').fadeOut(700);
364	});
365	$('.rot-modal.more-info').on('click',function(e){
366		e.preventDefault();
367		$(this).fadeOut(700);
368	});
369
370
371	//hackl - second nav bei tabs
372	$('.rot-cpt-tabs-wrap').each(function(){
373		var $this = $(this);
374		var tabs = $this.find('.rot-tabs .rot-tab');
375		var count = parseInt($this.find('.rot-tabs').attr('data-tabscount'));
376		console.log(tabs);
377
378		var next = $this.find('.next').on('click',function(e){
379			var active_tab = $this.find('.rot-tab.tab-active');
380			var active_index = parseInt(active_tab.attr('data-tabindex'));
381			var target_tab = $this.find('.rot-tab[data-tabindex="'+(active_index+1)+'"]');
382			// var target_tab = $this.find('.rot-tab').attr('data-tabindex',active_index+1);
383			console.log(target_tab);
384			if( active_index == count){
385				target_tab = $this.find('.rot-tab[data-tabindex="1"]')
386			}
387			target_tab.trigger('click');
388		});
389		var prev = $this.find('.prev').on('click',function(e){
390			var active_tab = $this.find('.rot-tab.tab-active');
391			var active_index = parseInt(active_tab.attr('data-tabindex'));
392			console.log(active_index);
393			var target_tab = $this.find('.rot-tab[data-tabindex="'+(active_index-1)+'"]');
394			if( active_index ==1){
395				target_tab = $this.find('.rot-tab[data-tabindex="'+count+'"]');
396			}
397			target_tab.trigger('click');
398		});
399
400
401	});
402
403		//LOAD MORE
404		let currentPage = 1;
405		// $('#load-more').on('click', function(e) {
406
407
408		$('[data-load-more="load-more"]').each(function(i){
409			$(this).attr('data-load-more-index','loadmore-'+i);
410			i++;
411			let currentPage = 1;
412
413			$(this).on('click', function(e) {
414				e.preventDefault();
415				// alert('clicked');
416				// var posts_per_page =$(this).data('posts_per_page');
417				// var post_type =$(this).data('post_type');
418				var json_a = $(this).data('query_array');
419				// json_a = JSON.parse(json_a);
420				/**
421				 * .data() erkennt die json-map daher brauch ich keine JSON.parse, wie wenn ichs mit attr() auslesen würde
422				 */
423				console.log(json_a);
424				var post_type=json_a.post_type;
425				var posts_per_page=json_a.posts_per_page;
426				var orderby=json_a.orderby;
427				var order=json_a.order;
428				var meta_key=json_a.meta_key;
429				var meta_query=json_a.meta_query;
430				var btn_index=$(this).data('load-more-index');
431
432				currentPage++; // Do currentPage + 1, because we want to load the next page
433				$.ajax({
434					type: 'POST',
435					url: '/wp-admin/admin-ajax.php',
436					dataType: 'json',
437					data: {
438						action: 'rot_load_more',
439						paged: currentPage,
440						postsPerPage: posts_per_page,
441						postType: post_type,
442						orderby: orderby,
443						order: order,
444						metaKey: meta_key,
445						metaQuery: meta_query,
446						btnIndex: btn_index
447						// jsonA: {json_a}
448
449					},
450					success: function (res) {
451						if(currentPage >= res.max) {
452							console.log(res.btnIndex);
453							$('[data-load-more-index="'+res.btnIndex+'"]').hide();
454						}
455						$('[data-load-more-index="'+res.btnIndex+'"]').closest('.btn__wrapper').siblings('.rot-cpt-items').append(res.html);
456					}
457				});
458			});
459		});
460
461
462
463
464//DOM ready close
465});
466
467
468jQuery('.leaflet-marker-icon[tabindex=0]').attr('data-test','testigor');
469
470
471jQuery(window).on('resize', function(){
472// jQuery(window).on('load rkp_defered_resize', function(){
473	// jQuery(this).trigger('resize');
474	jQuery(this).trigger('scroll');
475});
476
477function removeHash () {
478	console.log('removeHash ' , history.pushState("", document.title, window.location.pathname
479	+ window.location.search));
480
481}
482
483
484
485jQuery(window).on('rkp_deferred_resize', function(){
486
487	let wh =  jQuery(window).height();
488	let hh =  jQuery('#masthead').height();
489	let fh =  jQuery('#site-footer').outerHeight();
490	let ah =  jQuery('#wpadminbar').length?jQuery('#wpadminbar').height():0;
491	// jQuery('.scroll-s').each(function(){
492	//     let hhh = jQuery(this).outerHeight();
493	//     // console.log('section height:'+ hhh);
494	//     jQuery(this).css('height',hhh);
495	// });
496	jQuery('#content.site-content').css('margin-bottom',fh);
497	// console.log(fh);
498	// jQuery('#content').css('text-indent', fh  +  'px');
499	jQuery('#content').css('min-height', wh - fh - ah  +  'px');
500	// jQuery(this).trigger('get_vals');
501	jQuery(this).trigger('scroll');
502
503	//second image content
504	jQuery('.split-content-img .split-inner-row').each(function(){
505		var $this = jQuery(this);
506		var h = $this.outerHeight();
507		// console.log(h);
508		$this.closest('.content-row').find('.second-lvl').css('min-height',h - 60 + 'px');
509	});
510
511
512
513});
514jQuery(window).on('load', function(){
515	jQuery(this).trigger('resize');
516	// jQuery(this).trigger('resize');
517	jQuery('#masthead').removeClass('whitened');
518	// if(!jQuery('body').hasClass('home')){
519		// 	jQuery('#masthead').addClass('whitened')
520		// }
521	setTimeout(function(){
522		// console.log(window.scrollY);
523		// var wst = window.scrollY;
524		// if(wst < 60){
525		// 	setTimeout(function(){
526		// 		jQuery('html, body.home').animate({scrollTop:'+=280px'},1700);
527		// 	},2900);
528		// 	jQuery(this).trigger('scroll');
529		// }
530		console.log('geladen');
531		jQuery('#s_header').addClass('animation-ended');
532		jQuery('.da_popup').each(function(){
533			jQuery(this).fadeIn();
534			console.log(jQuery(this));
535		});
536	},1200);
537
538});

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.