PageSourceSearch

https://www.hamburger-tennisverband.de/frontend/js/init.js?v=8f502a0cf6c0ff6898826876ce388c92

js hamburger-tennisverband.de collected 2026-09-25 07:36:43 UTC 37,682 bytes, 1,144 lines download raw bytes

1$.ajaxSetup({
2    headers: {
3        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
4    }
5});
6
7$.fn.kcs_init = function () {
8    return this.each(function () {
9
10        $(".owl-carousel.sponsoren").each(function () {
11            const $carousel = $(this);
12
13            $carousel.owlCarousel({
14                loop: false,
15                nav: false,
16                dots: false,
17                autoplay: false,
18                margin: 90,
19                responsive: {
20                    0: { items: 2 },
21                    576: { items: 3 },
22                    768: { items: 4 },
23                    992: { items: 5 },
24                    1200: { items: 6 }
25                }
26            });
27
28            $(window).on('load resize', function () {
29                const $stage = $('.owl-carousel.sponsoren .owl-stage');
30                const width = $stage.width();// echte Breite des doppelten Sets
31                const speed = Math.floor(width / 90);// Sekunden für eine komplette Runde (anpassen!)
32
33                // Neuen Animationsstil setzen
34                $stage.css({
35                    'animation': `scroll-left ${speed}s linear infinite`
36                });
37
38                // Keyframes dynamisch einfügen (pixelgenau!)
39                const styleId = 'dynamic-scroll-keyframes';
40                $('#' + styleId).remove(); // Falls schon vorhanden
41
42                $('<style>')
43                    .attr('id', styleId)
44                    .html(`
45                            @keyframes scroll-left {
46                                0%   { transform: translateX(0); }
47                                100% { transform: translateX(-${width / 2}px); }
48                            }
49                        `)
50                    .appendTo('head');
51            });
52
53            let stopped_sponsoren = false;
54
55            $carousel.on("click mousedown touchstart pointerdown", function () {
56                if (stopped_sponsoren) return;
57                stopped_sponsoren = true;
58
59                const $stage = $carousel.find(".owl-stage");
60
61                // 1) Animation stoppen
62                $stage.css({
63                    'animation': 'none',
64                    'transform': 'translateX(0)' // aktuelle Position kann auch gespeichert werden
65                });
66
67                // 2) Stage horizontal scrollbar machen
68                $carousel.css({
69                    'overflow-x': 'auto',
70                    'cursor': 'grab',
71                    '-webkit-overflow-scrolling': 'touch'
72                });
73
74                // 3) Stage richtig sichtbar halten
75                $stage.css({
76                    'display': 'flex'
77                });
78            });
79
80        });
81
82
83        $(this).find(".owl-carousel.partners").each(function () {
84            const $carousel = $(this);
85            $carousel.owlCarousel({
86                loop: false,        // WICHTIG: wir loopen ja per CSS
87                nav: false,
88                dots: false,
89                autoplay: false,    // ANIMATION KOMMT NICHT MEHR VON OWL
90                margin: 90,
91                responsive: {
92                    0: { items: 2 },
93                    576: { items: 3 },
94                    768: { items: 4 },
95                    992: { items: 5 },
96                    1200: { items: 6 }
97                }
98            });
99
100            $(window).on('load resize', function () {
101                const $stage = $('.owl-carousel.partners .owl-stage');
102                const width = $stage.width();// echte Breite des doppelten Sets
103                const speed = Math.floor(width / 90);// Sekunden für eine komplette Runde (anpassen!)
104
105                // Neuen Animationsstil setzen
106                $stage.css({
107                    'animation': `scroll-left ${speed}s linear infinite`
108                });
109
110                // Keyframes dynamisch einfügen (pixelgenau!)
111                const styleId = 'dynamic-scroll-keyframes';
112                $('#' + styleId).remove(); // Falls schon vorhanden
113
114                $('<style>')
115                    .attr('id', styleId)
116                    .html(`
117                            @keyframes scroll-left {
118                                0%   { transform: translateX(0); }
119                                100% { transform: translateX(-${width / 2}px); }
120                            }
121                        `)
122                    .appendTo('head');
123            });
124
125            let stopped_partner = false;
126
127            $carousel.on("click mousedown touchstart pointerdown", function () {
128                if (stopped_partner) return;
129                stopped_partner = true;
130
131                const $stage = $carousel.find(".owl-stage");
132
133                // 1) Animation stoppen
134                $stage.css({
135                    'animation': 'none',
136                    'transform': 'translateX(0)' // aktuelle Position kann auch gespeichert werden
137                });
138
139                // 2) Stage horizontal scrollbar machen
140                $carousel.css({
141                    'overflow-x': 'auto',
142                    'cursor': 'grab',
143                    '-webkit-overflow-scrolling': 'touch'
144                });
145
146                // 3) Stage richtig sichtbar halten
147                $stage.css({
148                    'display': 'flex'
149                });
150            });
151
152        });
153
154    });
155};
156
157
158navi = {};
159navi.init = function () {
160    width = $(window).width();
161};
162
163$(document).ready(function () {
164    $(document).kcs_init();
165    navi.init();
166});
167
168$(window).on("resize", function () {
169    navi.init();
170});
171
172
173$(document).on('click', 'a.news-more-btn', function (event) {
174    event.preventDefault();  // Verhindert das Standardverhalten    
175    var index = $('#hidden_index_field').val();
176    var json_data = { index: index };
177    var path = '/verband/aktuelles';//window.location.pathname;
178    phery.remote('load_more_news', json_data, { "href": path + "/ajx" });
179});
180
181$(document).on('click', 'a.load_more_inter_news', function (event) {
182    event.preventDefault();  // Verhindert das Standardverhalten    
183    var index = $('#hidden_index_field').val();
184    var json_data = { index: index, perma: window.location.pathname };
185    var path = '/verband/aktuelles';//window.location.pathname;
186    phery.remote('load_more_inter_news', json_data, { "href": path + "/ajx" });
187});
188
189function init_content_pages($images) {
190    window_width = $(window).width();
191    $images.each(function () {
192        $image = $(this);
193        if (window_width < 768) {
194            width = this.naturalWidth;
195            height = this.naturalHeight;
196            ratio = width / height;
197            if (ratio >= 2.0) {
198                $image.css('display', 'block');
199                $image.css('width', '100%');
200                /*$image.css('max-width', '200px');*/
201                $image.css('margin-left', 'auto');
202                $image.css('margin-right', 'auto');
203            } else {
204                $image.css({
205                    /*'width': 'auto',*/
206                    'max-width': 'calc(100% + 0px)',//500px
207                    'margin-left': '',
208                    'margin-right': ''
209                });
210            }
211        } else {
212
213            $image.css({ 'max-width': '80%' });
214
215            /*
216            $image.css({
217                'width': '100%',
218                'max-width': '100%',
219                'margin-left': '',
220                'margin-right': ''
221            });*/
222        }
223    });
224}
225
226
227$(window).resize(function () {
228    init_content_pages($('.content-text-bild-element .left-image'));
229    init_content_pages($('.content-text-bild-element .right-image'));
230});
231
232$(document).ready(function () {
233    init_content_pages($('.content-text-bild-element .left-image'));
234    init_content_pages($('.content-text-bild-element .right-image'));
235});
236
237
238/**** Präsidium ****/
239
240praesidium = {};
241
242praesidium.hasWrappedText = function (el) {
243    const range = document.createRange();
244    range.selectNodeContents(el);
245    const rects = range.getClientRects();
246    return rects.length > 1;
247};
248praesidium.selected_rollen = [];
249
250praesidium.load_data = function () {
251    console.log();
252
253    var json_data = { indices: praesidium.selected_rollen };
254    var path = window.location.pathname;
255    phery.remote('filter_praesidium', json_data, { "href": path + "/ajx" });
256};
257
258praesidium.initUI = function () {
259
260
261    width = $(window).width();
262    if ((width >= 0) && (width < 992)) {
263        $('#praesidium .person-image img.medium').each(function () {
264            if ($('#praesidium .person-image img.big').length) {
265                height = $('#praesidium .person-image img.big').first().height();
266                $(this).css('height', height + 'px');
267                $(this).css('max-height', height + 'px');
268            }
269        });
270    } else if ((width >= 992) && (width < 1200)) {
271        $('#praesidium .person-image img.medium').removeAttr("style");
272
273    }
274
275
276
277    setTimeout(function () {
278        document.querySelectorAll('#praesidium .rolle').forEach(el => {
279            if (praesidium.hasWrappedText(el)) {
280                el.style.lineHeight = '23px';
281                el.style.width = 'max-content';
282                el.style.maxWidth = 'calc(100% - 60px)';
283                el.style.paddingTop = '10px';
284                el.style.paddingBottom = '10px';
285            }
286        });
287    }, 250);
288
289
290    $('#praesidium .filter-list .rolle').off('click');
291    $('#praesidium .filter-list .rolle').on('click', function () {
292        rolle_id = $(this).data('rolle-id');
293        if (rolle_id == 'all') {
294            $('#praesidium .filter-list .rolle').removeClass('active');
295            $(this).addClass('active');
296            praesidium.selected_rollen = [];
297            praesidium.selected_rollen.push('all');
298        } else {
299            if ($(this).hasClass('active')) {
300                $(this).removeClass('active');
301
302                // Element entfernen
303                array_index = praesidium.selected_rollen.indexOf(rolle_id);
304                if (array_index !== -1) {
305                    praesidium.selected_rollen.splice(array_index, 1);
306                }
307
308                array_index = praesidium.selected_rollen.indexOf('all');
309                if (array_index !== -1) {
310                    praesidium.selected_rollen.splice(array_index, 1);
311                }
312            } else {
313                $("#praesidium .rolle[data-rolle-id='all']").removeClass('active');
314                $('#praesidium .filter-list .rolle').removeClass('active');
315                $(this).addClass('active');
316                praesidium.selected_rollen = [];
317                praesidium.selected_rollen.push(rolle_id);
318
319                array_index = praesidium.selected_rollen.indexOf('all');
320                if (array_index !== -1) {
321                    praesidium.selected_rollen.splice(array_index, 1);
322                }
323            }
324        }
325
326        praesidium.load_data();
327    });
328};
329
330
331/**** Gremium ****/
332
333gremium = {};
334
335gremium.hasWrappedText = function (el) {
336    const range = document.createRange();
337    range.selectNodeContents(el);
338    const rects = range.getClientRects();
339    return rects.length > 1;
340};
341gremium.selected_rollen = [];
342
343gremium.load_data = function () {
344    console.log();
345
346    var json_data = { indices: gremium.selected_rollen };
347    var path = window.location.pathname;
348    phery.remote('filter_gremium', json_data, { "href": path + "/ajx" });
349};
350
351gremium.initUI = function () {
352
353
354    width = $(window).width();
355    if ((width >= 0) && (width < 992)) {
356        $('#gremium .person-image img.medium').each(function () {
357            if ($('#praesidium .person-image img.big').length) {
358                height = $('#praesidium .person-image img.big').first().height();
359                $(this).css('height', height + 'px');
360                $(this).css('max-height', height + 'px');
361            }
362        });
363    } else if ((width >= 992) && (width < 1200)) {
364        $('#gremium .person-image img.medium').removeAttr("style");
365
366    }
367
368    setTimeout(function () {
369        document.querySelectorAll('#praesidium .rolle').forEach(el => {
370            if (gremium.hasWrappedText(el)) {
371                el.style.lineHeight = '23px';
372                el.style.width = 'max-content';
373                el.style.maxWidth = 'calc(100% - 60px)';
374                el.style.paddingTop = '10px';
375                el.style.paddingBottom = '10px';
376            }
377        });
378    }, 250);
379
380
381    $('#gremium .filter-list .rolle').off('click');
382    $('#gremium .filter-list .rolle').on('click', function () {
383        rolle_id = $(this).data('rolle-id');
384        if (rolle_id == 'all') {
385            $('#gremium .filter-list .rolle').removeClass('active');
386            $(this).addClass('active');
387            gremium.selected_rollen = [];
388            gremium.selected_rollen.push('all');
389        } else {
390            if ($(this).hasClass('active')) {
391                $(this).removeClass('active');
392
393                // Element entfernen
394                array_index = gremium.selected_rollen.indexOf(rolle_id);
395                if (array_index !== -1) {
396                    gremium.selected_rollen.splice(array_index, 1);
397                }
398
399                array_index = gremium.selected_rollen.indexOf('all');
400                if (array_index !== -1) {
401                    gremium.selected_rollen.splice(array_index, 1);
402                }
403            } else {
404                $("#gremium .rolle[data-rolle-id='all']").removeClass('active');
405                $(this).addClass('active');
406                gremium.selected_rollen.push(rolle_id);
407
408                array_index = gremium.selected_rollen.indexOf('all');
409                if (array_index !== -1) {
410                    gremium.selected_rollen.splice(array_index, 1);
411                }
412            }
413        }
414
415        gremium.load_data();
416    });
417
418
419    // Optional: Dynamisch aria-expanded setzen für Screenreader (nur für bessere Barrierefreiheit)
420    const checkboxes = document.querySelectorAll('input[type="checkbox"]');
421    checkboxes.forEach(cb => {
422        const label = document.querySelector(`label[for="${cb.id}"]`);
423        cb.addEventListener('change', () => {
424            label.setAttribute('aria-expanded', cb.checked ? 'true' : 'false');
425        });
426    });
427
428};
429verbandhistorie = {};
430
431verbandhistorie.initUI = function () {
432    const $carousel = $('.custom-carousel');
433    const $prev = $('.owl-prev');
434    const $next = $('.owl-next');
435
436    $carousel.owlCarousel({
437        items: 3,
438        margin: 20,
439        loop: false,
440        navi: false,
441        dots: false,
442        center: true,
443        smartSpeed: 800,
444        startPosition: 1, // Wichtig: Start beim Dummy-Element
445    });
446
447    // eigene Buttons mit Owl steuern
448    $prev.click(function () {
449        $carousel.trigger('prev.owl.carousel');
450
451        setTimeout(function () {
452            jahr = $('.owl-item.active.center .item').data('year');
453            $('.text').hide();
454            $('#text_' + jahr).show();
455        }, 250);
456    });
457
458    $next.click(function () {
459        $carousel.trigger('next.owl.carousel');
460
461        setTimeout(function () {
462            jahr = $('.owl-item.active.center .item').data('year');
463            $('.text').hide();
464            $('#text_' + jahr).show();
465        }, 250);
466    });
467
468    function updateNavButtons(event) {
469        var current = event.item.index;
470        var count = event.item.count;
471
472        // Vorher-Navi ausblenden, wenn am Anfang
473        if (current === 1) {
474            $(".owl-prev").hide();
475        } else {
476            $(".owl-prev").show();
477        }
478
479        // Weiter-Navi ausblenden, wenn am Ende
480        console.log(current);
481        if (current === count - 1) {
482            $(".owl-next").hide();
483        } else {
484            $(".owl-next").show();
485        }
486    }
487    // Initial prüfen
488    $carousel.on("initialized.owl.carousel", updateNavButtons);
489
490    // Bei jedem Wechsel prüfen
491    $carousel.on("changed.owl.carousel", updateNavButtons);
492
493
494    $('.text:first').show();
495    $prev.hide();
496
497};
498/**** Geschäftsstelle ****/
499
500geschaeftsstelle = {};
501
502geschaeftsstelle.hasWrappedText = function (el) {
503    const range = document.createRange();
504    range.selectNodeContents(el);
505    const rects = range.getClientRects();
506    return rects.length > 1;
507};
508
509geschaeftsstelle.selected_rollen = [];
510
511geschaeftsstelle.load_data = function () {
512
513    var json_data = { indices: geschaeftsstelle.selected_rollen };
514    var path = window.location.pathname;
515    phery.remote('filter_geschaeftsstelle', json_data, { "href": path + "/ajx" });
516};
517
518geschaeftsstelle.initUI = function () {
519
520};
521
522
523/**** Geschäftsstelle ****/
524
525trainer = {};
526
527trainer.hasWrappedText = function (el) {
528    const range = document.createRange();
529    range.selectNodeContents(el);
530    const rects = range.getClientRects();
531    return rects.length > 1;
532};
533
534trainer.selected_rollen = [];
535
536trainer.load_data = function () {
537
538    var json_data = { indices: trainer.selected_rollen };
539    var path = window.location.pathname;
540    phery.remote('filter_geschaeftsstelle', json_data, { "href": path + "/ajx" });
541};
542
543trainer.initUI = function () {
544
545    width = $(window).width();
546    if ((width >= 0) && (width < 992)) {
547        $('#trainer .person-image img.medium').each(function () {
548            if ($('#praesidium .person-image img.big').length) {
549                height = $('#praesidium .person-image img.big').first().height();
550                $(this).css('height', height + 'px');
551                $(this).css('max-height', height + 'px');
552            }
553        });
554    } else if ((width >= 992) && (width < 1200)) {
555        $('#trainer .person-image img.medium').removeAttr("style");
556
557    }
558    setTimeout(function () {
559        document.querySelectorAll('#geschaeftsstelle .rolle').forEach(el => {
560            if (trainer.hasWrappedText(el)) {
561                el.style.lineHeight = '23px';
562                el.style.width = 'max-content';
563                el.style.maxWidth = 'calc(100% - 60px)';
564                el.style.paddingTop = '10px';
565                el.style.paddingBottom = '10px';
566            }
567        });
568    }, 250);
569
570
571    $('#trainer .filter-list .rolle').off('click');
572    $('#trainer .filter-list .rolle').on('click', function () {
573        rolle_id = $(this).data('rolle-id');
574        if (rolle_id == 'all') {
575            $('#trainer .filter-list .rolle').removeClass('active');
576            $(this).addClass('active');
577            trainer.selected_rollen = [];
578            trainer.selected_rollen.push('all');
579        } else {
580            if ($(this).hasClass('active')) {
581                $(this).removeClass('active');
582
583                // Element entfernen
584                array_index = trainer.selected_rollen.indexOf(rolle_id);
585                if (array_index !== -1) {
586                    trainer.selected_rollen.splice(array_index, 1);
587                }
588
589                array_index = trainer.selected_rollen.indexOf('all');
590                if (array_index !== -1) {
591                    trainer.selected_rollen.splice(array_index, 1);
592                }
593            } else {
594                $("#trainer .rolle[data-rolle-id='all']").removeClass('active');
595                $(this).addClass('active');
596                trainer.selected_rollen.push(rolle_id);
597
598                array_index = trainer.selected_rollen.indexOf('all');
599                if (array_index !== -1) {
600                    trainer.selected_rollen.splice(array_index, 1);
601                }
602            }
603        }
604
605        trainer.load_data();
606    });
607};
608
609
610navigation = {};
611navigation.initUI = function () {
612
613    $('a.dritte_ebene_dropdown').off('touchstart');
614    $('a.dritte_ebene_dropdown').on("touchstart", function (event) {
615        event.stopPropagation();
616        event.preventDefault();
617        $element = $(this).next('ul.third-dropdown-menu');
618        if ($element.hasClass('show')) {
619            $element.removeClass('show');
620            $(this).removeClass('show');
621        } else {
622            $element.addClass('show');
623            $(this).addClass('show');
624        }
625    });
626
627    $('a.dritte_ebene_dropdown').off('click');
628    $('a.dritte_ebene_dropdown').on('click', function (event) {
629        event.stopPropagation();
630        event.preventDefault();
631        $element = $(this).next('ul.third-dropdown-menu');
632        if ($element.hasClass('show')) {
633            $element.removeClass('show');
634            $(this).removeClass('show');
635        } else {
636            $element.addClass('show');
637            $(this).addClass('show');
638        }
639    });
640};
641
642
643faq = {};
644
645faq.initUi = function () {
646
647    $(".accordion-item .accordion-content").on('click', function (event) {
648        event.stopPropagation();
649    });
650
651    $(".accordion-item .accordion-label").on('click', function (event) {
652        event.stopPropagation();
653    });
654
655    $(".accordion-item").on("click", function (e) {
656        const item = $(this).get(0);
657        const content = $(this).find('.accordion-content').get(0);
658        if (item.classList.contains('active')) {
659            content.style.maxHeight = null;
660            item.classList.remove('active');
661        } else {
662            document.querySelectorAll('.accordion-item').forEach(i => {
663                i.classList.remove('active');
664                i.querySelector('.accordion-content').style.maxHeight = null;
665            });
666            item.classList.add('active');
667        }
668    });
669};
670
671termine = {};
672termine.selected_rollen = [];
673termine.load_data = function () {
674    var json_data = { tags: termine.selected_rollen };
675    var path = window.location.pathname;
676    phery.remote('termine_filter', json_data, { "href": path + "/ajx" });
677};
678
679termine.initUI = function () {
680    $('#termine .filter-list .single-click').off('click');
681    $('#termine .filter-list .single-click').on('click', function () {
682        rolle_id = $(this).data('rolle-id');
683        if (rolle_id == 'All') {
684            $('#termine .filter-list .rolle').removeClass('active');
685            $(this).addClass('active');
686            termine.selected_rollen = [];
687            termine.selected_rollen.push('All');
688        } else {
689            $('#termine .filter-list .rolle[data-rolle-id="All"]').removeClass('active');
690
691            if ($(this).hasClass('active')) {
692                $(this).removeClass('active');
693
694                // Element entfernen
695                array_index = termine.selected_rollen.indexOf(rolle_id);
696                if (array_index !== -1) {
697                    termine.selected_rollen.splice(array_index, 1);
698                }
699
700                array_index = termine.selected_rollen.indexOf('all');
701                if (array_index !== -1) {
702                    termine.selected_rollen.splice(array_index, 1);
703                }
704            } else {
705                $("#termine .single-click[data-rolle-id='all']").removeClass('active');
706                $('#termine .filter-list .single-click').removeClass('active');
707                $(this).addClass('active');
708                termine.selected_rollen = [];
709                termine.selected_rollen.push(rolle_id);
710
711                array_index = termine.selected_rollen.indexOf('all');
712                if (array_index !== -1) {
713                    termine.selected_rollen.splice(array_index, 1);
714                }
715            }
716        }
717
718        termine.load_data();
719    });
720};
721
722
723seminarkalender = {};
724seminarkalender.selected_rollen = [];
725seminarkalender.load_data = function () {
726    var json_data = { tags: seminarkalender.selected_rollen };
727    var path = window.location.pathname;
728    phery.remote('seminarkalender_filter', json_data, { "href": path + "/ajx" });
729};
730
731seminarkalender.initUI = function () {
732    $('#seminarkalender .filter-list .single-click').off('click');
733    $('#seminarkalender .filter-list .single-click').on('click', function () {
734        rolle_id = $(this).data('rolle-id');
735        if (rolle_id == 'All') {
736            $('#seminarkalender .filter-list .rolle').removeClass('active');
737            $(this).addClass('active');
738            seminarkalender.selected_rollen = [];
739            seminarkalender.selected_rollen.push('All');
740        } else {
741            $('#seminarkalender .filter-list .rolle[data-rolle-id="All"]').removeClass('active');
742
743            if ($(this).hasClass('active')) {
744                $(this).removeClass('active');
745
746                // Element entfernen
747                array_index = seminarkalender.selected_rollen.indexOf(rolle_id);
748                if (array_index !== -1) {
749                    seminarkalender.selected_rollen.splice(array_index, 1);
750                }
751
752                array_index = seminarkalender.selected_rollen.indexOf('all');
753                if (array_index !== -1) {
754                    seminarkalender.selected_rollen.splice(array_index, 1);
755                }
756            } else {
757                $("#seminarkalender .single-click[data-rolle-id='all']").removeClass('active');
758                $('#seminarkalender .filter-list .single-click').removeClass('active');
759                $(this).addClass('active');
760                seminarkalender.selected_rollen = [];
761                seminarkalender.selected_rollen.push(rolle_id);
762
763                array_index = seminarkalender.selected_rollen.indexOf('all');
764                if (array_index !== -1) {
765                    seminarkalender.selected_rollen.splice(array_index, 1);
766                }
767            }
768        }
769
770        seminarkalender.load_data();
771    });
772};
773
774aktuelles = {};
775aktuelles.selected_rollen = [];
776
777aktuelles.load_data = function () {
778    var json_data = { tags: aktuelles.selected_rollen };
779    var path = window.location.pathname;
780    phery.remote('aktuelles_filter', json_data, { "href": path + "/ajx" });
781};
782
783aktuelles.initUI = function () {
784    $('#aktuelles .filter-list .single-click').off('click');
785    $('#aktuelles .filter-list .single-click').on('click', function () {
786        rolle_id = $(this).data('rolle-id');
787        if (rolle_id == 'All') {
788            $('#aktuelles .filter-list .rolle').removeClass('active');
789            $(this).addClass('active');
790            aktuelles.selected_rollen = [];
791            aktuelles.selected_rollen.push('All');
792        } else {
793            $('#aktuelles .filter-list .rolle[data-rolle-id="All"]').removeClass('active');
794
795            if ($(this).hasClass('active')) {
796                $(this).removeClass('active');
797
798                // Element entfernen
799                array_index = aktuelles.selected_rollen.indexOf(rolle_id);
800                if (array_index !== -1) {
801                    aktuelles.selected_rollen.splice(array_index, 1);
802                }
803
804                array_index = aktuelles.selected_rollen.indexOf('all');
805                if (array_index !== -1) {
806                    aktuelles.selected_rollen.splice(array_index, 1);
807                }
808            } else {
809                $("#aktuelles .single-click[data-rolle-id='all']").removeClass('active');
810                $('#aktuelles .filter-list .single-click').removeClass('active');
811                $(this).addClass('active');
812                aktuelles.selected_rollen = [];
813                aktuelles.selected_rollen.push(rolle_id);
814
815                array_index = aktuelles.selected_rollen.indexOf('all');
816                if (array_index !== -1) {
817                    aktuelles.selected_rollen.splice(array_index, 1);
818                }
819            }
820        }
821
822        aktuelles.load_data();
823    });
824
825    $('#aktuelles .filter-list .single-select').off('click');
826    $('#aktuelles .filter-list .single-select').on('click', function () {
827        value = $(this).attr('aria-expanded');
828        if (value == 'true') {
829            $(this).attr('aria-expanded', false);
830            $(this).css('border-bottom-left-radius', '25px');
831            $(this).css('border-bottom-right-radius', '25px');
832            $(this).find('.single-select-dropdown').hide();
833        } else {
834            $(this).attr('aria-expanded', true);
835            $(this).css('border-bottom-left-radius', '0px');
836            $(this).css('border-bottom-right-radius', '0px');
837            $(this).find('.single-select-dropdown').show();
838        }
839
840    });
841
842
843    $('#aktuelles .filter-list .single-select .year').off('click');
844    $('#aktuelles .filter-list .single-select .year').on('click', function () {
845        year = $(this).data('value');
846        array_index = aktuelles.selected_rollen.findIndex(item => item.includes("year-"));
847        if (array_index !== -1) {
848            aktuelles.selected_rollen.splice(array_index, 1);
849        }
850
851        aktuelles.selected_rollen.push('year-' + year);
852        aktuelles.load_data();
853        if (year == '0') {
854            year = '';
855            $(this).parent().parent().removeClass('active');
856        } else {
857            $(this).parent().parent().addClass('active');
858        }
859        $(this).parent().parent().find('.caption-text').html('Nach Jahren: ' + year);
860
861    });
862
863
864    $('#aktuelles .filter-list .single-select .inter').off('click');
865    $('#aktuelles .filter-list .single-select .inter').on('click', function () {
866        value = $(this).data('value');
867        array_index = aktuelles.selected_rollen.findIndex(item => item.includes("inter-"));
868        if (array_index !== -1) {
869            aktuelles.selected_rollen.splice(array_index, 1);
870        }
871
872        aktuelles.selected_rollen.push('inter-' + value);
873        aktuelles.load_data();
874        if (value == '0') {
875            value = '';
876            $(this).parent().parent().removeClass('active');
877        } else {
878            $(this).parent().parent().addClass('active');
879        }
880        string_value = value.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
881        $(this).parent().parent().find('.caption-text').html('Turnier: ' + string_value);
882
883    });
884
885};
886
887function header_icon_same() {
888    if (window.innerWidth >= 992) {
889        element = document.querySelector('#logo-htv-navi');
890        rect = element.getBoundingClientRect();
891        absoluteX = rect.left + window.scrollX;
892        $('#headline-header-text').css('margin-left', absoluteX + 'px');
893    }
894}
895
896function navi_init() {
897    width = $(window).width();
898
899    $('.navbar-toggler').on('click', function () {
900        isExpanded = $('.navbar-toggler').attr('aria-expanded');
901        if (isExpanded == "true") {
902            document.body.classList.add('no-scroll');
903        } else {
904            document.body.classList.remove('no-scroll');
905        }
906    });
907
908
909    $div = $("header.page-header #header-main .navbar .navbar-collapse .navbar-new-nav li.nav-item.dropdown a.nav-link.dropdown-toggle");
910    if (width > 992) {
911        $div.each(function (index, element) {
912            single_height = 24;
913            if (element.clientHeight > single_height) {
914                /*$(this).css('background-color','red');*/
915                $(this).css('max-width', '200px');
916            }
917        });
918    }
919}
920/*
921function autoResizeIframe(iframe) {
922    if (iframe && iframe.contentWindow && iframe.contentWindow.document.body) {
923        iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
924    }
925}
926
927window.addEventListener('load', () => {
928    document.querySelectorAll('iframe.iframe1000, iframe.iframe500').forEach(iframe => {
929        iframe.addEventListener('load', () => autoResizeIframe(iframe));
930    });
931});
932*/
933
934more_text = {};
935more_text.initUI = function () {
936    $("a.more-text").on('click', function () {
937        text = $(this).html();
938        if (text == 'weniger') {
939            $(this).html('mehr');
940            $(this).parent().find(".part-text").show();
941            $(this).parent().find(".full-text").hide();
942        } else {
943            $(this).parent().find(".part-text").hide();
944            $(this).parent().find(".full-text").show();
945            $(this).html('weniger');
946        }
947    });
948};
949
950$(document).ready(function () {
951    praesidium.initUI();
952    gremium.initUI();
953    geschaeftsstelle.initUI();
954    trainer.initUI();
955    navigation.initUI();
956    faq.initUi();
957    aktuelles.initUI();
958    termine.initUI();
959    seminarkalender.initUI();
960    verbandhistorie.initUI();
961    more_text.initUI();
962    header_icon_same();
963    navi_init();
964});
965
966$(window).resize(function () {
967    praesidium.initUI();
968    gremium.initUI();
969    geschaeftsstelle.initUI();
970    trainer.initUI();
971    aktuelles.initUI();
972    termine.initUI();
973    seminarkalender.initUI();
974    header_icon_same();
975    navi_init();
976});
977
978
979function backIfFromHTV() {
980    const ref = document.referrer;
981
982    if (ref && ref.includes('hamburger-tennisverband.de')) {
983        history.back();
984        return false; // verhindert normalen Link
985    }
986
987    if (ref && ref.includes('localhost:8080')) {
988        history.back();
989        return false; // verhindert normalen Link
990    }
991
992    // Fallback: normale Weiterleitung
993    return true;
994}
995
996$(document).ready(function () {
997    $('.vereins-map').hide();
998    // url = "https://www.google.com/maps/d/embed?mid=17acK981pHB1c1HY_14lDmwkq_dkawB8&ehbc=2E312F";
999    url = "https://www.google.com/maps/d/embed?mid=1VJMfEvcFKizd3GuPxIXkVlRXTwbVqAQ&ehbc=2E312F&noprof=1";
1000    $('.two-clicks .cookie-btn').off('click');
1001    $('.two-clicks .cookie-btn').on('click', function () {
1002        CookieFirst.openPanel();
1003    });
1004
1005    const cfPoll = setInterval(function () {
1006        if (window.CookieFirst && CookieFirst.consent) {
1007            if (CookieFirst.consent.functional) {
1008                $('.vereins-map').removeClass('content-video-class');
1009                $('.vereins-map').attr('src', url);
1010                $('.vereins-map').css('width', '100%');
1011                $('.vereins-map').show();
1012                $('.two-clicks').hide();
1013                clearInterval(cfPoll);
1014            }
1015        }
1016    }, 200);
1017});
1018
1019
1020
1021turnier_page = {};
1022turnier_page.is_mobile = true;
1023turnier_page.first_time = true;
1024turnier_page.initUi = function () {
1025    $('#turnier-page .sub-content').hide();
1026
1027
1028    $('#turnier-page a.nav-link.turniere_subnavi_element').on('click', function () {
1029        turnier_id = $(this).data('turnier-id');
1030        ref_id = $(this).data('ref-id');
1031        $('.sub-content').hide();
1032        $('.sub-content.page-' + turnier_id + '-' + ref_id).show();
1033        $('a.nav-link.turniere_subnavi_element').each(function () {
1034            link_width = $(this).width();
1035            $(this).next('.underline-element').css('width', link_width);
1036            $(this).next('.underline-element').hide();
1037            $(this).parent().removeClass('aktiv');
1038        });
1039
1040        $(this).next('.underline-element').show();
1041        $(this).parent().addClass('aktiv');
1042
1043        // Mobiles-Menü wieder zu machen wenn man mobil geklickt hat
1044        if (!turnier_page.first_time) {
1045            width = $(window).width();
1046            if ( (width >= 992)){ 
1047                if(turnier_page.is_mobile){
1048                    //alert('mobile');
1049                    $('#turnier-page .navbar-toggler').click();
1050                }else{
1051                    //alert("desktop");
1052                }
1053            } else {
1054                //alert("mobil");
1055                $('#turnier-page .navbar-toggler').click();
1056            }
1057        }
1058        /*
1059        if ($(this).parent().hasClass('aktiv')) {
1060            if (!turnier_page.first_time) {
1061                breite = $(window).width();
1062                if (hasMenuOverflow('#sub-turnier-navi')) {
1063                    alert("desktop");
1064                    $('#turnier-page .navbar-toggler').click();
1065              
1066                }else{
1067                    alert("mobil");
1068                    $('#turnier-page .navbar-toggler').click();
1069                }
1070            }
1071        }
1072        */
1073    });
1074
1075    $('#turnier-page a.nav-link.turniere_subnavi_element').first().click();
1076
1077
1078    $('#turnier-page .navbar-toggler').on('click', function () {
1079
1080        if (turnier_page.first_time) {
1081            $('a.nav-link.turniere_subnavi_element').each(function () {
1082                link_width = $(this).width();
1083                $(this).next('.underline-element').css('width', link_width);
1084                $(this).next('.underline-element').hide();
1085                $(this).parent().removeClass('aktiv');
1086
1087            });
1088
1089            $('#turnier-page a.nav-link.turniere_subnavi_element:first').next('.underline-element').show();
1090            $('#turnier-page a.nav-link.turniere_subnavi_element:first').addClass('aktiv');
1091            turnier_page.first_time = false;
1092        }
1093
1094    });
1095
1096};
1097
1098$(document).ready(function () {
1099    turnier_page.initUi();
1100});
1101
1102
1103
1104
1105
1106function hasMenuOverflow(navSelector = '#sub-turnier-navi') {
1107    const nav = document.querySelector(navSelector);
1108    const ul = nav?.querySelector('ul');
1109
1110    if (!nav || !ul) return false;
1111
1112    return ul.getBoundingClientRect().width > nav.clientWidth;
1113}
1114
1115
1116$(document).ready(function () {
1117    if (hasMenuOverflow('#sub-turnier-navi')) {
1118        $('#sub-turnier-navi').removeClass('navbar-expand-lg');
1119        turnier_page.is_mobile = true;
1120    } else {
1121        $('#sub-turnier-navi').addClass('navbar-expand-lg');
1122        turnier_page.is_mobile = false;
1123    }
1124
1125    $('#turnier-page .navbar .navbar-nav').height('auto');
1126});
1127
1128let resizeTimeout;
1129$(window).resize(function () {
1130    clearTimeout(resizeTimeout);
1131    resizeTimeout = setTimeout(function () {
1132        if (hasMenuOverflow('#sub-turnier-navi')) {
1133            $('#sub-turnier-navi').removeClass('navbar-expand-lg');
1134            $('#turnier-page .navbar .navbar-nav').height('auto');
1135            turnier_page.is_mobile = true;
1136        } else {
1137            $('#sub-turnier-navi').addClass('navbar-expand-lg');
1138            $('#turnier-page .navbar .navbar-nav').height('auto');
1139            turnier_page.is_mobile = false;
1140
1141        }
1142    }, 1000);
1143
1144});

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.