1/* Source common/js/scripts/099_counter.js */ 2 3// NUMBER COUNTER 4// ------------------------------------------------------------------------------------------------- 5 6(function(document) { 7 var CountNumber = function($number) { 8 var _this = this; 9 10 _this.$number = $number; 11 _this.offset = 300; 12 13 _this.already_animated = false; 14 15 _this.duration = 5000; // 10 Sekunden dauer der Animation 16 _this.update = 50; // alle 0,05 Sekunden update im Frontend 17 }; 18 19 CountNumber.prototype = { 20 init: function() { 21 var _this = this; 22 23 window.addEventListener('scroll', _this._animate_number.bind(this)); 24 window.addEventListener('resize', _this._animate_number.bind(this)); 25 26 var $placeholder = _this.$number.nextElementSibling; 27 28 if ($placeholder.classList.contains('number_fix')) { 29 var number = Number($placeholder.innerHTML); 30 $placeholder.innerHTML = _this._commafy(number); 31 } 32 33 _this._animate_number(); 34 }, 35 36 _animate_number: function() { 37 var _this = this, 38 scroll_pos_y = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop, 39 offset = _this.$number.clientHeight - _this.offset, 40 window_height = window.innerHeight, 41 number_pos_y = _this.$number.getBoundingClientRect().top; 42 43 if (scroll_pos_y >= offset 44 && number_pos_y <= window_height 45 && !_this.already_animated) { 46 _this.already_animated = true; 47 _this._calc_number(_this.$number.innerHTML); 48 } 49 }, 50 51 _calc_number: function(end) { 52 var _this = this, 53 start = (end >= 100) ? Math.floor(end / 2) : 1, 54 range = Math.floor(end - start), 55 current = start, 56 update_range = range / _this.duration * _this.update; 57 58 var timer = setInterval(function() { 59 current = current + update_range; 60 61 if (current >= end) { 62 current = Math.abs(end); 63 window.clearInterval(timer); 64 } 65 66 _this.$number.innerHTML = _this._commafy(Math.abs(Math.floor(current))); 67 68 }, _this.update); 69 }, 70 71 _commafy: function(num) { 72 var _this = this, 73 str = num.toString().split('.'); 74 75 if (str[0].length >= 4) { 76 str[0] = str[0].replace(/(\d)(?=(\d{3})+$)/g, '$1.'); 77 } 78 79 if (str[1] && str[1].length >= 4) { 80 str[1] = str[1].replace(/(\d{3})/g, '$1 '); 81 } 82 return str.join('.'); 83 } 84 85 }; 86 87 var $counters = document.querySelectorAll('[data-counter]'); 88 89 for (var i = 0, $counter; $counter = $counters[i]; i++) { 90 new CountNumber($counter).init(); 91 } 92 93})(document); 94 95/* Source common/js/scripts/20_cookie_banner.js */ 96 97// COOKIE-HINWEIS 98// ------------------------------------------------------------------------------------------------- 99 100(function(document) { 101 var $cookie_banner = document.querySelector('#cookie_banner'), 102 $body = document.querySelector('body'); 103 104 if (!$cookie_banner) { 105 return; 106 } 107 108 var $close = $cookie_banner.querySelector('.close'), 109 now = new Date().getTime(), 110 storage = localStorage.getItem(domain + '_cookie_banner'); 111 112 if (storage === null || now > storage) { 113 $cookie_banner.classList.remove('hideme'); 114 $body.classList.add('cb_visible'); 115 } else { 116 $cookie_banner.classList.add('hideme'); 117 } 118 119 $close.addEventListener('click', function(event) { 120 event.preventDefault(); 121 122 localStorage.setItem(domain + '_cookie_banner', now + 31536000); 123 $cookie_banner.classList.add('hideme'); 124 $body.classList.remove('cb_visible'); 125 }); 126}(document)); 127 128/* Source common/js/scripts/21_cookie_banner_insert_spacing_footer.js */ 129 130// COOKIE-HINWEIS FUSSZEILE VERLÃNGERN 131// ------------------------------------------------------------------------------------------------- 132 133(function(document) { 134 var $cookie_banner = document.querySelector('#cookie_banner'), 135 $footer = document.querySelector('footer'), 136 $close = $cookie_banner.querySelector('.close'), 137 $cookie_spacing; 138 139 if (!$cookie_banner) { 140 return; 141 } 142 143 $close.addEventListener('click', function() { 144 if ($footer) { 145 $footer.removeChild($cookie_spacing); 146 } 147 }); 148 149 if ($footer) { 150 $cookie_spacing = document.createElement('div'); 151 $footer.appendChild($cookie_spacing); 152 $cookie_spacing.style.paddingBottom = $cookie_banner.clientHeight + 'px'; 153 window.addEventListener('resize', function() { 154 $cookie_spacing.style.paddingBottom = $cookie_banner.clientHeight + 'px'; 155 }, false); 156 } 157 158}(document)); 159 160/* Source common/js/scripts/26_seo_highlight_keywords.js */ 161 162// SEO: KEYWORDS IN STEUERNEWS ARTIKEL HERVORHEBEN 163// ------------------------------------------------------------------------------------------------- 164 165(function(document) { 166 var SeoHighlightKeywords = function($article) { 167 var _this = this; 168 169 _this.$article = $article; 170 _this.current_url = document.location.href; 171 _this.previous_url = document.referrer; 172 }; 173 174 SeoHighlightKeywords.prototype = { 175 init: function() { 176 var _this = this; 177 178 if (_this.previous_url.indexOf('/thema/') > -1 && 179 _this.current_url.indexOf('/thema/') === -1) { 180 181 var keyword = _this._get_keyword(), 182 regex = new RegExp('(?![^<]*>)' + '(' + keyword + ')', 'gi'); 183 184 _this.$article.innerHTML = _this.$article.innerHTML.replace(regex , '<span class="highlight_keyword">$1</span>'); 185 } 186 }, 187 188 _get_keyword: function() { 189 var _this = this, 190 keywords = _this.previous_url.split('/thema/'); 191 192 return decodeURIComponent(keywords[1]); 193 } 194 }; 195 196 var $article = document.getElementById('highlight_keywords'); 197 198 if ($article) { // has_seo raus, wenn SEO-Baustein 199 new SeoHighlightKeywords($article).init(); 200 } 201})(document); 202 203/* Source common/js/scripts/45_offcanvas_menu.js */ 204 205// OFFCANVAS MENU 206// ------------------------------------------------------------------------------------------------- 207 208(function(document) { 209 var OffCanvasMenu = function($toggle_offcanvas_menu) { 210 var _this = this, 211 controls; 212 213 controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls'); 214 215 _this.$offcanvas_menu = document.getElementById(controls); 216 _this.$main_menuitems_with_sub_menu = _this.$offcanvas_menu.querySelectorAll('a[aria-controls]'); 217 _this.$focus_elements = _this.$offcanvas_menu.querySelectorAll('a'); 218 _this.focus_element = false;
219 _this.$offcanvas_menu_state = false; 220 221 _this.$key = { 222 'tab' : 9, 223 }; 224 }; 225 226 OffCanvasMenu.prototype = { 227 init: function() { 228 var _this = this; 229 230 _this._init_accessibility(); 231 _this._init_keyboard(); 232 233 for (var j = 0, $main_menuitem_with_sub_menu; $main_menuitem_with_sub_menu = _this.$main_menuitems_with_sub_menu[j]; j++) { 234 $main_menuitem_with_sub_menu.addEventListener('click', 235 _this._on_click_main_menuitem.bind(_this, $main_menuitem_with_sub_menu) 236 ); 237 } 238 }, 239 240 _init_accessibility: function() { 241 var _this = this; 242 243 for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) { 244 $main_menuitem.setAttribute('aria-expanded', $main_menuitem.classList.contains('active')); 245 } 246 }, 247 248 _init_keyboard: function() { 249 var _this = this; 250 251 document.addEventListener('keydown', function(event) { 252 if (!_this.$offcanvas_menu_state.checked) { 253 return; 254 } 255 256 if (event.keyCode === _this.$key.tab) { 257 event.preventDefault(); 258 259 if (event.shiftKey) { 260 _this._focus_element_with_shift_tab_key(event); 261 } 262 else { 263 _this._focus_element_with_tab_key(event); 264 } 265 } 266 }); 267 }, 268 269 _focus_element_with_shift_tab_key: function() { 270 var _this = this; 271 272 _this.tab_index -= 1; 273 274 if (_this.tab_index < 0) { 275 _this.tab_index = _this.$focus_elements.length - 1; 276 } 277 278 for (var i = _this.tab_index, $focus_element; $focus_element = _this.$focus_elements[i]; i--) { 279 if ($focus_element.offsetParent === null || $focus_element.offsetWidth === 0) { 280 _this.tab_index -= 1; 281 continue; 282 } 283 284 _this.$focus_elements[_this.tab_index].focus(); 285 break; 286 } 287 }, 288 289 _focus_element_with_tab_key: function() { 290 var _this = this; 291 292 if (_this.tab_index === _this.$focus_elements.length - 1) { 293 _this.tab_index = 0; 294 } 295 else { 296 _this.tab_index += 1; 297 } 298 299 for (var i = _this.tab_index, $focus_element; $focus_element = _this.$focus_elements[i]; i++) { 300 if ($focus_element.offsetParent === null || $focus_element.offsetWidth === 0) { 301 _this.tab_index += 1; 302 303 if (_this.tab_index > _this.$focus_elements.length - 1) { 304 _this.tab_index = 0; 305 } 306 else { 307 continue; 308 } 309 } 310 311 _this.$focus_elements[_this.tab_index].focus(); 312 break; 313 } 314 }, 315 316 _on_click_main_menuitem: function($main_menuitem, event) { 317 var _this = this; 318 319 event.preventDefault(); 320 321 _this.$main_menuitem = $main_menuitem; 322 323 _this._toggle_sub_menus(); 324 }, 325 326 _toggle_sub_menus: function() { 327 var _this = this; 328 329 for (var i = 0, $main_menuitem; $main_menuitem = _this.$main_menuitems_with_sub_menu[i]; i++) { 330 var is_active_menuitem = _this.$main_menuitem === $main_menuitem, 331 $parent_menuitems = _this._get_parent_menu_elements(); 332 333 if (is_active_menuitem) { 334 _this.sub_menu_is_open = $main_menuitem.getAttribute('aria-expanded') === 'false'; 335 336 $main_menuitem.parentElement.classList.toggle('expanded', _this.sub_menu_is_open); 337 $main_menuitem.setAttribute('aria-expanded', _this.sub_menu_is_open); 338 } 339 else if ($parent_menuitems.indexOf($main_menuitem) !== -1) { // Check parents 340 $main_menuitem.parentElement.classList.toggle('expanded', 'true'); 341 $main_menuitem.parentElement.classList.toggle('expanded', 'true'); 342 $main_menuitem.setAttribute('aria-expanded', 'true'); 343 } 344 else { 345 $main_menuitem.parentElement.classList.remove('expanded'); 346 $main_menuitem.setAttribute('aria-expanded', 'false'); 347 } 348 } 349 }, 350 351 _get_parent_menu_elements: function() { 352 var _this = this.$main_menuitem, 353 $findings = []; 354 355 while (_this.parentNode) { 356 _this = _this.parentNode; 357 358 if (_this.nodeName.toLowerCase() === 'li') { 359 $findings.push(_this.querySelector('a')); 360 } 361 } 362 363 return $findings || False; 364 } 365 }; 366 367 var OffCanvasMenuOpener = function($toggle_offcanvas_menu) { 368 var _this = this; 369 var controls = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu').getAttribute('aria-controls'); 370 var what = document.getElementById('page-header'); 371 372 _this.$toggle_offcanvas_menu = $toggle_offcanvas_menu.querySelector('label'); 373 _this.$open_offcanvas_menu = $toggle_offcanvas_menu.querySelector('.open_offcanvas_menu'); 374 _this.$close_offcanvas_menu = $toggle_offcanvas_menu.querySelector('.close_offcanvas_menu'); 375 _this.$offcanvas_menu_state = document.querySelector('#' + _this.$toggle_offcanvas_menu.getAttribute('for')); 376 _this.$offcanvas_menu = document.getElementById(controls); 377 _this.$focus_elements = _this.$offcanvas_menu.querySelectorAll('a'); 378 379 _this.$key = { 380 'enter' : 13, 381 'escape' : 27, 382 'space' : 32 383 }; 384 }; 385 386 OffCanvasMenuOpener.prototype = { 387 init: function() { 388 var _this = this; 389 390 _this._init_keyboard(); 391 392 _this.$toggle_offcanvas_menu.addEventListener('click', _this._toggle_menu.bind(_this)); 393 _this.$open_offcanvas_menu.addEventListener('click', _this._open_menu.bind(_this)); 394 _this.$close_offcanvas_menu.addEventListener('click', _this._close_menu.bind(_this)); 395 396 _this.$offcanvas_menu.addEventListener('transitionend', function(event) { 397 398 // var _this = this; 399 if (event.target !== this) { 400 return; 401 } 402 403 if (_this.$offcanvas_menu_state.checked) { 404 if (_this.focus_element) { 405 _this.focus_element = false;
406 _this.$focus_elements[0].focus(); 407 } 408 } 409 else if (_this.focus_element) { 410 _this.focus_element = false; 411 _this.$open_offcanvas_menu.focus(); 412 } 413 }); 414 }, 415 416 _init_keyboard: function() { 417 var _this = this; 418 419 _this.$open_offcanvas_menu.addEventListener('keydown', function(event) { 420 if (event.keyCode === _this.$key.space || event.keyCode === _this.$key.enter) { 421 _this.focus_element = true; 422 } 423 424 if (event.keyCode === _this.$key.space) { 425 event.preventDefault(); 426 } 427 }); 428 429 _this.$close_offcanvas_menu.addEventListener('keydown', function(event) { 430 if (event.keyCode === _this.$key.space) { 431 event.preventDefault(); 432 } 433 }); 434 435 document.addEventListener('keydown', function(event) { 436 if (!_this.$offcanvas_menu_state.checked) { 437 return; 438 } 439 440 if (event.keyCode === _this.$key.escape) { 441 _this.focus_element = true; 442 _this._close_menu(event); 443 } 444 }); 445 }, 446 447 _scroll_to_top: function() { 448 var _this = this; 449 450 setTimeout(function() { 451 var duration = 300, 452 interval; 453 454 interval = setInterval(function() { 455 var diff = -window.pageYOffset, 456 step = diff / duration * 10; 457 458 if (Math.abs(diff) <= Math.abs(step)) { 459 if (_this.$anchor) { 460 _this.$anchor.focus(); 461 } 462 463 clearInterval(interval); 464 } 465 466 window.scrollBy(0, step); 467 duration -= 10; 468 }, 10); 469 }, 300); 470 }, 471 472 _toggle_menu: function(event) { 473 var _this = this; 474 475 if (_this.$offcanvas_menu_state.checked) { 476 _this._close_menu(event); 477 } 478 else { 479 _this._open_menu(event); 480 } 481 }, 482 483 _open_menu: function(event) { 484 var _this = this; 485 486 event.preventDefault(); 487 488 _this.$offcanvas_menu_state.checked = true; 489 _this.tab_index = 0; 490 491 _this._scroll_to_top(); 492 493 $header = document.getElementById('page-header'); 494 $logo = document.getElementById('header-logo'); 495 $header.classList.add('open'); 496 $logo.classList.add('open'); 497 498 }, 499 500 _close_menu: function(event) { 501 var _this = this; 502 503 event.preventDefault(); 504 505 _this.$offcanvas_menu_state.checked = false; 506 _this.tab_index = 0; 507 508 $header = document.getElementById('page-header'); 509 $logo = document.getElementById('header-logo'); 510 $header.classList.remove('open'); 511 $logo.classList.remove('open'); 512 } 513 }; 514 515 var $offcanvas_menu = document.getElementsByClassName('toggle_offcanvas_menu'); 516 517 if ($offcanvas_menu.length) { 518 new OffCanvasMenu($offcanvas_menu[0]).init(); // init once 519 520 // create an opener for each button 521 for (var i = 0, len = $offcanvas_menu.length; i < len; i++) { 522 new OffCanvasMenuOpener($offcanvas_menu[i]).init(); 523 } 524 } 525})(document); 526 527/* Source common/js/scripts/70_form_search_datalist.js */ 528 529// FORMULARE: SUCHBEGRIFF-VORSCHLÃGE FÃR DIE SUCHE 530// Wird gebraucht in: steuernews_search, search 531// ------------------------------------------------------------------------------------------------- 532 533(function(document) { 534 var FormSearchDataList = function($form) { 535 var _this = this; 536 537 _this.$form = $form; 538 _this.$search = $form.querySelector('input[type="search"]'); 539 _this.$submit = $form.querySelector('button[type="submit"]'); 540 _this.datalist = $form.getAttribute('data-datalist'); 541 _this.list = _this.$search.getAttribute('list'); 542 543 _this.datalist_loaded = false;
544 _this.datalist_inserted = false; 545 }; 546 547 FormSearchDataList.prototype = { 548 init: function() { 549 var _this = this; 550 551 _this.$form.addEventListener('submit', _this._submit.bind(this)); 552 _this.$search.addEventListener('focus', _this._focus.bind(this)); 553 554 _this._init_keyboard(); 555 _this._get_datalist(); 556 }, 557 558 _init_keyboard: function() { 559 var _this = this, 560 $key = { 561 'enter' : 13 562 }; 563 564 _this.$search.addEventListener('keyup', function(event) { 565 if (event.keyCode !== $key.enter) { 566 return; 567 } 568 569 var url = _this._get_url(); 570 571 if (url) { 572 location.href = url; 573 } 574 }); 575 }, 576 577 _get_datalist: function() { 578 var _this = this, 579 $datalist = sessionStorage.getItem(domain + '_datalist_search'), 580 $ajax, 581 $options; 582 583 if (!_this.datalist) { 584 return; 585 } 586 587 if ($datalist) { 588 $options = _this._get_sorted_datalist($datalist); 589 _this._create_datalist($options); 590 } 591 else { 592 $ajax = new XMLHttpRequest(); 593 $ajax.open('GET', _this.datalist, true); 594 595 $ajax.onload = function() { 596 if (this.status === 200) { 597 sessionStorage.setItem(domain + '_datalist_search', this.responseText); 598 599 $options = _this._get_sorted_datalist(this.responseText); 600 _this._create_datalist($options); 601 } 602 }; 603 604 $ajax.send(); 605 } 606 }, 607 608 _get_sorted_datalist: function($datalist) { 609 var $options = JSON.parse($datalist); 610 611 $options = $options.sort(function($a, $b) { 612 var a_value = $a.value.toLowerCase(), 613 b_value = $b.value.toLowerCase(); 614 615 if (a_value < b_value) { 616 return -1; 617 } 618 619 if (b_value < a_value) { 620 return 1; 621 } 622 }); 623 624 return $options; 625 }, 626 627 _create_datalist: function($options) { 628 var _this = this, 629 $datalist = document.createDocumentFragment(), 630 $datalist_entry; 631 632 for (var i = 0, $option; $option = $options[i]; i++) { 633 $datalist_entry = document.createElement('option'); 634 635 if ($option.url) { 636 $datalist_entry.setAttribute('data-url', $option.url); 637 } 638 639 if ($option.label && /Chrome\b/.test(navigator.userAgent)) { 640 if (!(/Edge\b/.test(navigator.userAgent))) { 641 $datalist_entry.setAttribute('label', $option.label); 642 } 643 } 644 645 $datalist_entry.setAttribute('data-value', $option.value.toLowerCase()); 646 $datalist_entry.textContent = $option.value; 647 $datalist.appendChild($datalist_entry); 648 } 649 650 _this.$datalist = $datalist; 651 }, 652 653 _focus: function() { 654 var _this = this; 655 656 if (_this.$datalist && !_this.datalist_inserted) { 657 document.querySelector('#' + _this.list).appendChild(_this.$datalist); 658 _this.datalist_inserted = true; 659 _this.$submit.removeAttribute('disabled'); 660 } 661 }, 662 663 _get_url: function() { 664 var _this = this, 665 value = _this.$search.value.toLowerCase(), 666 $option = document.querySelector('#' + _this.list + ' option[data-value="' + value + '"]'); 667 668 return $option ? $option.getAttribute('data-url') : ''; 669 }, 670 671 _submit: function(event) { 672 var _this = this, 673 url = _this._get_url(); 674 675 if (url) { 676 event.preventDefault(); 677 678 location.href = url; 679 } 680 } 681 }; 682 683 var $forms = document.querySelectorAll('[data-form*="datalist"]'); 684 685 for (var i = 0, $form; $form = $forms[i]; i++) { 686 new FormSearchDataList($form).init(); 687 } 688})(document); 689 690/* Source common/js/scripts/71_form_search.js */ 691 692// SUCHE 693// Wird gebraucht in: steuernews_search, suche 694// ------------------------------------------------------------------------------------------------- 695 696(function(document) { 697 var FormSearch = function($search) { 698 var _this = this; 699 700 _this.$search = $search; 701 _this.$input_search = $search.querySelector('input[type="search"]'); 702 _this.$button = $search.querySelector('button[type="submit"]'); 703 }; 704 705 FormSearch.prototype = { 706 init: function() { 707 var _this = this; 708 709 _this.$button.setAttribute('disabled', 'disabled'); 710 _this.$input_search.addEventListener('input', _this._on_input.bind(_this)); 711 }, 712 713 _on_input: function() { 714 var _this = this; 715 716 if (_this.$input_search.value.length > 0) { 717 _this.$button.removeAttribute('disabled'); 718 } 719 else { 720 _this.$button.setAttribute('disabled', 'disabled'); 721 } 722 } 723 }; 724 725 var $search = document.querySelectorAll('[role="search"]'); 726 727 if ($search.length) { 728 for (var i = 0, len = $search.length; i < len; i++) { 729 new FormSearch($search[i]).init(); 730 } 731 } 732})(document); 733 734/* Source common/js/scripts/72_form_search_box.js */ 735 736// SUCHE (BOX) 737// ------------------------------------------------------------------------------------------------- 738 739(function(document) { 740 var FormSearchBox = function($toggle_search_box) { 741 var _this = this, 742 controls; 743 744 _this.$toggle_search_box = $toggle_search_box.querySelector('label'); 745 _this.$open_search_box = $toggle_search_box.querySelector('.open_search_box'); 746 _this.$close_search_box_1 = $toggle_search_box.querySelector('.close_search_box'); 747 _this.$search_box_state = document.querySelector('#' + _this.$toggle_search_box.getAttribute('for')); 748 749 controls = _this.$open_search_box.getAttribute('aria-controls'); 750 751 _this.$search_box = document.getElementById(controls); 752 _this.$input_search = _this.$search_box.querySelector('input[type="search"]'); 753 _this.$search_button = _this.$search_box.querySelector('button[type="submit"]'); 754 _this.$close_search_box_2 = _this.$search_box.querySelector('.close_search_box'); 755 _this.$focus_elements = _this.$search_box.querySelectorAll('input[type="search"], button[type="submit"], .close_search_box'); 756 757 _this.$key = { 758 'escape' : 27, 759 'space' : 32, 760 'tab' : 9 761 }; 762 }; 763 764 FormSearchBox.prototype = { 765 init: function() { 766 var _this = this; 767 768 _this.$toggle_search_box.addEventListener('click', _this._toggle.bind(_this)); 769 _this.$open_search_box.addEventListener('click', _this._open.bind(_this)); 770 _this.$close_search_box_1.addEventListener('click', _this._close.bind(_this)); 771 _this.$close_search_box_2.addEventListener('click', _this._close.bind(_this)); 772 773 _this.$search_box.addEventListener('transitionend', function(event) { 774 if (event.target !== this) { 775 return; 776 } 777 778 if (_this.$search_box_state.checked) { 779 _this.$input_search.focus(); 780 } 781 }); 782 783 _this._init_keyboard(); 784 }, 785 786 _init_keyboard: function() { 787 var _this = this; 788 789 _this.$open_search_box.addEventListener('keydown', function(event) { 790 if (event.keyCode === _this.$key.space) { 791 event.preventDefault(); 792 } 793 }); 794 795 _this.$close_search_box_1.addEventListener('keydown', function(event) { 796 if (event.keyCode === _this.$key.space) { 797 event.preventDefault(); 798 } 799 }); 800 801 _this.$close_search_box_2.addEventListener('keydown', function(event) { 802 if (event.keyCode === _this.$key.space) { 803 event.preventDefault(); 804 } 805 }); 806 807 document.addEventListener('keydown', function(event) { 808 if (!_this.$search_box_state.checked) { 809 return; 810 } 811 812 switch(event.keyCode) { 813 case _this.$key.escape: 814 _this._close(event); 815 816 break; 817 818 case _this.$key.tab: 819 event.preventDefault(); 820 821 if (event.shiftKey) { 822 _this._focus_element_with_shift_tab_key(event); 823 } 824 else { 825 _this._focus_element_with_tab_key(event); 826 } 827 828 break; 829 } 830 }); 831 }, 832 833 _focus_element_with_shift_tab_key: function() { 834 var _this = this; 835 836 _this.tab_index -= 1; 837 838 if (_this.$search_button === _this.$focus_elements[_this.tab_index] && 839 _this.$search_button.getAttribute('disabled') === 'disabled') { 840 _this.tab_index -= 1; 841 } 842 if (_this.tab_index < 0) { 843 _this.tab_index = _this.$focus_elements.length - 1; 844 } 845 846 _this.$focus_elements[_this.tab_index].focus(); 847 }, 848 849 _focus_element_with_tab_key: function() { 850 var _this = this; 851 852 if (_this.tab_index === _this.$focus_elements.length - 1) { 853 _this.tab_index = 0; 854 } 855 else { 856 _this.tab_index += 1; 857 } 858 859 if (_this.$search_button === _this.$focus_elements[_this.tab_index] && 860 _this.$search_button.getAttribute('disabled') === 'disabled') { 861 _this.tab_index += 1; 862 } 863 864 _this.$focus_elements[_this.tab_index].focus(); 865 }, 866 867 _toggle: function(event) { 868 var _this = this; 869 870 if (_this.$search_box_state.checked) { 871 _this._close(event); 872 } 873 else { 874 _this._open(event); 875 } 876 }, 877 878 _open: function(event) { 879 var _this = this; 880 881 event.preventDefault(); 882 883 _this.$search_box_state.checked = true; 884 _this.tab_index = 0; 885 }, 886 887 _close: function(event) { 888 var _this = this; 889 890 event.preventDefault(); 891 892 _this.$search_box_state.checked = false;
893 _this.$open_search_box.focus(); 894 _this.tab_index = 0; 895 896 if (event.type === 'click') { 897 _this.$open_search_box.setAttribute('data-focus-method', 'mouse'); 898 } 899 } 900 }; 901 902 var $toggle_search_box = document.getElementsByClassName('toggle_search_box'); 903 904 for (var i = 0, len = $toggle_search_box.length; i < len; i++) { 905 new FormSearchBox($toggle_search_box[i]).init(); 906 } 907})(document); 908 909/* Source common/js/scripts/75_image_gallery.js */ 910 911// BILDER-GALERIE 912// Wird gebraucht in: image_gallery_overview 913// ------------------------------------------------------------------------------------------------- 914 915(function(document, window) { 916 var ImageGallery = function($images) { 917 var _this = this; 918 919 _this.$images = $images; 920 _this.$overlay = document.querySelector('#image_gallery_overlay'); 921 _this.$slider = _this.$overlay.querySelector('.gallery_slider'); 922 _this.$previous = _this.$overlay.querySelector('.previous'); 923 _this.$next = _this.$overlay.querySelector('.next'); 924 _this.$close = _this.$overlay.querySelector('.close'); 925 926 _this._current_index = 0; 927 _this._touch_flag = false; 928 }; 929 930 ImageGallery.prototype = { 931 init: function() { 932 var _this = this; 933 934 _this._init_animations(); 935 _this._init_mouse(); 936 _this._init_keyboard(); 937 _this._init_touch(); 938 }, 939 940 _init_animations: function() { 941 var _this = this; 942 943 _this.$overlay.addEventListener('transitionend', _this._overlay_transtion_end.bind(_this)); 944 _this.$slider.addEventListener('animationend', _this._bounce_animation_end.bind(_this)); 945 }, 946 947 _init_mouse: function() { 948 var _this = this; 949 950 for (var i = 0, len = _this.$images.length; i < len; i++) { 951 var $image = _this.$images[i]; 952 953 $image.addEventListener('click', _this._open.bind(_this, i)); 954 } 955 956 if (window.navigator.msMaxTouchPoints || 'ontouchstart' in document.documentElement) { 957 _this.$previous.classList.add('hideme'); 958 _this.$next.classList.add('hideme'); 959 } 960 else { 961 _this.$previous.addEventListener('click', function(event) { 962 event.stopPropagation(); 963 event.preventDefault(); 964 _this._show_previous_image(); 965 }); 966 967 _this.$next.addEventListener('click', function(event) { 968 event.stopPropagation(); 969 event.preventDefault(); 970 _this._show_next_image(); 971 }); 972 } 973 974 _this.$close.addEventListener('click', _this._close.bind(_this)); 975 _this.$overlay.addEventListener('click', _this._close.bind(_this)); 976 }, 977 978 _init_keyboard: function() { 979 var _this = this, 980 $key = { 981 'escape' : 27, 982 'arrow_left' : 37, 983 'arrow_right' : 39 984 }; 985 986 document.addEventListener('keydown', function(event) { 987 if (!_this.$overlay.classList.contains('show')) { 988 return; 989 } 990 991 if (event.keyCode === $key.escape) { 992 _this._hide_overlay(); 993 } 994 else if (event.keyCode === $key.arrow_left) { 995 _this._show_previous_image(); 996 } 997 else if (event.keyCode === $key.arrow_right) { 998 _this._show_next_image(); 999 } 1000 }); 1001 }, 1002 1003 _init_touch: function() { 1004 var _this = this; 1005 1006 _this.$overlay.addEventListener('touchstart', function(event) { 1007 _this._touch_start_x = event.changedTouches[0].pageX; 1008 _this._touch_start_y = event.changedTouches[0].pageY; 1009 }, { 1010 'passive' : true 1011 }); 1012 1013 _this.$overlay.addEventListener('touchmove', function(event) { 1014 if (_this._touch_flag) { 1015 return; 1016 } 1017 1018 var touch = event.touches[0] || event.changedTouches[0], 1019 touch_x = touch.pageX, 1020 touch_y = touch.pageY; 1021 1022 event.preventDefault(); 1023 1024 if (touch_x - _this._touch_start_x > 40) { 1025 _this._touch_flag = true; 1026 _this._show_previous_image(); 1027 }
1028 else if (touch_x - _this._touch_start_x < -40) { 1029 _this._touch_flag = true; 1030 _this._show_next_image(); 1031 } 1032 else if (_this._touch_start_y - touch_y > 100) { 1033 _this._hide_overlay(); 1034 } 1035 }); 1036 1037 _this.$overlay.addEventListener('touchend', function() { 1038 _this._touch_flag = false; 1039 }); 1040 }, 1041 1042 _open: function(index, event) { 1043 var _this = this; 1044 1045 event.preventDefault(); 1046 1047 _this._prepare_overlay(index); 1048 _this._show_overlay(index); 1049 }, 1050 1051 _close: function(event) { 1052 var _this = this; 1053 1054 event.preventDefault(); 1055 event.stopPropagation(); 1056 1057 if (event.target.tagName !== 'IMG') { 1058 _this._hide_overlay(); 1059 } 1060 }, 1061 1062 _overlay_transtion_end: function(event) { 1063 var _this = this; 1064 1065 if (event.target !== _this.$overlay) { 1066 return; 1067 } 1068 1069 if (!_this.$overlay.classList.contains('show')) { 1070 _this.$overlay.classList.add('hideme'); 1071 } 1072 }, 1073 1074 _bounce_animation_end: function() { 1075 var _this = this; 1076 1077 _this.$slider.classList.remove('bounce_from_left'); 1078 _this.$slider.classList.remove('bounce_from_right'); 1079 }, 1080 1081 _prepare_overlay: function(index) { 1082 var _this = this, 1083 gallery = _this.$images[index].getAttribute('data-image-gallery'); 1084 1085 if (_this._current_gallery === gallery) { 1086 return; 1087 } 1088 1089 _this.$full_images = []; 1090 _this.$current_images = document.querySelectorAll('[data-image-gallery="' + gallery + '"]'); 1091 _this._current_gallery = gallery; 1092 1093 while (_this.$slider.firstChild) { 1094 _this.$slider.removeChild(_this.$slider.firstChild); 1095 } 1096 1097 for (var i = 0, $full_image; i < _this.$current_images.length; i++) { 1098 $full_image = document.createElement('div'); 1099 $full_image.className = 'full_image'; 1100 1101 _this.$full_images.push($full_image); 1102 1103 _this.$slider.setAttribute('data-image-group', gallery); 1104 _this.$slider.appendChild($full_image); 1105 } 1106 }, 1107 1108 _show_overlay: function(index) { 1109 var _this = this; 1110 1111 index = Array.prototype.indexOf.call(_this.$current_images, _this.$images[index]); 1112 1113 _this._current_index = index; 1114 1115 _this.$overlay.classList.remove('hideme'); 1116 1117 setTimeout(function() { 1118 _this.$overlay.classList.add('show'); 1119 }, 50); 1120 1121 _this._load_image(_this._current_index, function() { 1122 _this._preload_previous_image(_this._current_index); 1123 _this._preload_next_image(_this._current_index); 1124 }); 1125 1126 _this._update_offset(); 1127 }, 1128 1129 _hide_overlay: function() { 1130 var _this = this; 1131 1132 _this.$overlay.classList.remove('show'); 1133 }, 1134 1135 _update_offset: function() { 1136 var _this = this, 1137 offset = -_this._current_index * 100 + '%'; 1138 1139 _this.$slider.style.transform = 'translate3d(' + offset + ', 0, 0)'; 1140 _this.$slider.style.webkitTransform = 'translate3d(' + offset + ', 0, 0)'; // Für iOS8 1141 }, 1142 1143 _show_previous_image: function() { 1144 var _this = this; 1145 1146 if (_this._current_index >= 1) { 1147 _this._current_index--; 1148 _this._preload_previous_image(_this._current_index); 1149 _this._update_offset(); 1150 } 1151 else { 1152 _this.$slider.classList.add('bounce_from_left'); 1153 } 1154 }, 1155 1156 _show_next_image: function() { 1157 var _this = this; 1158 1159 if (_this._current_index <= _this.$full_images.length - 2) { 1160 _this._current_index++; 1161 _this._preload_next_image(_this._current_index); 1162 _this._update_offset(); 1163 } 1164 else { 1165 _this.$slider.classList.add('bounce_from_right'); 1166 } 1167 }, 1168 1169 _preload_previous_image: function(index) { 1170 var _this = this; 1171 1172 if (_this._current_index - index >= 2) { 1173 return; 1174 } 1175 1176 _this._load_image(index - 1, function() { 1177 _this._preload_previous_image(index - 1); 1178 }); 1179 }, 1180 1181 _preload_next_image: function(index) { 1182 var _this = this; 1183 1184 if (index - _this._current_index >= 2) { 1185 return; 1186 } 1187 1188 _this._load_image(index + 1, function() { 1189 _this._preload_next_image(index + 1); 1190 }); 1191 }, 1192 1193 _load_image: function(index, callback) { 1194 var _this = this, 1195 $full_image = _this.$full_images[index]; 1196 1197 if (typeof $full_image === 'undefined') { 1198 return; 1199 } 1200 1201 if ($full_image.querySelector('img')) { 1202 if (callback) { 1203 callback(); 1204 } 1205 1206 return; 1207 } 1208 1209 var $figure = document.createElement('figure'), 1210 $image = document.createElement('img'), 1211 image_source = _this.$current_images[index].getAttribute('href'), 1212 image_description = _this.$current_images[index].getAttribute('data-image-description'); 1213 1214 $figure.innerHTML = '<div class="spinner">' + 1215 '<div class="bounce bounce_1"></div>' + 1216 '<div class="bounce bounce_2"></div>' + 1217 '<div class="bounce bounce_3"></div>' + 1218 '</div>'; 1219 1220 $image.setAttribute('src', image_source); 1221 1222 $image.addEventListener('load', function() { 1223 var $spinner = $figure.querySelector('.spinner'); 1224 1225 $image.classList.add('show'); 1226 $figure.removeChild($spinner); 1227 1228 if (callback) { 1229 callback(); 1230 } 1231 }); 1232 1233 $figure.appendChild($image); 1234 1235 if (image_description) { 1236 var $figcaption = document.createElement('figcaption'); 1237 1238 $figcaption.innerHTML = image_description; 1239 $figure.appendChild($figcaption); 1240 } 1241 1242 $full_image.appendChild($figure); 1243 } 1244 }; 1245 1246 var $images = document.querySelectorAll('[data-image-gallery]'); 1247 1248 if ($images.length) { 1249 new ImageGallery($images).init(); 1250 } 1251})(document, window); 1252 1253/* Source common/js/scripts/75_kpt_gallery.js */ 1254 1255// KARRIEREPAKET BILDER-GALERIE 1256// Wird gebraucht in: kpt_gallery 1257// ------------------------------------------------------------------------------------------------- 1258 1259(function(document, window) { 1260 var ImageGallery = function($images) { 1261 var _this = this; 1262 1263 _this.$images = $images; 1264 _this.$overlay = document.querySelector('#kpt_gallery_overlay'); 1265 _this.$slider = _this.$overlay.querySelector('.slider'); 1266 _this.$previous = _this.$overlay.querySelector('.previous'); 1267 _this.$next = _this.$overlay.querySelector('.next'); 1268 _this.$close = _this.$overlay.querySelector('.close'); 1269 1270 _this._current_index = 0; 1271 _this._touch_flag = false;
1272 }; 1273 1274 ImageGallery.prototype = { 1275 init: function() { 1276 var _this = this; 1277 1278 _this._init_animations(); 1279 _this._init_mouse(); 1280 _this._init_keyboard(); 1281 _this._init_touch(); 1282 }, 1283 1284 _init_animations: function() { 1285 var _this = this; 1286 1287 _this.$overlay.addEventListener('transitionend', _this._overlay_transtion_end.bind(_this)); 1288 _this.$slider.addEventListener('animationend', _this._bounce_animation_end.bind(_this)); 1289 }, 1290 1291 _init_mouse: function() { 1292 var _this = this; 1293 1294 for (var i = 0, len = _this.$images.length; i < len; i++) { 1295 var $image = _this.$images[i]; 1296 1297 $image.addEventListener('click', _this._open.bind(_this, i)); 1298 } 1299 1300 if (window.navigator.msMaxTouchPoints || 'ontouchstart' in document.documentElement) { 1301 _this.$previous.classList.add('hideme'); 1302 _this.$next.classList.add('hideme'); 1303 } 1304 else { 1305 _this.$previous.addEventListener('click', function(event) { 1306 event.stopPropagation(); 1307 event.preventDefault(); 1308 _this._show_previous_image(); 1309 }); 1310 1311 _this.$next.addEventListener('click', function(event) { 1312 event.stopPropagation(); 1313 event.preventDefault(); 1314 _this._show_next_image(); 1315 }); 1316 } 1317 1318 _this.$close.addEventListener('click', _this._close.bind(_this)); 1319 _this.$overlay.addEventListener('click', _this._close.bind(_this)); 1320 }, 1321 1322 _init_keyboard: function() { 1323 var _this = this, 1324 $key = { 1325 'escape' : 27, 1326 'arrow_left' : 37, 1327 'arrow_right' : 39 1328 }; 1329 1330 document.addEventListener('keydown', function(event) { 1331 if (!_this.$overlay.classList.contains('show')) { 1332 return; 1333 } 1334 1335 if (event.keyCode === $key.escape) { 1336 _this._hide_overlay(); 1337 } 1338 else if (event.keyCode === $key.arrow_left) { 1339 _this._show_previous_image(); 1340 } 1341 else if (event.keyCode === $key.arrow_right) { 1342 _this._show_next_image(); 1343 } 1344 }); 1345 }, 1346 1347 _init_touch: function() { 1348 var _this = this; 1349 1350 _this.$overlay.addEventListener('touchstart', function(event) { 1351 _this._touch_start_x = event.changedTouches[0].pageX; 1352 _this._touch_start_y = event.changedTouches[0].pageY; 1353 }, { 1354 'passive' : true 1355 }); 1356 1357 _this.$overlay.addEventListener('touchmove', function(event) { 1358 if (_this._touch_flag) { 1359 return; 1360 } 1361 1362 var touch = event.touches[0] || event.changedTouches[0], 1363 touch_x = touch.pageX, 1364 touch_y = touch.pageY; 1365 1366 event.preventDefault(); 1367 1368 if (touch_x - _this._touch_start_x > 40) { 1369 _this._touch_flag = true; 1370 _this._show_previous_image(); 1371 } 1372 else if (touch_x - _this._touch_start_x < -40) { 1373 _this._touch_flag = true; 1374 _this._show_next_image(); 1375 } 1376 else if (_this._touch_start_y - touch_y > 100) { 1377 _this._hide_overlay(); 1378 } 1379 }); 1380 1381 _this.$overlay.addEventListener('touchend', function() { 1382 _this._touch_flag = false; 1383 }); 1384 }, 1385 1386 _open: function(index, event) { 1387 var _this = this; 1388 1389 event.preventDefault(); 1390 1391 _this._prepare_overlay(index); 1392 _this._show_overlay(index); 1393 }, 1394 1395 _close: function(event) { 1396 var _this = this; 1397 1398 event.preventDefault(); 1399 event.stopPropagation(); 1400 1401 if (event.target.tagName !== 'IMG') { 1402 _this._hide_overlay(); 1403 } 1404 }, 1405 1406 _overlay_transtion_end: function(event) { 1407 var _this = this; 1408 1409 if (event.target !== _this.$overlay) { 1410 return; 1411 } 1412 1413 if (!_this.$overlay.classList.contains('show')) { 1414 _this.$overlay.classList.add('hideme'); 1415 } 1416 }, 1417 1418 _bounce_animation_end: function() { 1419 var _this = this; 1420 1421 _this.$slider.classList.remove('bounce_from_left'); 1422 _this.$slider.classList.remove('bounce_from_right'); 1423 }, 1424 1425 _prepare_overlay: function(index) { 1426 var _this = this, 1427 gallery = _this.$images[index].getAttribute('data-kpt-gallery'); 1428 1429 if (_this._current_gallery === gallery) { 1430 return; 1431 } 1432 1433 _this.$full_images = []; 1434 _this.$current_images = document.querySelectorAll('[data-kpt-gallery="' + gallery + '"]'); 1435 _this._current_gallery = gallery; 1436 1437 while (_this.$slider.firstChild) { 1438 _this.$slider.removeChild(_this.$slider.firstChild); 1439 } 1440 1441 for (var i = 0, $full_image; i < _this.$current_images.length; i++) { 1442 $full_image = document.createElement('div'); 1443 $full_image.className = 'full_image'; 1444 1445 _this.$full_images.push($full_image); 1446 1447 _this.$slider.setAttribute('data-image-group', gallery); 1448 _this.$slider.appendChild($full_image); 1449 } 1450 }, 1451 1452 _show_overlay: function(index) { 1453 var _this = this; 1454 1455 index = Array.prototype.indexOf.call(_this.$current_images, _this.$images[index]); 1456 1457 _this._current_index = index; 1458 1459 _this.$overlay.classList.remove('hideme'); 1460 1461 setTimeout(function() { 1462 _this.$overlay.classList.add('show'); 1463 }, 50); 1464 1465 _this._load_image(_this._current_index, function() { 1466 _this._preload_previous_image(_this._current_index); 1467 _this._preload_next_image(_this._current_index); 1468 }); 1469 1470 _this._update_offset(); 1471 }, 1472 1473 _hide_overlay: function() { 1474 var _this = this; 1475 1476 _this.$overlay.classList.remove('show'); 1477 }, 1478 1479 _update_offset: function() { 1480 var _this = this, 1481 offset = -_this._current_index * 100 + '%'; 1482 1483 _this.$slider.style.transform = 'translate3d(' + offset + ', 0, 0)'; 1484 _this.$slider.style.webkitTransform = 'translate3d(' + offset + ', 0, 0)'; // Für iOS8 1485 }, 1486 1487 _show_previous_image: function() { 1488 var _this = this; 1489 1490 if (_this._current_index >= 1) { 1491 _this._current_index--; 1492 _this._preload_previous_image(_this._current_index); 1493 _this._update_offset(); 1494 } 1495 else { 1496 _this.$slider.classList.add('bounce_from_left'); 1497 } 1498 }, 1499 1500 _show_next_image: function() { 1501 var _this = this; 1502 1503 if (_this._current_index <= _this.$full_images.length - 2) { 1504 _this._current_index++; 1505 _this._preload_next_image(_this._current_index); 1506 _this._update_offset(); 1507 } 1508 else { 1509 _this.$slider.classList.add('bounce_from_right'); 1510 } 1511 }, 1512 1513 _preload_previous_image: function(index) { 1514 var _this = this; 1515 1516 if (_this._current_index - index >= 2) { 1517 return; 1518 } 1519 1520 _this._load_image(index - 1, function() { 1521 _this._preload_previous_image(index - 1); 1522 }); 1523 }, 1524 1525 _preload_next_image: function(index) { 1526 var _this = this; 1527 1528 if (index - _this._current_index >= 2) { 1529 return; 1530 } 1531 1532 _this._load_image(index + 1, function() { 1533 _this._preload_next_image(index + 1); 1534 }); 1535 }, 1536 1537 _load_image: function(index, callback) { 1538 var _this = this, 1539 $full_image = _this.$full_images[index]; 1540 1541 if (typeof $full_image === 'undefined') { 1542 return; 1543 } 1544 1545 if ($full_image.querySelector('img')) { 1546 if (callback) { 1547 callback(); 1548 } 1549 1550 return; 1551 } 1552 1553 var $figure = document.createElement('figure'), 1554 $image = document.createElement('img'), 1555 image_source = _this.$current_images[index].getAttribute('href'), 1556 image_width = _this.$current_images[index].getAttribute('data-image-width'), 1557 image_height = _this.$current_images[index].getAttribute('data-image-height'), 1558 image_description = _this.$current_images[index].getAttribute('data-image-description'), 1559 image_text = _this.$current_images[index].querySelector('.text'); 1560 1561 if (image_text) { 1562 var $full_image_text = image_text.cloneNode(true); 1563 $full_image.appendChild($full_image_text); 1564 } 1565 1566 $figure.innerHTML = '<div class="spinner">' + 1567 '<div class="bounce bounce_1"></div>' + 1568 '<div class="bounce bounce_2"></div>' + 1569 '<div class="bounce bounce_3"></div>' + 1570 '</div>'; 1571 1572 $image.setAttribute('src', image_source); 1573 $image.setAttribute('alt', ''); 1574 1575 if (image_height != null) { 1576 $image.setAttribute('height', image_height); 1577 } 1578 1579 if (image_width != null) { 1580 $image.setAttribute('width', image_width); 1581 } 1582 1583 $image.addEventListener('load', function() { 1584 var $spinner = $figure.querySelector('.spinner'); 1585 1586 $image.classList.add('show'); 1587 $figure.removeChild($spinner); 1588 1589 if (callback) { 1590 callback(); 1591 } 1592 }); 1593 1594 $figure.appendChild($image); 1595 1596 if (image_description) { 1597 var $figcaption = document.createElement('figcaption'); 1598 1599 $figcaption.innerHTML = image_description; 1600 $figure.appendChild($figcaption); 1601 } 1602 1603 $full_image.appendChild($figure); 1604 // $full_image.appendChild($full_image_text); 1605 } 1606 }; 1607 1608 var $images = document.querySelectorAll('[data-kpt-gallery]'); 1609 1610 if ($images.length) { 1611 new ImageGallery($images).init(); 1612 } 1613})(document, window); 1614 1615/* Source common/js/scripts/76_kpt_slider.js */ 1616 1617// KARRIEREPAKET SLIDER 1618// ------------------------------------------------------------------------------------------------ 1619 1620(function(document, window) { 1621 var Slider = function($slider) { 1622 this.$slider = $slider; 1623 this.$slides = this.$slider.querySelectorAll('.slide'); 1624 this.active_index = 0; 1625 1626 this.$navigation = this.$slider.querySelector('.navigation'); 1627 this.$navigation_next = this.$slider.querySelector('.navigation .next'); 1628 this.$navigation_prev = this.$slider.querySelector('.navigation .prev'); 1629 this.$pagination = this.$slider.querySelectorAll('.pagination > a'); 1630 1631 this.auto_slide = this.$slider.className.match(/(\auto_slide\S*)/g); 1632 this.timeout = parseInt(this.auto_slide && this.auto_slide[0].split('auto_slide_')[1] || 4000); 1633 this.auto_stop = this.$slider.className.match(/(\auto_stop)/g); 1634 this.run = true; 1635 }; 1636 1637 Slider.prototype = { 1638 init: function() { 1639 var _this = this; 1640 1641 if (_this.auto_slide) { 1642 _this._auto_slide(); 1643 } 1644 1645 if (_this.auto_stop) { 1646 _this._auto_stop(); 1647 } 1648 1649 if (_this.$navigation) { 1650 _this._init_navigation(); 1651 } 1652 1653 if (_this.$pagination.length) { 1654 _this._init_pagination(); 1655 } 1656 1657 _this._update_slides(0); 1658 _this._init_slides_animation(); 1659 _this._init_accessibility(); 1660 1661 }, 1662 1663 next: function() { 1664 this.active_index = this._get_index(this.$slides, this.active_index + 1); 1665 this._update_slides(); 1666 this._set_slides_animation(); 1667 }, 1668 1669 prev: function() { 1670 this.active_index = this._get_index(this.$slides, this.active_index - 1); 1671 this._update_slides(); 1672 this._set_slides_animation(); 1673 }, 1674 1675 _init_slides_animation: function() { 1676 var _this = this; 1677 1678 for (var i = 0; i < _this.$slides.length; i++) { 1679 _this.$slides[i].addEventListener('transitionend', function() { 1680 _this.$slides = _this._remove_all_classes(_this.$slides, 'animated'); 1681 }); 1682 1683 _this.$slides[i].addEventListener('animationend', function() { 1684 _this.$slides = _this._remove_all_classes(_this.$slides, 'animated'); 1685 }); 1686 } 1687 }, 1688 1689 _init_navigation: function() { 1690 var _this = this; 1691 1692 _this.$navigation_next.addEventListener('click', function(event) { 1693 event.preventDefault(); 1694 1695 _this.next(); 1696 }); 1697 1698 _this.$navigation_prev.addEventListener('click', function(event) { 1699 event.preventDefault(); 1700 1701 _this.prev(); 1702 }); 1703 }, 1704 1705 _init_accessibility: function() { 1706 var _this = this; 1707 1708 _this.$slider.addEventListener('click', function(event) { 1709 this.is_keyboard = false;
1710 }, true); 1711 1712 _this.$slider.addEventListener('keydown', function(event) { 1713 this.is_keyboard = true; 1714 }, true); 1715 1716 _this.$slider.addEventListener('focusin', function(event) { 1717 slide = event.target.closest('.slide'); 1718 1719 if (slide && this.is_keyboard) { 1720 _this.active_index = parseInt(slide.getAttribute('data-index')); 1721 _this._update_slides(); 1722 _this._set_slides_animation(); 1723 1724 _this.$slider.querySelector('.slides').scrollLeft = 0; 1725 this.is_keyboard = false; 1726 } 1727 }, true); 1728 }, 1729 1730 _init_pagination: function() { 1731 var _this = this; 1732 1733 for (var i = 0; i < _this.$pagination.length; i++) { 1734 _this.$pagination[i].addEventListener('click', function(event) { 1735 event.preventDefault(); 1736 1737 _this.active_index = parseInt(this.getAttribute('data-index')); 1738 _this._update_slides(); 1739 _this._set_slides_animation(); 1740 }); 1741 } 1742 }, 1743 1744 _auto_slide: function() { 1745 var _this = this; 1746 1747 setInterval(function() { 1748 if (_this.run) { 1749 _this.next(); 1750 } 1751 }, _this.timeout); 1752 }, 1753 1754 _auto_stop: function() { 1755 var _this = this; 1756 1757 this.$slider.addEventListener('mousemove', function() { 1758 _this.run = false; 1759 }); 1760 1761 this.$slider.addEventListener('mouseleave', function() { 1762 _this.run = true; 1763 }); 1764 }, 1765 1766 _update_slides: function() { 1767 this._set_active_slide(); 1768 this._set_slides_position(); 1769 this._set_slides_visibility(); 1770 1771 if (this.$pagination.length) { 1772 this._update_pagination(); 1773 } 1774 }, 1775 1776 _update_pagination: function() { 1777 var index = this._get_index(this.$pagination, this.active_index); 1778 1779 this.$pagination = this._remove_all_classes(this.$pagination, 'active'); 1780 this.$pagination[index].classList.add('active'); 1781 }, 1782 1783 _remove_all_classes: function(elements, class_name) { 1784 1785 for (var i = 0; i < elements.length; i++) { 1786 elements[i].classList.remove(class_name); 1787 } 1788 1789 return elements; 1790 }, 1791 1792 _get_index: function(element, number) { 1793 var _this = this; 1794 1795 if (number >= (element.length * 2)) { 1796 number = number - (element.length * 2); 1797 } 1798 1799 if (number >= element.length) { 1800 number = number - element.length; 1801 } 1802 1803 if (number < 0) { 1804 number = number + element.length; 1805 } 1806 1807 return number; 1808 }, 1809 1810 _set_slides_animation: function() { 1811 var slide_length_third = this.$slides.length / 3; 1812 1813 this.$slides = this._remove_all_classes(this.$slides, 'animated'); 1814 1815 for (var i = -1; i <= slide_length_third; i++) { 1816 var index = this._get_index(this.$slides, this.active_index + i); 1817 this.$slides[index].classList.add('animated'); 1818 } 1819 }, 1820 1821 _set_active_slide: function() { 1822 var index = this._get_index(this.$slides, this.active_index); 1823 1824 this.$slides = this._remove_all_classes(this.$slides, 'active'); 1825 this.$slides[index].classList.add('active'); 1826 }, 1827 1828 _set_slides_position: function() { 1829 var slide_length_half = Math.floor(this.$slides.length / 2); 1830 1831 for (var i = -slide_length_half - 1; i <= slide_length_half; i++) { 1832 var index = this._get_index(this.$slides, this.active_index + i); 1833 this.$slides[index].setAttribute('data-position', i * 100); 1834 } 1835 }, 1836 1837 _set_slides_visibility: function() { 1838 var slide_length_third = this.$slides.length / 3; 1839 1840 this.$slides = this._remove_all_classes(this.$slides, 'visible'); 1841
1842 for (var i = -1; i <= slide_length_third; i++) { 1843 var index = this._get_index(this.$slides, this.active_index + i); 1844 this.$slides[index].classList.add('visible'); 1845 } 1846 } 1847 }; 1848 1849 var $slider = document.querySelectorAll(['.kpt_slider']); 1850 1851 for (var i = 0; i < $slider.length; i++) { 1852 new Slider($slider[i]).init(); 1853 } 1854})(document, window); 1855 1856/* Source common/js/scripts/77_slider.js */ 1857 1858// SLIDER 1859// ------------------------------------------------------------------------------------------------ 1860 1861(function(document, window) { 1862 var Slider = function($slider) { 1863 this.$slider = $slider; 1864 this.$slides = this.$slider.querySelectorAll('.slide'); 1865 this.active_index = 0; 1866 1867 this.$navigation_next = this.$slider.querySelector('.navigation .next'); 1868 this.$navigation_prev = this.$slider.querySelector('.navigation .prev'); 1869 this.$pagination = this.$slider.querySelectorAll('.pagination > a'); 1870 this.$autoslide_toggle = this.$slider.querySelector('.toggle_autoslide'); 1871 1872 this.vertical = this.$slider.classList.contains('vertical'); 1873 this.auto_slide = this.$slider.className.match(/(\auto_slide\S*)/g); 1874 this.no_autstop = this.$slider.classList.contains('no_autostop'); 1875 this.prevent_auto_slide = false; 1876 this.timeout = parseInt(this.auto_slide && this.auto_slide[0].split('auto_slide_')[1] || 4000); 1877 this.run = true; 1878 this.touch_flag = false; 1879 this.motion_query = matchMedia('(prefers-reduced-motion: reduce)'); 1880 }; 1881 1882 Slider.prototype = { 1883 init: function() { 1884 var _this = this; 1885 1886 if (!this.motion_query.matches) { 1887 if (_this.auto_slide) { 1888 _this._auto_slide(); 1889 if(!_this.no_autstop){ 1890 _this._auto_stop(); 1891 } 1892 } 1893 } 1894 1895 _this._init_navigation(); 1896 _this._init_pagination(); 1897 1898 _this._update_slides(0); 1899 _this._init_slides_animation(); 1900 _this._init_accessibility(); 1901 _this._init_touch(); 1902 }, 1903 1904 next: function() { 1905 this.active_index = this._get_index(this.$slides, this.active_index + 1); 1906 this._update_slides(); 1907 this._set_slides_animation(); 1908 }, 1909 1910 prev: function() { 1911 this.active_index = this._get_index(this.$slides, this.active_index - 1); 1912 this._update_slides(); 1913 this._set_slides_animation(); 1914 }, 1915 1916 _init_slides_animation: function() { 1917 var _this = this; 1918 1919 for (var i = 0; i < _this.$slides.length; i++) { 1920 _this.$slides[i].addEventListener('transitionend', function() { 1921 _this.$slides = _this._remove_all_classes(_this.$slides, 'animated'); 1922 }); 1923 1924 _this.$slides[i].addEventListener('animationend', function() { 1925 _this.$slides = _this._remove_all_classes(_this.$slides, 'animated'); 1926 }); 1927 } 1928 }, 1929 1930 _init_navigation: function() { 1931 var _this = this; 1932 1933 if (_this.$navigation_next) { 1934 _this.$navigation_next.addEventListener('click', function(event) { 1935 event.preventDefault(); 1936 1937 _this.next(); 1938 }); 1939 } 1940 1941 if (_this.$navigation_prev) { 1942 _this.$navigation_prev.addEventListener('click', function(event) { 1943 event.preventDefault(); 1944 1945 _this.prev(); 1946 }); 1947 } 1948 }, 1949 1950 _init_accessibility: function() { 1951 var _this = this; 1952 1953 _this.$slider.addEventListener('click', function(event) { 1954 this.is_keyboard = false; 1955 }, true); 1956 1957 _this.$slider.addEventListener('keydown', function(event) { 1958 this.is_keyboard = true; 1959 }, true); 1960 1961 _this.$slider.addEventListener('focusin', function() { 1962 _this.$slider.setAttribute('aria-live', 'polite') 1963 }); 1964 1965 _this.$slider.addEventListener('focusout', function() { 1966 _this.$slider.setAttribute('aria-live', 'off') 1967 }); 1968 1969 _this.$slider.addEventListener('focusin', function(event) { 1970 slide = event.target.closest('.slide'); 1971 1972 if (slide && this.is_keyboard) { 1973 _this.active_index = parseInt(slide.getAttribute('data-index')); 1974 _this._update_slides(); 1975 _this._set_slides_animation(); 1976 1977 _this.$slider.querySelector('.slides').scrollLeft = 0; 1978 this.is_keyboard = false; 1979 } 1980 }, true); 1981 1982 if (_this.auto_slide) {
1983 _this.$autoslide_toggle.addEventListener('click', function() { 1984 _this.prevent_auto_slide = !_this.prevent_auto_slide; 1985 _this.$autoslide_toggle.querySelector('.stop').classList.toggle('hideme'); 1986 _this.$autoslide_toggle.querySelector('.play').classList.toggle('hideme'); 1987 1988 if (_this.prevent_auto_slide){ 1989 _this.$autoslide_toggle.querySelector('.visible_for_screen_reader').innerText = ('Autoslide starten') 1990 } else { 1991 _this.$autoslide_toggle.querySelector('.visible_for_screen_reader').innerText= ('Autoslide stoppen') 1992 } 1993 }) 1994 } 1995 }, 1996 1997 _init_pagination: function() { 1998 var _this = this; 1999 2000 for (var i = 0; i < _this.$pagination.length; i++) { 2001 _this.$pagination[i].addEventListener('click', function(event) { 2002 event.preventDefault(); 2003 2004 _this.active_index = parseInt(this.getAttribute('data-index')); 2005 _this._update_slides(); 2006 _this._set_slides_animation(); 2007 }); 2008 } 2009 }, 2010 2011 _init_touch: function() { 2012 var _this = this; 2013 2014 _this.$slider.addEventListener('touchstart', function(event) { 2015 if (_this.vertical) { 2016 _this._touch_start = event.changedTouches[0].pageY; 2017 } 2018 else { 2019 _this._touch_start = event.changedTouches[0].pageX; 2020 } 2021 }, { 2022 'passive' : true 2023 }); 2024 2025 _this.$slider.addEventListener('touchmove', function(event) { 2026 var touches = event.touches[0] || event.changedTouches[0]; 2027 2028 if (_this.touch_flag) { 2029 return; 2030 } 2031 2032 if (_this.vertical) { 2033 var touch = touches.pageY; 2034 } 2035 else { 2036 var touch = touches.pageX; 2037 } 2038 2039 if (touch - _this._touch_start > 40) { 2040 _this.touch_flag = true; 2041 _this.prev(); 2042 } 2043 else if (touch - _this._touch_start < -40) { 2044 _this.touch_flag = true; 2045 _this.next(); 2046 } 2047 }, { 2048 'passive' : true 2049 }); 2050 2051 _this.$slider.addEventListener('touchend', function() { 2052 _this.touch_flag = false; 2053 }); 2054 }, 2055 2056 _auto_slide: function() { 2057 var _this = this; 2058 2059 setInterval(function() { 2060 if (_this.run && !_this.prevent_auto_slide) { 2061 _this.next(); 2062 } 2063 }, _this.timeout); 2064 }, 2065 2066 _auto_stop: function() { 2067 var _this = this; 2068 2069 _this.$slider.addEventListener('mousemove', function() { 2070 _this.run = false; 2071 }); 2072 2073 _this.$slider.addEventListener('focusin', function() { 2074 _this.run = false; 2075 }); 2076 2077 _this.$slider.addEventListener('mouseleave', function() { 2078 _this.run = true; 2079 }); 2080 2081 _this.$slider.addEventListener('focusout', function() { 2082 _this.run = true; 2083 }); 2084 }, 2085 2086 _update_slides: function() { 2087 this._set_active_slide(); 2088 this._set_slides_position(); 2089 this._set_slides_visibility(); 2090 this._set_slides_aria_attributes(); 2091 2092 if (this.$pagination.length) { 2093 this._update_pagination(); 2094 } 2095 }, 2096 2097 _update_pagination: function() { 2098 var index = this._get_index(this.$pagination, this.active_index); 2099 2100 this.$pagination = this._remove_all_classes(this.$pagination, 'active'); 2101 this.$pagination[index].classList.add('active'); 2102 }, 2103 2104 _remove_all_classes: function(elements, class_name) { 2105 2106 for (var i = 0; i < elements.length; i++) { 2107 elements[i].classList.remove(class_name); 2108 } 2109 2110 return elements; 2111 }, 2112 2113 _get_index: function(element, number) { 2114 var _this = this; 2115 2116 if (number >= (element.length * 2)) { 2117 number = number - (element.length * 2); 2118 } 2119 2120 if (number >= element.length) { 2121 number = number - element.length; 2122 } 2123 2124 if (number < 0) { 2125 number = number + element.length; 2126 } 2127 2128 return number; 2129 }, 2130 2131 _set_slides_animation: function() { 2132 var slide_length_third = this.$slides.length / 3; 2133 2134 this.$slides = this._remove_all_classes(this.$slides, 'animated'); 2135
2136 for (var i = -1; i <= slide_length_third; i++) { 2137 var index = this._get_index(this.$slides, this.active_index + i); 2138 this.$slides[index].classList.add('animated'); 2139 } 2140 }, 2141 2142 _set_active_slide: function() { 2143 var index = this._get_index(this.$slides, this.active_index); 2144 2145 this.$slides = this._remove_all_classes(this.$slides, 'active'); 2146 this.$slides[index].classList.add('active'); 2147 }, 2148 2149 _set_slides_position: function() { 2150 var slide_length_half = Math.floor(this.$slides.length / 2); 2151 2152 for (var i = -slide_length_half - 1; i <= slide_length_half; i++) { 2153 var index = this._get_index(this.$slides, this.active_index + i); 2154 this.$slides[index].setAttribute('data-position', i * 100); 2155 } 2156 }, 2157 2158 _set_slides_visibility: function() { 2159 var slide_length_third = this.$slides.length / 3; // this.$slides.length / 3 2160 2161 this.$slides = this._remove_all_classes(this.$slides, 'visible'); 2162 2163 for (var i = -4; i <= slide_length_third; i++) { 2164 var index = this._get_index(this.$slides, this.active_index + i); 2165 this.$slides[index].classList.add('visible'); 2166 } 2167 }, 2168 2169 _set_slides_aria_attributes: function() { 2170 for (var i = 0; i < this.$slides.length; i++) { 2171 var index = this._get_index(this.$slides, this.active_index + i); 2172 var focusable_elements = this.$slides[index].querySelectorAll('a, button, select, input, textarea, [tabindex="0"], iframe, details') 2173 2174 for (var j = 0; j < focusable_elements.length; j++) { 2175 focusable_elements[j].setAttribute('tabindex', -1) 2176 } 2177 2178 this.$slides[index].setAttribute('aria-hidden', true); 2179 } 2180 2181 var index = this._get_index(this.$slides, this.active_index); 2182 this.$slides[index].setAttribute('aria-hidden', false); 2183 var active_focusable_elements = this.$slides[index].querySelectorAll('a, button, select, input, textarea, iframe, details') 2184 for (var i = 0; i < active_focusable_elements.length; i++) { 2185 active_focusable_elements[i].setAttribute('tabindex', 0) 2186 } 2187 } 2188 }; 2189 2190 var $slider = document.querySelectorAll(['.slider']); 2191 2192 for (var i = 0; i < $slider.length; i++) { 2193 new Slider($slider[i]).init(); 2194 } 2195})(document, window); 2196 2197/* Source common/js/scripts/78_form_toggle_popup.js */ 2198 2199// SUCHE (BOX) 2200// ------------------------------------------------------------------------------------------------- 2201 2202(function(document) { 2203 var FormPopupBox = function($toggle_popup_box) { 2204 var _this = this, 2205 controls; 2206 2207 _this.$toggle_popup_box = $toggle_popup_box.querySelector('label'); 2208 _this.$open_popup_box = $toggle_popup_box.querySelector('.open_popup_box'); 2209 _this.$popup_box_state = document.querySelector('#' + _this.$toggle_popup_box.getAttribute('for')); 2210 2211 controls = _this.$open_popup_box.getAttribute('aria-controls'); 2212 2213 _this.$popup_box = document.getElementById(controls); 2214 _this.$submit_button = _this.$popup_box.querySelector('button[type="submit"]'); 2215 2216 _this.$close_popup_box = _this.$popup_box.querySelector('.close_popup_box'); 2217 _this.$focus_elements = _this.$popup_box.querySelectorAll('input:not([type="hidden"]):not(#empty), select, button, a'); 2218 2219 console.log(_this.$focus_elements); 2220 2221 _this.$key = { 2222 'escape' : 27, 2223 'space' : 32, 2224 'tab' : 9 2225 }; 2226 }; 2227 2228 FormPopupBox.prototype = { 2229 init: function() { 2230 var _this = this; 2231 2232 _this.$toggle_popup_box.addEventListener('click', _this._toggle.bind(_this)); 2233 _this.$open_popup_box.addEventListener('click', _this._open.bind(_this)); 2234 _this.$close_popup_box.addEventListener('click', _this._close.bind(_this)); 2235 2236 _this.$popup_box.addEventListener('transitionend', function(event) { 2237 if (event.target !== this) { 2238 return; 2239 } 2240 2241 if (_this.$popup_box_state.checked) { 2242 _this.$focus_elements[0].focus(); 2243 } 2244 }); 2245 2246 _this._init_keyboard(); 2247 }, 2248 2249 _init_keyboard: function() { 2250 var _this = this; 2251 2252 _this.$open_popup_box.addEventListener('keydown', function(event) { 2253 if (event.keyCode === _this.$key.space) { 2254 event.preventDefault(); 2255 } 2256 }); 2257 2258 _this.$close_popup_box.addEventListener('keydown', function(event) { 2259 if (event.keyCode === _this.$key.space) { 2260 event.preventDefault(); 2261 } 2262 }); 2263 2264 document.addEventListener('keydown', function(event) { 2265 if (!_this.$popup_box_state.checked) { 2266 return; 2267 } 2268 2269 switch(event.keyCode) { 2270 case _this.$key.escape: 2271 _this._close(event); 2272 break; 2273 2274 case _this.$key.tab: 2275 event.preventDefault(); 2276 2277 if (event.shiftKey) { 2278 _this._focus_element_with_shift_tab_key(event); 2279 } 2280 else { 2281 _this._focus_element_with_tab_key(event); 2282 } 2283 2284 break; 2285 } 2286 }); 2287 }, 2288 2289 _focus_element_with_shift_tab_key: function() { 2290 var _this = this; 2291 2292 _this.tab_index -= 1; 2293 2294 if (_this.$submit_button === _this.$focus_elements[_this.tab_index] && 2295 _this.$submit_button.getAttribute('disabled') === 'disabled') { 2296 _this.tab_index -= 1; 2297 } 2298 if (_this.tab_index < 0) { 2299 _this.tab_index = _this.$focus_elements.length - 1; 2300 } 2301 2302 _this.$focus_elements[_this.tab_index].focus(); 2303 }, 2304 2305 _focus_element_with_tab_key: function() { 2306 var _this = this; 2307 2308 if (_this.tab_index === _this.$focus_elements.length - 1) { 2309 _this.tab_index = 0; 2310 } 2311 else { 2312 _this.tab_index += 1; 2313 } 2314 2315 if (_this.$submit_button === _this.$focus_elements[_this.tab_index] && 2316 _this.$submit_button.getAttribute('disabled') === 'disabled') { 2317 _this.tab_index += 1; 2318 } 2319 2320 _this.$focus_elements[_this.tab_index].focus(); 2321 }, 2322 2323 _toggle: function(event) { 2324 var _this = this; 2325 2326 if (_this.$popup_box_state.checked) { 2327 _this._close(event); 2328 } 2329 else { 2330 _this._open(event); 2331 } 2332 }, 2333 2334 _open: function(event) { 2335 var _this = this; 2336 2337 event.preventDefault(); 2338 2339 _this.$popup_box_state.checked = true; 2340 _this.tab_index = 0; 2341 }, 2342 2343 _close: function(event) { 2344 var _this = this; 2345 2346 event.preventDefault(); 2347 2348 _this.$popup_box_state.checked = false;
2349 _this.$open_popup_box.focus(); 2350 _this.tab_index = 0; 2351 2352 if (event.type === 'click') { 2353 _this.$open_popup_box.setAttribute('data-focus-method', 'mouse'); 2354 } 2355 } 2356 }; 2357 2358 var $toggle_popup_box = document.getElementsByClassName('toggle_popup_box'); 2359 2360 for (var i = 0, len = $toggle_popup_box.length; i < len; i++) { 2361 new FormPopupBox($toggle_popup_box[i]).init(); 2362 } 2363})(document); 2364 2365/* Source common/js/scripts/82_scrolled_down_header.js */ 2366 2367// SCROLL DOWN HEADER 2368// Vergibt eine Klasse scrolled_down auf den Header 2369// ------------------------------------------------------------------------------------------------- 2370 2371(function(document, window) { 2372 var scrolled_down = function($animated_element) { 2373 var _this = this; 2374 _this._$animated_element = $animated_element; 2375 }; 2376 2377 scrolled_down.prototype = { 2378 2379 init: function() { 2380 var _this = this; 2381 2382 _this._is_scrolled_down(); 2383 window.addEventListener('scroll', this._is_scrolled_down.bind(_this), true); 2384 }, 2385 2386 _is_scrolled_down: function() { 2387 var _this = this; 2388 2389 if (window.pageYOffset > 40) { 2390 _this._$animated_element.classList.add('scrolled_down'); 2391 } else { 2392 _this._$animated_element.classList.remove('scrolled_down'); 2393 } 2394 } 2395 }; 2396 2397 var $animated_elements = document.querySelectorAll('body'); 2398 2399 for (var i = 0, len = $animated_elements.length; i < len; i++) { 2400 new scrolled_down($animated_elements[i]).init(); 2401 } 2402 2403}(document, window)); 2404 2405/* Source common/js/scripts/86_infolists_add_tabindex.js */ 2406 2407// INFOLISTEN: Tabindex zu infolist_text hinzufügen, wenn dies innerhalb eines text_containers ist 2408// ------------------------------------------------------------------------------------------------- 2409 2410(function() { 2411 var $infolist_texts = document.querySelectorAll('.infolist_text'); 2412 2413 for (var i = 0, len = $infolist_texts.length; i < len; i++) { 2414 var parent = $infolist_texts[i].parentNode; 2415 2416 if (parent && parent.classList.contains("infolist_text_container")) { 2417 $infolist_texts[i].tabIndex = 0; 2418 } 2419 } 2420}()); 2421 2422/* Source common/js/scripts/87_social_media_share_popup.js */ 2423 2424// INFOLISTEN: WEITERE WERTE 2425// Wird verwendet für Wichtige Beträge (show_more_content) 2426// ------------------------------------------------------------------------------------------------- 2427 2428(function(window) { 2429 var $share_button = document.querySelectorAll('.share_button'); 2430 2431 for (var i = 0, len = $share_button.length; i < len; i++) { 2432 $share_button[i].addEventListener('click', function(event) { 2433 event.preventDefault(); 2434 2435 var _this = this, 2436 href = _this.getAttribute('href'); 2437 2438 window.open(href,'Inhalt teilen','height=450, width=550, top=' + (window.innerHeight / 2 - 275) + ', left=' + (window.innerWidth / 2 - 225) + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0'); 2439 }); 2440 } 2441}(window)); 2442 2443/* Source common/js/scripts/88_parallax.js */ 2444 2445function parallax() { 2446 var scroll_top = window.pageYOffset, 2447 $header_picture = document.getElementById('header_image'); 2448 2449 $header_picture.style.transform = "translateY(" + (scroll_top / 2.5) + "px)"; 2450} 2451 2452parallax(); 2453 2454window.addEventListener('resize', parallax); 2455window.addEventListener('scroll', parallax); 2456/* Source common/js/scripts/90_vcard.js */ 2457 2458// VCARD SWITCHER FÃR DESKTOP/MOBIL 2459// Wird verwendet für: team_overview, team_entry, address_vcard_button, steuernews_contact_person 2460// ------------------------------------------------------------------------------------------------- 2461 2462(function(document) { 2463 if (device.mobile || device.tablet) { 2464 return; 2465 } 2466 2467 var $vcards = document.querySelectorAll('[data-vcard-href]'); 2468 2469 for (var i = 0, len = $vcards.length; i < len; i++) { 2470 var $vcard = $vcards[i], 2471 href = $vcard.getAttribute('data-vcard-href'); 2472 2473 if (href) { 2474 $vcard.setAttribute('href', href); 2475 $vcard.removeAttribute('data-vcard-href'); 2476 } 2477 } 2478}(document)); 2479 2480/* Source common/js/scripts/93_background_image_slider_overview.js */ 2481 2482// Slideshow Animation 2483(function(document) {
2484 var BackgroundImageSlider = function($slider) { 2485 var _this = this; 2486 _this.$slider = $slider; 2487 _this.$slides = _this.$slider.querySelectorAll('.background_image_wrapper'), 2488 _this.$dots = _this.$slider.querySelectorAll('.pagination .item'), 2489 _this.$prev = _this.$slider.querySelector('.navigation_wrapper .prev'), 2490 _this.$next = _this.$slider.querySelector('.navigation_wrapper .next'), 2491 _this.index = 0, 2492 _this.oldindex = 0, 2493 _this.time = 8000, 2494 _this.intervall, 2495 _this.touch_start_x; 2496 }; 2497 2498 BackgroundImageSlider.prototype = { 2499 init: function() { 2500 var _this = this; 2501 2502 if (_this.$slides.length > 1) { 2503 _this._init_mouse(); 2504 _this._init_touch(); 2505 _this.intervall = setInterval(_this._callIntervall.bind(this), _this.time); 2506 } 2507 }, 2508 2509 _init_mouse: function() { 2510 var _this = this; 2511 2512 for (var i = 0; i < _this.$dots.length; i++) { 2513 _this.$dots[i].index = i; 2514 _this.$dots[i].addEventListener('click', function(event) { 2515 event.preventDefault(); 2516 _this._changeSlider(this.index); 2517 }, false); 2518 } 2519 if (_this.$prev) { 2520 _this.$prev.addEventListener('click', function(event) { 2521 event.preventDefault(); 2522 _this._changeSlider(_this.index - 1); 2523 }, false); 2524 } 2525 if (_this.$next) { 2526 _this.$next.addEventListener('click', function(event) { 2527 event.preventDefault(); 2528 _this._changeSlider(_this.index + 1); 2529 }, false); 2530 } 2531 }, 2532 2533 _changeSlider: function(newIndex) { 2534 clearInterval(this.intervall); 2535 this.intervall = setInterval(this._callIntervall.bind(this), this.time); 2536 2537 if (newIndex === this.index) { 2538 return; 2539 } 2540 2541 if (newIndex < 0) { 2542 newIndex = this.$slides.length - 1; 2543 } 2544 if (newIndex > this.$slides.length - 1) { 2545 newIndex = 0; 2546 } 2547 2548 this.oldindex = this.index; 2549 this.index = newIndex; 2550 this.$slides[this.index].classList.add('show'); 2551 this.$slides[this.oldindex].classList.remove('show'); 2552 2553 if (this.$dots && this.$dots.length > 0) { 2554 this.$dots[this.index].classList.add('active'); 2555 this.$dots[this.oldindex].classList.remove('active'); 2556 } 2557 }, 2558 2559 _init_touch: function() { 2560 var _this = this 2561 _this.$slider.addEventListener('touchstart', function(event) { 2562 _this.touch_start_x = event.changedTouches[0].pageX; 2563 }); 2564 2565 _this.$slider.addEventListener('touchmove', function(event) { 2566 var touch = event.touches[0] || event.changedTouches[0], 2567 touch_x = touch.pageX; 2568 2569 if ((touch_x - _this.touch_start_x > 50) || (touch_x - _this.touch_start_x < -50)) { 2570 event.preventDefault(); 2571 } 2572 }); 2573 2574 _this.$slider.addEventListener('touchend', function(event) { 2575 var touch = event.touches[0] || event.changedTouches[0], 2576 touch_x = touch.pageX; 2577 2578 if (touch_x - _this.touch_start_x > 50) { 2579 _this._changeSlider(_this.index - 1); 2580 } 2581 else if (touch_x - _this.touch_start_x < -50) { 2582 _this._changeSlider(_this.index + 1); 2583 } 2584 }); 2585 }, 2586 2587 _callIntervall: function() { 2588 this._changeSlider(this.index + 1); 2589 }, 2590 2591 }; 2592 2593 var $slider = document.querySelectorAll('.background_image_slider_overview'); 2594 2595 for (var i = 0; i < $slider.length; i++) { 2596 new BackgroundImageSlider($slider[i]).init(); 2597 } 2598 2599})(document); 2600 2601/* Source common/js/scripts/94_slider.js */ 2602 2603// SLIDER 2604// Wird verwendet für: steuernews_article_slider 2605// ------------------------------------------------------------------------------------------------- 2606 2607(function(document, window) { 2608 var Slider = function($slider) { 2609 var _this = this; 2610 2611 _this._$slider = $slider;
2612 _this._$slides = $slider.querySelectorAll('[data-slide]'); 2613 _this._$status = $slider.querySelectorAll('[data-slider-status]'); 2614 2615 _this._animated = true; 2616 _this._touch_flag = false; 2617 }; 2618 2619 Slider.prototype = { 2620 init: function() { 2621 var _this = this; 2622 2623 _this._init_animation(); 2624 _this._init_mouse(); 2625 _this._init_touch(); 2626 }, 2627 2628 _init_mouse: function() { 2629 var _this = this; 2630 2631 _this._$slider.addEventListener('mouseover', function() { 2632 _this._animated = false; 2633 }); 2634 2635 _this._$slider.addEventListener('mouseout', function() { 2636 _this._animated = true; 2637 }); 2638 }, 2639 2640 _init_touch: function() { 2641 var _this = this; 2642 2643 _this._$slider.addEventListener('touchstart', function(event) { 2644 _this._touch_start_x = event.changedTouches[0].pageX; 2645 _this._touch_start_y = event.changedTouches[0].pageY; 2646 _this._animated = false; 2647 }, { 2648 'passive' : true 2649 }); 2650 2651 _this._$slider.addEventListener('touchmove', function(event) { 2652 if (_this._touch_flag) { 2653 return; 2654 } 2655 2656 var touch = event.touches[0] || event.changedTouches[0], 2657 touch_x = touch.pageX; 2658 2659 if (touch_x - _this._touch_start_x > 40) { 2660 _this._touch_flag = true; 2661 _this._prev_slide(); 2662 } 2663 else if (touch_x - _this._touch_start_x < -40) { 2664 _this._touch_flag = true; 2665 _this._next_slide(); 2666 } 2667 }, { 2668 'passive' : true 2669 }); 2670 2671 _this._$slider.addEventListener('touchend', function() { 2672 _this._touch_flag = false; 2673 _this._animated = true; 2674 }); 2675 }, 2676 2677 _init_animation: function() { 2678 var _this = this, 2679 start, 2680 progress; 2681 2682 function step(timestamp) { 2683 if (!start || !_this._animated) { 2684 start = timestamp; 2685 } 2686 2687 progress = timestamp - start; 2688 2689 if (progress >= 5000) { 2690 _this._next_slide(); 2691 start = timestamp; 2692 } 2693 2694 window.requestAnimationFrame(step); 2695 } 2696 2697 window.requestAnimationFrame(step); 2698 }, 2699 2700 _prev_slide: function() { 2701 var _this = this; 2702 2703 for (var index = 0, len = _this._$status.length; index < len; index++) { 2704 var checked = _this._$status[index].checked; 2705 2706 if (checked) { 2707 _this._$slides[index].querySelector('[data-prev-slide]').click(); 2708 break; 2709 } 2710 } 2711 }, 2712 2713 _next_slide: function() { 2714 var _this = this; 2715 2716 for (var index = 0, len = _this._$status.length; index < len; index++) { 2717 var checked = _this._$status[index].checked; 2718 2719 if (checked) { 2720 _this._$slides[index].querySelector('[data-next-slide]').click(); 2721 break; 2722 } 2723 } 2724 }, 2725 }; 2726 2727 var $sliders = document.querySelectorAll('[data-slider]'); 2728 2729 for (var i = 0, len = $sliders.length; i < len; i++) { 2730 new Slider($sliders[i]).init(); 2731 } 2732})(document, window); 2733 2734/* Source common/js/scripts/96_open_street_map.js */ 2735 2736// OPEN STREET MAPS 2737// ------------------------------------------------------------------------------------------------- 2738 2739(function(window) { 2740 var OpenStreetMap = function(id, locations, additional_markers, options) { 2741 this.id = id; 2742 this.locations = locations; 2743 this.additional_markers = additional_markers; 2744 this.options = options; 2745 this.$map_id = document.querySelector('#open_street_map_' + this.id); 2746 this.$layer_additional_markers = []; 2747 this.window_width = window.innerWidth; 2748 this.$selected_location; 2749 this.$map; 2750 }; 2751 2752 OpenStreetMap.prototype = { 2753 init: function() { 2754 var _this = this; 2755 2756 this._init_map(); 2757 this._init_locations_markers(); 2758 this._init_additional_markers(); 2759 this._init_plan_route(); 2760 2761 window.addEventListener('resize', function() { 2762 2763 // Manche mobilen Geräte lösen beim vertikalen Scrollen ein resize-Event aus, da die Browserleiste ein-/ausgeblendet wird 2764 2765 if (_this.window_width !== window.innerWidth) { 2766 _this.window_width = window.innerWidth; 2767 _this._center_map(); 2768 } 2769 }); 2770 }, 2771 2772 // OpenStreetMap Karte initialisieren 2773 2774 _init_map: function() { 2775 var _this = this; 2776 $view = new ol.View({ 2777 center: ol.proj.fromLonLat([this.options.center_lng, this.options.center_lat]), 2778 zoom: this.options.zoom, 2779 minZoom: this.options.min_zoom, 2780 maxZoom: this.options.max_zoom, 2781 enableRotation: false 2782 }); 2783 2784 var url = '/maps/tile/{z}/{x}/{y}.png'; 2785 2786 // Anderer Tiles Server für die Verwendung auf der Beta 2787 if (window.location.hostname === 'beta.atikon.io') {
2788 url = 'https://maps.atikon.com/maps/tile/{z}/{x}/{y}.png'; 2789 } 2790 2791 var tile = new ol.layer.Tile({ 2792 source: new ol.source.OSM({ 2793 url: url 2794 }) 2795 }); 2796 2797 this.$map = new ol.Map({ 2798 2799 // Auf iOS-Geräten soll das Srollen in der Karte nur mit zwei Fingern möglich sein. iOS benötigt ein eigenes Handling. Nur im Konstruktor der Map funktioniert dieser Event-Listener in Kombination mit DragPan flüssig. Bei Chrome greift ein CSS Regel. 2800 2801 interactions: ol.interaction.defaults({ 2802 dragPan: false, // Lösche die DragPan Standard Funktion 2803 mouseWheelZoom: false // Kein Zoomen beim Betätigen des Mausrads 2804 }).extend([new ol.interaction.DragPan({ 2805 2806 // Fügt eine eigene abgeleitete Drag Funktion ein und erweitere die Standardfunktionen um diese 2807 2808 condition: function(event) { 2809 2810 // Wenn iOS: return regelt das Aktivieren der Drag-Funktion 2811 2812 if (document.querySelector('html').classList.contains('ios')) { 2813 2814 // Chrome hat momentan ein Pointer-Event und kein Touch-Event wie iOS 2815 2816 if (event.originalEvent.touches) {
2817 var $map_overlay = _this.$map_id.querySelector('.map_overlay'); 2818 2819 if (event.originalEvent.touches.length > 1) { 2820 $map_overlay.classList.remove('show'); 2821 } else { 2822 2823 // Blende eine Bedienwarnung "zwei Finger zum Verschieben" ein 2824 2825 $map_overlay.classList.add('show'); 2826 setTimeout(function() { 2827 $map_overlay.classList.remove('show'); 2828 }, 1000); 2829 return false; 2830 } 2831 } 2832 } 2833 2834 return true; 2835 } 2836 })]), 2837 target: 'map_' + this.id, 2838 layers: [tile], 2839 loadTilesWhileAnimating: true, 2840 view: $view 2841 }); 2842 2843 // Soll Karte nach Graustufen konvertiert werden? 2844 2845 if (this.options.grayscale) { 2846 tile.on('postcompose', function(event) { 2847 var imageData = _this._convert_map_to_greyscale(event.context) 2848 event.context.putImageData(imageData, 0, 0); 2849 }); 2850 } 2851 2852 this._setup_zoom_buttons(); 2853 }, 2854 2855 // Zoom Buttons als inaktiv kennzeichnen 2856 2857 _setup_zoom_buttons: function() { 2858 var _this = this, 2859 $zoom_in_button = this.$map_id.querySelector('.ol-zoom-in'), 2860 $zoom_out_button = this.$map_id.querySelector('.ol-zoom-out'), 2861 $view = this.$map.getView(); 2862 2863 if ($view.getZoom() >= this.options.max_zoom) { 2864 $zoom_in_button.classList.add('disabled'); 2865 } 2866 if ($view.getZoom() <= this.options.min_zoom) { 2867 $zoom_out_button.classList.add('disabled'); 2868 } 2869 2870 $view.on('change:resolution', function() { 2871 if ($view.getZoom() >= _this.options.max_zoom) { 2872 $zoom_in_button.classList.add('disabled'); 2873 } else { 2874 $zoom_in_button.classList.remove('disabled'); 2875 } 2876 2877 if ($view.getZoom() <= _this.options.min_zoom) { 2878 $zoom_out_button.classList.add('disabled'); 2879 } else { 2880 $zoom_out_button.classList.remove('disabled'); 2881 } 2882 }); 2883 }, 2884 2885 // Karte nach Graustufen konvertieren 2886 2887 _convert_map_to_greyscale: function(context) { 2888 var imageData = context.getImageData(0, 0, context.canvas.width, context.canvas.height), 2889 data = imageData.data; 2890 2891 for (i = 0; i < data.length; i = i + 4) { 2892 var red = data[i], 2893 green = data[i + 1], 2894 blue = data[i + 2], 2895 alpha = data[i + 3]; 2896 2897 var average = (red + green + blue) / 3; 2898 2899 // Beim Laden der Karte die Transparenz auf Null setzen 2900 2901 if (average === 0) { 2902 alpha = 0; 2903 } else { 2904 alpha = 255; 2905 } 2906 2907 data[i] = average; // Rot 2908 data[i + 1] = average; // Grün 2909 data[i + 2] = average; // Blau 2910 data[i + 3] = alpha; // Alpha 2911 } 2912 2913 return imageData; 2914 }, 2915 2916 // Marker für Standort positionieren 2917 2918 _init_locations_markers: function() { 2919 for (var i = 0; i < this.locations.length; i++) { 2920 2921 $marker = this._add_marker( 2922 this.locations[i].lng, 2923 this.locations[i].lat, 2924 this.locations[i].marker 2925 ); 2926 2927 this.$map.addLayer($marker); 2928 $marker.setZIndex(10); 2929 } 2930 2931 if (this.locations.length === 1) { 2932 this.$selected_location = this.locations[0]; 2933 } 2934 2935 this._center_map(); 2936 }, 2937 2938 // Zusätzlich Marker positionieren 2939 2940 _init_additional_markers: function() { 2941 for (var i = 0; i < this.additional_markers.length; i++) { 2942 $marker = this._add_marker( 2943 this.additional_markers[i].lng, 2944 this.additional_markers[i].lat, 2945 this.additional_markers[i].marker 2946 ); 2947 2948 this.$layer_additional_markers.push($marker); 2949 this.$map.addLayer($marker); 2950 $marker.setZIndex(8); 2951 $marker.setVisible(false); 2952 } 2953 2954 if (this.additional_markers.length > 0) { 2955 this._manage_additional_markers_visibility(); 2956 var _this = this; 2957 2958 this.$map.getView().on('propertychange', function(event) { 2959 if (event.key === 'resolution') { 2960 _this._manage_additional_markers_visibility(); 2961 } 2962 }); 2963 } 2964 }, 2965 2966 // Zusätzlich Marker Sichtbarkeit anhand der Zoomstufe regulieren 2967 2968 _manage_additional_markers_visibility: function() { 2969 for (var i = 0; i < this.additional_markers.length; i++) { 2970 if (this.$map.getView().getZoom() >= this.additional_markers[i].min_zoom_visible) { 2971 this.$layer_additional_markers[i].setVisible(true); 2972 } else { 2973 this.$layer_additional_markers[i].setVisible(false); 2974 } 2975 } 2976 }, 2977 2978 // Routenplanung initialisieren 2979 2980 _init_plan_route: function() { 2981 var _this = this, 2982 $destination_select = this.$map_id.querySelector('select'), 2983 $plan_route_form = this.$map_id.querySelector('form'); 2984 2985 if ($plan_route_form) { 2986 2987 // Mehrere Standorte? 2988 2989 if ($destination_select) { 2990 $destination_select.addEventListener('change', function() { 2991 if (this.options[this.selectedIndex].value !== '') { 2992 _this.$selected_location = _this.locations[(this.options[this.selectedIndex].value)]; 2993 _this._update_plan_route_form($plan_route_form); 2994 } else { 2995 2996 // Kein Standort ausgewählt 2997 _this.$selected_location = ''; 2998 $plan_route_form.action = ''; 2999 _this._center_map(); 3000 } 3001 _this._center_map(); 3002 }); 3003 } else { 3004 _this._update_plan_route_form($plan_route_form); 3005 } 3006 } 3007 }, 3008 3009 // Aktion für die Routenplanung via GoogleMaps zusammenbauen 3010 3011 _update_plan_route_form: function($form) { 3012 var $daddr = this.$map_id.querySelector('[name="daddr"]'); 3013 3014 $form.action = 'https://maps.google.de/maps'; 3015 $daddr.value = this.$selected_location.postal_code + ' ' + this.$selected_location.locality + ', ' + this.$selected_location.street_address; 3016 }, 3017 3018 // Standardaktion für das Setzen von Markierungen (Standort und zusätzliche Markierungen) 3019 3020 _add_marker: function(lng, lat, marker) { 3021 return new ol.layer.Vector({ 3022 source: new ol.source.Vector({ 3023 features: [new ol.Feature({ 3024 geometry: new ol.geom.Point( 3025 ol.proj.transform([lng, lat], 3026 this.options.dataProjection, 3027 this.options.featureProjection 3028 )), 3029 })] 3030 }), 3031
3032 // Dient zur Ausrichtung der Markierung 3033 3034 style: new ol.style.Style({ 3035 image: new ol.style.Icon({ 3036 anchor: [0.5, 1], 3037 anchorXUnits: 'fraction', 3038 anchorYUnits: 'fraction', 3039 src: marker['href'], 3040 scale: 0.5, 3041 maxZoom: 1, 3042 }) 3043 }) 3044 }); 3045 }, 3046 3047 // Standardaktion zum Zentrieren der Karte 3048 3049 _center_map: function() { 3050 3051 // Ist eine Zentrierung der Karte gewünscht? 3052 3053 if (this.options.center_lng === 0 && this.options.center_lat === 0) { 3054 3055 // Gibt es nur einen Standort bzw. ist einer ausgewählt? 3056 3057 if (this.locations.length === 1 || this.$selected_location) { 3058 this._center_map_point( 3059 this.$selected_location.lng, 3060 this.$selected_location.lat, 3061 this.options.zoom 3062 ); 3063 } else { 3064 // mehrere Standorte anzeigen 3065 3066 this._center_map_more_locations(); 3067 } 3068 } else { 3069 this._center_map_point( 3070 this.options.center_lng, 3071 this.options.center_lat, 3072 this.options.center_zoom 3073 ); 3074 } 3075 }, 3076 3077 // Karte auf einen Punkt zentrieren 3078 3079 _center_map_point: function(lng, lat, zoom) { 3080 this.$map.getView().animate({ 3081 center: ol.proj.fromLonLat([lng, lat]), 3082 duration: 500, 3083 zoom: zoom 3084 }); 3085 }, 3086 3087 // Karte neu zentrieren anhand von mehreren Standorten mit einem Sicherheitsabstand 3088 3089 _center_map_more_locations: function() { 3090 var extent = ol.proj.transformExtent( 3091 this._get_locations_bounds(), 3092 this.options.dataProjection, 3093 this.options.featureProjection 3094 ); 3095 3096 this.$map.getView().fit(extent, { 3097 size: this.$map.getSize(), 3098 padding: this._max_marker_padding(), 3099 constrainResolution: false, 3100 duration: 500 3101 }); 3102 }, 3103 3104 // Minimale und maximale Grenzen der Standorte als Koordinaten-Array 3105 3106 _get_locations_bounds: function() { 3107 var lng_min = this.locations[0].lng, 3108 lng_max = this.locations[0].lng, 3109 lat_min = this.locations[0].lat, 3110 lat_max = this.locations[0].lat; 3111 3112 for (var i = 1; i < this.locations.length; i++) { 3113 if (this.locations[i].lng > lng_max) { 3114 lng_max = this.locations[i].lng; 3115 } 3116 if (this.locations[i].lng < lng_min) { 3117 lng_min = this.locations[i].lng; 3118 } 3119 if (this.locations[i].lat > lat_max) { 3120 lat_max = this.locations[i].lat; 3121 } 3122 if (this.locations[i].lat < lat_min) { 3123 lat_min = this.locations[i].lat; 3124 } 3125 } 3126 3127 return [lng_min, lat_min, lng_max, lat_max]; 3128 }, 3129 3130 // Sicherheitsabstand der Markierungen zum User-Interface und den Kartenrändern 3131 3132 _max_marker_padding: function() { 3133 var max_height = 0, 3134 max_width = 0, 3135 default_padding = 30 3136 result = []; 3137 3138 for (var i = 0; i < this.locations.length; i++) { 3139 if (this.locations[i].marker.width > max_width) { 3140 max_width = this.locations[i].marker.width; 3141 } 3142 if (this.locations[i].marker.height > max_height) { 3143 max_height = this.locations[i].marker.height; 3144 } 3145 } 3146 3147 result = [max_height + default_padding, max_width / 2 + default_padding + this.$map_id.querySelector('button').offsetWidth, default_padding, max_width / 2 + default_padding]; 3148 3149 return result; 3150 } 3151 }; 3152
3153 // Hole von jeder Karte die vorkommt die Daten und lege ein eigenes JavaScript-Objekt an 3154 3155 if (window.$open_street_map_data) { 3156 for (var i = 0, len = window.$open_street_map_data.length; i < len; i++) { 3157 var id = window.$open_street_map_data[i].id, 3158 locations = window.$open_street_map_data[i].locations, 3159 additional_markers = window.$open_street_map_data[i].additional_markers, 3160 options = window.$open_street_map_data[i].options; 3161 3162 new OpenStreetMap(id, locations, additional_markers, options).init(); 3163 } 3164 } 3165 3166})(window); 3167 3168/* Source common/js/scripts/97_accordion.js */ 3169 3170// ACCORDION 3171// Wird verwendet für: infolist_list_content, listfoldercontent, u_online_benefits_1 3172// ------------------------------------------------------------------------------------------------- 3173 3174(function(document, window) { 3175 var Accordion = function($accordion) { 3176 this.$accordion = $accordion; 3177 this.$tabs = $accordion.querySelectorAll('[role=tab]'); 3178 this.one_tab_open = true; // only one Tab open 3179 } 3180 Accordion.prototype = { 3181 init: function() { 3182 var _this = this; 3183 3184 window.addEventListener('load', function() { 3185 var interval = setInterval(function() { // Timeout notwendig wegen SmoothScroll (hash) 3186 clearInterval(interval); 3187 _this._init_tabs(); 3188 _this._init_location_hash(); 3189 _this._init_keyboard_nav(); 3190 _this._on_window_resize(); 3191 }, 300); 3192 }); 3193 }, 3194 3195 _on_window_resize: function() { 3196 var _this = this, 3197 window_width = window.innerWidth; 3198 3199 window.addEventListener('resize', function() { 3200 var interval; 3201 3202 if (window_width != window.innerWidth) { // Notwendig damit die Veränderung der Höhe der Seite nicht den Event auslöst 3203 _this._set_tab_max_height(); 3204 3205 interval = setInterval(function() { // Macht die Animation sauberer - eliminiert Ruckeln 3206 clearInterval(interval); 3207 for (var i = 0; i < _this.$tabs.length; i++) { 3208 _this.$tabs[i].$tabpanel.classList.add('animated'); 3209 } 3210 }, 50); 3211 } 3212 }); 3213 }, 3214 3215 _init_tabs: function() { 3216 var _this = this; 3217 3218 for (var i = 0; i < _this.$tabs.length; i++) { 3219 _this.$tabs[i].index = i; 3220 _this.$tabs[i].$tabpanel = document.querySelector('#' + _this.$tabs[i].getAttribute('aria-controls')); 3221 3222 _this.$tabs[i].addEventListener('click', function(event) { 3223 event.preventDefault(); 3224 _this._toggle_tabpanel(this); 3225 }); 3226 } 3227 3228 _this._set_tab_max_height(); 3229 3230 for (var i = 0; i < _this.$tabs.length; i++) { 3231 _this.$tabs[i].$tabpanel.classList.add('animated'); 3232 } 3233 }, 3234 3235 _init_location_hash: function() { 3236 var anchor = location.hash; 3237 3238 if (anchor.length > 0) { 3239 var $accordion_entry = this.$accordion.querySelector(anchor); 3240 3241 if ($accordion_entry) { 3242 this._open_tabpanel($accordion_entry); 3243 } 3244 } 3245 }, 3246 3247 _toggle_tabpanel: function($tab) { 3248 if ($tab.getAttribute('aria-expanded') === 'true') { 3249 this._close_tabpanel($tab); 3250 } else { 3251 this._open_tabpanel($tab); 3252 this._change_hash($tab); 3253 3254 if (this.one_tab_open) { 3255 this._close_other_tabs($tab); 3256 } 3257 } 3258 }, 3259 3260 _close_tabpanel: function($tab) { 3261 $tab.setAttribute('aria-expanded', 'false'); 3262 $tab.$tabpanel.setAttribute('aria-hidden', 'true'); 3263 $tab.$tabpanel.style.maxHeight = 0; 3264 }, 3265 3266 _open_tabpanel: function($tab) { 3267 $tab.setAttribute('aria-expanded', 'true'); 3268 $tab.$tabpanel.setAttribute('aria-hidden', 'false'); 3269 $tab.$tabpanel.style.maxHeight = $tab.$tabpanel.max_height + 'px'; 3270 }, 3271 3272 _change_hash: function($tab) { 3273 var scroll_to_x = window.pageXOffset, 3274 scroll_to_y = window.pageYOffset; 3275 3276 window.location.hash = $tab.getAttribute('id');
3277 window.scrollTo(scroll_to_x, scroll_to_y); // Verhindert das Springen vom Browser durch den Hash 3278 }, 3279 3280 _close_other_tabs: function($tab) { 3281 for (var i = 0; i < this.$tabs.length; i++) { 3282 if (this.$tabs[i] !== $tab) { 3283 this._close_tabpanel(this.$tabs[i]); 3284 } 3285 } 3286 }, 3287 3288 _set_tab_max_height: function() { 3289 for (var i = 0; i < this.$tabs.length; i++) { 3290 var $tab = this.$tabs[i], 3291 is_active_tab = $tab.getAttribute('aria-expanded'); 3292 3293 $tab.$tabpanel.classList.remove('animated'); 3294 $tab.$tabpanel.style.maxHeight = 'none'; 3295 3296 // Ãffne das Element und setzte die Höhe nicht 3297 $tab.setAttribute('aria-expanded', 'true'); 3298 $tab.$tabpanel.setAttribute('aria-hidden', 'false'); 3299 $tab.$tabpanel.max_height = $tab.$tabpanel.clientHeight; 3300 3301 if (is_active_tab === 'false') { 3302 this._close_tabpanel($tab); 3303 } else { 3304 this._open_tabpanel($tab); 3305 } 3306 } 3307 }, 3308 3309 _init_keyboard_nav: function() { 3310 var _this = this; 3311 3312 for (var i = 0; i < _this.$tabs.length; i++) { 3313 _this.$tabs[i].addEventListener('keydown', function(event) { 3314 switch (event.keyCode) { 3315 case 9: // Tabulator 3316 if (event.shiftKey) { 3317 _this._change_focused_tab(event, this.index - 1) 3318 } else { 3319 if (this.getAttribute('aria-expanded') === 'false') { 3320 _this._change_focused_tab(event, this.index + 1); 3321 } 3322 } 3323 break; 3324 case 13: // Eingabe 3325 _this._toggle_tabpanel(this); 3326 break; 3327 case 32: // Leertaste 3328 _this._toggle_tabpanel(this); 3329 break; 3330 case 35: // Pos1 3331 _this._change_focused_tab(event, _this.$tabs.length - 1); 3332 break; 3333 case 36: // Ende 3334 _this._change_focused_tab(event, 0); 3335 break; 3336 case 37: // Pfeil nach links 3337 _this._change_focused_tab(event, this.index - 1); 3338 break; 3339 case 38: // Pfeil nach oben 3340 _this._change_focused_tab(event, this.index - 1); 3341 break; 3342 case 39: // Pfeil nach rechts 3343 _this._change_focused_tab(event, this.index + 1); 3344 break; 3345 case 40: // Pfeil nach unten 3346 _this._change_focused_tab(event, this.index + 1); 3347 break; 3348 } 3349 }); 3350 } 3351 }, 3352 3353 _change_focused_tab: function(event, index) { 3354 if (index === this.$tabs.length || index === -1) { 3355 return false; 3356 } 3357 3358 event.preventDefault(); 3359 $tab = this.$tabs[index]; 3360 3361 for (var i = 0; i < this.$tabs.length; i++) { 3362 this.$tabs[i].setAttribute('aria-selected', 'false'); 3363 } 3364 3365 $tab.setAttribute('aria-selected', 'true'); 3366 $tab.focus(); 3367 3368 return true; 3369 } 3370 }; 3371 3372 var $accordions = document.querySelectorAll('.accordion'); 3373 3374 for (var i = 0; i < $accordions.length; i++) { 3375 new Accordion($accordions[i]).init(); 3376 } 3377 3378})(document, window); 3379 3380/* Source common/js/scripts/98_onlinetool_popup.js */ 3381 3382// ONLINETOOL POPUP 3383// Wird verwendet für: download_overview, onlinetools_popup_overview, video_tutorials_overview 3384// ------------------------------------------------------------------------------------------------- 3385 3386(function(document, window) { 3387 var OnlinetoolPopup = function($onlinetool) { 3388 var _this = this; 3389 3390 _this.$onlinetool = $onlinetool; 3391 3392 _this.title = $onlinetool.getAttribute('title'); 3393 _this.id = '#' + $onlinetool.getAttribute('data-popup-id'); 3394 _this.href = $onlinetool.getAttribute('href'); 3395 }, 3396 3397 $body = document.querySelector('body'), 3398 $popup, 3399 $content, 3400 $close, 3401 $iframe; 3402 3403 // Private 3404
3405 function _create_element(html) { 3406 var $div = document.createElement('div'), 3407 $filtered_nodes = [], 3408 $nodes; 3409 3410 $div.innerHTML = html.trim(); 3411 $nodes = $div.childNodes; 3412 3413 for (var i = 0, len = $nodes.length; $nodes !== null && i < len; i++) { 3414 if ($nodes[i].nodeType === 1) { 3415 $filtered_nodes.push($nodes[i]); 3416 } 3417 } 3418 3419 return $filtered_nodes; 3420 } 3421 3422 function _create_popup() { 3423 $popup = document.querySelector('.popup_overlay'); 3424 $content = $popup.querySelector('.popup_content'); 3425 $close = $popup.querySelector('.popup_close'); 3426 $iframe = $popup.querySelector('iframe'); 3427 3428 $iframe.addEventListener('load', function() { 3429 if ($iframe.getAttribute('src') && $iframe.getAttribute('src').length && $popup.classList.contains('show')) { 3430 $iframe.classList.add('show'); 3431 } 3432 }); 3433 } 3434 3435 function _close_popup() { 3436 var _close = function() { 3437 $body.classList.remove('no_scroll'); 3438 $content.classList.remove('show'); 3439 $iframe.classList.remove('show'); 3440 3441 window.history.replaceState(null, document.title, window.location.pathname); 3442 }; 3443 3444 $close.addEventListener('click', function(event) { 3445 event.preventDefault(); 3446 _close(); 3447 }); 3448 3449 document.addEventListener('keydown', function(event) { 3450 if ($popup.classList.contains('show') && event.which === 27) { 3451 _close(); 3452 } 3453 }); 3454 3455 $content.addEventListener('transitionend', function() { 3456 if (!$content.classList.contains('show')) { 3457 $popup.classList.remove('show'); 3458 } 3459 }); 3460 } 3461 3462 _create_popup(); 3463 _close_popup(); 3464 3465 // Public 3466 3467 OnlinetoolPopup.prototype = { 3468 init: function() { 3469 var _this = this; 3470 3471 _this.$onlinetool.addEventListener('click', function(event) { 3472 event.preventDefault(); 3473 _this.open(); 3474 }); 3475 }, 3476 3477 open: function() { 3478 var _this = this; 3479 3480 $body.classList.add('no_scroll'); 3481 $popup.classList.add('show'); 3482 $content.classList.add('show'); 3483 $iframe.setAttribute('src', _this.href); 3484 3485 window.history.replaceState(null, document.title, _this.id); 3486 } 3487 }; 3488 3489 if (window.device.mobile || window.device.tablet) { 3490 return; 3491 } 3492 3493 var $onlinetools = document.querySelectorAll('[data-popup="true"]'), 3494 $onlinetool; 3495 3496 for (var i = 0, len = $onlinetools.length; i < len; i++) { 3497 $onlinetool = new OnlinetoolPopup($onlinetools[i]); 3498 3499 $onlinetool.init(); 3500 3501 if ($onlinetool.id === window.location.hash) { 3502 $onlinetool.open(); 3503 } 3504 } 3505})(document, window); 3506 3507/* Source common/js/scripts/99_benefit_slide.js */ 3508 3509// KARRIEREPAKET VORTEILE SLIDES 3510// ------------------------------------------------------------------------------------------------- 3511 3512(function(document) { 3513 var next = document.querySelectorAll('.kpt_benefit_entry .navigation .next'), 3514 prev = document.querySelectorAll('.kpt_benefit_entry .navigation .prev'),
3515 kpt_benefit_entries = document.querySelectorAll('.kpt_benefit_entry'); 3516 3517 for (var i = 0, nextbutton; nextbutton = next[i]; i++) { 3518 nextbutton.addEventListener('click', function(event) { 3519 this.parentNode.parentNode.classList.add('show'); 3520 }); 3521 } 3522 3523 for (var i = 0, prevbutton; prevbutton = prev[i]; i++) { 3524 prevbutton.addEventListener('click', function(event) { 3525 this.parentNode.parentNode.classList.remove('show'); 3526 }); 3527 } 3528}(document)); 3529 3530/* Source common/js/scripts/99_kpt_interview_card.js */ 3531 3532(function(document) { 3533 3534 var CardFlipper = function($interview_overview) { 3535 var _this = this; 3536 3537 _this.$overview = $interview_overview; 3538 _this.$interviews = _this.$overview.querySelectorAll('.kpt_interview'); 3539 }; 3540 3541 CardFlipper.prototype = { 3542 init: function() { 3543 var _this = this; 3544 3545 for (var i = 0; i < _this.$interviews.length; i++) { 3546 var $interview = _this.$interviews[i]; 3547 3548 $interview.addEventListener('click', function() { 3549 _this._flip_element(this); 3550 }); 3551 3552 $interview.addEventListener('keydown', function(event) { 3553 if (event.keyCode == 13) { // Enter 3554 _this._flip_element(this); 3555 } 3556 }); 3557 } 3558 }, 3559 3560 _flip_element: function($element) { 3561 $element.classList.toggle("flip"); 3562 } 3563 } 3564 3565 var $interview_overviews = document.querySelectorAll('.kpt_interview_overview.card'); 3566 3567 for (var i = 0; i < $interview_overviews.length; i++) { 3568 new CardFlipper($interview_overviews[i]).init(); 3569 } 3570}(document)); 3571 3572/* Source common/js/scripts/99_team_popup.js */ 3573 3574// Team Popup 3575(function(document) { 3576 var $entries = document.querySelectorAll('.team_overview_popup .entry'); 3577 3578 if (!$entries && $entries.length < 1) { 3579 return; 3580 } 3581 3582 function init() { 3583 for (var i = 0; i < $entries.length; i++) { 3584 $entries[i].$pop_up = $entries[i].querySelector('.popup_info'); 3585 3586 if ($entries[i].$pop_up) { 3587 var $callers = $entries[i].querySelectorAll('.caller'), // Es kann mehrere Aufrufer geben 3588 $close = $entries[i].querySelector('.close'); 3589 3590 for (var h = 0; h < $callers.length; h++) { 3591 $callers[h].$pop_up = $entries[i].$pop_up; 3592 3593 $callers[h].addEventListener('click', function(event) { 3594 event.preventDefault(); 3595 this.$pop_up.classList.add('show'); 3596 }); 3597 } 3598 3599 // ESC Taste gedrückt? 3600 document.addEventListener('keydown', function(event) { 3601 if (event.which === 27) { 3602 for (var h = 0; h < $entries.length; h++) { 3603 var $entry = $entries[h].$pop_up; 3604 3605 if ($entry && $entry.classList.contains('show')) { 3606 $entry.classList.remove('show'); 3607 } 3608 } 3609 } 3610 }); 3611 3612 $close.$pop_up = $entries[i].$pop_up; 3613 $close.addEventListener('click', function() { 3614 this.$pop_up.classList.remove('show'); 3615 }); 3616 } 3617 } 3618 } 3619 3620 init(); 3621}(document)); 3622
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.