PageSourceSearch

https://www.dbb.de/_assets/d57d955b9e53c734140a859f0960631c/Js/basic/dbb-ms.js?1759669674

js dbb.de collected 2026-10-02 03:37:42 UTC 17,966 bytes, 557 lines download raw bytes

1$(function() {
2    /* adaptResultHeightContact(); */
3    callStaticFunctions();
4    callDynamicFunctions();
5
6});
7
8$(window).on('load', function() {
9    var hash = window.location.hash.substring(1);
10    if(hash !== ''){
11        scrollToId(hash);
12    }
13    callDynamicFunctions();
14});
15
16$(window).on('resize orientationchange', function() {
17
18    setTimeout(function(){
19        callDynamicFunctions();
20    }, 100);
21
22});
23
24$(document).on('click touchstart', 'header .top-icons.desktop a[class^="icon-"]', function(e){
25
26    var parentWrap = $(this).closest('header .top-icons.desktop'),
27        ajaxContentArea = $(this).closest('header .top-icons').find('.top-icons-ajax-content'),
28        closeButton = ajaxContentArea.find('span.close'),
29        lastClickIndex = parseInt(typeof ajaxContentArea.attr('data-click-index') === 'undefined' ? -1 : ajaxContentArea.attr('data-click-index')),
30        currentClickIndex = $(this).index(),
31        currentRequestUrl = $(this).attr('data-ajax-url'),
32        lastVisibleIcon = $(this).closest('header .top-icons').find('a[class^="icon"]:visible:last'),
33        ajaxContentAreaTopMargin = ((lastVisibleIcon.offset().top + lastVisibleIcon.outerHeight(true) - $(window).scrollTop())*-1) - 30;
34
35    ajaxContentArea.css('margin-top', ajaxContentAreaTopMargin);
36
37    if(!ajaxContentArea.is(':visible')){
38        ajaxContentArea.find('.inner-wrap').hide();
39    }
40    else{
41        ajaxContentArea.find('.inner-wrap').fadeOut();
42        closeButton.fadeOut();
43        ajaxContentArea.removeAttr('data-click-index');
44        parentWrap.find('a[class^="icon-"]').removeClass('current');
45    }
46
47    ajaxContentArea.animate({width: 'toggle', 'opacity': 1}, 350, 'swing', function () {
48        if(lastClickIndex !== currentClickIndex){
49            ajaxContentArea.attr('data-click-index', currentClickIndex);
50            parentWrap.find('a[class^="icon-"]').removeClass('current');
51            parentWrap.find('a[class^="icon-"]:eq('+currentClickIndex+')').addClass('current');
52            loadAjaxContent(currentRequestUrl, ajaxContentArea.find('.inner-wrap'));
53            closeButton.fadeIn();
54            if(!ajaxContentArea.is(':visible'))
55                ajaxContentArea.animate({width: 'toggle', 'opacity': 1}, 350, 'swing');
56        }
57
58        if(!ajaxContentArea.is(':visible'))
59            ajaxContentArea.find('.inner-wrap').html('');
60    });
61
62    e.preventDefault();
63});
64
65$(document).on('click', function(e){
66    var topIcons = $('header .top-icons.desktop');
67    if (!topIcons.is(e.target) && topIcons.has(e.target).length === 0 && topIcons.find('header .top-icons-ajax-content').is(':visible')){
68        topIcons.find('header .top-icons-ajax-content .close').trigger('click');
69    }
70});
71
72$(document).on('click', 'header .top-icons.desktop span.close', function(e){
73    var parentWrap = $(this).closest('header .top-icons.desktop'),
74        ajaxContentArea = $(this).closest('header .top-icons').find('.top-icons-ajax-content'),
75        closeButton = ajaxContentArea.find('span.close');
76    ajaxContentArea.find('.inner-wrap').fadeOut();
77    closeButton.fadeOut();
78    ajaxContentArea.animate({width: 'toggle', 'opacity': 1}, 350, 'swing', function () {
79        ajaxContentArea.removeAttr('data-click-index');
80        ajaxContentArea.find('.inner-wrap').html('');
81        parentWrap.find('a[class^="icon-"]').removeClass('current');
82    });
83    e.preventDefault();
84});
85
86$(document).on('click', 'a', function(e){
87    if($(this).hasClass('word') || $(this).hasClass('excel') || $(this).hasClass('zip'))
88        return confirm('Wollen Sie diese Datei herunterladen?');
89
90    if (typeof $(this).attr('href') !== 'undefined'
91        && $(this).attr('href').indexOf('#') !== -1
92        && window.location.pathname === getUrlPathname($(this).attr('href'))
93    ) {
94        var anchor_array = $(this).attr('href').split('#');
95        if (anchor_array.length
96            && anchor_array[1]
97            && ( $('#'+anchor_array[1])[0] || $('a[name="'+anchor_array[1]+'"]')[0])
98        ) {
99            scrollToId(anchor_array[1]);
100            e.preventDefault();
101        }
102    }
103});
104
105
106/* Show Link page top */
107/*
108$(document).on('scroll', function() {
109    var y = $(this).scrollTop();
110    if (y > 100) {
111        $('a.page-top').fadeIn();
112    } else {
113        $('a.page-top').fadeOut();
114    }
115});
116*/
117
118var callStaticFunctions = function(){
119
120    setLightGallery();
121    setAnchorOnLoad();
122    setPageToTopLink();
123    setAffix();
124    resizeIframe();
125    showYoutube();
126
127};
128
129var callDynamicFunctions = function(){
130
131    setTopIconClass();
132    adaptAside();
133    setVideoProportions();
134    setAffix();
135    resizeIframe();
136    resizeToolIframe();
137
138};
139
140var showYoutube = function(){
141    let dbbAllowYoutube = readCookie('dbb_cookie_allow_youtube');
142
143    if(dbbAllowYoutube === '1') {
144        $('[data-yt-src]').each(function () {
145            var currentLink = $(this),
146                currentPoster = currentLink.attr('data-yt-poster');
147
148            if (typeof currentPoster !== 'undefined' && currentPoster !== '') {
149                currentLink.attr({
150                    'data-poster': currentPoster
151                });
152            }
153
154            currentLink.attr({
155                'data-src': currentLink.attr('data-yt-src')
156            });
157        });
158    }
159};
160
161var setAffix = function(){
162    var header = $('header'),
163        headerHeight = header.outerHeight(true);
164
165    if(typeof header.attr('data-height') === 'undefined' || header.attr('data-height') !== headerHeight)
166        header.attr('data-height', headerHeight);
167
168    if(window.innerWidth >= 768) {
169        $(document).unbind('scroll');
170
171        $(document).on('scroll', function () {
172
173            var y = $(this).scrollTop();
174            if (y > (header.attr('data-height')-78)) {
175                header.addClass('fixed').css('top', '-' + (header.attr('data-height')-78) + 'px');
176                $('body').css('padding-top', header.attr('data-height') + 'px');
177            } else {
178                header.removeClass('fixed').removeAttr('style');
179                $('body').css('padding-top', 0);
180            }
181
182        });
183    }
184    else{
185        header.removeClass('fixed').removeAttr('style');
186        $('body').css('padding-top', 0);
187    }
188};
189
190var setPageToTopLink = function(){
191    var page_to_top_link = $('a.page-top');
192    page_to_top_link.hide();
193
194    document.addEventListener('scroll', function () {
195        var y = $(this).scrollTop();
196        if (y > 100) {
197            page_to_top_link.fadeIn();
198        } else {
199            page_to_top_link.fadeOut();
200        }
201    });
202    page_to_top_link.click(function(e){
203        $("html, body").animate({ scrollTop: 0 });
204        e.preventDefault();
205    });
206};
207
208/* jump to correct anchor on load for firefox and mobile browser */
209var setAnchorOnLoad = function(){
210    if(location.hash && !location.hash.includes('no-scroll')){
211        var elId = location.hash.replace('#','');
212        var scrollToEl = document.getElementById(elId);
213        if(scrollToEl){
214            scrollToEl.scrollIntoView(true);
215        }
216    }
217};
218
219var getUrlPathname = function(url){
220    /* <summary>Parses the domain/host from a given url.</summary> */
221    var a = document.createElement("a");
222    a.href = url;
223
224    /* window.location.pathname */
225    if(url.substring(0, 1) === '#'){
226        return a.pathname;
227    }
228
229    /* Handle chrome which will default to domain where script is called from if invalid */
230    return url.indexOf(a.pathname) !== -1 ? a.pathname : '';
231};
232
233var scrollToId = function(cobjname){
234    if(!cobjname.includes('no-scroll')) {
235
236        var cobj = $('#' + cobjname)[0] ? $('#' + cobjname) : ($('a[name="' + cobjname + '"]')[0] ? $('a[name="' + cobjname + '"]') : null);
237
238        var body_padding = parseInt($('body').css('padding-top') ? $('body').css('padding-top') : 0);
239        if (typeof cobj !== 'undefined') {
240            $('html,body').animate({scrollTop: (cobj.offset().top - body_padding)}, 'slow', '', function () {
241                body_padding = parseInt($('body').css('padding-top') ? $('body').css('padding-top') : 0);
242
243                if (body_padding > 0)
244                    $('html,body').animate({scrollTop: (cobj.offset().top - body_padding)}, 'slow');
245
246            });
247        }
248
249    }
250
251};
252
253var adaptAside = function(){
254    if(window.innerWidth>991) {
255        $('main>.container>section[class^=aside-]').wrapAll('<aside class="col-aside" />');
256    }
257    else{
258        if(typeof $('aside').attr('class') !== 'undefined'){
259            $('section[class^=aside-]').unwrap();
260        }
261    }
262};
263/*
264var adaptDceMember = function(){
265
266    var contentContainer = $('main>.container section.col-content'),
267        contentContainerElements = $('main>.container section.col-content >'),
268        dceMemberFirst = contentContainer.find('.dce-member:first'),
269        dceMemberLast = contentContainer.find('.dce-member:last');
270
271    if(dceMemberFirst.parent().attr('class') !== 'dce-member-all'){
272        var matched = false;
273        var elementIndex = [];
274        contentContainerElements.each(function(){
275            if(dceMemberFirst.html() === $(this).html() || matched){
276                elementIndex.push($(this).index());
277                matched = true;
278                if(dceMemberLast.html() === $(this).html())
279                    matched = false;
280            }
281        });
282        var selectorString = '';
283        for(var i = 0; i < elementIndex.length; i++){
284            selectorString += (i>0 ? ', ' : '')+'>:eq('+elementIndex[i]+')';
285        }
286        contentContainer.find(selectorString).wrapAll('<div class="dce-member-all" />');
287    }
288
289};
290*/
291var loadAjaxContent = function(url, area){
292    $.ajax({
293        url: url,
294        success: function(result){
295            area.html(result);
296        },
297        complete: function(){
298            area.fadeIn();
299        }
300    });
301};
302
303var setTopIconClass = function(){
304    var topIcons = $('header .top-icons');
305    if(window.innerWidth>767) {
306        topIcons.find('a.icon-search').removeAttr('style');
307        topIcons.addClass('desktop').removeClass('mobile');
308    }
309    else{
310        topIcons.addClass('mobile').removeClass('desktop');
311    }
312};
313
314var setLightGallery = function(){
315    if($.isFunction($.fn.lightGallery)) {
316
317        $('.dce-member a.lg, a.lightbox').on('click', function(e) {
318
319            $(this).lightGallery({
320                download: false,
321                counter: false,
322                dynamic: true,
323                dynamicEl: [{
324                    "src": $(this).attr('href'),
325                    'thumb': $(this).find('img').attr('src'),
326                    'subHtml': (typeof $(this).find('img').attr('title') !== 'undefined' ? '<h4 class="lg-title">'+$(this).find('img').attr('title')+'</h4>' : '')+(typeof $(this).attr('data-sub-html') !== 'undefined' ? $(this).attr('data-sub-html') : '')
327                }]
328            });
329            e.preventDefault();
330
331        });
332
333        $('figure.image, figure.video').lightGallery({
334            selector: 'a.lg',
335            download: false,
336            counter: false,
337            hideBarsDelay: 4000,
338            autoplayFirstVideo: false,
339            youtubeThumbSize: 'default'
340        });
341
342        /* modal iframe */
343        $('.t3modal, .icon-send').on('click', function (e) {
344            $(this).lightGallery({
345                download: false,
346                counter: false,
347                zoom: false,
348                fullScreen: false,
349                hideBarsDelay: 4000,
350                autoplayFirstVideo: false,
351                youtubeThumbSize: 'default',
352                iframeMaxWidth: '90%',
353                dynamic: true,
354                dynamicEl: [{
355                    'src': $(this).attr('href'),
356                    'iframe': 'true'
357                }]
358            });
359            e.preventDefault();
360        });
361    }
362};
363
364$(document).on('click', 'a[class*="popup-"]', function(e){
365    var current_url = $(this).attr('href');
366    if($(this).hasClass('popup-pdf-h')) popup('pdf_h', current_url);
367    if($(this).hasClass('popup-pdf-q')) popup('pdf_q', current_url);
368    if($(this).hasClass('popup-h')) popup('popup_h', current_url);
369    if($(this).hasClass('popup-q')) popup('popup_q', current_url);
370    if($(this).hasClass('popup-blank')) popup('popup_h', current_url);
371    if($(this).hasClass('popup-epaper')) popup('pdf_q', current_url);
372    e.preventDefault();
373});
374
375$(document).on('click', 'button.dbb-allow-youtube', function(e){
376    let domain = window.location.hostname.replace("www.", ".");
377    createCookie('dbb_cookie_allow_youtube', 1, 182, domain);
378    location.reload();
379    e.preventDefault();
380});
381
382$(document).on('click', '.dbb-disallow-youtube', function(e){
383    let domain = window.location.hostname.replace("www.", ".");
384    createCookie('dbb_cookie_allow_youtube', "", -1, domain);
385    alert('Die Anzeige von Youtube-Videos wurde abgelehnt.');
386    location.reload();
387    e.preventDefault();
388});
389
390$(document).on('click', '.short-profile a.icon-solution-close', function(e){
391    $(this).toggleClass('icon-solution-open');
392    $(this).closest('.link-icon').parent().find('.solution').slideToggle();
393    e.preventDefault();
394});
395
396var createCookie = function(name, value, days, domain) {
397    var expires;
398
399    if (days) {
400        var date = new Date();
401        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
402        expires = "; expires=" + date.toGMTString();
403    } else {
404        expires = "";
405    }
406    document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/" + ((domain)?"; domain="+domain:"");
407};
408
409var readCookie = function(name) {
410    var nameEQ = encodeURIComponent(name) + "=";
411    var ca = document.cookie.split(';');
412    for (var i = 0; i < ca.length; i++) {
413        var c = ca[i];
414        while (c.charAt(0) === ' ')
415            c = c.substring(1, c.length);
416        if (c.indexOf(nameEQ) === 0)
417            return decodeURIComponent(c.substring(nameEQ.length, c.length));
418    }
419    return null;
420};
421
422var setVideoProportions = function(){
423    var video_iframes = $('.video-wrap iframe');
424    video_iframes.removeAttr('style');
425
426    video_iframes.each(function(){
427        var video_iframe = $(this),
428            parent_video_div_width = parseInt(video_iframe.parent().width());
429
430        /* 16:9 ratio */
431        video_iframe_height = parent_video_div_width/1.7777777;
432        video_iframe.css({
433            'width': parent_video_div_width,
434            'height': video_iframe_height,
435            'border': 'none'
436        });
437    });
438
439    var video_iframes2 = $('.video-wrap-2 iframe');
440    video_iframes2.removeAttr('style');
441
442    video_iframes2.each(function(){
443        var video_iframe = $(this),
444            parent_video_div_width = parseInt(video_iframe.parent().width());
445        /* 16:9 ratio + Höhenkorrektur */
446        video_iframe_height = parent_video_div_width/1.7777777 + parseInt(80)+'px';
447        video_iframe.css({
448            'width': parent_video_div_width,
449            'height': video_iframe_height,
450            'border': 'none'
451        });
452    });
453};
454
455var resizeToolIframe = function() {
456
457    $(window).on("message", function(e) {
458
459        if(typeof e.originalEvent.data != 'undefined' && typeof e.originalEvent.data.height != 'undefined') {
460            var heightArray = e.originalEvent.data.height.split('|'),
461                iframePid = parseInt(heightArray[0]),
462                currentIframe = $('iframe[data-tool-pid="' + iframePid + '"]'),
463                currentHeight = parseInt(heightArray[1]);
464
465            if (typeof currentIframe !== 'undefined') {
466                currentIframe.css("height", currentHeight + "px");
467                currentIframe.attr('data-current-height', currentHeight);
468                currentIframe.css('margin', '');
469            }
470            if (typeof currentIframe !== 'undefined' && iframePid === 0) {
471                currentIframe = $('iframe#tool-iframe');
472                currentIframe.css("height", currentHeight + "px");
473                currentIframe.attr('data-current-height', currentHeight);
474                /*currentIframe.css('margin', '0');*/
475            }
476        }
477    });
478
479};
480
481var resizeIframe = function() {
482
483    $(window).on("message", function(e) {
484
485        var currentIframe = $('#imscms'),
486            oldHeight = typeof currentIframe.attr('data-current-height') === 'undefined' ? 0 : parseInt(currentIframe.attr('data-current-height')),
487            currentHeight = parseInt(e.originalEvent.data) + 20;
488
489        currentIframe.css("height", currentHeight + "px");
490        if(currentHeight > 0)
491            currentIframe.attr('data-current-height', currentHeight);
492
493        if(currentHeight > 0 && oldHeight > 0 && oldHeight !== currentHeight){
494            scrollToId('imscms');
495        }
496
497    });
498
499};
500
501var popup = function(type, url){
502    var wi=0, he=0;
503    switch (type){
504        case 'pdf_h':
505            wi=900;
506            he=900;
507            break;
508        case 'pdf_q':
509            wi=1100;
510            he=800;
511            break;
512        case 'popup_q':
513            wi=1100;
514            he=800;
515            break;
516        case 'popup_h':
517            wi=900;
518            he=900;
519            break;
520        case 'blank':
521            wi=1019;
522            he=768;
523            break;
524        case 'print':
525            wi=850;
526            he=768;
527            break;
528    }
529    var screenX = 30,
530        screenY = 30,
531        left = 30,
532        top = 30;
533    if(type==='blank'){
534        screenX = 2;
535        screenY = 2;
536        left = 5;
537        top = 5;
538    }
539
540    open(url,"_blank","status=0,toolbar=0,scrollbars=1,resizable=1,width="+wi+",height="+he+",screenX="+screenX+",screenY="+screenY+",left="+left+",top="+top+"");
541    return false;
542};
543
544
545/*
546function printArea(printArea) {
547    var printContents = document.getElementById(printArea).innerHTML;
548    var originalContents = document.body.innerHTML;
549
550    document.body.innerHTML = printContents;
551
552    window.print();
553
554    document.body.innerHTML = originalContents;
555}
556
557 */

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.