1 2$(function(){ 3 // Set class on p elements that have a strong-tag child and preced an ul or ol 4 //$("p > strong").parent().next("ul,ol").addClass("moveup"); 5 6 /*jQuery Extend: in-viewport*/ 7 (function ($) { 8 $.belowthefold = (el, settings) => { 9 // Set the fold to the bottom of the page minus the bottom threshold 10 let fold = $(window).height() + $(window).scrollTop() - settings.bottom; 11 12 if ($(window).scrollTop() === 0) { 13 // When on top of page, return true for all elements in viewport 14 // settings.bottom has to be subtracted since it is already factored into the fold 15 return fold <= $(el).offset().top - settings.bottom; 16 } else { 17 // When user scrolled, return true if element plus the general threshold is above the fold 18 return fold <= $(el).offset().top; 19 } 20 }; 21 22 $.abovethetop = (el, settings) => { 23 // Set the fold to the top of the page plus the top threshold 24 let top = $(window).scrollTop() + settings.top; 25 26 // Return true if the bottom of the element minus the general threshold is not under the top 27 return top >= $(el).offset().top + $(el).height(); 28 }; 29 30 $.inviewport = (el, settings) => { 31 return !$.belowthefold(el, settings) && !$.abovethetop(el, settings); 32 }; 33 34 $.extend($.expr[":"], { 35 "in-viewport": function (el) { 36 return $.inviewport(el, { 37 top: -50, // How many pixels from the top should the element count to be in viewport? 38 bottom: 150, // How many pixels from the bottom should the element count to be in viewport? 39 }); 40 }, 41 }); 42 })(jQuery); 43 44 /* highlightWords(); */ 45 46 // Contactform Label functionality 47 let toSelectFocusout = null; 48 49 // On load (timeout necessary so URL parameter can be written into input first) 50 setTimeout(() => { 51 $("[class*='--label-inside']:not(.label), .cis-select--label-inside > select").each((_i,el) => { 52 checkLabels(el,undefined); 53 }); 54 },200); 55 56 // On event trigger 57 $(document).on("focusin change focusout", "[class*='--label-inside']:not(.label), .cis-select--label-inside > select", e => { 58 checkLabels(e.target, e.type); 59 }); 60 61 function checkLabels(_target, _eventtype) { 62 if (_target.type === "select-one") { 63 // Select 64 clearTimeout(toSelectFocusout); 65 if (_eventtype === "focusin" || (_eventtype !== "focusout" && _target.value !== undefined && _target.value.length)) { 66 labelinside($(_target).parent(), "add", _eventtype); 67 } else if (_eventtype === "focusout") { 68 // Set timeout as we have to wait for the value to get updated by creanetSelect.js 69 toSelectFocusout = setTimeout(() => { 70 if (_target.value !== undefined && _target.value.length) { 71 labelinside($(_target).parent(), "add", _eventtype); 72 } else { 73 labelinside($(_target).parent(), "remove", _eventtype); 74 } 75 },150); 76 } 77 } else { 78 if (_eventtype === "focusin" || (_target.value !== undefined && _target.value.length)) { 79 labelinside(_target, "add", _eventtype); 80 } else if (_eventtype === "focusout" && !_target.value.length) { 81 labelinside(_target, "remove", _eventtype); 82 } 83 } 84 } 85 86 function labelinside(_target, _action, _eventtype) { 87 let $targetParent = $(_target).parent(), 88 aParentClass = (typeof $targetParent.attr('class') !== 'undefined') ? $targetParent.attr('class').split(' ') : []; 89 90 if (aParentClass.length > 0) { 91 if (_action === "add" && _eventtype !== "focusout" && _eventtype !== undefined) { 92 $targetParent.addClass(aParentClass[0] + "--focus"); 93 } else { 94 $targetParent.removeClass(aParentClass[0] + "--focus"); 95 } 96 } 97 98 $targetParent.find('[class*="--label-inside"]').each((_i, element) => { 99 let aModifier = [...element.classList].filter(sClass => sClass.includes("--label-inside")); 100 if (aModifier.length > 0) { 101 let sBlock = aModifier[0].substring(aModifier[0].indexOf("--label-inside"), 0); 102 103 if (_action === "add") { 104 $(element).addClass(sBlock + "--label-inside--up"); 105 } else { 106 $(element).removeClass(sBlock + "--label-inside--up"); 107 } 108 } 109 }); 110 } 111 112 setTimeout(function () { 113 mark_visible_items();
114 }, 400); 115 116 if (is_touch_device() == true) { 117 $("body").addClass("body--touch"); 118 } 119 120 121 $('.categories_select').on('change', function(){ 122 var val = $(this).val(); 123 if (val != '') { 124 $(this).parent().addClass('not_empty'); 125 } 126 }); 127 128 function formSetRangeElements() { 129 130 if ($('.input__range').length > 0) { 131 $('.input__range').attr('type',"range"); 132 133 $('.input__range').each(function(){ 134 var val = $(this).parent().find('.input__range--abs').attr("max"); 135 $(this).val(val); 136 137 138 $(this).on('change', function(){ 139 var val = $(this).val(); 140 var obj = $(this); 141 if ($(this).hasClass('input__range--first')) { 142 var maxVal = parseFloat($('.input__range--abs').val()); 143 if (val >= maxVal) { 144 val = maxVal - 50; 145 } 146 console.log(maxVal); 147 setTimeout(function(){ 148 $(obj).val( val); 149 }, 200); 150 151 } else { 152 var maxVal = parseFloat($('.input__range--first').val()); 153 if (val <= maxVal) { 154 val = maxVal + 50; 155 } 156 setTimeout(function(){ 157 $(obj).val( val); 158 }, 200); 159 } 160 $(this).next().html(val); 161 //$(this).trigger('change'); 162 }); 163 164 165 166 // $(this).on('mousemove', function(){ 167 // var val = $(this).val(); 168 // if ($(this).hasClass('input__range--first')) { 169 // var maxVal = $(this).next('.input__range--abs').val(); 170 // if (val >= maxVal) { 171 // val = maxVal - 1; 172 // } 173 // $(this).attr("max", maxVal); 174 // } else { 175 // var maxVal = $(this).prev('input').val(); 176 // if (val <= maxVal) { 177 // val = maxVal + 1; 178 // } 179 // } 180 181 // $(this).next().html(val); 182 // $(this).trigger('change'); 183 // }); 184 185 // $(this).on('mouseup', function(){ 186 // var val = $(this).val(); 187 // if ($(this).hasClass('input__range--first')) { 188 // var maxVal = $(this).next('input').val(); 189 // if (val >= maxVal) { 190 // val = maxVal - 1; 191 // } 192 // } else { 193 // var maxVal = $(this).prev('input').val(); 194 // if (val <= maxVal) { 195 // val = maxVal + 1; 196 // } 197 // } 198 199 // $(this).next().html(val); 200 // $(this).trigger('change'); 201 // }); 202 203 // $(this).on('touchmove', function(){ 204 // var val = $(this).val(); 205 // if ($(this).hasClass('input__range--first')) { 206 // var maxVal = $(this).next('input').val(); 207 // if (val >= maxVal) { 208 // val = maxVal - 1; 209 // } 210 // } else { 211 // var maxVal = $(this).prev('input').val(); 212 // if (val <= maxVal) { 213 // val = maxVal + 1; 214 // } 215 // } 216 217 // $(this).next().html(val); 218 // $(this).trigger('change'); 219 // }); 220 221 222 // $(this).on('touchend', function(){ 223 // var val = $(this).val(); 224 // if ($(this).hasClass('input__range--first')) { 225 // var maxVal = $(this).next('input').val(); 226 // if (val >= maxVal) { 227 // val = maxVal - 1; 228 // } 229 // } else { 230 // var maxVal = $(this).prev('input').val(); 231 // if (val <= maxVal) { 232 // val = maxVal + 1; 233 // } 234 // } 235 236 // $(this).next().html(val); 237 // $(this).trigger('change'); 238 // }); 239 }); 240 } 241 } 242 243 formSetRangeElements(); 244 245 246 247 248 $(window).scroll(function () { 249 var scrolled = $(this).scrollTop(); 250 let footerTop = $('.footer').position().top; 251 let fromTop = $(window).height(); 252 253 // if (scrolled < ($('.cheader').height() - 100)) { 254 // $('.cheader .flickity-viewport').css('transform', "translateY("+ scrolled * .6 +"px)"); 255 // } 256 257 //setScrolltopColor (); 258 259 if (scrolled > fromTop) { 260 $("body").addClass("body--show-scrolltop"); 261 if ((scrolled + fromTop) > footerTop) { 262 $("body").addClass('body--scrolled-end'); 263 } else { 264 $("body").removeClass('body--scrolled-end'); 265 } 266 } else { 267 $("body").removeClass("body--show-scrolltop"); 268 } 269 270 if (scrolled > $(".main > article").first().height() - $('.header').height()) { 271 $("body").addClass("body--scrolled"); 272 } else { 273 $("body").removeClass("body--scrolled"); 274 } 275 276 throttle(() => { 277 mark_visible_items();
278 },100); 279 }); 280 281 if ($(this).scrollTop() > 0) { 282 if ($(this).scrollTop() > $(".main > article").first().height() - $('.header').height()) { 283 $("body").addClass("body--scrolled"); 284 } else { 285 $("body").removeClass("body--scrolled"); 286 } 287 } 288 289 function setScrolltopColor () { 290 var scrolled = $(this).scrollTop(); 291 let scrolltopTop = $('.scrolltop').position().top + 30; // menuicon 292 293 // special treatment of menutrigger class if in viewport of some special articles 294 $('article').each(function(){ 295 var pos = $(this).offset().top - scrolled; // 296 297 298 if (pos <= scrolltopTop && pos + $(this).height() > scrolltopTop) { 299 if ($(window).width() < 1500) { 300 301 if ($(this).hasClass('object--design-2') 302 || $(this).hasClass('cheader') 303 || $(this).hasClass("cgalleryslide") 304 || $(this).hasClass("cimage") 305 || $(this).hasClass("cvideo")) { 306 $('.scrolltop').addClass('white'); 307 } else { 308 $('.scrolltop.white').removeClass('white'); 309 } 310 } else { 311 if ($(this).hasClass('object--design-2') 312 || $(this).hasClass('cheader') 313 || $(this).hasClass("cgalleryslide") 314 || $(this).hasClass("cimage") 315 || $(this).hasClass("cvideo")) { 316 $('.scrolltop').addClass('white'); 317 } else { 318 $('.scrolltop.white').removeClass('white'); 319 } 320 } 321 } else { 322 $('.scrolltop.white').removeClass('white'); 323 } 324 }); 325 } 326 327 if ($(window).width() < 1900) { 328 329 $(".ciconboxes__element").hover( 330 function(){ 331 $(this).addClass('showText'); 332 var left = $(this).position().left; 333 334 if ($(window).width() > 900) { 335 if (left < 120) { 336 $(this).addClass('showText--moveRight'); 337 $(this).find('.ciconboxes__textwrapper').css("left", (150 - left) + 'px'); 338 } 339 340 if (left > $(window).width() - 300) { 341 $(this).addClass('showText--moveLeft'); 342 $(this).find('.ciconboxes__textwrapper').css("left", (-10 - 0) + 'px'); 343 } 344 } else if ($(window).width() > 500) { 345 if (left < 100) { 346 $(this).addClass('showText--moveRight'); 347 $(this).find('.ciconboxes__textwrapper').css("left", (150 - left) + 'px'); 348 } 349 350 if (left > $(window).width() - 200) { 351 $(this).addClass('showText--moveLeft'); 352 $(this).find('.ciconboxes__textwrapper').css("left", (-20 - 0) + 'px'); 353 } 354 } else { 355 if (left < 90) { 356 $(this).addClass('showText--moveRight'); 357 $(this).find('.ciconboxes__textwrapper').css("left", (160 - left) + 'px'); 358 } else { 359 360 if (left < 100) { 361 $(this).addClass('showText--moveSoftRight'); 362 $(this).find('.ciconboxes__textwrapper').css("left", (150 - left) + 'px'); 363 } 364 365 if (left > $(window).width() - 180) { 366 $(this).addClass('showText--moveLeft'); 367 $(this).find('.ciconboxes__textwrapper').css("left", (-60 - 0) + 'px'); 368 } else { 369 370 } 371 } 372 373 374 } 375 }, 376 function(){ 377 $(this).find('.ciconboxes__textwrapper').css("left",""); 378 $(this).removeClass('showText'); 379 $(this).removeClass('showText--moveRight'); 380 $(this).removeClass('showText--moveLeft'); 381 } 382 ); 383 } 384 385 386 if ($('body').hasClass('body--home')) { 387 var homeVid = $('.body--home .cheader .cheader__video'); 388 var homeVidSource = $(homeVid).find('source'); 389 var sSource = $(homeVidSource).attr('src'); 390 var mobileSource = $(homeVidSource).attr('data-src-mobile'); 391 392 if ($(window).width() < 670) { 393 $(homeVid).attr('src', mobileSource); 394 $(homeVidSource).attr('src', mobileSource); 395 } else { 396 $(homeVid).attr('src', sSource); 397 $(homeVidSource).attr('src', sSource); 398 } 399 } 400 401 $(window).resize(function(){ 402 403 if ($('body').hasClass('body--home')) { 404 405 if ($(window).width() < 670) { 406 if ($(homeVid).attr('src') != mobileSource) { 407 $(homeVid).attr('src', mobileSource); 408 $(homeVidSource).attr('src', mobileSource); 409 } 410 } else { 411 if ($(homeVid).attr('src') != sSource) { 412 $(homeVid).attr('src', sSource); 413 $(homeVidSource).attr('src', sSource); 414 } 415 } 416 } 417 418 }); 419 420 // Scrolldown 421 if ($('article').length > 1) { 422 let lotti = $('.scrolldown').html(); 423 setTimeout(function(){ 424 $('.main article').first().append($(".scrolldown")); 425 $('.scrolldown').html(lotti); 426 }, 1000); 427 428 // $('.main article').not(':last-child').not('.ctwocols').append('<div class="scrolldown"></div>'); 429 // $('.main article').first().addClass('first'); 430 } 431 432 // Properties Iso 433 if ($('.cproperties__row').length > 0) { 434 $('.cproperties__row').each(function(){ 435 let obj = $(this); 436 $(obj).hover( 437 function(){ 438 if ($(obj).attr('data-image1') != '') { 439 var img = $(obj).attr('data-image1') != undefined ? $(obj).attr('data-image1') : $(obj).attr('data-image0') ; 440 console.log(img); 441 $('#isometrie').attr("src", img); 442 } 443 },function(){ 444 $('#isometrie').attr("src", $(obj).attr('data-default-image'));
445 }); 446 }); 447 } 448 449 $('.footer__newsletter--enter').click(function(){ 450 $('#Email').val($('#nl_email').val()); 451 }); 452 453 $('.scrolldown').each(function () { 454 $(this).on('click', function(){ 455 var preTop = $(this).parent().offset().top; 456 457 var artnr = $('article').index($(this).parent()); 458 var next = artnr + 1; 459 let padding = -100; 460 461 let elm = $(this).parents(".main").find('article')[next]; 462 let pos = $(elm).offset().top; 463 464 if (pos != undefined) { 465 let ttop = pos + padding; 466 $('html, body').animate({ 467 scrollTop: ttop 468 }, 1000, "swing"); 469 } 470 }); 471 }); 472 473 // News History.back 474 475 $('.history-back').click(function(e){ 476 e.preventDefault(); 477 window.Location.href = history.back(); 478 }); 479 480 // Cookiehub 481 $(document).on("click", ".show_cookiehub_settings", function(e){ 482 e.preventDefault(); 483 window.cookiehub.openSettings(); 484 }); 485 486 /*Menutrigger*/ 487 $(document).on("click", ".menutrigger", function () { 488 $(".body").toggleClass("body--shownav"); 489 }); 490 $(document).on("click", ".header__navbackdrop", function () { 491 $(".body").removeClass("body--shownav"); 492 }); 493 494 // Mark active menus 495 if (!$.isEmptyObject($(`a[data-pageid="${active_pageid}"]`)[0])) { 496 setActiveMenus(active_pageid); 497 } else { 498 let aPages = active_pagelist.split(","); 499 500 aPages.shift(); // remove first 'home'-entry 501 aPages.reverse(); // reverse order 502 503 for (let page_id of aPages) { 504 if (!$.isEmptyObject($(`a[data-pageid="${page_id}"]`)[0])) { 505 setActiveMenus(page_id); 506 507 break; // break loop if menu is found 508 } 509 } 510 } 511 512 // Menus ein-/ausblenden 513 //let toMenuClose; 514 // $(document).on('click', '.header__navli', function (enterEvent) { 515 // enterEvent.stopPropagation(); 516 517 // let $this = $(this), 518 // $menutrigger = $(".menutrigger"); 519 520 // clearTimeout(toMenuClose); 521 522 // if (!$.isEmptyObject($this.siblings('.header__navli--running')[0]) && !$menutrigger.is(':visible')) { 523 // // toMenuClose = setTimeout(function(){ 524 // $this.siblings('.header__navli--running').removeClass('header__navli--running').find('.header__navlist').removeClass('header__navlist--show'); 525 // $this.find('.header__navli--running').removeClass('header__navli--running'); 526 // // }, 100); 527 // } 528 529 // if ($this.hasClass('header__navli--isparent')) { 530 // enterEvent.preventDefault(); 531 532 // // Submenu toggle 533 // if (!$this.hasClass('header__navli--running')) { 534 // $this.addClass('header__navli--running').find('> .header__navlist').addClass('header__navlist--show'); 535 // } else { 536 // closeNavi($this); 537 // } 538 // } 539 540 // $this.one('mouseleave', function (leaveEvent) { 541 // if (!$menutrigger.is(':visible')) { 542 // clearTimeout(toMenuClose); 543 // toMenuClose = setTimeout(function () { 544 // closeNavi($this); 545 // }, 300); 546 // } 547 // }); 548 549 // function closeNavi($self) { 550 // $self.removeClass('header__navli--running').find('.header__navlist').removeClass('header__navlist--show'); 551 // if (!$menutrigger.is(':visible')) { 552 // $('.header__navli--running').removeClass('header__navli--running'); 553 // } 554 // } 555 // }); 556 557 $('.header__navlist--lvl-1').addClass('hide-before'); 558 559 setTimeout(function(){ 560 $('.header__navlist--lvl-1').removeClass('hide-before'); 561 }, 2000); 562 563 // sessionStorage leeren, wenn Navigation betätigt wird. 564 $(".header__navlink--lvl-2, .footer__navlink--lvl-2, .cheader__text a").on("click", function (e) { 565 let title = $(this).attr('title'); 566 let $this = $(this), 567 sHref = $this.attr("href"); 568 569 if (sHref.indexOf("#") > -1) { 570 let target = "#" + sHref.split("#")[1]; 571 e.preventDefault(); 572 573 if (!$.isEmptyObject($(target)[0])) { 574 let timer = 100; 575 $('body').removeClass('body--shownav'); 576 577 if ($(window).width() < 1024) { 578 timer = 500; 579 } 580 var Goto = parseInt($(target).offset().top + 0); 581 setTimeout(function(){ 582 $(".body,.html").animate({ scrollTop: Goto }, 400); 583 }, timer); 584 585 $('.header__navli--lvl-2.header__navli--active').removeClass('header__navli--active'); 586 $('.header__navlink--lvl-2.header__navlink--active').removeClass('header__navlink--active'); 587 588 $(this).addClass('header__navlink--active'); 589 $(this).parent().addClass('header__navli--active'); 590 591 $('.caccordion__label').each(function(){ 592 if ($(this).html().indexOf(title) > -1) { 593 $(this).prev('input').prop('checked', "checked"); 594 } 595 }); 596 597 $('.header__navlist--lvl-1').addClass('hide-before'); 598 599 setTimeout(function(){ 600 $('.header__navlist--lvl-1').removeClass('hide-before'); 601 }, 1000); 602 603 } else { 604 window.location.href = sHref; 605 } 606 } 607 608 if ( 609 typeof sessionStorage["searchfilter"] !== "undefined" && 610 $this.attr("data-pageid") !== undefined && 611 !$.isEmptyObject($this.attr("data-pageid")[0]) 612 ) { 613 let data = JSON.parse(sessionStorage["searchfilter"]), 614 sPage = "page_" + $this.attr("data-pageid"); 615 616 if (data.hasOwnProperty(sPage)) { 617 delete data[sPage]; 618 619 sessionStorage["searchfilter"] = JSON.stringify(data); 620 } 621 } 622 }); 623 624 $(document).on("click", ".locations__open, .locations__close", function(e) { 625 e.preventDefault(); 626 627 $(".locations__open").toggleClass("locations__open--hidden");
628 $(".locations__nav").toggleClass("locations__nav--hidden"); 629 }); 630 631 // Scrolltop 632 $(document).on("click", ".scrolltop", function (event) { 633 event.preventDefault(); 634 $("body,html").animate({ scrollTop: 0 }, 800); 635 $(".body").removeClass("body--shownav"); 636 }); 637 638 // E-Mail senden 639 $(document).on("click", 'a[href^="#msg="]', function (event) { 640 event.preventDefault(); 641 642 let string = $(this).attr("href"), 643 code = string.substring(string.indexOf("=") + 1); 644 645 msg(code); 646 }); 647 648 // Modal öffnen 649 $(document).on("click", "a.modal", function (event) { 650 event.preventDefault(); 651 let sHref = $(this).attr("data-url"); 652 653 loadModal(sHref); 654 }); 655 656 // Modal ausblenden 657 $(document).on("click", ".modal, .modal__close", function (e) { 658 e.preventDefault(); 659 closeModal(); 660 }); 661 662 // Video in Modal öffnen 663 $(document).on("click", 'a[href*="youtu"]', function (event) { 664 event.preventDefault(); 665 666 let sHref = $(this).attr("href"), 667 aRegGroups = sHref.match( 668 /https:\/\/(www.)?youtu(\.)?be(\.com)?\/(watch\?v\=)?(.+)/ 669 ), 670 code = aRegGroups[aRegGroups.length - 1], 671 payload = { code: code }; 672 673 loadModal( 674 siterelpath + "apps/services/youtube.cfm", 675 "modal__popup--video", 676 payload 677 ); 678 }); 679}); 680 681function loadModal(dataURL, dataClass, dataPOST) { 682 let sInitClass = "modal__popup", 683 $popup = $("." + sInitClass); 684 685 $popup.attr("class", sInitClass); 686 687 $("body").addClass("body--hide-scrollbar"); 688 689 if (typeof dataClass !== "undefined") $popup.addClass(dataClass); 690 dataPOST = dataPOST || {}; 691 692 if ( 693 dataURL.indexOf(window.location.host) !== -1 || 694 dataURL.indexOf("youtube.cfm") !== -1 695 ) { 696 $.ajax({ 697 type: "POST", 698 data: dataPOST, 699 url: dataURL, 700 success: function (response) { 701 $popup.html($.trim(response)).show(); 702 $(".modal").fadeIn(100); 703 }, 704 }); 705 } else { 706 dataPOST.url = dataURL; 707 708 $.ajax({ 709 type: "POST", 710 data: dataPOST, 711 url: siterelpath + "apps/services/iframe.cfm", 712 success: function (response) { 713 $popup.html($.trim(response)).show(); 714 $(".modal").fadeIn(100); 715 }, 716 }); 717 } 718 mark_visible_items(); 719} 720 721function closeModal() { 722 $("body").removeClass("body--hide-scrollbar"); 723 724 // iFrame Inhalt neu laden (allfällige Videos werden gestoppt.) 725 $(".modal__popup iframe").each(function (i, frame) { 726 let $frame = $(frame); 727 if (typeof $frame.attr("src") !== "undefined") { 728 let iframeLink = $frame.attr("src"); 729 // Autoplay auf false setzen, sonst beginnt das Video von vorne! 730 iframeLink = iframeLink.replace("autoplay=1", "autoplay=0"); 731 iframeLink = iframeLink.replace("autoplay=true", "autoplay=false"); 732 $frame.attr("src", ""); 733 $frame.attr("src", iframeLink); 734 } 735 }); 736 737 $(".modal__popup").hide().empty(); 738 $(".modal").fadeOut(100); 739} 740 741function is_touch_device(){ 742 try { 743 document.createEvent("TouchEvent"); 744 return true; 745 } catch (e) { 746 return false; 747 } 748} 749 750function setActiveMenus(_pageid) { 751 $(`a[data-pageid="${_pageid}"]`).each((i, elLink) => { 752 let sBlockClass = "nav"; 753 754 if (elLink.classList.length) { 755 sBlockClass = elLink.classList[1].split("__")[0]; 756 } 757 758 $(elLink).removeClass(sBlockClass + "__navlink--inactive").addClass(sBlockClass + "__navlink--active"); 759 760 $(elLink).parents("li").each((i, elListItem) => { 761 $(elListItem).find('> input').prop('checked', 'checked'); 762 $(elListItem).removeClass(sBlockClass + "__navli--inactive").addClass(sBlockClass + "__navli--active"); 763 $(elListItem).find("> a").removeClass(sBlockClass + "__navlink--inactive").addClass(sBlockClass + "__navlink--active"); 764 $(elListItem).find("> label > a").removeClass(sBlockClass + "__navlink--inactive").addClass(sBlockClass + "__navlink--active"); 765 }); 766 }); 767} 768 769// Mark all visible items in viewport 770function mark_visible_items() { 771 $("[class*='--not-visible']:not([class*='--visible'])").filter(":in-viewport").each((i, el) => { 772 setTimeout(() => { 773 // Get BEM Element class 774 let aElementClass = [...el.classList].filter(sClass => !sClass.includes("--")), 775 776 // Get class with --not-visible modifier 777 aNotVisibleClass = [...el.classList].filter(sClass => sClass.includes("--not-visible")), 778 779 // Get possible additional modifier 780 sAdditionalModifier = aNotVisibleClass[0].replace(/.*--not-visible/,""), 781 782 // Append possible additional modifier to --visible modifier 783 sModifier = sAdditionalModifier.length ? `--visible${sAdditionalModifier}` : "--visible"; 784 785 if(aElementClass.length){ 786 $(el).addClass(aElementClass[0] + sModifier); 787 } 788 }, i * 300); 789 }); 790} 791 792// Throttle 793let throttle_lastTime = 0; 794function throttle(func, timeFrame) { 795 let now = new Date(); 796 if (now - throttle_lastTime >= timeFrame) { 797 func();
798 throttle_lastTime = now; 799 } 800} 801 802function getUrlParam() { 803 let sURL = window.location.search, 804 oParameter = {}; 805 806 if (sURL.length <= 0) return oParameter; 807 808 sURL = sURL.replace("?", ""); 809 urlParams = sURL.split("&"); 810 811 for(let i = 0; i < urlParams.length; i++) { 812 let aParam = urlParams[i].split("="); 813 814 oParameter[aParam[0]] = aParam[1]; 815 } 816 817 return oParameter; 818} 819 820function highlightWords() { 821 //Get URL-Parameter 822 const queryString = window.location.search; 823 const urlParams = new URLSearchParams(queryString); 824 const keyword = urlParams.get("so_search"); 825 826 if (keyword !== null) { 827 $.ajax({ 828 url: rooturl + "cis-data/plugins/markjs/mark.min.js", 829 dataType: "script", 830 cache: true, 831 }).done(function () { 832 var instance = new Mark("main"); 833 instance.mark(keyword); 834 835 if ( 836 !$.isEmptyObject($("mark")[0]) && 837 urlParams.get("scrollto") !== null 838 ) { 839 setTimeout(function () { 840 $("body,html").animate( 841 { scrollTop: $("mark").offset().top - 50 }, 842 800 843 ); 844 }, 700); 845 } 846 }); 847 } 848} 849 850$.fn.shuffle = function(callback) { 851 var allElems = this.get(), 852 getRandom = function(max) { 853 return Math.floor(Math.random() * max); 854 }, 855 shuffled = $.map(allElems, function(){ 856 var random = getRandom(allElems.length), 857 randEl = $(allElems[random]).clone(true)[0]; 858 allElems.splice(random, 1); 859 return randEl; 860 }); 861 862 this.each(function(i){ 863 $(this).replaceWith($(shuffled[i])); 864 }); 865 866 if(typeof callback !== 'undefined') callback(); 867}; 868 869function msg(encoded_email){ 870 var decoded_email = window.atob(encoded_email); 871 window.location.href="mailto:"+decoded_email; 872}
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.