PageSourceSearch

https://www.etl-unternehmensberatung.de/wp-content/themes/etl-theme/js/etl-customs.js?20250620130000

js etl-unternehmensberatung.de collected 2026-10-08 07:45:30 UTC 14,685 bytes, 384 lines download raw bytes

1jQuery(function($) {
2/* Datei für allgemeingültige Script-Dateien. Z.B.: Hamburger-Nav */
3
4
5
6$(document).ready(function () {
7
8    /**
9     * Move Breadcrumb to Position if Header
10     */
11    if($('.etlBCWrapper').length) {
12        if(window.location.hash == "#bc") {
13            $('.etlBCWrapper').removeClass('d-none');
14        }
15        let bc = $('.etlBCWrapper');
16        
17        if(!$('main>article').length) {
18            $('.bcApplic').prepend(bc).css({'marginTop':'200px'}); //reduce layout shift in Aktuelles
19        }
20        $('.bcApplic').prepend(bc);
21        $('.bcNP').addClass('pt-4');
22    }
23
24    if(window.location.hash == "#lang") {
25        $('.langSwtich').removeClass('d-none').addClass('d-inline-flex');
26    }
27
28
29    if(!$('.podcastForm').length) {
30        $('a[href^="#"]').on('click',function(e) {
31            if(!$(this).hasClass('krTabNavItem')) {
32                e.preventDefault();
33                var target = this.hash;
34                if($(target).length) { //'if' added roha002 2023-10-17
35                    //var $target = $(target); //deakt roha002 2023-10-17
36                    $('html, body').stop().animate({
37                     'scrollTop': $(target).offset().top //mod roha002 2023-10-17 (was $target instead of $(target))
38                    }, 900, 'swing', function () {
39                     window.location.hash = target;
40                    });
41                }
42            }
43        });
44    }
45    if($('.hero-etl-full').length) {
46        $('.langSwtich').addClass('greenSwitch');
47    } 
48    if(!$('.hero-etl-header').length)  {
49        $('.langSwtich').addClass('greySwitch');
50    }
51
52    if($('.hero-etl-header').length && !$('.no-hero-header').length) {
53        $('body').addClass('header-transparent');
54
55
56
57        if($('.breadcrumbs').length)  {
58        $('.breadcrumbs').find('.breadcrumbsContainer').addClass('activated');
59        let brCrumbs = $('.breadcrumbs').html();
60        $('.breadcrumbs').remove();
61        $('.hero-etl-header').after(brCrumbs);
62    }
63    }   
64
65    $('.md-parent').each(function() {
66        if(!$(this).find('.sub-menu-link').length) {
67            $(this).removeClass('md-parent');
68        }
69      
70    });
71
72
73    $('.mainnavitem').on('click', function(e) {
74        if(!$(this).hasClass('md-parent')){
75        $('.mainnavitem').removeClass('opened');
76        $(this).addClass('opened');
77        $('#masthead').removeClass('nav-opened');
78        $('.md-sub-menu').slideUp('fast');
79    } else {
80        e.preventDefault();
81        var navHeight = $('#masthead').outerHeight();
82        var OffsetTop = $(window).scrollTop();
83        console.log(OffsetTop)
84        var navMD = $(this).find('.sub-menu-link').attr('data-navmodal-id');
85        if(!$(this).hasClass('opened')) {
86        $('.md-parent').removeClass('opened');
87        $('.md-sub-menu').slideUp('fast');
88        $(this).addClass('opened');
89        $('#masthead').addClass('nav-opened');
90        if($('header').hasClass('nav-down')) {
91        $('#'+navMD+'').css('top', navHeight+'px' );
92        }
93        else {
94            $('#'+navMD+'').css('top', navHeight-OffsetTop+'px' );
95        }
96        $('#'+navMD+'').slideDown('fast');
97        }
98        else {
99            $(this).removeClass('opened');
100            $('#masthead').removeClass('nav-opened');
101            $('#'+navMD+'').slideUp('fast');
102        }
103    }
104    });
105
106
107/* SWITCH TOGGLE ON CLICK */
108$('.mobile-md-container a').click(function(){
109    $('#menuToggle').toggleClass('active');
110    $('.mobile-md-container').toggleClass('active');
111    $('body').toggleClass('modal-open');
112});
113
114	$('#menuToggle').click(function(){
115        $(this).toggleClass('active');
116        $('.mobile-md-container').toggleClass('active');
117        $('body').toggleClass('modal-open');
118    });
119    
120        // INITALIZE AOS PER CLASS //
121        function ismatch(str) {
122            var ret = null;
123            var tab = ['data-aos_', 'data-aos-delay_', 'data-aos-duration_', 'data-aos-easing_'];
124            Object.values(tab).forEach(function (value) {
125                if (String(str).match(value)) {
126                    ret = str.split('_');
127                    return false;
128                }
129            });
130            return ret;
131        }
132        $('.etl-aos').each(function () {
133            var $this = $(this);
134            var tab = $this.attr('class').split(' ');
135            var keep;
136            Object.values(tab).forEach(function (item) {
137                var ello = ismatch(item)
138                if (ello !== null)
139                    $this.attr(ello[0], ello[1]);
140            });
141    
142        });
143    
144    
145        if ($('.etl-aos').length) {
146            AOS.init({
147                // once: true
148                duration: 800,
149            });
150        }
151    
152    framebuster();
153    window.setTimeout(function () {
154        checkBorlandSkips();
155    },1500);
156    
157    fixEditorAccordion();
158    barrierefreiheitsstaerkungsgesetz2025();
159});
160// Hide Header on on scroll down
161var didScroll;
162var lastScrollTop = 0;
163var delta = 0;
164
165$(window).scroll(function(event){
166
167    var st = $(this).scrollTop();
168
169if (st > 200 ) {
170
171        $('header').addClass('nav-down');
172    }
173    else {
174        $('.md-parent').removeClass('opened');
175        $('#masthead').removeClass('nav-opened');
176        $('.md-sub-menu').slideUp('fast');
177        $('header').removeClass('nav-down');
178    }
179    lastScrollTop = st;    });
180
181
182
183});
184
185function framebuster() {
186    if(top.frames.length!=0){
187        if(top.location!=self.document.location){
188            top.location=self.document.location;
189        }
190    }
191}
192
193function checkBorlandSkips() {
194    $('body').find('script,iframe,object,img').each(function(){
195        
196        var skipId=$(this).data("borlabs-script-blocker-id");
197        if(typeof skipId!=="undefined" && skipId!=""){
198            var skipSrc=$(this).data("borlabs-script-blocker-src");
199            //console.log(skipId + ': ' + skipSrc);
200            if(typeof skipSrc==="undefined"){
201                var skipSrc='';
202            }else{
203                if(skipSrc.slice(-3)=='.js'){
204                    var skipMsg='<div class="hinweisVideoDSGVO mb-3"><h4>Ooops</h4><p>Das externe Skript "' + skipSrc + '" kann aufgrund getroffener Datenschutzentscheidungen (Consent Manager) hier nicht eingebettet ausgeführt werden.<br /><a href="javascript:cookieHinweis.show();">Bitte ändern Sie Ihre Datenschutzentscheidung</a> und laden die Seite neu.</p></div>';
205                }else{
206                    var skipMsg='<div class="hinweisVideoDSGVO mb-3"><h4>Ooops</h4><p>Dieser externe Inhalt "' + skipId + '" kann aufgrund getroffener Datenschutzentscheidungen (Consent Manager) hier nicht eingebettet angezeigt werden.<br /><a href="javascript:cookieHinweis.show();">Bitte ändern Sie Ihre Datenschutzentscheidung</a> und laden die Seite neu.</p><p><a href="' + skipSrc + '" target="_blank" class="btn-teal-primary mb-0">Diesen Inhalt direkt aufrufen</a><br /><br />(Öffnet neues Fenster mit dem Link ' + skipSrc + ', dadurch wird Ihre IP-Adresse mglw. übermittelt und falls Sie dort ein Profil besitzen und bereits eingeloggt sind, der Besuch unserer Seite mit Ihrem Profil verknüpft.)</p></div>';                    
207                }
208            }
209            if(skipSrc==''){
210                var skipMsg='<div class="hinweisVideoDSGVO mb-3">Externer Inhalt aufgrund getroffener Datenschutzentscheidungen (Consent Manager) geblockt.<br /><a href="javascript:cookieHinweis.show();">Bitte ändern Sie Ihre Datenschutzentscheidung</a> und laden die Seite neu.</p></div>';
211            }
212            $(this).parent().append(skipMsg);
213        }
214        
215    });
216}
217
218var cookieHinweis = {
219    show: function() {
220        window.BorlabsCookie.openCookiePreference();
221    }
222};
223
224function fixEditorAccordion() {
225    var _ts = Date.now();
226
227    $('.mceTmpl .accordeon-item').each(function () {
228        var $item = $(this);
229        var $header = $item.find('.accordeon-header').first();
230
231        // Neue A11y-Akkordeons nicht anfassen.
232        if ($header.find('button').length) {
233            return;
234        }
235
236        $header.attr('data-bs-target', '#acc_' + _ts);
237        $item.find('>div+div').attr('id', 'acc_' + _ts);
238
239        _ts++;
240    });
241}
242
243//Borlabs und Hubspot
244function waitForElm(selector) {
245    console.log('HS waiting');
246    return new Promise(resolve => {
247        if (document.querySelector(selector)) {
248            return resolve(document.querySelector(selector));
249        }
250
251        const observer = new MutationObserver(mutations => {
252            if (document.querySelector(selector)) {
253                resolve(document.querySelector(selector));
254                observer.disconnect();
255            }
256        });
257
258        setTimeout(function() {
259            var _hsp = window._hsp = window._hsp || [];
260            _hsp.push(['showBanner']);
261        },250);
262
263        observer.observe(document.body, {
264            childList: true,
265            subtree: true
266        });
267    });
268}
269	
270function handleConsent(analyticsConsent, marketingConsent){   
271    console.log('HS adjusting'); 
272    if((analyticsConsent && jQuery('#hs-category-toggle-analytics').prop('checked')!=true)||(!analyticsConsent && jQuery('#hs-category-toggle-analytics').prop('checked')==true)){
273        acceptButton=document.querySelector('#hs-category-toggle-analytics');
274        acceptButton && acceptButton.click();
275    }
276    if((marketingConsent && jQuery('#hs-category-toggle-advertisement').prop('checked')!=true)||(!marketingConsent && jQuery('#hs-category-toggle-advertisement').prop('checked')==true)){
277        acceptButton=document.querySelector('#hs-category-toggle-advertisement');
278        acceptButton && acceptButton.click();
279    }
280    if((marketingConsent && jQuery('#hs-category-toggle-functionality').prop('checked')!=true)||(!marketingConsent && jQuery('#hs-category-toggle-functionality').prop('checked')==true)){
281        acceptButton=document.querySelector('#hs-category-toggle-functionality');
282        acceptButton && acceptButton.click();
283    }
284
285    acceptButton=document.querySelector('#hs-modal-save-settings');
286    acceptButton && acceptButton.click();  
287}
288	
289function initDeutschlandkarte(){
290    if(jQuery('#DeutschlandkarteObject').length>0){
291        var a=document.getElementById("DeutschlandkarteObject");
292        if(typeof a === "undefined"||a===null){
293            console.log('re-trying to init map svg');
294            window.setTimeout(initDeutschlandkarte,250);
295        }
296        //a.addEventListener("load",function(){
297            var svgDoc=a.contentDocument;
298            if(typeof svgDoc === "undefined"||svgDoc===null){
299                console.log('re-trying to init map svg');
300                window.setTimeout(initDeutschlandkarte,250);
301            }
302            try {
303                var DSVG=svgDoc.getElementById("DeutschlandkarteSVG");
304            }catch{
305                console.log('re-trying to init map svg');
306                window.setTimeout(initDeutschlandkarte,250);
307            }
308            jQuery(DSVG).find('>path')
309            .each(function(t){
310                $(this)
311                .on('click', function(c){
312                    clickDeutschlandkarte($(this).attr('id'));
313                })
314                .html('<title>' + $(this).attr('id') + '</title>');
315            })
316            .on('mouseover', function(e){
317                jQuery(this).css({'fill':primary_color,'stroke':primary_color});
318            })
319            .on('mouseout', function(f){
320                jQuery(this).css({'fill':'#eee','stroke':'#777'});
321            })
322            .css({'cursor':'pointer'});
323        //}, false);    
324        jQuery('#DeutschlandkarteHTML').remove();
325        jQuery('#DeutschlandkarteMODAL').remove();
326        jQuery('.modal-backdrop').remove();
327        jQuery('#DeutschlandkarteObject').parent().append('<div id="DeutschlandkarteHTML"></div>');
328        jQuery('.standorteuebersichtWrapper').hide();
329    }else{
330        console.log('re-trying to init map svg');
331        window.setTimeout(initDeutschlandkarte,250);
332    }
333}
334
335function clickDeutschlandkarte(bula){
336    let dlkcontent='<p>Keine Standorte gefunden. Bitte versuchen Sie ein anderes Bundesland zu wählen.</p>';
337    if(jQuery('.row.standortliste #stAccordion').length>0){
338        jQuery('.row.standortliste #stAccordion>.accordeon-item')
339        .each(function(e){
340            if($(this).find('>.accordeon-header').html()==bula){
341                //dlkcontent=$(this).find('div[data-parent="#stAccordion"]').html();
342                dlkcontent=$(this).find('div[data-bs-parent="#stAccordion"]').html();
343            }
344        });
345    }
346    jQuery('#DeutschlandkarteMODAL').remove();
347    jQuery('.modal-backdrop').remove();
348    jQuery('#DeutschlandkarteHTML').html('<div class="modal fade" id="DeutschlandkarteMODAL" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" style="z-index:2000;">  <div class="modal-dialog modal-lg" role="document">    <div class="modal-content">      <div class="modal-header" style="border-bottom:none;">        <h5 class="modal-title" id="exampleModalLabel">'+bula+'</h5>        <button type="button" class="close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close">          <span aria-hidden="true">&times;</span>        </button>      </div>      <div class="modal-body">'+dlkcontent+'      </div>      <div class="modal-footer">        <a href="#" class="btn-teal-outline" data-dismiss="modal" data-bs-dismiss="modal">schließen</a>      </div>    </div>  </div></div>');
349    //jQuery('#DeutschlandkarteMODAL').modal();
350    const DeutschlandkarteMODAL = new bootstrap.Modal('#DeutschlandkarteMODAL'); DeutschlandkarteMODAL.show();
351}
352
353function barrierefreiheitsstaerkungsgesetz2025(){
354    jQuery.getScript("https://services.etl-web.de/barrierefreiheit/load.js?"+Math.floor(Math.random() * 3600), function( data, textStatus, jqxhr ) { });
355}
356
357
358// ich fange #xyz URLs ab und scrolle dann verzögert sanft auf den Anker
359document.addEventListener("DOMContentLoaded", () => {
360  const hash = window.location.hash;
361  if (!hash) return;
362
363  const targetId = decodeURIComponent(hash.substring(1));
364  const target = document.getElementById(targetId);
365  if (!target) return;
366
367  const offset = 100; // sticky nav bar
368  const delay = 1000; // Verzögerung in Millisekunden
369
370  // Browser-Standardsprung verhindern
371  history.replaceState(null, "", window.location.pathname + window.location.search);
372
373  setTimeout(() => {
374    const targetPosition =
375      target.getBoundingClientRect().top + window.pageYOffset - offset;
376
377    window.scrollTo({
378      top: targetPosition,
379      behavior: "smooth"
380    });
381
382    history.replaceState(null, "", "#" + encodeURIComponent(targetId));
383  }, delay);
384});

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.