1/** 2 * Cookis PluginStore 3.0.2 3 * Cookis Webworks, Franz Xaver RennstraÃe 4, A-6460 Imst 4 * @author Cookis GmbH 5 * @description Diese Datei umfasst Plugins und nützliche Skripts, 6 * die in der Desktopversion im Frontend aufgerufen werden können. 7 */ 8 9/* Temp - Send Javascript Errors - */ 10/* 11window.onerror = function(error) { 12 console.log(error); 13 $.ajax({ 14 type: "POST", 15 url: 'https://www.bakehouse.at/jslog/log.php', 16 data: { message: error, domain: window.location.href }, 17 success: function(){ 18 console.log('messagelogged'); 19 } 20 }) 21}; 22*/ 23 24if (Bh == null) { 25 var Bh = {}; 26} 27 28Bh.mediabox = function () {}; 29Bh.plugins = { 30 callbackStack: { 31 fader: function () { 32 $('.bhFadecontainer[data-menu="none"]').cssFader(); 33 $('.bhFadecontainer[data-menu="arrow"]').cssFader().cssFaderArrows(); 34 $('.bhFadecontainer[data-menu="point"]').cssFader().cssFaderMenuPoint(); 35 $('.bhFadecontainer[data-menu="arrowpoint"]') 36 .cssFader() 37 .cssFaderMenuPoint() 38 .cssFaderArrows(); 39 }, 40 datepicker: function () { 41 if (Bh.page.activeLanguage() == 0) { 42 $.datepicker.setDefaults($.datepicker.regional["de"]); 43 } 44 45 $(".bh-datefields") 46 .eq(0) 47 .find("input") 48 .datepicker({ 49 defaultDate: "+1w", 50 changeMonth: true, 51 numberOfMonths: 2, 52 showOn: "button", 53 buttonImage: "/fileadmin/images/cal.png", 54 buttonImageOnly: true, 55 dateFormat: "dd.mm.yy", 56 onClose: function (selectedDate) { 57 $(".bh-datefield") 58 .eq(1) 59 .find("input") 60 .datepicker("option", "minDate", selectedDate); 61 }, 62 }); 63 $(".bh-datefields") 64 .eq(1) 65 .find("input") 66 .datepicker({ 67 defaultDate: "+1w", 68 changeMonth: true, 69 numberOfMonths: 2, 70 showOn: "button", 71 buttonImage: "/fileadmin/images/cal.png", 72 buttonImageOnly: true, 73 dateFormat: "dd.mm.yy", 74 onClose: function (selectedDate) { 75 $(".bh-datefield") 76 .eq(0) 77 .find("input") 78 .datepicker("option", "maxDate", selectedDate); 79 }, 80 }); 81 //Einfacher Kalender 82 var months = 2; 83 if (screen.width <= 700) { 84 months = 1; 85 } 86 $(".bh-deprecated-datepicker").find("input").datepicker({ 87 changeMonth: true, 88 numberOfMonths: months, 89 minDate: 0, 90 dateFormat: "dd.mm.yy", 91 }); 92 $(".ui-datepicker").addClass("notranslate"); 93 }, 94 mediabox: function () { 95 // COLORBOX 96 97 if ($.colorbox && !$("body").hasClass("bhe-state-editing")) { 98 // Nur wenn Plugin geladen 99 $('a[target="lightbox"]').each(function (e) { 100 var href = $(this).attr("href"); 101 if (href) { 102 var hrefFileType = href.split("."); 103 var ind = hrefFileType.length - 1; 104 var type = hrefFileType[ind].toLowerCase(); 105 if ( 106 type == "jpg" || 107 type == "jpeg" || 108 type == "png" || 109 type == "gif" 110 ) { 111 $(this).addClass("colorbox_picture"); 112 } 113 // else if (href.indexOf(Bh.page.domain) != -1) { //Not external 114 // $(this).addClass('colorbox_picture'); 115 // } 116 else if (href.indexOf("youtube") != -1) { 117 // Youtube
118 $(this).addClass("cb_youtube"); 119 } else { 120 // Iframe 121 $(this).addClass("cb_iframe"); 122 } 123 } 124 }); 125 126 $("a[target='lightbox'].colorbox_picture").colorbox({ 127 maxWidth: "100%", 128 maxHeight: "100%", 129 // innerWidth:"900px", 130 // innerHeight:"600px", 131 fixed: true, 132 rel: "gal", 133 }); 134 135 $(".lightboxgroup").each(function (i) { 136 $(this) 137 .find(".colorbox_picture") 138 .colorbox({ 139 rel: "lightboxGroup" + i, 140 }); 141 }); 142 143 $("a[target='lightbox'].cb_youtube").colorbox({ 144 iframe: true, 145 innerWidth: "80%", 146 innerHeight: "80%", 147 fixed: true, 148 }); 149 $("a[target='lightbox'].cb_iframe").colorbox({ 150 iframe: true, 151 innerWidth: "90%", 152 innerHeight: "90%", 153 fixed: true, 154 }); 155 } 156 }, 157 accordion: function () { 158 $(".bhContainer:has(.bhAccordeonItem)").accordion(); 159 }, 160 tab: function () { 161 // TAB 162 if (!$("body").hasClass("bh-tab-elements-initialized")) { 163 $("body").addClass("bh-tab-elements-initialized"); 164 $(".bhTabElement").attr("tabindex", 0); 165 $("body").on("click keydown", ".bhTabElement", function (event) { 166 if (event.type === "click" || event.key === "Enter") { 167 var $activeTab = $(this), 168 $element = $activeTab.closest(".bhTabs"), 169 $tabs = $element.find(".bhTabElement"), 170 $containers = $element 171 .find(".bh-tabcontent") 172 .children(".bhContainer"), 173 $activeContainer = $containers.eq($(this).index()); 174 175 if (typeof Storage !== "undefined") { 176 try { 177 window.sessionStorage.setItem( 178 "tabI" + $element.data("content"), 179 $(this).index(), 180 ); 181 } catch (e) { 182 //safari ikognito modus error 183 } 184 } 185 186 $tabs.removeClass("bh-tabtoggler-active"); 187 $activeTab.addClass("bh-tabtoggler-active"); 188 189 $containers.removeClass("bh-tabcontent-active"); 190 $activeContainer.addClass("bh-tabcontent-active"); 191 192 $element.trigger({ 193 type: "bh-tab-change", 194 activeToggler: $activeTab, 195 activeContainer: $activeContainer, 196 }); 197 198 //TODO - IN VERSCHIEDENE EVENTS AUFTEILEN (INIT.UPDATE.RESIZE) 199 //TODO grep und alte projekte umbauen 200 Bh.plugins.refresh(); 201 } 202 }); 203 } 204 205 $(".bhTabs").each(function () { 206 // Damit merkt sich die Tabbox im Editingmodus welcher offen war 207 if (!$(this).hasClass("bh-tabs-initialized")) { 208 $(this).addClass("bh-tabs-initialized"); 209 210 var tabIndexID = 0; 211 if (typeof Storage !== "undefined") { 212 try { 213 if ( 214 window.sessionStorage.getItem( 215 "tabI" + $(this).data("content"), 216 ) != undefined && 217 $("body").hasClass("bh-bemode") 218 ) { 219 tabIndexID = window.sessionStorage.getItem( 220 "tabI" + $(this).data("content"), 221 ); 222 } else { 223 tabIndexID = 0; 224 } 225 } catch (e) { 226 //safari ikognito modus error 227 } 228 } 229 $(this) 230 .find(".bhTabElement:not(.bhe-state-content-hidden)") 231 .eq(tabIndexID) 232 .trigger("click"); 233 } 234 }); 235 }, 236 }, 237 refresh: function (options) { 238 // FORM VALIDATION 239 $("form.validate:not(.form-initialised)").each(function () { 240 $(this).addClass("form-initialised"); 241 242 $(this).ajaxValidate(); 243 }); 244 245 $.each(this.callbackStack, function (index, callback) { 246 callback(); 247 }); 248 }, 249 onRefresh: function (key, callback) { 250 if (typeof key === "function") { 251 callback = key; 252 key = randomKey(); 253 } 254 this.callbackStack[key] = callback; 255 }, 256 257 /* 258 Anfrage-Funktionen 259 */ 260 anfrage: { 261 onSubmitHooks: [], 262 }, 263}; 264 265// DATEPICKER Deutsch-Settings 266jQuery(function ($) { 267 $.datepicker.regional["de"] = { 268 clearText: "löschen", 269 clearStatus: "aktuelles Datum löschen", 270 closeText: "schlieÃen", 271 closeStatus: "ohne Ãnderungen schlieÃen", 272 prevText: "<zurück", 273 prevStatus: "letzten Monat zeigen", 274 nextText: "Vor>",
275 nextStatus: "nächsten Monat zeigen", 276 currentText: "heute", 277 currentStatus: "", 278 monthNames: [ 279 "Januar", 280 "Februar", 281 "März", 282 "April", 283 "Mai", 284 "Juni", 285 "Juli", 286 "August", 287 "September", 288 "Oktober", 289 "November", 290 "Dezember", 291 ], 292 monthNamesShort: [ 293 "Jan", 294 "Feb", 295 "Mär", 296 "Apr", 297 "Mai", 298 "Jun", 299 "Jul", 300 "Aug", 301 "Sep", 302 "Okt", 303 "Nov", 304 "Dez", 305 ], 306 monthStatus: "anderen Monat anzeigen", 307 yearStatus: "anderes Jahr anzeigen", 308 weekHeader: "Wo", 309 weekStatus: "Woche des Monats", 310 dayNames: [ 311 "Sonntag", 312 "Montag", 313 "Dienstag", 314 "Mittwoch", 315 "Donnerstag", 316 "Freitag", 317 "Samstag", 318 ], 319 dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], 320 dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], 321 dayStatus: "Setze DD als ersten Wochentag", 322 dateStatus: "Wähle D, M d", 323 dateFormat: "dd.mm.yy", 324 firstDay: 1, 325 initStatus: "Wähle ein Datum", 326 isRTL: false, 327 }; 328}); 329 330$(document).ready(function () { 331 Bh.page.domain = "/"; 332 333 if ($("body").hasClass("bh-femode")) { 334 document.cookie = 335 "bhBackendMode=; Expires=Thu, 01 Jan 1970 00:00:00 UTC; Path=/; SameSite=Lax"; //delete backend cookie 336 } 337 if (typeof Storage !== "undefined") { 338 try { 339 window.sessionStorage.setItem("redirectAfterLogin", window.location.href); 340 } catch (e) { 341 //safari ikognito modus error 342 } 343 } 344 345 Bh.plugins.refresh(); 346 347 //Disable Colorbox in Editingmode 348 if ($.colorbox) { 349 $("body").on("bhe-page-editing-start", function () { 350 $.colorbox.remove(); 351 }); 352 353 $("body").on("bhe-page-editing-stop", function () { 354 $("body").removeClass("bhe-state-editing"); 355 Bh.plugins.callbackStack.mediabox(); 356 }); 357 } 358 359 //prevent open new window (flicker) 360 $("body").on("click", '[target="download"]', function (event) { 361 if ($("body").hasClass("bhe-state-editing")) { 362 event.preventDefault(); 363 } 364 365 /* 366 NOTE: wozu war diese Zeile nötig? macht irgendwie keinen Sinn 367 */ 368 // window.location.href = $(this).attr('href'); 369 }); 370 371 /* -------- DoubleTapToGo ------- */ 372 $(".bh-doubletap").each(function () { 373 $(this).find(".hnavi_item:has(ul)").doubleTapToGo(); 374 }); 375}); 376 377/* //TODO depricated wird stellenweise verwendet */ 378$.browser = {}; 379if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 380 $.browser.msie = true; 381 382 var ieversion = new Number(RegExp.$1); 383 if (ieversion >= 9) $.browser.version = 9; 384 else if (ieversion >= 8) $.browser.version = 8; 385 else if (ieversion >= 7) $.browser.version = 7; 386 else if (ieversion >= 6) $.browser.version = 6; 387 else if (ieversion >= 5) $.browser.version = 0; 388} 389 390/** 391 * CSS3 Fader Plugin 392 * 393 * Cookis Webworks GmbH 394 * @author Starjakob Werner 395 **/ 396(function ($) { 397 var defaults = { 398 view: ".bhContainer", 399 items: ".bhElement", 400 duration: 5000, 401 rotations: -1, 402 start: 0, 403 startstop: 0, 404 mousepause: false, 405 endsWithLastSlide: false, 406 }; 407 408 var isAutoFading = false; 409 410 var autofade = function (fader) { 411 var delay = fader.data("duration"); 412 clearTimeout(fader.data("timer")); 413 fader.data( 414 "timer", 415 setTimeout(function () { 416 //TODO besser lösen (zb bei editing verlassen => starten ) 417 if (!$("body").hasClass("bhe-state-editing")) { 418 fader.cssFader("next"); 419 } else { 420 autofade(fader); 421 } 422 }, delay), 423 ); 424 isAutoFading = true; 425 }; 426 427 var startautoFade = function (fader) { 428 if (fader.data("duration") > 0) { 429 fader.unbind(".rotation"); 430 fader.bind("changed.rotation", function () { 431 autofade(fader); 432 }); 433 } 434 }; 435 436 var stoptautoFade = function (fader) { 437 clearTimeout(fader.data("timer")); 438 fader.unbind(".rotation"); 439 isAutoFading = false; 440 }; 441 442 var methods = { 443 init: function (options) { 444 options = $.extend({}, defaults, options); 445 return this.each(function () { 446 var $this = $(this); 447 $this.addClass("bh-fader-init"); 448 if (!jQuery.hasData($this)) { 449 $this.data({}); 450 } 451 $this.data($.extend(options, $this.data())); 452 453 //Play/Stop 454 //Geht davon aus, dass std-mäÃig auf 455 //eventuell in eigenes Plugin auslagern ... 456 if ($this.data("startstop")) { 457 $this.append( 458 '<div class="cssFaderPlayStop"><div class="playstopbutton play hidden"></div><div class="playstopbutton stop"></div></div>', 459 ); 460 $this.find(".play").click(function () { 461 $(".playstopbutton").removeClass("hidden"); 462 $(this).addClass("hidden"); 463 startautoFade($this); 464 $this.cssFader("next"); 465 }); 466 $this.find(".stop").click(function () { 467 $(".playstopbutton").removeClass("hidden"); 468 $(this).addClass("hidden"); 469 stoptautoFade($this); 470 }); 471 } 472 473 // pause on mouseover 474 if ($this.data("rotations") != "0") { 475 if ($this.data("mousepause")) { 476 $this.hover( 477 function () { 478 stoptautoFade($this); 479 }, 480 function () { 481 startautoFade($this); 482 }, 483 ); 484 } 485 if ($this.data("rotations") > 0) { 486 $this.data("rotations", $this.data("rotations") - 1); 487 } 488 startautoFade($this); 489 } 490 491 //$this.css('width', parseInt($this.data('width'))); 492 $this.css("width", $this.data("width")); 493 // $this.find($this.data('view')).css('width',parseInt($this.data('width')) ); 494 495 //TODO resize / TS settings 496 //$this.css('height', parseInt($this.data('height'))); 497 $this.css("height", $this.data("height")); 498 499 $this.find($this.data("view")).css({ 500 //'height': parseInt($this.data('height')), 501 //'max-height': parseInt($this.data('height')) 502 height: $this.data("height"), 503 "max-height": $this.data("height"), 504 }); 505 506 // $this.find($this.data('items')).css('height',parseInt($this.data('height')) ); 507 $this.cssFader("change", $this.data("start")); 508 }); 509 }, 510 prev: function () { 511 return this.each(function () { 512 var $this = $(this); 513 var index; 514 var prev = $this 515 .find( 516 "> " + 517 $this.data("view") + 518 " > " + 519 $this.data("items") + 520 ".current", 521 ) 522 .prevAll($this.data("items")) 523 .eq(0); //.prev($this.data('items')); 524 if (prev.length > 0) { 525 index = $this 526 .find("> " + $this.data("view") + " > " + $this.data("items")) 527 .index(prev); 528 } else { 529 index = 530 $this.find("> " + $this.data("view") + " > " + $this.data("items")) 531 .length - 1; 532 } 533 $this.cssFader("change", index); 534 }); 535 }, 536 next: function () { 537 return this.each(function () { 538 var $this = $(this); 539 var index; 540 var next = $this 541 .find( 542 "> " + 543 $this.data("view") + 544 " > " + 545 $this.data("items") + 546 ".current", 547 ) 548 .nextAll($this.data("items")) 549 .eq(0); //next($this.data('items')); 550 if (next.length > 0) { 551 index = $this 552 .find("> " + $this.data("view") + " > " + $this.data("items")) 553 .index(next); 554 } else { 555 if ($this.data("rotations") > 0) { 556 $this.data("rotations", $this.data("rotations") - 1); 557 } else if ($this.data("rotations") == 0) { 558 $this.data("duration", 0); 559 560 if (isAutoFading === true) { 561 stoptautoFade($this); 562 563 if ($this.data("endsWithLastSlide")) { 564 return false;
565 } 566 } 567 } 568 index = 0; 569 } 570 571 $this.cssFader("change", index); 572 }); 573 }, 574 change: function (index) { 575 return this.each(function () { 576 var $this = $(this); 577 $this.clearQueue().stop(); 578 579 //TODO selector verbessern ... passt nicht mehr mit den options zusammen 580 var eq = $this 581 .find("> " + $this.data("view") + " > " + $this.data("items")) 582 .removeClass("current") 583 .removeClass("next") 584 .removeClass("prev") 585 .eq(index); 586 eq.addClass("current"); 587 eq.nextAll($this.data("items")).addClass("next"); 588 eq.prevAll($this.data("items")).addClass("prev"); 589 590 // IE ANIMATE WORKAROUND 591 if (!$this.hasClass("slideEffect")) { 592 //&& parseInt($.browser.version, 10) != 9 593 if ( 594 jQuery.browser.msie || 595 (jQuery.browser.mozilla && parseInt(jQuery.browser.version, 10) < 4) 596 ) { 597 //alert("wo"); 598 $this 599 .find($this.data("items")) 600 .css({ 601 left: 0, 602 top: 0, 603 }) 604 .clearQueue() 605 .stop(); 606 607 if (!$this.data("fader-ie-init")) { 608 $this.find($this.data("items")).css("opacity", 0); 609 $this.data("fader-ie-init", true); 610 } 611 612 eq.animate( 613 { 614 opacity: 1, 615 }, 616 300, 617 ); 618 619 $this 620 .find($this.data("items")) 621 .filter(function (index) { 622 if ( 623 parseInt($(this).css("opacity")) > 0 && 624 !$(this).hasClass("current") 625 ) { 626 return true; 627 } else { 628 return false; 629 } 630 }) 631 .animate( 632 { 633 opacity: 0, 634 }, 635 300, 636 ); 637 } 638 } 639 640 $this.trigger({ 641 type: "changed", 642 el: $this, 643 index: index, 644 }); 645 //TODO - IN VERSCHIEDENE EVENTS AUFTEILEN (INIT.UPDATE.RESIZE) 646 Bh.plugins.refresh(); 647 }); 648 }, 649 }; 650 651 $.fn.cssFader = function (method) { 652 var $this = $(this); 653 // alert($this.length); 654 var $thisarguments = arguments; 655 $this.each(function (index) { 656 if (!$(this).hasClass("bh-fader-init")) { 657 methods.init.apply($(this), $thisarguments); 658 } 659 }); 660 661 if (methods[method]) { 662 return methods[method].apply( 663 this, 664 Array.prototype.slice.call(arguments, 1), 665 ); 666 } else if (typeof method === "object" || !method) { 667 return $this; 668 // return methods.init.apply( this, arguments ); 669 } else { 670 $.error("Method " + method + " does not exist on jQuery.tooltip"); 671 } 672 }; 673})(jQuery); 674 675/** 676 * CSS3 Fader Menu Thumbnails Plugin 677 * 678 * Cookis Webworks GmbH 679 * @author Starjakob Werner 680 **/ 681 682(function ($) { 683 var defaults = { 684 items: ".cssFaderItem", 685 view: ".cssFaderMenuThumb", 686 slider: ".cssFaderMenuThumbSlider", 687 width: "100c", 688 height: "80c", 689 currentPosition: 150, 690 tmplView: 691 '<div class="cssFaderMenuThumb"><div class="cssFaderMenuThumbSlider"></div><div class="cssFaderMenuThumbPrev"></div><div class="cssFaderMenuThumbNext"></div></div>', 692 tmplItem: 693 '<div class="cssFaderMenuThumbItem loading"><img src="${src}" alt="${title}" title="${title}" /></div>', 694 newItem: function ($this, item, options, index) { 695 var picture = $(item).find("img"); 696 var src, title; 697 if (picture.length > 0) { 698 var id = null; 699 var width = $this.data("cssFaderMenuThumb").options.width; 700 var height = $this.data("cssFaderMenuThumb").options.height; 701 if ($("body[data-pageuid]").length > 0) { 702 id = $("body").data("pageuid"); 703 //alert(id); 704 } 705 var path = picture.attr("src") || picture.data("path"); 706 //src = 'index.php?' + (id > 0 ? 'id=' + id + '&' : '') + 'type=2000&path=' + path + '&width=' + width + '&height=' + height; 707 src = ""; 708 title = picture[0].alt; 709 } else { 710 src = ""; 711 } 712 return { 713 src: src, 714 title: title, 715 }; 716 }, 717 newItemOptions: {}, 718 prev: { 719 selector: ".cssFaderMenuThumbPrev", 720 click: function (e) { 721 $(e.data.parent).cssFader("prev"); 722 }, 723 }, 724 thumb: { 725 selector: ".cssFaderMenuThumbItem", 726 click: function (e) { 727 $(e.data.parent).cssFader("change", e.data.index); 728 }, 729 }, 730 next: { 731 selector: ".cssFaderMenuThumbNext", 732 click: function (e) { 733 $(e.data.parent).cssFader("next"); 734 }, 735 }, 736 }; 737 738 var methods = { 739 init: function (options) { 740 options = $.extend({}, defaults, options); 741 742 $.template("cssFaderMenuThumbItem", options.tmplItem); 743 744 return this.each(function () { 745 var $this = $(this); 746 $this.data("cssFaderMenuThumb", {}); 747 $this.data("cssFaderMenuThumb").options = options; 748 749 $this.append($(options.tmplView)); 750 751 $this.data("cssFaderMenuThumb").data = []; 752 $this.find(options.items).each(function (index, item) { 753 var callback = options.newItem; 754 $this 755 .data("cssFaderMenuThumb") 756 .data.push(callback($this, item, options.newItemOptions, index)); 757 }); 758 759 var view = $this.find(options.view); 760 var slider = $this.find(options.slider); 761 762 slider.empty(); 763 $.tmpl( 764 "cssFaderMenuThumbItem", 765 $this.data("cssFaderMenuThumb").data, 766 ).appendTo(slider); 767 slider.find("img").load(function () { 768 // alert('sf'); 769 $(this).parent().removeClass("loading"); 770 }); 771 772 $this.find(options.prev.selector).bind( 773 "click", 774 { 775 parent: $this, 776 }, 777 function (e) { 778 options.prev.click(e); 779 }, 780 ); 781 782 var width = 0; 783 $this.find(options.thumb.selector).each(function (index) { 784 width += $(this).outerWidth(true); 785 $(this).bind( 786 "click", 787 { 788 index: index, 789 parent: $this, 790 }, 791 function (e) { 792 options.thumb.click(e); 793 }, 794 ); 795 }); 796 slider.css("width", width); 797 798 $this.find(options.next.selector).bind( 799 "click", 800 { 801 parent: $this, 802 }, 803 function (e) { 804 options.next.click(e); 805 }, 806 ); 807 808 $this.bind("changed", function (e) { 809 var currentItem = $this.find(options.thumb.selector).eq(e.index); 810 $this.find(options.thumb.selector).removeClass("current"); 811 currentItem.addClass("current"); 812 813 var currentPosition = options.currentPosition; 814 var viewInnerWidth = view.width(); 815 var sliderOuterWidth = slider.outerWidth(true); 816 if (viewInnerWidth < sliderOuterWidth) { 817 var left = currentItem.position().left; 818 if (left > sliderOuterWidth - viewInnerWidth) { 819 left = sliderOuterWidth - viewInnerWidth; 820 } else if (left < currentPosition) { 821 left = 0; 822 } else { 823 left -= currentPosition; 824 } 825 826 // IE ANIMATE WORKAROUND 827 if ($.browser.msie) { 828 slider.clearQueue().stop(); 829 slider.animate( 830 { 831 left: -left, 832 }, 833 500, 834 ); 835 } else { 836 // standard function NICHT löschen!! 837 slider.css("left", -left); 838 } 839 } 840 }); 841 842 $this 843 .find(options.thumb.selector) 844 .eq($this.data("start")) 845 .addClass("current"); 846 }); 847 }, 848 }; 849 850 $.fn.cssFaderMenuThumb = function (method) { 851 if (methods[method]) { 852 return methods[method].apply( 853 this, 854 Array.prototype.slice.call(arguments, 1), 855 ); 856 } else if (typeof method === "object" || !method) { 857 return methods.init.apply(this, arguments); 858 } else { 859 $.error( 860 "Method " + method + " does not exist on jQuery.cssFaderMenuThumb", 861 ); 862 } 863 }; 864})(jQuery); 865 866/** 867 * CSS3 Fader Menu Points Plugin 868 * 869 * Cookis Webworks GmbH 870 * @author Starjakob Werner 871 **/ 872(function ($) { 873 var defaults = { 874 items: ".bhElement", 875 view: ".bhContainer", 876 container: ".cssFaderMenuPointInner", 877 tmplView: 878 '<div class="cssFaderMenuPoint"><div class="cssFaderMenuPointInner"></div></div>', 879 tmplItem: '<div class="cssFaderMenuPointItem"></div>', 880 point: { 881 selector: ".cssFaderMenuPointItem", 882 click: function (e) { 883 $(e.data.parent).cssFader("change", e.data.index); 884 }, 885 }, 886 }; 887 888 var methods = { 889 init: function (options) { 890 options = $.extend({}, defaults, options); 891 892 return this.each(function () { 893 var $this = $(this); 894 if ($this.find($this.data("items")).length > 1) { 895 $this.data("cssFaderMenuPoint", {}); 896 $this.data("cssFaderMenuPoint").options = options; 897 898 $this.data("cssFaderMenuPoint").data = []; 899 900 var container = $this.find(options.container); 901 if (container.length == 0) { 902 $(options.tmplView).appendTo($this); 903 container = $this.find(options.container); 904 } else { 905 container.empty(); 906 } 907 908 //TODO geht nur mit diesem html aufbau => verallgemeinern 909 $this 910 .find("> " + options.view + " > " + options.items) 911 .each(function (index) { 912 container.append($(options.tmplItem)); 913 }); 914 915 $this.find(options.point.selector).each(function (index) { 916 $(this).bind( 917 "click", 918 { 919 index: index, 920 parent: $this, 921 }, 922 function (e) { 923 options.point.click(e); 924 }, 925 ); 926 }); 927 928 $this.bind("changed", function (e) { 929 $this.find(options.point.selector).removeClass("current"); 930 $this.find(options.point.selector).eq(e.index).addClass("current"); 931 }); 932 933 // var current = $this.find('> .bhContainer > '+options.items).index('.current'); 934 var current = $this.find( 935 "> " + options.view + " > " + options.items + ".current", 936 ); 937 var currentIndex = $this 938 .find("> " + options.view + " > " + options.items) 939 .index(current); 940 $this 941 .find(options.point.selector) 942 .eq(currentIndex || $this.data("start")) 943 .addClass("current"); 944 } else if ($this.find($this.data("items")).length <= 1) { 945 var container = $this.find(options.container); 946 container.empty(); 947 } 948 }); 949 }, 950 }; 951 952 $.fn.cssFaderMenuPoint = function (method) { 953 if (methods[method]) { 954 return methods[method].apply( 955 this, 956 Array.prototype.slice.call(arguments, 1), 957 ); 958 } else if (typeof method === "object" || !method) { 959 return methods.init.apply(this, arguments); 960 } else { 961 $.error( 962 "Method " + method + " does not exist on jQuery.cssFaderMenuThumb", 963 ); 964 } 965 }; 966})(jQuery); 967 968/** 969 * CSS3 Fader Arrows Plugin (beta) 970 * 971 * Cookis Webworks GmbH 972 * @author Cookis GmbH 973 **/ 974(function ($) { 975 var defaults = { 976 parent: "view", 977 }; 978 979 var methods = { 980 init: function (options) { 981 var options = $.extend({}, defaults, options); 982 983 return this.each(function () { 984 var $this = $(this); 985 $this.addClass("bh-faderarrows-init"); 986 if (options.parent == "view") { 987 var parent = $this; 988 } else { 989 parent = $this.find(options.parent); 990 } 991 if ($this.find($this.data("items")).length > 1) {
992 parent.prepend($('<div class="cssFaderArrow fadePrev">')); 993 parent.append($('<div class="cssFaderArrow fadeNext">')); 994 995 parent.find(".fadePrev").bind("click", function () { 996 $this.cssFader("prev"); 997 }); 998 parent.find(".fadeNext").bind("click", function () { 999 $this.cssFader("next"); 1000 }); 1001 } 1002 }); 1003 }, 1004 }; 1005 1006 $.fn.cssFaderArrows = function (method) { 1007 var $this = $(this); 1008 // alert($this.length); 1009 var $thisarguments = arguments; 1010 $this.each(function (index) { 1011 if (!$(this).hasClass("bh-faderarrows-init")) { 1012 methods.init.apply($(this), $thisarguments); 1013 } 1014 }); 1015 1016 if (methods[method]) { 1017 return methods[method].apply( 1018 this, 1019 Array.prototype.slice.call(arguments, 1), 1020 ); 1021 } else if (typeof method === "object" || !method) { 1022 return $this; 1023 // return methods.init.apply( this, arguments ); 1024 } else { 1025 $.error("Method " + method + " does not exist on jQuery.tooltip"); 1026 } 1027 }; 1028})(jQuery); 1029 1030/** 1031 * Accordion 1032 */ 1033(function ($) { 1034 var defaults = { 1035 speed: 500, 1036 startAnimation: true, 1037 item: ".bhAccordeonItem", 1038 toggler: ".bh-accordion-toggler", 1039 element: ".bh-accordion-element", 1040 inner: ".bh-accordion-element-inner", 1041 active: "bh-accordion-active", 1042 forceOpen: true, 1043 multiOpen: false, 1044 firstOpen: false, 1045 }; 1046 1047 var open = function ($this, toggler) { 1048 var index = getToggler($this).index(toggler); 1049 var element = $(getElements($this).get(index)); 1050 var inner = element.find($this.data("options").inner); 1051 var height = inner.outerHeight(true); 1052 element.stop(true, true); // clear queued animations before toggling 1053 toggler.addClass($this.data("options").active); 1054 toggler.data("status", "opening"); 1055 if (!$this.data("options").startAnimation) { 1056 element.css({ 1057 height: "auto", 1058 }); 1059 element.addClass($this.data("options").active); 1060 $this.data("options").startAnimation = true; 1061 toggler.attr("aria-expanded", "true"); 1062 element.prop("inert", false); 1063 } else { 1064 element.animate( 1065 { 1066 height: height, 1067 }, 1068 $this.data("options").speed, 1069 function () { 1070 if (toggler.data("status") !== "closing") { 1071 element.addClass($this.data("options").active); 1072 element.css("height", "auto"); 1073 element.css("overflow", "visible"); 1074 toggler.data("status", "opened"); 1075 toggler.attr("aria-expanded", "true"); 1076 } 1077 element.prop("inert", false); 1078 }, 1079 ); 1080 } 1081 return index; 1082 }; 1083 1084 var close = function ($this, toggler) { 1085 var index = getToggler($this).index(toggler); 1086 var element = $(getElements($this).get(index)); 1087 element.stop(true, true); // clear queued animations before toggling 1088 toggler.removeClass($this.data("options").active); 1089 element.removeClass($this.data("options").active); 1090 toggler.data("status", "closing"); 1091 element.css("overflow", "hidden"); 1092 element.animate( 1093 { 1094 height: 0, 1095 }, 1096 $this.data("options").speed, 1097 function () { 1098 if (toggler.data("status") !== "opening") { 1099 toggler.data("status", "closed"); 1100 toggler.attr("aria-expanded", "false"); 1101 } 1102 element.prop("inert", true); 1103 }, 1104 ); 1105 return index; 1106 }; 1107 1108 var getToggler = function ($this) { 1109 return $this.find($this.data("options").toggler).filter(function (i) { 1110 //TODO je nach verschachtelung der container haben die toggler 1111 //mehrere click listerner (von jedem container/accordion einen) 1112 //fällt bei "forceOpen = false" auf, der filter soll nur auf seiner 1113 //containerebene nach toggler suchen 1114 return $(this).closest(".bh-accordion-init")[0] == $this[0]; 1115 //TODO problem wenn accordion noch nicht intitialisiert => besseren selector finden 1116 //vielleicht mit "container" option 1117 }); 1118 }; 1119 1120 var getElements = function ($this) { 1121 //siehe getToggler 1122 return $this.find($this.data("options").element).filter(function (i) { 1123 return $(this).closest(".bh-accordion-init")[0] == $this[0]; 1124 }); 1125 }; 1126 1127 var methods = { 1128 init: function (options) { 1129 options = $.extend({}, defaults, options); 1130 return $(this).each(function () { 1131 var $this = $(this); 1132 $this.addClass("bh-accordion-init"); 1133 $this.data("options", $this.data("options") || {}); 1134 $this.data("options", $.extend(options, $this.data("options"))); 1135 1136 $this 1137 .find($this.data("options").item) 1138 .first() 1139 .addClass("accordeon-first"); 1140 $this 1141 .find($this.data("options").item) 1142 .last() 1143 .addClass("accordeon-last"); 1144 1145 $this.on( 1146 "click", 1147 $this.data("options").toggler, 1148 { sender: $this }, 1149 function (event) { 1150 if ( 1151 (event.detail || 1152 (event.originalEvent && event.originalEvent.detail) || 1153 1) > 1 1154 ) 1155 return; // ignore double-click 1156 var $toggler = $(this); 1157 event.preventDefault(); 1158 event.stopPropagation(); 1159 event.data.sender.accordion("toggle", $toggler); 1160 }, 1161 ); 1162 1163 $this.on( 1164 "keydown", 1165 $this.data("options").toggler, 1166 { sender: $this }, 1167 function (event) { 1168 if ( 1169 (event.key !== "Enter" && event.code !== "Space") || 1170 event.currentTarget.tagName === "BUTTON" || 1171 $(event.target).is( 1172 "input, textarea, [contenteditable='true'], [contenteditable='']", 1173 ) 1174 ) 1175 return; 1176 var $toggler = $(this); 1177 event.preventDefault(); 1178 event.stopPropagation(); 1179 event.data.sender.accordion("toggle", $toggler); 1180 }, 1181 ); 1182 1183 $this 1184 .find($this.data("options").element) 1185 .height(0) 1186 .css("overflow", "hidden") 1187 .prop("inert", true); 1188 1189 $this 1190 .find($this.data("options").toggler) 1191 .addClass("bh-accordion-toggler-event") 1192 .removeClass($this.data("options").active); 1193 if ( 1194 $this.data("options").firstOpen || 1195 $this.data("options").forceOpen 1196 ) { 1197 $this.data("options").startAnimation = false;
1198 // var first = $this.find( $this.data('options').toggler ).get() 1199 $this.accordion("open", 0); 1200 } else { 1201 //$this.data('options').startAnimation = false; 1202 } 1203 }); 1204 }, 1205 close: function (toggler) { 1206 return $(this).each(function () { 1207 var $this = $(this); 1208 toggler = 1209 typeof toggler == "object" 1210 ? toggler 1211 : $(getToggler($this).get(toggler)); 1212 1213 if ( 1214 toggler.hasClass($this.data("options").active) && 1215 (!$this.data("options").forceOpen || $this.data("options").multiOpen) 1216 ) { 1217 close($this, toggler); 1218 } 1219 }); 1220 }, 1221 open: function (toggler) { 1222 return $(this).each(function () { 1223 var $this = $(this); 1224 toggler = 1225 typeof toggler == "object" 1226 ? toggler 1227 : $(getToggler($this).get(toggler)); 1228 if (!toggler.hasClass($this.data("options").active)) { 1229 var index = open($this, toggler); 1230 if (!$this.data("options").multiOpen) { 1231 getToggler($this).each(function (i) { 1232 if (index != i) close($this, $(this)); 1233 }); 1234 } 1235 } 1236 }); 1237 }, 1238 toggle: function (toggler) { 1239 return $(this).each(function () { 1240 var $this = $(this); 1241 toggler = 1242 typeof toggler == "object" 1243 ? toggler 1244 : $(getToggler($this).get(toggler)); 1245 if (toggler.hasClass($this.data("options").active)) { 1246 $this.accordion("close", toggler); 1247 } else { 1248 $this.accordion("open", toggler); 1249 } 1250 }); 1251 }, 1252 }; 1253 1254 $.fn.accordion = function (method) { 1255 var $this = $(this); 1256 var argus = arguments; 1257 //var sis = this; 1258 // alert($this.length); 1259 $this.each(function (index) { 1260 if (!$(this).hasClass("bh-accordion-init")) { 1261 methods.init.apply(this, argus); 1262 } 1263 }); 1264 1265 if (methods[method]) { 1266 return methods[method].apply( 1267 this, 1268 Array.prototype.slice.call(arguments, 1), 1269 ); 1270 } else if (typeof method === "object" || !method) { 1271 return $(this); 1272 // return methods.init.apply( this, arguments ); 1273 } else { 1274 $.error("Method " + method + " does not exist on jQuery.tooltip"); 1275 } 1276 }; 1277})(jQuery); 1278 1279/* wird nur in der geomap verwendet */ 1280(function ($) { 1281 var methods = { 1282 init: function (options) { 1283 var refs = (options && options.refItems) || this; 1284 return this.each(function () { 1285 var $this = $(this); 1286 $this.data("refItems", refs); 1287 $this.find(".selectTitel").click(function () { 1288 if ($this.find(".selectOptions").is(":visible")) { 1289 $this.selectButton("close"); 1290 } else { 1291 $this.selectButton("open"); 1292 } 1293 }); 1294 1295 if (options.onClick != null) { 1296 $this.delegate(".selectItem", "click", options.onClick); 1297 } 1298 1299 //hideShowAll 1300 if (options.showhideAll) { 1301 if ($this.find(".selectAll").length < 1) { 1302 alert( 1303 "selectButton Plugin-Error: You have to place a divElement ShowAll with class('.selectAll') in your Select-HtmlCode", 1304 ); 1305 } 1306 1307 $this.find(".selectAll").click(function () { 1308 $this.find(".selectItem").trigger("click"); 1309 1310 if ($(this).hasClass("reverseSelect")) { 1311 $(this).removeClass("reverseSelect").html($(this).data("label")); 1312 } else { 1313 $(this) 1314 .addClass("reverseSelect") 1315 .html($(this).data("reverselabel")); 1316 } 1317 }); 1318 } 1319 }); 1320 }, 1321 open: function () { 1322 return this.each(function () { 1323 $(this).data("refItems").selectButton("close"); 1324 // $(this).find('.selectOptions').show('slow'); 1325 $(this).find(".selectOptions").slideDown(); 1326 }); 1327 }, 1328 close: function () { 1329 return this.each(function () { 1330 //$(this).find('.selectOptions').hide(); 1331 $(this).find(".selectOptions").slideUp(); 1332 }); 1333 }, 1334 }; 1335 $.fn.selectButton = function (method) { 1336 if (methods[method]) { 1337 return methods[method].apply( 1338 this, 1339 Array.prototype.slice.call(arguments, 1), 1340 ); 1341 } else if (typeof method === "object" || !method) { 1342 return methods.init.apply(this, arguments); 1343 } else { 1344 $.error("Method " + method + " does not exist on jQuery.tooltip"); 1345 } 1346 }; 1347})(jQuery); 1348 1349/* //TODO depricated - 11.2017 - wir nur mehr in der alten mediabox verwendet */ 1350function heightOfChildren(element) { 1351 var $heights = 0; 1352 $(element) 1353 .children() 1354 .each(function () { 1355 $heights += $(this).outerHeight(true); 1356 }); 1357 return $heights; 1358} 1359 1360/* //TODO depricated - 11.2017 - wir nur mehr in der alten mediabox verwendet */ 1361var waitForFinalEvent = (function () { 1362 var timers = {}; 1363 return function (callback, ms, uniqueId) { 1364 if (!uniqueId) { 1365 alert("NO uniqueId given"); 1366 } 1367 if (timers[uniqueId]) { 1368 clearTimeout(timers[uniqueId]); 1369 } 1370 timers[uniqueId] = setTimeout(callback, ms); 1371 }; 1372})(); 1373 1374/* //TODO depricated - 11.2017 - wir nur mehr in der alten mediabox verwendet */ 1375$(window).resize(function () { 1376 waitForFinalEvent( 1377 function () { 1378 $(window).trigger("resizeComplete"); 1379 }, 1380 500, 1381 "resizeComplete", 1382 ); 1383}); 1384 1385function randomKey() { 1386 var text = ""; 1387 var possible = 1388 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 1389 1390 for (var i = 0; i < 5; i++) 1391 text += possible.charAt(Math.floor(Math.random() * possible.length)); 1392 1393 return text; 1394} 1395 1396// könnte nützlich sein 1397 1398$(document).ready(function () { 1399 if (typeof Fancybox !== "undefined") { 1400 Fancybox.defaults = { 1401 ...Fancybox.defaults, 1402 animationEffect: "zoom-in-out", 1403 Toolbar: { 1404 display: { 1405 left: ["infobar"], 1406 middle: [], 1407 right: ["close"], 1408 }, 1409 }, 1410 wheel: false, 1411 Thumbs: false, 1412 }; 1413 1414 const getSlideType = (element) => { 1415 /** @todo direkt type from Bakehouse, e.g. PDF */ 1416 const check = { 1417 image: 1418 /(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i, 1419 pdf: /\.pdf((\?|#).*)?$/i, 1420 }; 1421 1422 for (const [type, regex] of Object.entries(check)) { 1423 if (element.href.match(regex)) { 1424 return type; 1425 } 1426 } 1427 return "iframe"; 1428 }; 1429 1430 const isMobile = () => { 1431 return /Mobi|Android|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile|WPDesktop/i.test( 1432 navigator.userAgent, 1433 ); 1434 }; 1435 1436 const getGroupLevel = (element) => { 1437 return $(element).parents(".lightboxgroup").length; 1438 }; 1439 1440 //Wenn Duplikate vom Swiper angeklickt werden, wird das passende Originalbild gesucht und geöffnet 1441 const getOriginalNode = (element) => { 1442 if (!$(element).hasClass("swiper-slide-duplicate")) { 1443 return element; 1444 } 1445 const href = $(element).attr("href"); 1446 const selector = `.swiper-slide[href="${href}"]:not(.swiper-slide-duplicate)`; 1447 return $(element).parent().find(selector).get(0); 1448 }; 1449 1450 $("body").on("click", '[target="lightbox"]', function (e) { 1451 e.preventDefault(); 1452 1453 if ($("body").hasClass("bhe-state-editing")) { 1454 return; 1455 } 1456 1457 const node = getOriginalNode(this); 1458 1459 const type = getSlideType(node); 1460 if (["iframe", "pdf"].includes(type)) { 1461 /** 1462 * mobile endgräte, spezell Safari am iPhone/iPad haben Darstellungsprobleme bei mehrseitigen PDFs
1463 * daher lassen wir generell bei mobilen endgeräten die PDFs + Iframes in einem neuen Tab öffnen 1464 */ 1465 if (isMobile()) { 1466 window.open(node.href, "_blank"); 1467 return; 1468 } 1469 // open single lightbox 1470 new Fancybox([ 1471 { 1472 src: node.href, 1473 type, 1474 caption: node.title, 1475 height: "auto", 1476 width: "100%", 1477 }, 1478 ]); 1479 } else { 1480 const groupLevel = getGroupLevel(node); 1481 const $parent = groupLevel 1482 ? $(node).closest(".lightboxgroup") 1483 : $("body"); 1484 const $group = $parent 1485 .find( 1486 '[target="lightbox"]:not(.swiper-slide-duplicate, .bhe-content-inner-link)', 1487 ) 1488 .filter((index, element) => getGroupLevel(element) === groupLevel) 1489 .filter((index, element) => getSlideType(element) === "image"); 1490 const startIndex = $group.index(node); 1491 const group = $group.toArray().map((element) => { 1492 return { 1493 src: element.href, 1494 type: "image", 1495 caption: element.title, 1496 // echtes alt-Attribut des Vorschaubilds; Fancybox selbst leitet alt nur aus der Caption ab 1497 altText: $(element).find("img[alt]").first().attr("alt"), 1498 }; 1499 }); 1500 new Fancybox(group, { 1501 startIndex, 1502 on: { 1503 loaded: (fancybox, slide) => { 1504 if (slide.altText && slide.imageEl) { 1505 slide.imageEl.alt = slide.altText; 1506 } 1507 }, 1508 }, 1509 }); 1510 } 1511 }); 1512 } 1513});
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.