1$(document).ready(function(){ 2 $('.navbar--top .sub-menu').addClass('loaded'); 3 $('.readspeaker__infoicon').addClass('visible'); 4 $('.readspeaker__infoicon').on('click', function(){ 5 window.location.href = $('.readspeaker__infoicon').attr('href'); 6 }); 7 /* Animate on Scroll AOS */ 8 AOS.init({ 9 duration: 1200, 10 }); 11 12 13 14 /* MMenu */ 15 $('#menu li.menu-item-has-children').each(function () { 16 $(this).find('a:first').contents().unwrap().wrap('<span/>'); 17 }); 18 19 $("#menu").mmenu({ 20 extensions: ["shadow-panels", "fx-listitems-slide", "border-none", "position-right"], 21 setSelected: true, 22 searchfield: { 23 resultsPanel: true 24 } 25 }); 26 27 var mmApi = $("#menu").data("mmenu"); 28 var $hamburgerToggle = $('.navbar-toggler'); 29 var $hamburgerIcon = $('#nav-icon2'); 30 31 // Grundlegende A11y-Attribute sicherheitshalber auch per JS setzen 32 $hamburgerToggle.attr({ 33 'role': 'button', 34 'aria-label': $hamburgerToggle.attr('aria-label') || 'Hauptmenü öffnen', 35 'aria-controls': 'menu', 36 'aria-expanded': 'false', 37 'aria-haspopup': 'true' 38 }); 39 40 // Hilfsfunktionen 41 function setExpanded(isExpanded) { 42 $hamburgerToggle.attr('aria-expanded', isExpanded ? 'true' : 'false'); 43 } 44 45 function openMenu() { 46 $('body').scrollTop(0); 47 mmApi.open(); 48 // Icon-Animation 49 $hamburgerIcon.addClass('open'); 50 setExpanded(true); 51 52 // Fokus nach dem Ãffnen ins Menü setzen (erstes fokussierbares Element) 53 setTimeout(function () { 54 var $firstLink = $('#menu').find('a, button, [tabindex]:not([tabindex="-1"])').first(); 55 if ($firstLink.length) { 56 $firstLink.focus(); 57 } 58 }, 300); 59 } 60 61 function closeMenu() { 62 mmApi.close(); 63 $hamburgerIcon.removeClass('open'); 64 setExpanded(false); 65 66 // Fokus zurück auf den Hamburger 67 setTimeout(function () { 68 $hamburgerToggle.focus(); 69 }, 50); 70 } 71 72 // Klick auf den Hamburger 73 $hamburgerToggle.on('click', function (e) { 74 e.preventDefault(); 75 76 if ($hamburgerIcon.hasClass('open')) { 77 closeMenu(); 78 } else { 79 openMenu(); 80 } 81 }); 82 83 // Hamburger per Tastatur (Enter/Space) 84 $hamburgerToggle.on('keydown', function (e) { 85 if (e.key === 'Enter' || e.key === ' ') { 86 e.preventDefault(); 87 if ($hamburgerIcon.hasClass('open')) { 88 closeMenu(); 89 } else { 90 openMenu(); 91 } 92 } 93 }); 94 95 // ESC schlieÃt Menü (falls offen) 96 $(document).on('keydown.mmenuToggle', function (e) { 97 if (e.key === 'Escape' && $hamburgerIcon.hasClass('open')) { 98 e.preventDefault(); 99 closeMenu(); 100 } 101 }); 102 103 // Falls mmenu selbst (z.B. durch Wischen oder Klick auf Overlay) öffnet/schlieÃt, 104 // ARIA-Status & Icon mit der API synchron halten 105 mmApi.bind('open:after', function () { 106 $hamburgerIcon.addClass('open'); 107 setExpanded(true); 108 }); 109 110 mmApi.bind('close:after', function () { 111 $hamburgerIcon.removeClass('open'); 112 setExpanded(false); 113 // Fokus nicht erzwingen, wenn der Nutzer z.B. im Menü selbst schlieÃt 114 }); 115 116 117 $('a[href="https://www.inneremission-bremen.de/das-leisten-wir/hospize/"]').each(function() { 118 $(this).attr('href', 'https://www.mission-lebenshaus.de/'); 119 $(this).attr('target', '_blank'); 120 }); 121 122 123 //Subnav anker 124 if($('.subnav--ankerlink').length) { 125 $('.subnav--ankerlink').first().addClass('active'); 126 $('.subnav--ankerlink').on('click', function(){ 127 $('.subnav--ankerlink').removeClass('active'); 128 $(this).addClass('active'); 129 }); 130 } 131 132 /* Sidebar */ 133 /* 134 if($('.sidebar').length){ 135 136 $( window ).resize(function() { 137 posSidebar() 138 }).trigger('resize'); 139 function posSidebar(){ 140 if (window.matchMedia("(min-width: 992px)").matches) { 141 142 //Sidebar Image Float Handling 143 var sidebarHeight = $('.sidebar').outerHeight(true); 144 var sidebarWidth = $('.sidebar').outerWidth(true); 145 146 $('.content-leistungen:first img.size-large').each(function(){ 147 if($(this).parent('p').length) { 148 var thisTopPos = $(this).parent('p').position().top; 149 $(this).css('max-width','calc(100% - ' + sidebarWidth + 'px)'); 150 } 151 });
152 153 $('.sidebar').addClass('d-none'); 154 if($('body').hasClass('single-spendenprojekte') || $('body').hasClass('single-post')){ 155 $('.sidebar').prependTo('.col-content-leistungen'); 156 } else { 157 $('.sidebar').prependTo('.content-leistungen:first .col-lg-10'); 158 } 159 } else { 160 $('.sidebar').removeClass('d-none'); 161 if($('body').hasClass('single-spendenprojekte') || $('body').hasClass('single-post')){ 162 $('.sidebar').appendTo('.col-content-leistungen'); 163 } else { 164 $('.sidebar').appendTo('.content-leistungen:last .col-lg-10'); 165 } 166 $('.content-leistungen:first img').css('max-width','100%'); 167 } 168 } 169 170 }*/ 171 /* Submenu */ 172 $('.navbar--top .menu-item-has-children').hover( 173 function() { 174 $( this ).find('.sub-menu').addClass('visible'); 175 }, function() { 176 $( this ).find('.sub-menu').removeClass('visible'); 177 } 178 ); 179 /* Swuper */ 180 var jumbotronSwiper = new Swiper('.jumbotron__swiper-container--mood', { 181 loop: false, 182 speed: 800, 183 effect: 'fade', 184 navigation: { 185 nextEl: '.jumbotron__swiper-container--mood .swiper-button-next', 186 prevEl: '.jumbotron__swiper-container--mood .swiper-button-prev', 187 }, 188 pagination: { 189 el: '.jumbotron__swiper-pagination--mood', 190 clickable: true 191 }, 192 autoplay: { 193 delay: 3000, 194 }, 195 on: { 196 init: function () { 197 if(($(".jumbotron__swiper-container--mood .swiper-slide").length) == 1) { 198 $('.jumbotron__swiper-pagination--mood').addClass( "disabled" ); 199 $('.jumbotron__swiper-container--mood .swiper-button-next, .jumbotron__swiper-container--mood .swiper-button-prev').addClass( "disabled" ); 200 } 201 /*$('.jumbotron__iconwrap-inner img').each(function(){ 202 var thisWidth = $(this).width(); 203 var thisHeight = $(this).height(); 204 $(this).attr('data-width',thisWidth); 205 $(this).attr('data-height',thisHeight); 206 var percentage = ((1.13 - (thisWidth / thisHeight)) * 10); 207 percentage = percentage * 6.078 + "%"; 208 $(this).attr('data-gap', percentage).css('bottom',percentage); 209 })*/ 210 }, 211 slideNextTransitionStart: function () { 212 $('.jumbotron__swiper-container--mood .swiper-slide:eq(' + (this.activeIndex - 1) + ')').find('.jumbotron__content').addClass('changeslide'); 213 }, 214 slidePrevTransitionStart: function () { 215 $('.jumbotron__swiper-container--mood .swiper-slide:eq(' + (this.activeIndex + 1) + ')').find('.jumbotron__content').addClass('changeslide'); 216 }, 217 transitionEnd: function () { 218 $('.jumbotron__swiper-container--mood .jumbotron__content').removeClass('changeslide'); 219 }, 220 transitionStart: function () { 221 var endColor = $('.jumbotron__swiper-container--mood .swiper-slide:eq(' + (this.activeIndex) + ')').css("background-color"); 222 endColor = rgbToHex(endColor); 223 if(!$('.navbar').hasClass('navbar--shadow')) { 224 document.querySelector("meta[name=theme-color]").setAttribute("content", endColor); 225 } 226 document.querySelector("meta[name=theme-color]").setAttribute("data-content", endColor); 227 } 228 } 229 }); 230 var jumbotronSwiper = new Swiper('.jumbotron__swiper-container--teaser', { 231 loop: false, 232 speed: 800, 233 effect: 'fade', 234 navigation: { 235 nextEl: '.jumbotron__swiper-container--teaser .swiper-button-next', 236 prevEl: '.jumbotron__swiper-container--teaser .swiper-button-prev', 237 }, 238 pagination: { 239 el: '.jumbotron__swiper-pagination--teaser', 240 clickable: true 241 }, 242 autoplay: { 243 delay: 5000, 244 }, 245 on: { 246 init: function () { 247 if(($(".jumbotron__swiper-container--teaser .swiper-slide").length) == 1) { 248 $('.jumbotron__swiper-pagination--teaser').addClass( "disabled" ); 249 $('.jumbotron__swiper-container--teaser .swiper-button-next, .jumbotron__swiper-container--teaser .swiper-button-prev').addClass( "disabled" ); 250 } 251 } 252 } 253 }); 254 var reasonsSwiper = new Swiper('.section-teaser-reasons__swiper-container', { 255 loop: true, 256 speed: 800, 257 autoHeight: true, 258 effect: 'slide', 259 navigation: { 260 nextEl: '.swiper-button-next', 261 prevEl: '.swiper-button-prev', 262 }, 263 pagination: { 264 el: '.swiper-pagination', 265 clickable: true 266 } 267 }); 268 var missionSwiper = new Swiper('.section-teaser-mission__swiper-container', { 269 loop: true,
270 speed: 800, 271 autoHeight: true, 272 effect: 'slide', 273 navigation: { 274 nextEl: '.swiper-button-next', 275 prevEl: '.swiper-button-prev', 276 }, 277 pagination: { 278 el: '.swiper-pagination', 279 clickable: true 280 } 281 }); 282 var newsSwiper = new Swiper('.section-teaser-news__swiper-container', { 283 loop: true, 284 speed: 800, 285 autoHeight: true, 286 effect: 'slide', 287 navigation: { 288 nextEl: '.section-teaser-news__swiper-button-next', 289 prevEl: '.section-teaser-news__swiper-button-prev', 290 }, 291 pagination: { 292 el: '.section-teaser-news__swiper-pagination', 293 clickable: true 294 } 295 }); 296 if($('.section-teaser-news__swiper-container').length){ 297 $(window).resize(function(){ 298 swiperNewsButtons(); 299 }).trigger('resize'); 300 301 } 302 function swiperNewsButtons(){ 303 if (!window.matchMedia('(min-width: 992px)').matches) { 304 var imgHeight = $('.section-teaser-news__swiper-container .fullsizebg-cover').height(); 305 $('.section-teaser-news__swiper-button-prev, .section-teaser-news__swiper-button-next').css('top',imgHeight / 2); 306 } else { 307 $('.section-teaser-news__swiper-button-prev, .section-teaser-news__swiper-button-next').css('top','50%'); 308 } 309 } 310 var standorteSwiper = new Swiper('.section-teaser-map__swiper-container', { 311 loop: true, 312 speed: 800, 313 autoHeight: true, 314 effect: 'slide', 315 navigation: { 316 nextEl: '.swiper-button-next', 317 prevEl: '.swiper-button-prev', 318 }, 319 pagination: { 320 el: '.swiper-pagination', 321 clickable: true, 322 renderBullet: function (index, className) { 323 var slideName = $('.swiper-slide[data-slide-index="' + index + '"]').attr('data-slide-name'); 324 return '<span class="' + className + '">' + slideName + '</span>'; 325 }, 326 } 327 }); 328 var contentSwiper = new Swiper('.content-slider__swiper-container', { 329 loop: true, 330 autoHeight: true, 331 speed: 800, 332 effect: 'slide', 333 navigation: { 334 nextEl: '.swiper-button-next', 335 prevEl: '.swiper-button-prev', 336 }, 337 pagination: { 338 el: '.swiper-pagination', 339 clickable: true 340 } 341 }); 342 343 /* Toggle */ 344 $('.toggle__header').click(function(){ 345 var toggleParent = $(this).parent('.toggle'); 346 if(toggleParent.hasClass('open')){ 347 closeAkkordeon($(this)); 348 }else { 349 window.location.hash = toggleParent.attr('id'); 350 openAkkordeon($(this)); 351 } 352 }); 353 354 function closeAkkordeon(toggle) { 355 window.location.hash = "!"; 356 var toggleParent = toggle.parent('.toggle'); 357 358 // ARIA: Akkordeon zu 359 toggle.attr('aria-expanded', 'false'); 360 361 toggleParent.toggleClass('open'); 362 toggleParent.find('.toggle__header').css('color','#fff'); 363 toggleParent.find('.toggle__arrow').css({ 364 'background-image':"url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24.35' height='29.62' viewBox='2.633 -2.635 24.35 29.62'%3E%3Cpath fill='%23FFF' d='M13.547 26.492L3.082 16.028c-1.682-1.682 1.775-5.232 3.551-3.457l5.699 5.793V-.604c0-2.709 4.952-2.709 4.952 0v18.967l5.792-5.793c1.683-1.775 5.14 1.775 3.457 3.457L16.071 26.492a1.862 1.862 0 0 1-2.524 0z'/%3E%3C/svg%3E\")", 365 'border-color':'#fff' 366 }); 367 } 368 369 function openAkkordeon(toggle) { 370 // ARIA: alle offenen Akkordeons auf aria-expanded=false setzen 371 $('.toggle.open .toggle__header').attr('aria-expanded', 'false'); 372 373 $('.toggle.open .toggle__header').css('color','#fff'); 374 $('.toggle.open .toggle__arrow').css({ 375 'background-image':"url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24.35' height='29.62' viewBox='2.633 -2.635 24.35 29.62'%3E%3Cpath fill='%23FFF' d='M13.547 26.492L3.082 16.028c-1.682-1.682 1.775-5.232 3.551-3.457l5.699 5.793V-.604c0-2.709 4.952-2.709 4.952 0v18.967l5.792-5.793c1.683-1.775 5.14 1.775 3.457 3.457L16.071 26.492a1.862 1.862 0 0 1-2.524 0z'/%3E%3C/svg%3E\")", 376 'border-color':'#fff' 377 }); 378 $('.toggle.open').removeClass('open'); 379 380 var toggleParent = toggle.parent('.toggle'); 381 382 toggleParent.toggleClass('open'); 383 384 // ARIA: aktuelles Akkordeon auf aria-expanded=true setzen 385 toggle.attr('aria-expanded', 'true'); 386 387 var thisColor = toggleParent.attr('data-color'); 388 var thisColorBlank = thisColor.replace("#", ""); 389 toggleParent.find('.toggle__header').css('color',thisColor); 390 toggleParent.find('.toggle__arrow').css({ 391 'background-image':"url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24.35' height='29.619' viewBox='2.633 -2.635 24.35 29.619'%3E%3Cpath fill='%23"+thisColorBlank+"' d='M16.069-2.143L26.534 8.322c1.682 1.682-1.775 5.231-3.551 3.457l-5.699-5.793v18.967c0 2.709-4.951 2.709-4.951 0V5.986l-5.792 5.793c-1.683 1.774-5.14-1.775-3.457-3.457L13.545-2.143a1.862 1.862 0 0 1 2.524 0z'/%3E%3C/svg%3E\")", 392 'border-color':thisColor 393 }); 394 var toggleOffset = 20; 395 if (window.matchMedia("(max-width: 992px)").matches) { 396 toggleOffset = toggleOffset + $('.navbar').outerHeight(); 397 } 398 $("html, body").animate({ scrollTop: (toggle.offset().top) - toggleOffset }, 600); 399 } 400 401 function openAkkordeonAll(toggle) { 402 var toggleParent = toggle.parent('.toggle'); 403 404 toggleParent.addClass('open'); 405
406 // ARIA: dieses Akkordeon als geöffnet markieren 407 toggle.attr('aria-expanded', 'true'); 408 409 var thisColor = toggleParent.attr('data-color'); 410 var thisColorBlank = thisColor.replace("#", ""); 411 toggleParent.find('.toggle__header').css('color',thisColor); 412 toggleParent.find('.toggle__arrow').css({ 413 'background-image':"url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24.35' height='29.619' viewBox='2.633 -2.635 24.35 29.619'%3E%3Cpath fill='%23"+thisColorBlank+"' d='M16.069-2.143L26.534 8.322c1.682 1.682-1.775 5.231-3.551 3.457l-5.699-5.793v18.967c0 2.709-4.951 2.709-4.951 0V5.986l-5.792 5.793c-1.683 1.774-5.14-1.775-3.457-3.457L13.545-2.143a1.862 1.862 0 0 1 2.524 0z'/%3E%3C/svg%3E\")", 414 'border-color':thisColor 415 }); 416 } 417 418 /* Toggle Inhalte Toggle */ 419 if($('.toggle__content').length){ 420 $('.toggle__content').each(function(){ 421 var color = $(this).parent('.toggle').attr('data-color'); 422 423 // Panels & Tabs holen 424 var $panels = $(this).find('.toggle__content-content'); 425 var $togglers = $(this).find('.toggle__content-content-toggler'); 426 427 // Standard: alle Panels verstecken & aria 428 $panels.hide().attr('hidden', 'hidden'); 429 430 // Ersten Tab/Panels aktiv setzen, falls vorhanden 431 if ($panels.length) { 432 $panels.first().show().removeAttr('hidden'); 433 } 434 435 if ($togglers.length) { 436 $togglers 437 .attr({ 438 'aria-selected': 'false', 439 'tabindex': '-1' 440 }) 441 .css({'color':'','border-color':''}); 442 443 $togglers.first() 444 .attr({ 445 'aria-selected': 'true', 446 'tabindex': '0' 447 }) 448 .css({'color':color,'border-color':color}); 449 } 450 }); 451 } 452 453 $('.toggle__content-content-toggler').click(function(){ 454 var thisRel = $(this).attr('rel'); 455 var $toggle = $(this).parents('.toggle'); 456 var color = $toggle.attr('data-color'); 457 458 var $togglers = $toggle.find('.toggle__content-content-toggler'); 459 var $panels = $toggle.find('.toggle__content-content'); 460 461 // Visuell zurücksetzen 462 $togglers.css({'color':'','border-color':''}); 463 464 // ARIA: alle Tabs inaktiv 465 $togglers.attr({ 466 'aria-selected':'false', 467 'tabindex':'-1' 468 }); 469 470 // Diesen Tab aktiv 471 $(this).css({'color':color,'border-color':color}); 472 $(this).attr({ 473 'aria-selected':'true', 474 'tabindex':'0' 475 }); 476 477 // Panels umschalten inkl. hidden 478 $panels.hide().attr('hidden', 'hidden'); 479 var $targetPanel = $toggle.find('.toggle__content-content[rel="'+thisRel+'"]'); 480 $targetPanel.fadeIn().removeAttr('hidden'); 481 }); 482 483 if($('.toggle').length){ 484 var hash = window.location.hash; 485 if(hash != "" && hash != "#!"){ 486 $('.toggle' + hash).find('.toggle__header').trigger('click'); 487 } 488 } 489 490 $('.rsbtn_play').on('click',function(){ 491 $('.toggle__header').each(function(){ 492 openAkkordeonAll($(this)); 493 494 setTimeout(function(){ $(window).trigger('resize'); }, 500); 495 496 }); 497 498 }); 499
500 /* Responsive Background Images Start */ 501 responssiveBackgroundImages(); 502 $(window).resize(function(){ 503 responssiveBackgroundImages(); 504 }); 505 function responssiveBackgroundImages(){ 506 $( ".fullsizebg-cover__picture-to-bg" ).each( function( index, element ){ 507 var container = $(this); 508 509 if(container.find('.loading-spinner').length == 0){ 510 container.append('<div class="loading-spinner"></div>'); 511 } 512 container.imagesLoaded( function() { 513 if (Modernizr.picture) { 514 this.element = container; 515 this.img = element.querySelector('img'); 516 this.src = ''; 517 var src = typeof this.img.currentSrc !== 'undefined' ? this.img.currentSrc : this.img.src; 518 if (this.src !== src) { 519 this.src = src; 520 var src_ = src; 521 container.find('.loading-spinner').fadeOut(); 522 container.css('background-image', 'url(' + src_ + ')'); 523 } 524 } else { 525 var match = 0; 526 var bg = false; 527 container.find('source').each( function( index, element ){ 528 if (window.matchMedia($(this).attr('media')).matches) { 529 if(parseInt($(this).attr('data-size')) >= match){ 530 match = $(this).attr('data-size'); 531 var srcset = $(this).attr('srcset'); 532 var srcset_explode = srcset.split(" "); 533 var img_src = srcset_explode[0]; 534 if(img_src){ 535 container.find('.loading-spinner').fadeOut(); 536 container.css('background-image', 'url(' + img_src + ')'); 537 bg = true; 538 } 539 } 540 } 541 }); 542 if(!bg){ 543 var img_src = container.find('img').attr('src'); 544 container.find('.loading-spinner').fadeOut(); 545 container.css('background-image', 'url(' + img_src + ')'); 546 } 547 548 } 549 }); 550 }); 551 }
552 /* Responsive Background Images End */ 553 554 555 556 //Header 557 headerShrink(); 558 $( window ).scroll(function() { 559 if(!$('.searchbar').hasClass('visible')) { 560 headerShrink(); 561 } 562 if(!$('.navbar').hasClass('animate')){ 563 $('.navbar').addClass('animate') 564 } 565 }); 566 function headerShrink() { 567 var c, currentScrollTop = 0, 568 navbar = $('.navbar'); 569 if (!window.matchMedia('(min-width: 992px)').matches) { 570 var a = $(window).scrollTop(); 571 var b = navbar.height(); 572 573 currentScrollTop = a; 574 navbar.removeClass('shrink'); 575 /*if (c < currentScrollTop && a > b + b) { 576 navbar.addClass('shrink'); 577 } else if (c > currentScrollTop && !(a <= b)) { 578 navbar.removeClass('shrink'); 579 }*/ 580 581 if(a > 50){ 582 navbar.addClass('navbar--shadow'); 583 document.querySelector("meta[name=theme-color]").setAttribute("content", "#ffffff"); 584 585 }else { 586 navbar.removeClass('navbar--shadow'); 587 var oldcolor = document.querySelector("meta[name=theme-color]").getAttribute("data-content"); 588 if(oldcolor != "" && oldcolor != null) { 589 document.querySelector("meta[name=theme-color]").setAttribute("content", oldcolor); 590 } 591 } 592 593 c = currentScrollTop; 594 }else { 595 navbar.removeClass('navbar--shadow'); 596 var top_pos = $(window).scrollTop(); 597 if(top_pos > 20){ 598 navbar.addClass('shrink'); 599 600 }else { 601 navbar.removeClass('shrink'); 602 } 603 } 604 } 605 606 /* Ajax News Start */ 607 if($('.news__ajax').length){ 608 var container = $('.news__ajax'); 609 /* History Handling */ 610 var hash = window.location.hash; 611 if(hash != "" && hash.indexOf('article') !== -1 && hash.indexOf('category') !== -1){ 612 $(document).scrollTop( 0 ); 613 } 614 [].slice.call( document.querySelectorAll( 'select.cs-select__filter-news' ) ).forEach( function(el) { 615 new SelectFx(el, { 616 stickyPlaceholder: false, 617 onChange : function( val ) { 618 window.history.replaceState( {} , 'return', '#!' ); 619 window.location.hash = '#!'; 620 container.attr('data-category', val); 621 setTimeout(function(){ 622 ajaxNews(true); 623 }, 50); 624 } 625 }); 626 } ); 627 628 629 ajaxNews(false); 630 if($('#nachladen').length){ 631 var nachladenContainer = $('#nachladen'); 632 var nachladenSpinner = $('#nachladen .loading-spinner'); 633 $(window).scroll(function(){ 634 if(nachladenContainer.isOnScreen(0)){ 635 if(nachladenContainer.attr('data-getter') == 1){ 636 nachladenSpinner.show(); 637 ajaxNews(false); 638 } 639 nachladenContainer.attr('data-getter',0); 640 } 641 }); 642 nachladenContainer.click(function(){ 643 nachladenSpinner.show(); 644 ajaxNews(false); 645 }); 646 647 } 648 } 649 function ajaxNews(replace) { 650 var container = $('.news__ajax'); 651 652 if(replace){ 653 container.attr('data-page',1); 654 $('#nachladen').show(); 655 $('#nachladen').attr('data-getter',0); 656 } 657 658 var perpage = container.attr('data-perpage'); 659 var page = container.attr('data-page'); 660 var newsart = container.attr('data-newsart'); 661 var orderby = container.attr('data-orderby'); 662 var category = container.attr('data-category'); 663 664 if(window.location.hash != "" && window.location.hash.indexOf('article') !== -1 && window.location.hash.indexOf('category') !== -1){ 665 $('#shadow').show(); 666 var hashSplit = window.location.hash.split("/"); 667 var categoryHash = hashSplit[1]; 668 categoryHash = categoryHash.replace("category-", ""); 669 category = categoryHash; 670 671 //$('.news-sorting[rel="' + category + '"]').addClass('active'); 672 $('.cs-select__filter-news .cs-placeholder').html($('.cs-select__filter-news .cs-options li[data-value="'+category+'"] span').html()); 673 $('.cs-select__filter-news .cs-options li[data-value="'+category+'"]').addClass('cs-selected'); 674 } 675 676 var infinite = container.attr('data-infinite'); 677 678 //var replace = false; 679 680 $.ajax({ 681 url : imscripts_ajax.ajax_url, // Note that 'aj_ajax_demo' is from the wp_localize_script() call. 682 type : 'post', 683 dataType: 'json', 684 data : { 685 action : 'im_ajax_news', // Note that this is part of the add_action() call. 686 security : imscripts_ajax.im_ajax_nonce, // Note that 'aj_demo_nonce' is from the wp_localize_script() call. 687 perpageData : perpage, 688 pageData : page, 689 newsartData : newsart, 690 orderbyData : orderby, 691 categoryData : category 692 }, 693 success : function( response ) { 694 var items = []; 695 var countItems = response.info.found_posts; 696 var countItems_page = response.info.found_posts_page; 697 var debug = response.info.debug; 698 699 $('#nachladen').find('.btn').hide(); 700 701 if(countItems_page > 0){ 702 $('#news-update').text('Weitere News wurden geladen'); 703 704 $.each( response.items, function( key, val ) { 705 var counter = container.attr('data-counter'); 706 707 if(val.beitrag_type == "pressemitteilung") { 708 var type = "press"; 709 var item = '<div class="col-lg-6 col-xl-4">' + 710 '<article id="' + val.beitrag_id + '" class="position-relative news-item news-item--press" data-aos="from-down">' + 711 '<div class="section-teaser-news__content h-100 d-flex align-items-end">' + 712 '<a href="' + val.beitrag_permalink + '" class="section-teaser-news__content-teaser">' + 713 '<span class="section-teaser-news__teaser-headline">' + val.beitrag_titel + '</span>' + 714 '<span class="section-teaser-news__teaser-text">' + val.beitrag_datum + '</span>' + 715 '</a>' + 716 '</div>' + 717 '</article>' + 718 '</div>'; 719 counter++; 720 container.attr('data-counter',counter); 721 } else { 722 var classZusatz_1 = ' section-teaser-news__col-imgwrap'; 723 var classZusatz_2 = ' section-teaser-news__col-contentwrap'; 724 var beitrag_image = '<div class="section-teaser-news__imgwrap"></div>'; 725 if(val.beitrag_image != '') { 726 beitrag_image = '<a aria-label="Mehr lesen: ' + val.beitrag_titel + '" href="' + val.beitrag_permalink + '" class="d-block section-teaser-news__imgwrap find-zoomin-hover">' + 727 '<div class="fullsizebg-cover fullsizebg-cover__picture-to-bg zoomin-hover w-100 h-100" style="">' + 728 '<picture>' + 729 '<source data-size="0" srcset="' + val.beitrag_image_small + ' 1x, ' + val.beitrag_image_medium + ' 1.5x, ' + val.beitrag_image_medium + ' 2x"> ' + 730 '<img src="' + val.beitrag_image_medium + '" alt="' + val.beitrag_image_alt + '">' + 731 '</picture>' + 732 '</div>' + 733 '</a>' 734 } 735 if(val.beitrag_zitat != ""){ 736 var item = '<article id="' + val.beitrag_id + '" class="position-relative news-item news-item__zitat" data-aos="from-down">' + 737 '<div class="section-teaser-news__content h-100">' + 738 '<div class="row">' + 739 '<div class="col-md-9 text-center">' + 740 '<div class="mood-text__cite">' + val.beitrag_zitat + '</div>' + 741 '<div class="mood-text__cite-source">' + val.beitrag_zitat_source + '</div>' + 742 '</div>' + 743 '<div class="col-md-3">' + 744 '<div class="d-flex align-items-end h-100 flex-row-reverse"><a class="btn btn-teaser float-right" href="' + val.beitrag_permalink +' ">Zum Impuls</a></div>' + 745 '</div>' + 746 '</div>' + 747 '</div>' + 748 '</article>'; 749 }else { 750 if(counter % 2 == 0){
751 classZusatz_1 = ' section-teaser-news__col-imgwrap order-lg-2'; 752 classZusatz_2 = ' section-teaser-news__col-contentwrap order-lg-1'; 753 } 754 var item = '<article id="' + val.beitrag_id + '" class="position-relative news-item" data-aos="from-down">' + 755 '<div class="row justify-content-center h-100">' + 756 '<div class="col-lg-6' + classZusatz_1 + '">' + 757 beitrag_image + 758 '</div>' + 759 '<div class="col-lg-6' + classZusatz_2 + '">' + 760 '<div class="section-teaser-news__content h-100 d-flex align-items-end">' + 761 '<a href="' + val.beitrag_permalink + '" class="section-teaser-news__content-teaser">' + 762 '<span class="section-teaser-news__teaser-headline">' + val.beitrag_titel + '</span>' + 763 '<span class="section-teaser-news__teaser-text">' + val.beitrag_teasertext + '</span>' + 764 '</a>' + 765 '</div>' + 766 '</div>' + 767 '</div>' + 768 '</article>'; 769 counter++; 770 container.attr('data-counter',counter); 771 } 772 } 773 774 775 776 items.push( item ); 777 }); 778 779 780 781 if(replace) { 782 container.html(items.join('')); 783 container.attr('data-page', parseInt(page) + 1); 784 785 786 } 787 else { 788 container.append(items.join('')); 789 container.attr('data-page', parseInt(page) + 1); 790 } 791 792 responssiveBackgroundImages(); 793 794 AOS.refreshHard(); 795 796 797 798 799 $('#nachladen .loading-spinner').hide(); 800 if(page <= infinite){ 801 $('#nachladen').attr('data-getter',1); 802 }else { 803 if(parseInt(countItems) != parseInt($('.news__ajax article').length)){ 804 $('#nachladen').find('.btn').fadeIn(); 805 } 806 } 807 808 809 /* Klick auf Beitrag History Handling */ 810 $('article').on('mousedown', function(){ 811 var id = $(this).attr('id'); 812 var page = container.attr('data-page'); 813 var category = container.attr('data-category'); 814 if (id !== undefined && page !== undefined && category !== undefined){ 815 var hash = window.location.hash; 816 var hashNew = '#article-' + id + '/category-' + category; 817 window.history.replaceState( {} , 'return', hashNew ); 818 } 819 }); 820 821 /* History Handling */ 822 var hash = window.location.hash; 823 if(hash != "" && hash.indexOf('article') !== -1 && hash.indexOf('category') !== -1){ 824 var hashSplit = hash.split("/"); 825 var articleHash = hashSplit[0]; 826 articleHash = articleHash.replace("article-", ""); 827 var jumptoContainer = $(articleHash); 828 if(jumptoContainer.length){ 829 $(document).scrollTop( jumptoContainer.offset().top - 150 ); 830 window.history.replaceState( {} , 'return', '#!' ); 831 window.location.hash = '#!'; 832 $('#shadow').fadeOut('fast'); 833 } 834 else { 835 ajaxNews(false); 836 } 837 } 838 839 840 } 841 else { 842 $('#nachladen').hide(); 843 } 844 } 845 }); 846 } 847 /* Ajax News End */ 848 849 /* Kontaktformular Start */ 850 $('.form__form').submit(function( event ) { 851 if(!$('.send-form').hasClass('loading')){ 852 $('.send-form').addClass('loading').append('<div class="loading-spinner"></div>'); 853 } 854 var data = $( this ).serialize(); 855 event.preventDefault(); 856 $.ajax({ 857 url : imscripts_ajax.ajax_url, // Note that 'aj_ajax_demo' is from the wp_localize_script() call. 858 type : 'post', 859 dataType: 'json', 860 data : { 861 action : 'im_ajax_kontaktform', // Note that this is part of the add_action() call. 862 security : imscripts_ajax.im_ajax_nonce, // Note that 'aj_demo_nonce' is from the wp_localize_script() call. 863 formData : data 864 }, 865 success : function( response ) { 866 867 var errorCount = response.confirm_error_count; 868 var errorFelder = response.confirm_error_felder; 869 870 if($('.send-form').hasClass('loading')){ 871 $('.send-form').removeClass('loading').find('.loading-spinner').remove(); 872 } 873 874 $('.form__form .form-control').removeClass('error'); 875 $('.form-check-label').removeClass('red'); 876 $('.form__error span').html(''); 877 $('.form__error').hide(); 878 if(errorCount == 0){ 879 $.fancyConfirm({ 880 title : response.confirm_titel, 881 message : response.confirm_text, 882 okButton : response.confirm_btn_text, 883 noButton : '' 884 });
885 $('.form__form').trigger('reset'); 886 }else { 887 $.each(errorFelder, function(index, value){ 888 $('.form__form .form-control[name="'+value+'"]').addClass('error'); 889 $('.form__error').fadeIn(); 890 if(value == 'form-datenschutz-fehler') { 891 $('.form-check-label').addClass('red'); 892 $('.form__error span').html(' und akzeptieren Sie die Datenschutzerklärung'); 893 } 894 }); 895 } 896 } 897 }); 898 }); 899 /* Kontaktformular End */ 900 901 902 903 /* Barriere melden Formular Start */ 904 $('.form__form_barriere').submit(function( event ) { 905 if(!$('.send-form').hasClass('loading')){ 906 $('.send-form').addClass('loading').append('<div class="loading-spinner"></div>'); 907 } 908 var data = $( this ).serialize(); 909 event.preventDefault(); 910 $.ajax({ 911 url : imscripts_ajax.ajax_url, // Note that 'aj_ajax_demo' is from the wp_localize_script() call. 912 type : 'post', 913 dataType: 'json', 914 data : { 915 action : 'im_ajax_barriereform', // Note that this is part of the add_action() call. 916 security : imscripts_ajax.im_ajax_nonce, // Note that 'aj_demo_nonce' is from the wp_localize_script() call. 917 formData : data 918 }, 919 success : function( response ) { 920 921 var errorCount = response.confirm_error_count; 922 var errorFelder = response.confirm_error_felder; 923 924 if($('.send-form').hasClass('loading')){ 925 $('.send-form').removeClass('loading').find('.loading-spinner').remove(); 926 } 927 928 $('.form__form_barriere .form-control').removeClass('error'); 929 $('.form-check-label').removeClass('red'); 930 $('.form__error span').html(''); 931 $('.form__error').hide(); 932 if(errorCount == 0){ 933 $.fancyConfirm({ 934 title : response.confirm_titel, 935 message : response.confirm_text, 936 okButton : response.confirm_btn_text, 937 noButton : '' 938 }); 939 $('.form__form_barriere').trigger('reset'); 940 }else { 941 $.each(errorFelder, function(index, value){ 942 $('.form__form_barriere .form-control[name="'+value+'"]').addClass('error'); 943 $('.form__error').fadeIn(); 944 if(value == 'form-datenschutz-fehler') { 945 $('.form-check-label').addClass('red'); 946 $('.form__error span').html(' und akzeptieren Sie die Datenschutzerklärung'); 947 } 948 }); 949 } 950 } 951 }); 952 }); 953 /* Kontaktformular End */ 954 955 956 957 958 /* Complianceform Start */ 959 $('.form__form--compliance').submit(function( event ) { 960 if(!$('.send-form').hasClass('loading')){ 961 $('.send-form').addClass('loading').append('<div class="loading-spinner"></div>'); 962 } 963 964 var data = $( this ).serialize(); 965 var form = $('#complianceform')[0]; 966 var formData = new FormData(form); 967 968 formData.append('action', 'im_ajax_kontaktform_compliance'); 969 formData.append('files_', $('#form-files').prop('files')[0]); 970 event.preventDefault(); 971 972 $.ajax({ 973 url : imscripts_ajax.ajax_url, // Note that 'aj_ajax_demo' is from the wp_localize_script() call. 974 type : 'POST', 975 processData: false, 976 contentType: false, 977 enctype: 'multipart/form-data', 978 data: formData, 979 success : function( response ) { 980 981 var errorCount = response.confirm_error_count; 982 var errorFelder = response.confirm_error_felder; 983 984 console.log(errorFelder); 985 986 if($('.send-form').hasClass('loading')){ 987 $('.send-form').removeClass('loading').find('.loading-spinner').remove(); 988 } 989 990 $('.form__form--compliance .form-control').removeClass('error'); 991 $('.form-check-label').removeClass('red'); 992 $('.form__error span').html(''); 993 $('.form__error').hide(); 994 if(errorCount == 0){ 995 $.fancyConfirm({ 996 title : response.confirm_titel, 997 message : response.confirm_text, 998 okButton : response.confirm_btn_text, 999 noButton : '' 1000 }); 1001 $('.form__form--compliance').trigger('reset'); 1002 }else { 1003 $.each(errorFelder, function(index, value){ 1004 $('.form__form--compliance .form-control[name="'+value+'"]').addClass('error'); 1005 $('.form__error').fadeIn(); 1006 if(value == 'form-datenschutz-fehler') { 1007 $('.form-check-label').addClass('red'); 1008 $('.form__error span').html(' und akzeptieren Sie die Datenschutzerklärung'); 1009 } 1010 });
1011 } 1012 } 1013 }); 1014 }); 1015 /* Kontaktformular End */ 1016 1017 1018 /* Anmmeldung Formular Start */ 1019 $('#form-begleitung').on('change', function () { 1020 $('.form__form--anmeldung-begleitungwrap').toggleClass('d-none', !this.checked); 1021 }); 1022 $('.form__form--anmeldung').submit(function( event ) { 1023 if(!$('.send-form--anmeldung').hasClass('loading')){ 1024 $('.send-form--anmeldung').addClass('loading').append('<div class="loading-spinner"></div>'); 1025 } 1026 var data = $( this ).serialize(); 1027 event.preventDefault(); 1028 $.ajax({ 1029 url : imscripts_ajax.ajax_url, // Note that 'aj_ajax_demo' is from the wp_localize_script() call. 1030 type : 'post', 1031 dataType: 'json', 1032 data : { 1033 action : 'im_ajax_anmeldeform', // Note that this is part of the add_action() call. 1034 security : imscripts_ajax.im_ajax_nonce, // Note that 'aj_demo_nonce' is from the wp_localize_script() call. 1035 formData : data 1036 }, 1037 success : function( response ) { 1038 1039 var errorCount = response.confirm_error_count; 1040 var errorFelder = response.confirm_error_felder; 1041 1042 console.log(errorCount); 1043 console.log(errorFelder); 1044 1045 if($('.send-form--anmeldung').hasClass('loading')){ 1046 $('.send-form--anmeldung').removeClass('loading').find('.loading-spinner').remove(); 1047 } 1048 1049 $('.form__form--anmeldung .form-control').removeClass('error'); 1050 $('.form-check-label').removeClass('red'); 1051 $('.form__error span').html(''); 1052 $('.form__error').hide(); 1053 if(errorCount == 0){ 1054 $.fancyConfirm({ 1055 title : response.confirm_titel, 1056 message : response.confirm_text, 1057 okButton : response.confirm_btn_text, 1058 noButton : '' 1059 }); 1060 $('.form__form--anmeldung').trigger('reset'); 1061 }else { 1062 $.each(errorFelder, function(index, value){ 1063 $('.form__form--anmeldung .form-control[name="'+value+'"]').addClass('error'); 1064 $('.form__error').fadeIn(); 1065 if(value == 'form-datenschutz-fehler') { 1066 $('.form-check-label-datenschutz').addClass('red'); 1067 $('.form__error span').html(' und akzeptieren Sie die Datenschutzerklärung'); 1068 } 1069 }); 1070 } 1071 } 1072 }); 1073 }); 1074 /* Kontaktformular End */ 1075 1076 1077 1078 /* Search Start */ 1079 var kwdelay = (function(){ 1080 var timer = 0; 1081 return function(callback, ms){ 1082 clearTimeout (timer); 1083 timer = setTimeout(callback, ms); 1084 }; 1085 })(); 1086 var $searchbar = $('.searchbar'); 1087 var $searchInput = $('#search'); 1088 var lastSearchTrigger = null; 1089 1090 // Ãffnen des Overlays 1091 function openSearchbar(triggerEl) { 1092 lastSearchTrigger = triggerEl || lastSearchTrigger; 1093 1094 var scrollTopPos = $(document).scrollTop(); 1095 var time = scrollTopPos > 0 ? 200 : 0; 1096 1097 $('html').animate({ scrollTop: 0 }, time, function () { 1098 $searchbar.addClass('visible'); 1099 $('.navbar').addClass('absolute'); 1100 $('#shadow').addClass('nospinner').fadeIn('fast'); 1101 1102 // ARIA-Status setzen 1103 $('.jumbotron__send').attr('aria-expanded', 'true'); 1104 1105 // Fokus ins Suchfeld 1106 if (typeof focusAndOpenKeyboard === 'function') { 1107 focusAndOpenKeyboard($searchInput, 700); 1108 } else { 1109 setTimeout(function () { 1110 $searchInput.focus(); 1111 }, 50); 1112 } 1113 }); 1114 } 1115 1116 // SchlieÃen des Overlays 1117 function closeSearchbar() { 1118 $searchInput.val(''); 1119 $('.searchbar__res').html(''); 1120 1121 $searchbar.removeClass('visible'); 1122 $('.navbar').removeClass('absolute'); 1123 $('#shadow').fadeOut('fast', function () { 1124 $(this).removeClass('nospinner'); 1125 }); 1126 1127 // ARIA-Status zurücksetzen 1128 $('.jumbotron__send').attr('aria-expanded', 'false'); 1129 1130 setTimeout(function () { 1131 $searchInput.blur(); 1132 // Fokus zurück auf den auslösenden Link 1133 if (lastSearchTrigger) { 1134 $(lastSearchTrigger).focus(); 1135 } 1136 }, 50); 1137 } 1138 1139 // Klick auf Trigger (Mobile + Desktop) 1140 $('.jumbotron__send').on('click', function (e) { 1141 e.preventDefault(); 1142 openSearchbar(this); 1143 });
1144 1145 // Trigger per Tastatur: Enter/Space 1146 $('.jumbotron__send').on('keydown', function (e) { 1147 if (e.key === 'Enter' || e.key === ' ') { 1148 e.preventDefault(); 1149 openSearchbar(this); 1150 } 1151 }); 1152 1153 // SchlieÃen-Element: Klick 1154 $('.searchbar__close').on('click', function (e) { 1155 e.preventDefault(); 1156 closeSearchbar(); 1157 }); 1158 1159 // SchlieÃen-Element: Tastatur (Enter/Space) 1160 $('.searchbar__close').on('keydown', function (e) { 1161 if (e.key === 'Enter' || e.key === ' ') { 1162 e.preventDefault(); 1163 closeSearchbar(); 1164 } 1165 }); 1166 1167 // ESC schlieÃt Overlay 1168 $(document).on('keydown.searchbar', function (e) { 1169 if (e.key === 'Escape' && $searchbar.hasClass('visible')) { 1170 e.preventDefault(); 1171 closeSearchbar(); 1172 } 1173 }); 1174 1175 // Ajax-Suche mit Live-Region 1176 $searchInput.on('keyup', function () { 1177 var data = $(this).val(); 1178 1179 kwdelay(function () { 1180 if (data.length > 1) { 1181 $.ajax({
1182 url: imscripts_ajax.ajax_url, 1183 type: 'post', 1184 dataType: 'json', 1185 data: { 1186 action: 'im_ajax_suche', 1187 sData: data 1188 }, 1189 success: function (response) { 1190 var items = []; 1191 var countItms = response.length; 1192 1193 $.each(response, function (key, val) { 1194 var elmStart = "<div "; 1195 var elmEnd = "</div>"; 1196 if (val.permalink !== "") { 1197 elmStart = "<a href='" + val.permalink + "' "; 1198 elmEnd = "</a>"; 1199 } 1200 var text = (val.text != null) ? val.text : ""; 1201 1202 items.push( 1203 elmStart + 1204 "class='search-results__result w-100'>" + 1205 "<strong class='size-buttons search-results__title'>" + 1206 val.titel + 1207 "</strong>" + 1208 "<p>" + text + "</p>" + 1209 elmEnd 1210 ); 1211 }); 1212 1213 // Live-Region aktualisieren 1214 $('.searchbar__res').html(items.join('')).fadeIn('fast'); 1215 1216 // Matomo-Tracking 1217 setTimeout(function () { 1218 if (window.BorlabsCookie && window.BorlabsCookie.checkCookieConsent("matomo")) { 1219 _paq.push([ 1220 'trackSiteSearch', 1221 data, 1222 false, 1223 countItms 1224 ]); 1225 } 1226 }, 1000); 1227 } 1228 }); 1229 } else { 1230 $('.searchbar__res').html(''); 1231 } 1232 }, 200); 1233 }); 1234 1235 /* Search End */ 1236 1237 1238 1239 /* Spenden Button Bottom */ 1240 if ($('#prozess-btn').length) { 1241 var pbtn = $('#prozess-btn'); 1242 1243 function hideProzessBtn() { 1244 pbtn.fadeOut('slow', function () { 1245 pbtn.attr('aria-hidden', 'true'); 1246 }); 1247 } 1248 1249 function showProzessBtn() { 1250 if (!pbtn.is(':visible')) { 1251 pbtn.fadeIn('slow', function () { 1252 pbtn.attr('aria-hidden', 'false'); 1253 }); 1254 } 1255 } 1256 1257 if (!readCookie("btn_prozess_hide")) { 1258 var currentURL = window.location.href; 1259 var targetURL = "https://www.inneremission-bremen.de/spenden-engagement/spenden/"; 1260 1261 $(document).on('scroll.prozessBtn', function () { 1262 if (currentURL.indexOf(targetURL) === -1) { 1263 var scrollPosition = $(document).scrollTop(); 1264 if (scrollPosition > 500) { 1265 showProzessBtn(); 1266 } else { 1267 hideProzessBtn(); 1268 } 1269 } else { 1270 // Auf der Spenden-Seite selbst den Button nicht anzeigen 1271 hideProzessBtn(); 1272 } 1273 }); 1274 } else { 1275 // Wenn Cookie vorhanden: Element komplett verstecken 1276 pbtn.hide().attr('aria-hidden', 'true'); 1277 } 1278 1279 // SchlieÃen per Klick 1280 $('.prozess_btn__close').on('click', function (e) { 1281 e.preventDefault(); 1282 createCookie("btn_prozess_hide", 1, 1); 1283 pbtn.fadeOut('slow', function () { 1284 pbtn.attr('aria-hidden', 'true').remove(); 1285 }); 1286 }); 1287 1288 // SchlieÃen per Tastatur (Enter / Space) 1289 $('.prozess_btn__close').on('keydown', function (e) { 1290 if (e.key === 'Enter' || e.key === ' ') { 1291 e.preventDefault(); 1292 createCookie("btn_prozess_hide", 1, 1); 1293 pbtn.fadeOut('slow', function () { 1294 pbtn.attr('aria-hidden', 'true').remove(); 1295 }); 1296 } 1297 }); 1298 } 1299 1300 1301 /* Spenden Button */ 1302 if($('.spenden-btn').length) { 1303 $('.spenden-btn').addClass('d-flex').fadeIn('fast'); 1304 } 1305 1306 1307 /* Staging Handling */ 1308 var currentUrl = window.location.href; 1309 var isStaging = currentUrl.indexOf('?staging=1') !== -1 || currentUrl.indexOf('&staging=1') !== -1; 1310 1311 if (isStaging) { 1312 $('body a').each(function() { 1313 var link = $(this).attr('href'); 1314 1315 if (link && (link.indexOf('/') === 0 || link.indexOf('https://www.inneremission-bremen.de') === 0)) { 1316 if (link.indexOf('?') !== -1) { 1317 $(this).attr('href', link + '&staging=1'); 1318 } else { 1319 $(this).attr('href', link + '?staging=1'); 1320 } 1321 } 1322 }); 1323 } 1324 1325 1326 /*[].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) { 1327 new SelectFx(el, { 1328 stickyPlaceholder: false 1329 }); 1330 } );*/ 1331 1332}); 1333function focusAndOpenKeyboard(el, timeout) { 1334 if(!timeout) { 1335 timeout = 200; 1336 } 1337 if(el) { 1338 var tempElm = $('<input/>', { 1339 class: 'search-overlay__input-fake' 1340 }); 1341 tempElm.appendTo( 'body' ); 1342 tempElm.focus(); 1343 1344 setTimeout(function() { 1345 el.focus(); 1346 el.trigger('click'); 1347 tempElm.remove(); 1348 }, timeout); 1349 } 1350} 1351function hexToRgb(hex) { 1352 // Hex nach RGB umwandeln 1353 var bigint = parseInt(hex.slice(1), 16); 1354 var r = (bigint >> 16) & 255; 1355 var g = (bigint >> 8) & 255; 1356 var b = bigint & 255; 1357 1358 return [r, g, b]; 1359} 1360 1361function rgbToHex(rgb) { 1362 // Prüfe, ob rgb ein String ist 1363 if (typeof rgb === "string" && rgb.indexOf("rgb") !== -1) { 1364 // Extrahiere die einzelnen Werte für r, g, b 1365 var rgbArray = rgb.match(/\d+/g).slice(0, 3); // Ignoriere den vierten Wert, falls es rgba ist 1366 var hex = "#" + rgbArray.map(function(value) { 1367 // Jede Zahl in Hexadezimal umwandeln und sicherstellen, dass sie zweistellig ist 1368 return ("0" + parseInt(value).toString(16)).slice(-2); 1369 }).join(""); 1370 return hex; 1371 } 1372 return rgb; // Falls es kein RGB-Wert ist, gib den Originalwert zurück 1373}
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.