PageSourceSearch

https://www.sankt-barbara-apo.de/typo3conf/ext/t3b/Resources/Public/JavaScript/js.js?1732490065

js sankt-barbara-apo.de collected 2026-10-06 22:24:15 UTC 15,953 bytes, 484 lines download raw bytes

1// IE
2function getInternetExplorerVersion() {
3    let rV = -1; // Return value assumes failure.
4
5    if (navigator.appName == 'Microsoft Internet Explorer' || navigator.appName == 'Netscape') {
6        const uA = navigator.userAgent;
7        const rE = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
8
9        if (rE.exec(uA) != null) {
10            rV = parseFloat(RegExp.$1);
11        }
12        /*check for IE 11*/
13        else if (!!navigator.userAgent.match(/Trident.*rv\:11\./)) {
14            rV = 11;
15        }
16    }
17    return rV;
18}
19
20if (getInternetExplorerVersion() != -1) {
21    const body = document.body;
22    body.classList.add('is-IE');
23}
24
25// lazysizes
26window.lazySizesConfig = window.lazySizesConfig || {};
27window.lazySizesConfig = {loadHidden: false};
28
29// load Sliders
30function buildSliderConfiguration(slides, slideOptions, slideTime) {
31    const windowWidth = $(window).width();
32
33    // sliding to first slide in infiniteloop
34    const useCSS = false;
35
36    if (slideTime > 0) {
37        // use this slideTime
38    } else {
39        // use default
40        slideTime = 6000;
41    }
42    let numberOfVisibleSlides,
43        controls = false,
44        auto = true,
45        pager = true,
46        captions = false,
47        speed = 2000,
48        touchEnabled = false,
49        mode = 'fade',
50        oneToOneTouch = false,
51        autoControls = false,
52        stopAutoOnClick = true,
53        moveSlides = 0,
54        slideWidth = 0,
55        slideMargin = 0;
56
57    // set options based on window size
58    if (windowWidth < 768) {
59        numberOfVisibleSlides = 1;
60        controls = true;
61        touchEnabled = false;
62        oneToOneTouch = true;
63    } else {
64        numberOfVisibleSlides = 1;
65    }
66
67    //set options based on slider type
68    if (slideOptions > 0) {
69        if (slideOptions == 4) {
70            pager = true;
71            touchEnabled = false;
72            autoControls = false;
73            stopAutoOnClick = false;
74        }
75        if (slideOptions == 14) {
76            mode = 'horizontal';
77            moveSlides = 1;
78            pager = false;
79            controls = true;
80            slideWidth = 600;
81            slideMargin = 20;
82            numberOfVisibleSlides = 2;
83            if (windowWidth < 1201) {
84                numberOfVisibleSlides = 1;
85                touchEnabled = true;
86                slideWidth = 1200;
87            }
88        }
89    }
90
91    //set options based on slider type > multi slide type, make sure to enable slideWith etc
92    if (slideOptions > 0) {
93        if (slideOptions == 5) {
94            pager = true;
95            touchEnabled = true;
96            autoControls = false;
97            stopAutoOnClick = false;
98            mode = 'horizontal';
99            slideWidth = 600;
100        }
101        if (slideOptions == 7) {
102            slideWidth = 400;
103            slideMargin = 20;
104            numberOfVisibleSlides = 3;
105            //console.log(windowWidth);
106            if (windowWidth < 768) {
107                numberOfVisibleSlides = 1;
108            }
109            slideTime = 12000;
110            mode = 'horizontal';
111            controls = true;
112        }
113        // hashtag slider
114        if (slideOptions == 13) {
115            slideWidth = 300;
116            slideMargin = 20;
117            numberOfVisibleSlides = 4;
118            if (windowWidth < 993) {
119                numberOfVisibleSlides = 2;
120                touchEnabled = true;
121            }
122            if (windowWidth < 768) {
123                numberOfVisibleSlides = 1;
124                touchEnabled = true;
125            }
126            mode = 'horizontal';
127            controls = true;
128            moveSlides = 1;
129            pager = true;
130        }
131
132        // hashtag ad slider
133        if (slideOptions == 14) {
134            mode = 'horizontal';
135            controls = true;
136            moveSlides = 1;
137            pager = true;
138            if (windowWidth < 993) {
139                touchEnabled = true;
140            }
141        }
142    }
143
144    // remove auto and controls when only 1 image
145    if (slides < 2) {
146        auto = false;
147        controls = false;
148        pager = false;
149    }
150
151    return {
152        controls: controls,
153        captions: captions,
154        auto: auto,
155        autoControls: autoControls,
156        pager: pager,
157        touchEnabled: touchEnabled,
158        oneToOneTouch: oneToOneTouch,
159        speed: speed,
160        pause: slideTime,
161        nextText: '<i class="icon icon-right-open"></i>',
162        prevText: '<i class="icon icon-left-open"></i>',
163        slideWidth: slideWidth,
164        shrinkItems: true,
165        minSlides: numberOfVisibleSlides,
166        maxSlides: numberOfVisibleSlides,
167        slideMargin: slideMargin,
168        mode: mode,
169        moveSlides: moveSlides,
170        useCSS: useCSS
171    };
172}
173
174// load bxSliders
175let jsk_sliders = [];
176
177function loadSliders(mode) {
178
179    // if sliders have already been loaded
180    if (mode) {
181        // wait a bit for possible image reloads
182        setTimeout(function () {
183            //console.log('reloading: '+jsk_sliders.length);
184            let i;
185            for (i = 0; i < jsk_sliders.length; i++) {
186                const slides = jsk_sliders[i][0]['childElementCount'];
187                const slideOptions = jsk_sliders[i][0]['dataset']['type'];
188                const slideTime = jsk_sliders[i][0]['dataset']['slidetime'];
189                const config = buildSliderConfiguration(slides, slideOptions, slideTime);
190                jsk_sliders[i].redrawSlider(config);
191            }
192        }, 1000);
193    }
194
195    // first load
196    else {
197        $('header .slider, main .slider, .frame-media-310 .ce-gallery, .news-list-20').each(function () {
198            const slides = $('div', this).length;
199            const slideOptions = ($(this).attr('data-type')) ? $(this).attr('data-type') : 1;
200            const slideTime = $(this).attr('data-slidetime');
201            const config = buildSliderConfiguration(slides, slideOptions, slideTime);
202            // save to sliders[] array for future reference
203            const sliderIndex = jsk_sliders.push($(this).bxSlider(config)) - 1;
204            $(this).attr('data-slider-id', sliderIndex);
205        });
206    }
207    //console.log(jsk_sliders);
208}
209
210// mobile menu
211function sidrMenu() {
212    $('.page-nav-trigger').sidr({
213        name: 'sidr-menu',
214        source: '#sidrnav',
215        renaming: false,
216        onOpen: function () {
217            $('.sidr .close').show('slow');
218            let i = 0;
219            $('.sidr-inner > ul > li').each(function () {
220                $(this).addClass('animate fadeInUp delay-' + i);
221                i++;
222            });
223        },
224        onClose: function () {
225            let i = 0;
226            $('.sidr-inner > ul > li').each(function () {
227                $(this).removeClass('animate fadeInUp delay-' + i);
228                i++;
229            });
230        },
231    });
232
233    // submenus openable
234    $('.sidr-inner li').each(
235        function (intIndex) {
236            const this_li = this;
237            const sub_menu = $(this_li).children('ul');
238
239            if (!sub_menu.length) return true;
240
241            $($('a', this_li)[0]).prepend('<div class="has-sub"><div class="sub-inner"><i class="icon-angle-right"></div></div>')
242            $($('a .has-sub', this_li)[0]).bind(
243                'click', function () {
244
245                    if (sub_menu.is(':hidden')) {
246                        sub_menu.slideDown('fast');
247                        $('i', this).removeClass('icon-angle-down').addClass('icon-angle-up active');
248                        const parent = $(this).parent().parent();
249                        let i = 0;
250                        $('li', parent).each(function () {
251                            $(this).addClass('animate fadeInUp delay-' + i);
252                            i++;
253                        });
254                    } else {
255                        sub_menu.slideUp('fast');
256                        $('i', this).removeClass('icon-angle-up active').addClass('icon-angle-down');
257                        const parent = $(this).parent().parent();
258                        let i = 0;
259                        $('li', parent).each(function () {
260                            $(this).removeClass('animate fadeInUp delay-' + i);
261                            i++;
262                        });
263                    }
264                    return false;
265                }
266            );
267        }
268    );
269    $('.close-nav').on({
270        mouseenter: function () {
271            $('i', this).addClass('animate-spin');
272
273        },
274        mouseleave: function () {
275            $('i', this).removeClass('animate-spin');
276        }
277    });
278    $('.page-container, .close-nav').on('click', function () {
279        $.sidr('close', 'sidr-menu');
280    });
281}
282
283// is in viewport?
284function isInViewport(elem) {
285    const elemTop = elem.offsetTop;
286    const elemBottom = elemTop + elem.offsetHeight;
287    const viewportTop = window.scrollY;
288    const viewportBottom = viewportTop + window.innerHeight;
289    return elemBottom > viewportTop && elemTop < viewportBottom;
290}
291
292// add touchswipe to lightbox
293(function () {
294    const magnificPopup = $.magnificPopup.instance;
295    $('a.opener, a.ligthbox').on('click', function (e) {
296        setTimeout(function () {
297            $('.mfp-container').swipe({
298                swipeLeft: function (event, direction, distance, duration, fingerCount) {
299                    //console.log("swipe right");
300                    magnificPopup.next();
301                },
302                swipeRight: function (event, direction, distance, duration, fingerCount) {
303                    //console.log("swipe left");
304                    magnificPopup.prev();
305                },
306            });
307        }, 500);
308    });
309}).call(this);
310
311$(document).ready(function () {
312    // javascript is enabled
313    const body = $('body');
314    body.removeClass('no-js');
315
316    // initiate mobile menu
317    sidrMenu();
318
319    // sidenav
320    $('#sidenav').prepend('<li id="close-sidenav"><i class="icon-cancel-circled"></i></li>')
321    body.on('click', '#close-sidenav', function () {
322        $('#sidenav').removeClass('hovered');
323    })
324
325    $('#sidenav a').on('click', function (e) {
326        if (!$(this).closest('#sidenav').hasClass('hovered')) {
327            if (parseFloat($('.page-nav-trigger').css('opacity')) > 0) {
328                // navigation has opacity greater than 0, so we want to prevent the default a behaviour
329                e.preventDefault();
330            }
331        }
332    });
333
334    body.on('click', '#sidenav:not(.hovered)', function () {
335        $(this).addClass('hovered');
336    });
337
338    // initialise superfish plugin
339    if ($('.sf-menu').length) {
340        const supernav = $('.sf-menu').superfish({
341            cssArrows: false,
342            animation: {opacity: 'show', height: 'show'},
343        });
344    }
345
346    // hide empty lines
347    // For each <p> tag on the page
348    $('p').each(function () {
349        // If the <p> tag only contains &nbsp;
350        if ($(this).html().trim() === '&nbsp;') {
351            // Hide it
352            $(this).addClass('filler');
353        }
354    });
355
356    // load slider(s)
357    $(document).on('lazybeforeunveil', function (e) {
358        // hacky but works - better way (including the optional 100% of the slider)?
359        // var id = e.target.id;
360        // var el = document.getElementById(id);
361        // using closests because the value needs adjustment when slide contains more than just images
362        setTimeout(function () {
363            //alert(e.target.height);
364            let slideHeight = $(e.target).closest('.slides').height();
365            //console.log(slideHeight);
366            if (slideHeight && slideHeight > 50) {
367                $(e.target).closest('.bx-viewport').height(slideHeight);
368            }
369        }, 250);
370    });
371
372    loadSliders(0);
373
374    // initiate lightbox
375    $('.ce-gallery, .news-img-wrap, header .slider, main .slider').each(function () {
376        $(this).magnificPopup({
377            tLoading: '',
378            callbacks: {
379                imageLoadComplete: function () {
380                    const self = this;
381                    setTimeout(function () {
382                        self.wrap.addClass('mfp-image-loaded');
383                    }, 16);
384                },
385                close: function () {
386                    this.wrap.removeClass('mfp-image-loaded');
387                },
388            },
389            delegate: 'a.lightbox',
390            disableOn: function () {
391                return $(window).width() >= 400;
392            },
393            type: 'image',
394            removalDelay: 100,
395            mainClass: 'mfp-fade mfp-zoom-in',
396            gallery: {
397                enabled: true,
398                navigateByImgClick: true,
399                arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
400                tPrev: 'Vorheriges (linke Pfeiltaste)',
401                tNext: 'Nächtes (rechte Pfeiltaste)',
402                tCounter: '<span class="mfp-counter">%curr%&nbsp;von&nbsp;%total%</span>'
403            },
404            retina: {
405                // TODO RETINA!
406            }
407        });
408    });
409    // accordion
410    $('.frame-310 > header').on('click', function () {
411        $('.ce-textpic', $(this).parent()).slideToggle();
412        $(this).toggleClass('act-acc');
413    });
414
415    // add TOPLINK to page after scroll
416    body.append('<a id="top" title="zum Seitenanfang" href="#top"><i class="icon-up-open"></i></a>');
417
418    $(window).scroll(function () {
419        if ($(this).scrollTop()) {
420            $('#top:hidden').stop(true, true).fadeIn();
421            body.addClass('scrolled');
422        } else {
423            $('#top').stop(true, true).fadeOut();
424            body.removeClass('scrolled');
425        }
426    });
427
428    $(document).on('click', 'a[href="#top"]', function () {
429        $('html, body').animate({scrollTop: 0}, 'slow');
430        return false;
431    });
432});
433
434$(window).on('load', function () {
435    $('body').removeClass('preload');
436    setTimeout(function () {
437        /* do not scroll to content on mobile
438        if (parseFloat($('.page-nav-trigger').css('opacity')) < 1) {
439            $('html, body').animate({
440                scrollTop: $('#content').offset().top - 100
441            }, 1000);
442        }*/
443        if ($('.pid-1').length < 1) {
444            $('html, body').animate({
445                scrollTop: $('#content').offset().top - 100
446            }, 1000);
447        }
448    }, 500);
449
450    // firefox bug
451    if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
452        setTimeout(function () {
453            loadSliders(1);
454        }, 100);
455    }
456
457});
458
459$(document).ready(function () {
460    let previousWidth = $(window).width(); // Store the initial window width
461    let timer;
462    const threshold = 50; // Minimum change in width to trigger the function
463
464    // Create the event listener function
465    const listener = function (event) {
466        clearTimeout(timer);
467
468        // Use a timeout to delay the function execution
469        timer = setTimeout(() => {
470            const currentWidth = $(window).width();
471            const widthDifference = Math.abs(currentWidth - previousWidth);
472
473            if (widthDifference >= threshold) {
474                loadSliders(1);
475            }
476
477            previousWidth = currentWidth;
478        }, 200); // Adjust the delay as per your requirement
479    };
480
481    // Add the event listener with passive option
482    window.addEventListener('orientationchange', listener, {passive: true});
483    window.addEventListener('resize', listener, {passive: true});
484});

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.