1 2var mcNsp = (function namespace() 3{ 4 var fireEvent = function (mcType) { 5 $(document).trigger('wco-mediaconsent-accepted', [mcType]); 6 }; 7 8 var reloadItem = function (item) { 9 if (item.attr('data-rld-page') === 0) { 10 $.get(item.attr('data-mcuri'), function (data) { 11 item.off('click'); 12 item.html(data); 13 }, 'html'); 14 } else { 15 $.get(item.attr('data-mcuri'), function (data) { 16 item.off('click'); 17 window.location.reload(); 18 }); 19 } 20 }; 21 22 return { 23 reloadItem: reloadItem, 24 fireEvent: fireEvent 25 }; 26 27 28}()); 29$(function () { 30 $('.mediaconsent_activate__btn').on('click', function (event) { 31 $(this).find('.spinner').removeClass('d-none'); 32 var $mediaconsent__wrapper = $(this).parent().parent(); 33 // Walk over list of items matching the type in attr('data-mctype') 34 var mcType = $mediaconsent__wrapper.attr('data-mctype'); 35 $('.mediaconsent__wrapper[data-mctype=' + mcType + ']').each(function () { 36 mcNsp.fireEvent(mcType); 37 mcNsp.reloadItem($(this)); 38 }); 39 }); 40}); 41 42if(typeof TYPO3 !== 'undefined' && typeof TYPO3.settings.wcoMediaconsentProvider !== 'undefined'){ 43 $(document).on('wco-mediaconsent-accepted', function (e, mcType) { 44 if (mcType == TYPO3.settings.wcoMediaconsentProvider) { 45 inilizeMap() 46 } 47 }) 48} else { 49 inilizeMap(); 50 51} 52 53function inilizeMap() { 54 var $googleMapsAddressView = $("#googleMapsAddressView"); 55 if ($googleMapsAddressView.length > 0) { 56 var map; 57 var bounds; 58 var infowindow; 59 // var positions = arr 60 var $addressesForMap = $('.wco-addressForMap'); 61 var amountOfAddresses = $addressesForMap.length; 62 var markers = new Array(0); 63 var amountFilled = 0; 64 65 function setMarkers($input) { 66 var adviceCenter = $input.data('adviceCenter'); 67 var adviceCenterLatitude = $input.data('latitude'); 68 var adviceCenterLongitude = $input.data('longitude'); 69 var $tableRow = $('tr[data-advice-center="' + adviceCenter + '"]'); 70 var markerTitle = $input.data('markerTitle'); 71 var content = $input.parents('.address-container').find('.infoWindow').html(); 72 73 var marker = new google.maps.Marker({ 74 map: map, 75 position: {lat: adviceCenterLatitude, lng: adviceCenterLongitude}, 76 title: markerTitle, 77 icon: '/typo3conf/ext/wco_advice_center_db/Resources/Public/Icons/Star_20.png' 78 }); 79 80 marker.addListener('click', function () { 81 infowindow.setContent(content); 82 infowindow.open(map, marker); 83 }); 84 85 $tableRow.data('googleMapsMarker', marker); 86 $tableRow.data('googleMapsInfoContent', content); 87 $tableRow.addClass("wco-advicecenter-clickable"); 88 89 markers.push(marker); 90 amountFilled = amountFilled + 1; 91 92 if (amountFilled === amountOfAddresses) { 93 for (i = 0; i < markers.length; i++) { 94 bounds.extend(markers[i].getPosition()); 95 } 96 map.fitBounds(bounds); 97 98 //remove one zoom level to ensure no marker is on the edge. 99 map.setZoom(map.getZoom() - 1); 100 101 // set a minimum zoom 102 // if you got only 1 marker or all markers are on the same address map will be zoomed too much. 103 if (map.getZoom() > 15) { 104 map.setZoom(15); 105 } 106 } 107 } 108 109 bounds = new google.maps.LatLngBounds(); 110 infowindow = new google.maps.InfoWindow({ 111 content: '' 112 }); 113 114 var latlng = new google.maps.LatLng(51.5167, 9.9167); 115 var mapOptions = { 116 zoom: 8, 117 gestureHandling: "cooperative", 118 center: latlng, 119 mapTypeId: google.maps.MapTypeId.ROADMAP 120 }; 121 map = new google.maps.Map(document.getElementById('googleMapsAddressView'), mapOptions); 122 123 $addressesForMap.each(function () { 124 setMarkers($(this)); 125 }); 126 map.fitBounds(bounds); 127 } 128} 129 130var $googleMapsGermanyView = $("#wco-googleMapsGermanyView"); 131if ($googleMapsGermanyView.length > 0) { 132 bounds = new google.maps.LatLngBounds(); 133 var neutralMap = new google.maps.Map(document.getElementById('wco-googleMapsGermanyView'), { 134 center: {lat: 51.5167, lng: 9.9167}, 135 zoom: 6, 136 gestureHandling: "cooperative", 137 mapTypeId: google.maps.MapTypeId.ROADMAP 138 }); 139} 140 141 142 143 144$('.wco-advice-center-table-container tbody tr').on('click', function () { 145 if ($(this).data('googleMapsInfoContent') && $(this).data('googleMapsMarker')) { 146 var marker = $(this).data('googleMapsMarker'); 147 var singleBounds = new google.maps.LatLngBounds(); 148 singleBounds.extend(marker.getPosition()); 149 map.fitBounds(singleBounds); 150 151 //remove one zoom level to ensure no marker is on the edge. 152 map.setZoom(map.getZoom() - 1); 153 // set a minimum zoom 154 // if you got only 1 marker or all markers are on the same address map will be zoomed too much. 155 if (map.getZoom() > 15) { 156 map.setZoom(15); 157 } 158 159 infowindow.setContent($(this).data('googleMapsInfoContent')); 160 infowindow.open(map, marker); 161 if ($(document).scrollTop() > $googleMapsAddressView.offset().top - 110) { 162 $('html, body').animate({ 163 scrollTop: $googleMapsAddressView.offset().top - 110 164 }, 500); 165 } 166 } 167}); 168 169jQuery(function($) { 170 initAutocomplete() 171}); 172 173function initAutocomplete() { 174 let url = $("#autoCompleteUrl-search").data('url'); 175 jQuery("#wco_advicecenter_db-search").autocomplete({ 176 source: function (request, response) { 177 $.post({ 178 url: url, 179 dataType: "json", 180 data: { 181 term: request.term 182 }, 183 success: function (data) { 184 response(data); 185 }, 186 error: function (message) { 187 response([]); 188 } 189 }); 190 }, 191 192 minLength: 2, 193 maxLength: 50, 194 select: function(event, ui){ 195 var valueFieldSelector = $(this).data('valueField'); 196 $(valueFieldSelector).val(ui.item.value); 197 $(this).val(ui.item.label); 198 return false;
199 } 200 }); 201} 202 203$(document).ready(function() { 204 var searchvalue = $.trim($('#wco_advicecenter_db-search').val()); 205 if(searchvalue){ 206 $('html, body').animate({ 207 scrollTop: $("#wco-advicecenter-search").offset().top 208 }, 1500); 209 } 210}); 211/** 212 * Google Preview 213 * 214 * @author Ryan Chase 215 * @version 1.0 216 * @url http://www.blastam.com/blog/index.php/2013/03/how-to-track-downloads-in-google-analytics-v2 217 */ 218document.addEventListener('DOMContentLoaded', function(event) { 219 var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i; 220 221 document.querySelector('a').addEventListener('click', function(event) { 222 var track = true, 223 href = this.href, 224 isThisDomain = href.match(document.domain.split('.').reverse()[1] + '.' + document.domain.split('.').reverse()[0]); 225 226 if(!href.match(/^javascript:/i)) { 227 var elEv = []; 228 elEv.value = 0, elEv.non_i = false; 229 if(href.match(/^mailto\:/i)) { 230 elEv.category = "email"; 231 elEv.action = "click"; 232 elEv.label = href.replace(/^mailto\:/i, ''); 233 elEv.loc = href; 234 } else if(href.match(filetypes)) { 235 var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined; 236 elEv.category = "download"; 237 elEv.action = "click-" + extension[0]; 238 elEv.label = href.replace(/ /g, "-"); 239 elEv.loc = href; 240 } else if(href.match(/^https?\:/i) && !isThisDomain) { 241 elEv.category = "external"; 242 elEv.action = "click"; 243 elEv.label = href.replace(/^https?\:\/\//i, ''); 244 elEv.non_i = true; 245 elEv.loc = href; 246 } else if(href.match(/^tel\:/i)) { 247 elEv.category = "telephone"; 248 elEv.action = "click"; 249 elEv.label = href.replace(/^tel\:/i, ''); 250 elEv.loc = href; 251 } else track = false; 252 253 if(track) { 254 ga('send', 'event', elEv.category.toLowerCase(), elEv.action.toLowerCase(), elEv.label.toLowerCase(), elEv.value, {'nonInteraction': elEv.non_i}); 255 } 256 } 257 }); 258}); 259 260/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) 261 * Licensed under the MIT License (LICENSE.txt). 262 * 263 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 264 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 265 * Thanks to: Seamus Leahy for adding deltaX and deltaY 266 * 267 * Version: 3.0.6 268 * 269 * Requires: 1.2.2+ 270 */ 271(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= 272d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); 273/*! 274 * fancyBox - jQuery Plugin 275 * version: 2.1.5 (Fri, 14 Jun 2013) 276 * @requires jQuery v1.6 or later 277 * 278 * Examples at http://fancyapps.com/fancybox/ 279 * License: www.fancyapps.com/fancybox/#license 280 * 281 * Copyright 2012 Janis Skarnelis - [email protected] 282 * 283 */ 284 285(function (window, document, $, undefined) { 286 "use strict"; 287 288 var H = $("html"), 289 W = $(window), 290 D = $(document), 291 F = $.fancybox = function () { 292 F.open.apply( this, arguments ); 293 }, 294 IE = navigator.userAgent.match(/msie/i), 295 didUpdate = null, 296 isTouch = document.createTouch !== undefined, 297 298 isQuery = function(obj) { 299 return obj && obj.hasOwnProperty && obj instanceof $; 300 }, 301 isString = function(str) { 302 return str && $.type(str) === "string"; 303 }, 304 isPercentage = function(str) { 305 return isString(str) && str.indexOf('%') > 0; 306 }, 307 isScrollable = function(el) { 308 return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight))); 309 },
vendor: 16,702 bytes, lines 310-1033
310 getScalar = function(orig, dim) { 311 var value = parseInt(orig, 10) || 0; 312 313 if (dim && isPercentage(orig)) { 314 value = F.getViewport()[ dim ] / 100 * value; 315 } 316 317 return Math.ceil(value); 318 }, 319 getValue = function(value, dim) { 320 return getScalar(value, dim) + 'px'; 321 }; 322 323 $.extend(F, { 324 // The current version of fancyBox 325 version: '2.1.5', 326 327 defaults: { 328 padding : 15, 329 margin : 20, 330 331 width : 800, 332 height : 600, 333 minWidth : 100, 334 minHeight : 100, 335 maxWidth : 9999, 336 maxHeight : 9999, 337 pixelRatio: 1, // Set to 2 for retina display support 338 339 autoSize : true, 340 autoHeight : false, 341 autoWidth : false, 342 343 autoResize : true, 344 autoCenter : !isTouch, 345 fitToView : true, 346 aspectRatio : false, 347 topRatio : 0.5, 348 leftRatio : 0.5, 349 350 scrolling : 'auto', // 'auto', 'yes' or 'no' 351 wrapCSS : '', 352 353 arrows : true, 354 closeBtn : true, 355 closeClick : false, 356 nextClick : false, 357 mouseWheel : true, 358 autoPlay : false, 359 playSpeed : 3000, 360 preload : 3, 361 modal : false, 362 loop : true, 363 364 ajax : { 365 dataType : 'html', 366 headers : { 'X-fancyBox': true } 367 }, 368 iframe : { 369 scrolling : 'auto', 370 preload : true 371 }, 372 swf : { 373 wmode: 'transparent', 374 allowfullscreen : 'true', 375 allowscriptaccess : 'always' 376 }, 377 378 keys : { 379 next : { 380 13 : 'left', // enter 381 34 : 'up', // page down 382 39 : 'left', // right arrow 383 40 : 'up' // down arrow 384 }, 385 prev : { 386 8 : 'right', // backspace 387 33 : 'down', // page up 388 37 : 'right', // left arrow 389 38 : 'down' // up arrow 390 }, 391 close : [27], // escape key 392 play : [32], // space - start/stop slideshow 393 toggle : [70] // letter "f" - toggle fullscreen 394 }, 395 396 direction : { 397 next : 'left', 398 prev : 'right' 399 }, 400 401 scrollOutside : true, 402 403 // Override some properties 404 index : 0, 405 type : null, 406 href : null, 407 content : null, 408 title : null, 409 410 // HTML templates 411 tpl: { 412 wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', 413 image : '<img class="fancybox-image" src="{href}" alt="" />', 414 iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>', 415 error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', 416 closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>', 417 next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', 418 prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>' 419 }, 420 421 // Properties for each animation type 422 // Opening fancyBox 423 openEffect : 'fade', // 'elastic', 'fade' or 'none' 424 openSpeed : 250, 425 openEasing : 'swing', 426 openOpacity : true, 427 openMethod : 'zoomIn', 428 429 // Closing fancyBox 430 closeEffect : 'fade', // 'elastic', 'fade' or 'none' 431 closeSpeed : 250, 432 closeEasing : 'swing', 433 closeOpacity : true, 434 closeMethod : 'zoomOut', 435 436 // Changing next gallery item 437 nextEffect : 'elastic', // 'elastic', 'fade' or 'none' 438 nextSpeed : 250, 439 nextEasing : 'swing', 440 nextMethod : 'changeIn', 441 442 // Changing previous gallery item 443 prevEffect : 'elastic', // 'elastic', 'fade' or 'none' 444 prevSpeed : 250, 445 prevEasing : 'swing', 446 prevMethod : 'changeOut', 447 448 // Enable default helpers 449 helpers : { 450 overlay : true, 451 title : true 452 }, 453 454 // Callbacks 455 onCancel : $.noop, // If canceling 456 beforeLoad : $.noop, // Before loading 457 afterLoad : $.noop, // After loading 458 beforeShow : $.noop, // Before changing in current item 459 afterShow : $.noop, // After opening 460 beforeChange : $.noop, // Before changing gallery item 461 beforeClose : $.noop, // Before closing 462 afterClose : $.noop // After closing 463 }, 464 465 //Current state 466 group : {}, // Selected group 467 opts : {}, // Group options 468 previous : null, // Previous element 469 coming : null, // Element being loaded 470 current : null, // Currently loaded element 471 isActive : false, // Is activated 472 isOpen : false, // Is currently open 473 isOpened : false, // Have been fully opened at least once 474 475 wrap : null, 476 skin : null, 477 outer : null, 478 inner : null, 479 480 player : { 481 timer : null, 482 isActive : false 483 }, 484 485 // Loaders 486 ajaxLoad : null, 487 imgPreload : null, 488 489 // Some collections 490 transitions : {}, 491 helpers : {}, 492 493 /* 494 * Static methods 495 */ 496 497 open: function (group, opts) { 498 if (!group) { 499 return; 500 } 501 502 if (!$.isPlainObject(opts)) { 503 opts = {}; 504 } 505 506 // Close if already active 507 if (false === F.close(true)) { 508 return; 509 } 510 511 // Normalize group 512 if (!$.isArray(group)) { 513 group = isQuery(group) ? $(group).get() : [group]; 514 } 515 516 // Recheck if the type of each element is `object` and set content type (image, ajax, etc) 517 $.each(group, function(i, element) { 518 var obj = {}, 519 href, 520 title, 521 content, 522 type, 523 rez, 524 hrefParts, 525 selector; 526 527 if ($.type(element) === "object") { 528 // Check if is DOM element 529 if (element.nodeType) { 530 element = $(element); 531 } 532 533 if (isQuery(element)) { 534 obj = { 535 href : element.data('fancybox-href') || element.attr('href'), 536 title : element.data('fancybox-title') || element.attr('title'), 537 isDom : true, 538 element : element 539 }; 540 541 if ($.metadata) { 542 $.extend(true, obj, element.metadata()); 543 } 544 545 } else { 546 obj = element; 547 } 548 } 549 550 href = opts.href || obj.href || (isString(element) ? element : null); 551 title = opts.title !== undefined ? opts.title : obj.title || ''; 552 553 content = opts.content || obj.content; 554 type = content ? 'html' : (opts.type || obj.type); 555 556 if (!type && obj.isDom) { 557 type = element.data('fancybox-type'); 558 559 if (!type) { 560 rez = element.prop('class').match(/fancybox\.(\w+)/); 561 type = rez ? rez[1] : null; 562 } 563 } 564 565 if (isString(href)) { 566 // Try to guess the content type 567 if (!type) { 568 if (F.isImage(href)) { 569 type = 'image'; 570 571 } else if (F.isSWF(href)) { 572 type = 'swf'; 573 574 } else if (href.charAt(0) === '#') { 575 type = 'inline'; 576 577 } else if (isString(element)) { 578 type = 'html'; 579 content = element; 580 } 581 } 582 583 // Split url into two pieces with source url and content selector, e.g, 584 // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id" 585 if (type === 'ajax') { 586 hrefParts = href.split(/\s+/, 2); 587 href = hrefParts.shift(); 588 selector = hrefParts.shift(); 589 } 590 } 591 592 if (!content) { 593 if (type === 'inline') { 594 if (href) { 595 content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 596 597 } else if (obj.isDom) { 598 content = element; 599 } 600 601 } else if (type === 'html') { 602 content = href; 603 604 } else if (!type && !href && obj.isDom) { 605 type = 'inline'; 606 content = element; 607 } 608 } 609 610 $.extend(obj, { 611 href : href, 612 type : type, 613 content : content, 614 title : title, 615 selector : selector 616 }); 617 618 group[ i ] = obj; 619 }); 620 621 // Extend the defaults 622 F.opts = $.extend(true, {}, F.defaults, opts); 623 624 // All options are merged recursive except keys 625 if (opts.keys !== undefined) { 626 F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; 627 } 628 629 F.group = group; 630 631 return F._start(F.opts.index); 632 }, 633 634 // Cancel image loading or abort ajax request 635 cancel: function () { 636 var coming = F.coming; 637 638 if (!coming || false === F.trigger('onCancel')) { 639 return; 640 } 641 642 F.hideLoading(); 643 644 if (F.ajaxLoad) { 645 F.ajaxLoad.abort(); 646 } 647 648 F.ajaxLoad = null; 649 650 if (F.imgPreload) { 651 F.imgPreload.onload = F.imgPreload.onerror = null; 652 } 653 654 if (coming.wrap) { 655 coming.wrap.stop(true, true).trigger('onReset').remove(); 656 } 657 658 F.coming = null; 659 660 // If the first item has been canceled, then clear everything 661 if (!F.current) { 662 F._afterZoomOut( coming ); 663 } 664 }, 665 666 // Start closing animation if is open; remove immediately if opening/closing 667 close: function (event) { 668 F.cancel(); 669 670 if (false === F.trigger('beforeClose')) { 671 return; 672 } 673 674 F.unbindEvents(); 675 676 if (!F.isActive) { 677 return; 678 } 679 680 if (!F.isOpen || event === true) { 681 $('.fancybox-wrap').stop(true).trigger('onReset').remove(); 682 683 F._afterZoomOut(); 684 685 } else { 686 F.isOpen = F.isOpened = false; 687 F.isClosing = true; 688 689 $('.fancybox-item, .fancybox-nav').remove(); 690 691 F.wrap.stop(true, true).removeClass('fancybox-opened'); 692 693 F.transitions[ F.current.closeMethod ](); 694 } 695 }, 696 697 // Manage slideshow: 698 // $.fancybox.play(); - toggle slideshow 699 // $.fancybox.play( true ); - start 700 // $.fancybox.play( false ); - stop 701 play: function ( action ) { 702 var clear = function () { 703 clearTimeout(F.player.timer); 704 }, 705 set = function () { 706 clear(); 707 708 if (F.current && F.player.isActive) { 709 F.player.timer = setTimeout(F.next, F.current.playSpeed); 710 } 711 }, 712 stop = function () { 713 clear(); 714 715 D.unbind('.player'); 716 717 F.player.isActive = false; 718 719 F.trigger('onPlayEnd'); 720 }, 721 start = function () { 722 if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { 723 F.player.isActive = true; 724 725 D.bind({ 726 'onCancel.player beforeClose.player' : stop, 727 'onUpdate.player' : set, 728 'beforeLoad.player' : clear 729 }); 730 731 set(); 732 733 F.trigger('onPlayStart'); 734 } 735 }; 736 737 if (action === true || (!F.player.isActive && action !== false)) { 738 start(); 739 } else { 740 stop(); 741 } 742 }, 743 744 // Navigate to next gallery item 745 next: function ( direction ) { 746 var current = F.current; 747 748 if (current) { 749 if (!isString(direction)) { 750 direction = current.direction.next; 751 } 752 753 F.jumpto(current.index + 1, direction, 'next'); 754 } 755 }, 756 757 // Navigate to previous gallery item 758 prev: function ( direction ) { 759 var current = F.current; 760 761 if (current) { 762 if (!isString(direction)) { 763 direction = current.direction.prev; 764 } 765 766 F.jumpto(current.index - 1, direction, 'prev'); 767 } 768 }, 769 770 // Navigate to gallery item by index 771 jumpto: function ( index, direction, router ) { 772 var current = F.current; 773 774 if (!current) { 775 return; 776 } 777 778 index = getScalar(index); 779 780 F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ]; 781 F.router = router || 'jumpto'; 782 783 if (current.loop) { 784 if (index < 0) { 785 index = current.group.length + (index % current.group.length); 786 } 787 788 index = index % current.group.length; 789 } 790 791 if (current.group[ index ] !== undefined) { 792 F.cancel(); 793 794 F._start(index); 795 } 796 }, 797 798 // Center inside viewport and toggle position type to fixed or absolute if needed 799 reposition: function (e, onlyAbsolute) { 800 var current = F.current, 801 wrap = current ? current.wrap : null, 802 pos; 803 804 if (wrap) { 805 pos = F._getPosition(onlyAbsolute); 806 807 if (e && e.type === 'scroll') { 808 delete pos.position; 809 810 wrap.stop(true, true).animate(pos, 200); 811 812 } else { 813 wrap.css(pos); 814 815 current.pos = $.extend({}, current.dim, pos); 816 } 817 } 818 }, 819 820 update: function (e) { 821 var type = (e && e.type), 822 anyway = !type || type === 'orientationchange'; 823 824 if (anyway) { 825 clearTimeout(didUpdate); 826 827 didUpdate = null; 828 } 829 830 if (!F.isOpen || didUpdate) { 831 return; 832 } 833 834 didUpdate = setTimeout(function() { 835 var current = F.current; 836 837 if (!current || F.isClosing) { 838 return; 839 } 840 841 F.wrap.removeClass('fancybox-tmp'); 842 843 if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) { 844 F._setDimension(); 845 } 846 847 if (!(type === 'scroll' && current.canShrink)) { 848 F.reposition(e); 849 } 850 851 F.trigger('onUpdate'); 852 853 didUpdate = null; 854 855 }, (anyway && !isTouch ? 0 : 300)); 856 }, 857 858 // Shrink content to fit inside viewport or restore if resized 859 toggle: function ( action ) { 860 if (F.isOpen) { 861 F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView; 862 863 // Help browser to restore document dimensions 864 if (isTouch) { 865 F.wrap.removeAttr('style').addClass('fancybox-tmp'); 866 867 F.trigger('onUpdate'); 868 } 869 870 F.update(); 871 } 872 }, 873 874 hideLoading: function () { 875 D.unbind('.loading'); 876 877 $('#fancybox-loading').remove(); 878 }, 879 880 showLoading: function () { 881 var el, viewport; 882 883 F.hideLoading(); 884 885 el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body'); 886 887 // If user will press the escape-button, the request will be canceled 888 D.bind('keydown.loading', function(e) { 889 if ((e.which || e.keyCode) === 27) { 890 e.preventDefault(); 891 892 F.cancel(); 893 } 894 }); 895 896 if (!F.defaults.fixed) { 897 viewport = F.getViewport(); 898 899 el.css({ 900 position : 'absolute', 901 top : (viewport.h * 0.5) + viewport.y, 902 left : (viewport.w * 0.5) + viewport.x 903 }); 904 } 905 }, 906 907 getViewport: function () { 908 var locked = (F.current && F.current.locked) || false, 909 rez = { 910 x: W.scrollLeft(), 911 y: W.scrollTop() 912 }; 913 914 if (locked) { 915 rez.w = locked[0].clientWidth; 916 rez.h = locked[0].clientHeight; 917 918 } else { 919 // See http://bugs.jquery.com/ticket/6724 920 rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width(); 921 rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height(); 922 } 923 924 return rez; 925 }, 926 927 // Unbind the keyboard / clicking actions 928 unbindEvents: function () { 929 if (F.wrap && isQuery(F.wrap)) { 930 F.wrap.unbind('.fb'); 931 } 932 933 D.unbind('.fb'); 934 W.unbind('.fb'); 935 }, 936 937 bindEvents: function () { 938 var current = F.current, 939 keys; 940 941 if (!current) { 942 return; 943 } 944 945 // Changing document height on iOS devices triggers a 'resize' event, 946 // that can change document height... repeating infinitely 947 W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update); 948 949 keys = current.keys; 950 951 if (keys) { 952 D.bind('keydown.fb', function (e) { 953 var code = e.which || e.keyCode, 954 target = e.target || e.srcElement; 955 956 // Skip esc key if loading, because showLoading will cancel preloading 957 if (code === 27 && F.coming) { 958 return false; 959 } 960 961 // Ignore key combinations and key events within form elements 962 if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { 963 $.each(keys, function(i, val) { 964 if (current.group.length > 1 && val[ code ] !== undefined) { 965 F[ i ]( val[ code ] ); 966 967 e.preventDefault(); 968 return false; 969 } 970 971 if ($.inArray(code, val) > -1) { 972 F[ i ] (); 973 974 e.preventDefault(); 975 return false; 976 } 977 }); 978 } 979 }); 980 } 981 982 if ($.fn.mousewheel && current.mouseWheel) { 983 F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) { 984 var target = e.target || null, 985 parent = $(target), 986 canScroll = false; 987 988 while (parent.length) { 989 if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) { 990 break; 991 } 992 993 canScroll = isScrollable( parent[0] ); 994 parent = $(parent).parent(); 995 } 996 997 if (delta !== 0 && !canScroll) { 998 if (F.group.length > 1 && !current.canShrink) { 999 if (deltaY > 0 || deltaX > 0) { 1000 F.prev( deltaY > 0 ? 'down' : 'left' ); 1001 1002 } else if (deltaY < 0 || deltaX < 0) { 1003 F.next( deltaY < 0 ? 'up' : 'right' ); 1004 } 1005 1006 e.preventDefault(); 1007 } 1008 } 1009 }); 1010 } 1011 }, 1012 1013 trigger: function (event, o) { 1014 var ret, obj = o || F.coming || F.current; 1015 1016 if (!obj) { 1017 return; 1018 } 1019 1020 if ($.isFunction( obj[event] )) { 1021 ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); 1022 } 1023 1024 if (ret === false) { 1025 return false; 1026 } 1027 1028 if (obj.helpers) { 1029 $.each(obj.helpers, function (helper, opts) { 1030 if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) { 1031 F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); 1032 } 1033 });
vendor: 8,050 bytes, lines 1033-1392
1033 1034 } 1035 1036 D.trigger(event); 1037 }, 1038 1039 isImage: function (str) { 1040 return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); 1041 }, 1042 1043 isSWF: function (str) { 1044 return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); 1045 }, 1046 1047 _start: function (index) { 1048 var coming = {}, 1049 obj, 1050 href, 1051 type, 1052 margin, 1053 padding; 1054 1055 index = getScalar( index ); 1056 obj = F.group[ index ] || null; 1057 1058 if (!obj) { 1059 return false; 1060 } 1061 1062 coming = $.extend(true, {}, F.opts, obj); 1063 1064 // Convert margin and padding properties to array - top, right, bottom, left 1065 margin = coming.margin; 1066 padding = coming.padding; 1067 1068 if ($.type(margin) === 'number') { 1069 coming.margin = [margin, margin, margin, margin]; 1070 } 1071 1072 if ($.type(padding) === 'number') { 1073 coming.padding = [padding, padding, padding, padding]; 1074 } 1075 1076 // 'modal' propery is just a shortcut 1077 if (coming.modal) { 1078 $.extend(true, coming, { 1079 closeBtn : false, 1080 closeClick : false, 1081 nextClick : false, 1082 arrows : false, 1083 mouseWheel : false, 1084 keys : null, 1085 helpers: { 1086 overlay : { 1087 closeClick : false 1088 } 1089 } 1090 }); 1091 } 1092 1093 // 'autoSize' property is a shortcut, too 1094 if (coming.autoSize) { 1095 coming.autoWidth = coming.autoHeight = true; 1096 } 1097 1098 if (coming.width === 'auto') { 1099 coming.autoWidth = true; 1100 } 1101 1102 if (coming.height === 'auto') { 1103 coming.autoHeight = true; 1104 } 1105 1106 /* 1107 * Add reference to the group, so it`s possible to access from callbacks, example: 1108 * afterLoad : function() { 1109 * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); 1110 * } 1111 */ 1112 1113 coming.group = F.group; 1114 coming.index = index; 1115 1116 // Give a chance for callback or helpers to update coming item (type, title, etc) 1117 F.coming = coming; 1118 1119 if (false === F.trigger('beforeLoad')) { 1120 F.coming = null; 1121 1122 return; 1123 } 1124 1125 type = coming.type; 1126 href = coming.href; 1127 1128 if (!type) { 1129 F.coming = null; 1130 1131 //If we can not determine content type then drop silently or display next/prev item if looping through gallery 1132 if (F.current && F.router && F.router !== 'jumpto') { 1133 F.current.index = index; 1134 1135 return F[ F.router ]( F.direction ); 1136 } 1137 1138 return false; 1139 } 1140 1141 F.isActive = true; 1142 1143 if (type === 'image' || type === 'swf') { 1144 coming.autoHeight = coming.autoWidth = false; 1145 coming.scrolling = 'visible'; 1146 } 1147 1148 if (type === 'image') { 1149 coming.aspectRatio = true; 1150 } 1151 1152 if (type === 'iframe' && isTouch) { 1153 coming.scrolling = 'scroll'; 1154 } 1155 1156 // Build the neccessary markup 1157 coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' ); 1158 1159 $.extend(coming, { 1160 skin : $('.fancybox-skin', coming.wrap), 1161 outer : $('.fancybox-outer', coming.wrap), 1162 inner : $('.fancybox-inner', coming.wrap) 1163 }); 1164 1165 $.each(["Top", "Right", "Bottom", "Left"], function(i, v) { 1166 coming.skin.css('padding' + v, getValue(coming.padding[ i ])); 1167 }); 1168 1169 F.trigger('onReady'); 1170 1171 // Check before try to load; 'inline' and 'html' types need content, others - href 1172 if (type === 'inline' || type === 'html') { 1173 if (!coming.content || !coming.content.length) { 1174 return F._error( 'content' ); 1175 } 1176 1177 } else if (!href) { 1178 return F._error( 'href' ); 1179 } 1180 1181 if (type === 'image') { 1182 F._loadImage(); 1183 1184 } else if (type === 'ajax') { 1185 F._loadAjax(); 1186 1187 } else if (type === 'iframe') { 1188 F._loadIframe(); 1189 1190 } else { 1191 F._afterLoad(); 1192 } 1193 }, 1194 1195 _error: function ( type ) { 1196 $.extend(F.coming, { 1197 type : 'html', 1198 autoWidth : true, 1199 autoHeight : true, 1200 minWidth : 0, 1201 minHeight : 0, 1202 scrolling : 'no', 1203 hasError : type, 1204 content : F.coming.tpl.error 1205 }); 1206 1207 F._afterLoad(); 1208 }, 1209 1210 _loadImage: function () { 1211 // Reset preload image so it is later possible to check "complete" property 1212 var img = F.imgPreload = new Image(); 1213 1214 img.onload = function () { 1215 this.onload = this.onerror = null; 1216 1217 F.coming.width = this.width / F.opts.pixelRatio; 1218 F.coming.height = this.height / F.opts.pixelRatio; 1219 1220 F._afterLoad(); 1221 }; 1222 1223 img.onerror = function () { 1224 this.onload = this.onerror = null; 1225 1226 F._error( 'image' ); 1227 }; 1228 1229 img.src = F.coming.href; 1230 1231 if (img.complete !== true) { 1232 F.showLoading(); 1233 } 1234 }, 1235 1236 _loadAjax: function () { 1237 var coming = F.coming; 1238 1239 F.showLoading(); 1240 1241 F.ajaxLoad = $.ajax($.extend({}, coming.ajax, { 1242 url: coming.href, 1243 error: function (jqXHR, textStatus) { 1244 if (F.coming && textStatus !== 'abort') { 1245 F._error( 'ajax', jqXHR ); 1246 1247 } else { 1248 F.hideLoading(); 1249 } 1250 }, 1251 success: function (data, textStatus) { 1252 if (textStatus === 'success') { 1253 coming.content = data; 1254 1255 F._afterLoad(); 1256 } 1257 } 1258 })); 1259 }, 1260 1261 _loadIframe: function() { 1262 var coming = F.coming, 1263 iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) 1264 .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling) 1265 .attr('src', coming.href); 1266 1267 // This helps IE 1268 $(coming.wrap).bind('onReset', function () { 1269 try { 1270 $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); 1271 } catch (e) {} 1272 }); 1273 1274 if (coming.iframe.preload) { 1275 F.showLoading(); 1276 1277 iframe.one('load', function() { 1278 $(this).data('ready', 1); 1279 1280 // iOS will lose scrolling if we resize 1281 if (!isTouch) { 1282 $(this).bind('load.fb', F.update); 1283 } 1284 1285 // Without this trick: 1286 // - iframe won't scroll on iOS devices 1287 // - IE7 sometimes displays empty iframe 1288 $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); 1289 1290 F._afterLoad(); 1291 }); 1292 } 1293 1294 coming.content = iframe.appendTo( coming.inner ); 1295 1296 if (!coming.iframe.preload) { 1297 F._afterLoad(); 1298 } 1299 }, 1300 1301 _preloadImages: function() { 1302 var group = F.group, 1303 current = F.current, 1304 len = group.length, 1305 cnt = current.preload ? Math.min(current.preload, len - 1) : 0, 1306 item, 1307 i; 1308 1309 for (i = 1; i <= cnt; i += 1) { 1310 item = group[ (current.index + i ) % len ]; 1311 1312 if (item.type === 'image' && item.href) { 1313 new Image().src = item.href; 1314 } 1315 } 1316 }, 1317 1318 _afterLoad: function () { 1319 var coming = F.coming, 1320 previous = F.current, 1321 placeholder = 'fancybox-placeholder', 1322 current, 1323 content, 1324 type, 1325 scrolling, 1326 href, 1327 embed; 1328 1329 F.hideLoading(); 1330 1331 if (!coming || F.isActive === false) { 1332 return; 1333 } 1334 1335 if (false === F.trigger('afterLoad', coming, previous)) { 1336 coming.wrap.stop(true).trigger('onReset').remove(); 1337 1338 F.coming = null; 1339 1340 return; 1341 } 1342 1343 if (previous) { 1344 F.trigger('beforeChange', previous); 1345 1346 previous.wrap.stop(true).removeClass('fancybox-opened') 1347 .find('.fancybox-item, .fancybox-nav') 1348 .remove(); 1349 } 1350 1351 F.unbindEvents(); 1352 1353 current = coming; 1354 content = coming.content; 1355 type = coming.type; 1356 scrolling = coming.scrolling; 1357 1358 $.extend(F, { 1359 wrap : current.wrap, 1360 skin : current.skin, 1361 outer : current.outer, 1362 inner : current.inner, 1363 current : current, 1364 previous : previous 1365 }); 1366 1367 href = current.href; 1368 1369 switch (type) { 1370 case 'inline': 1371 case 'ajax': 1372 case 'html': 1373 if (current.selector) { 1374 content = $('<div>').html(content).find(current.selector); 1375 1376 } else if (isQuery(content)) { 1377 if (!content.data(placeholder)) { 1378 content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() ); 1379 } 1380 1381 content = content.show().detach(); 1382 1383 current.wrap.bind('onReset', function () { 1384 if ($(this).find(content).length) { 1385 content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false); 1386 } 1387 }); 1388 } 1389 break; 1390 1391 case 'image': 1392 content = current.tpl.image.replace(
vendor: 14,919 bytes, lines 1392-1961
1392'{href}', href); 1393 break; 1394 1395 case 'swf': 1396 content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>'; 1397 embed = ''; 1398 1399 $.each(current.swf, function(name, val) { 1400 content += '<param name="' + name + '" value="' + val + '"></param>'; 1401 embed += ' ' + name + '="' + val + '"'; 1402 }); 1403 1404 content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>'; 1405 break; 1406 } 1407 1408 if (!(isQuery(content) && content.parent().is(current.inner))) { 1409 current.inner.append( content ); 1410 } 1411 1412 // Give a chance for helpers or callbacks to update elements 1413 F.trigger('beforeShow'); 1414 1415 // Set scrolling before calculating dimensions 1416 current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); 1417 1418 // Set initial dimensions and start position 1419 F._setDimension(); 1420 1421 F.reposition(); 1422 1423 F.isOpen = false; 1424 F.coming = null; 1425 1426 F.bindEvents(); 1427 1428 if (!F.isOpened) { 1429 $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove(); 1430 1431 } else if (previous.prevMethod) { 1432 F.transitions[ previous.prevMethod ](); 1433 } 1434 1435 F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ](); 1436 1437 F._preloadImages(); 1438 }, 1439 1440 _setDimension: function () { 1441 var viewport = F.getViewport(), 1442 steps = 0, 1443 canShrink = false, 1444 canExpand = false, 1445 wrap = F.wrap, 1446 skin = F.skin, 1447 inner = F.inner, 1448 current = F.current, 1449 width = current.width, 1450 height = current.height, 1451 minWidth = current.minWidth, 1452 minHeight = current.minHeight, 1453 maxWidth = current.maxWidth, 1454 maxHeight = current.maxHeight, 1455 scrolling = current.scrolling, 1456 scrollOut = current.scrollOutside ? current.scrollbarWidth : 0, 1457 margin = current.margin, 1458 wMargin = getScalar(margin[1] + margin[3]), 1459 hMargin = getScalar(margin[0] + margin[2]), 1460 wPadding, 1461 hPadding, 1462 wSpace, 1463 hSpace, 1464 origWidth, 1465 origHeight, 1466 origMaxWidth, 1467 origMaxHeight, 1468 ratio, 1469 width_, 1470 height_, 1471 maxWidth_, 1472 maxHeight_, 1473 iframe, 1474 body; 1475 1476 // Reset dimensions so we could re-check actual size 1477 wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); 1478 1479 wPadding = getScalar(skin.outerWidth(true) - skin.width()); 1480 hPadding = getScalar(skin.outerHeight(true) - skin.height()); 1481 1482 // Any space between content and viewport (margin, padding, border, title) 1483 wSpace = wMargin + wPadding; 1484 hSpace = hMargin + hPadding; 1485 1486 origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width; 1487 origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height; 1488 1489 if (current.type === 'iframe') { 1490 iframe = current.content; 1491 1492 if (current.autoHeight && iframe.data('ready') === 1) { 1493 try { 1494 if (iframe[0].contentWindow.document.location) { 1495 inner.width( origWidth ).height(9999); 1496 1497 body = iframe.contents().find('body'); 1498 1499 if (scrollOut) { 1500 body.css('overflow-x', 'hidden'); 1501 } 1502 1503 origHeight = body.outerHeight(true); 1504 } 1505 1506 } catch (e) {} 1507 } 1508 1509 } else if (current.autoWidth || current.autoHeight) { 1510 inner.addClass( 'fancybox-tmp' ); 1511 1512 // Set width or height in case we need to calculate only one dimension 1513 if (!current.autoWidth) { 1514 inner.width( origWidth ); 1515 } 1516 1517 if (!current.autoHeight) { 1518 inner.height( origHeight ); 1519 } 1520 1521 if (current.autoWidth) { 1522 origWidth = inner.width(); 1523 } 1524 1525 if (current.autoHeight) { 1526 origHeight = inner.height(); 1527 } 1528 1529 inner.removeClass( 'fancybox-tmp' ); 1530 } 1531 1532 width = getScalar( origWidth ); 1533 height = getScalar( origHeight ); 1534 1535 ratio = origWidth / origHeight; 1536 1537 // Calculations for the content 1538 minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth); 1539 maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth); 1540 1541 minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight); 1542 maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight); 1543 1544 // These will be used to determine if wrap can fit in the viewport 1545 origMaxWidth = maxWidth; 1546 origMaxHeight = maxHeight; 1547 1548 if (current.fitToView) { 1549 maxWidth = Math.min(viewport.w - wSpace, maxWidth); 1550 maxHeight = Math.min(viewport.h - hSpace, maxHeight); 1551 } 1552 1553 maxWidth_ = viewport.w - wMargin; 1554 maxHeight_ = viewport.h - hMargin; 1555 1556 if (current.aspectRatio) { 1557 if (width > maxWidth) { 1558 width = maxWidth; 1559 height = getScalar(width / ratio); 1560 } 1561 1562 if (height > maxHeight) { 1563 height = maxHeight; 1564 width = getScalar(height * ratio); 1565 } 1566 1567 if (width < minWidth) { 1568 width = minWidth; 1569 height = getScalar(width / ratio); 1570 } 1571 1572 if (height < minHeight) { 1573 height = minHeight; 1574 width = getScalar(height * ratio); 1575 } 1576 1577 } else { 1578 width = Math.max(minWidth, Math.min(width, maxWidth)); 1579 1580 if (current.autoHeight && current.type !== 'iframe') { 1581 inner.width( width ); 1582 1583 height = inner.height(); 1584 } 1585 1586 height = Math.max(minHeight, Math.min(height, maxHeight)); 1587 } 1588 1589 // Try to fit inside viewport (including the title) 1590 if (current.fitToView) { 1591 inner.width( width ).height( height ); 1592 1593 wrap.width( width + wPadding ); 1594 1595 // Real wrap dimensions 1596 width_ = wrap.width(); 1597 height_ = wrap.height(); 1598 1599 if (current.aspectRatio) { 1600 while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) { 1601 if (steps++ > 19) { 1602 break; 1603 } 1604 1605 height = Math.max(minHeight, Math.min(maxHeight, height - 10)); 1606 width = getScalar(height * ratio); 1607 1608 if (width < minWidth) { 1609 width = minWidth; 1610 height = getScalar(width / ratio); 1611 } 1612 1613 if (width > maxWidth) { 1614 width = maxWidth; 1615 height = getScalar(width / ratio); 1616 } 1617 1618 inner.width( width ).height( height ); 1619 1620 wrap.width( width + wPadding ); 1621 1622 width_ = wrap.width(); 1623 height_ = wrap.height(); 1624 } 1625 1626 } else { 1627 width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); 1628 height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); 1629 } 1630 } 1631 1632 if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) { 1633 width += scrollOut; 1634 } 1635 1636 inner.width( width ).height( height ); 1637 1638 wrap.width( width + wPadding ); 1639 1640 width_ = wrap.width(); 1641 height_ = wrap.height(); 1642 1643 canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight; 1644 canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight)); 1645 1646 $.extend(current, { 1647 dim : { 1648 width : getValue( width_ ), 1649 height : getValue( height_ ) 1650 }, 1651 origWidth : origWidth, 1652 origHeight : origHeight, 1653 canShrink : canShrink, 1654 canExpand : canExpand, 1655 wPadding : wPadding, 1656 hPadding : hPadding, 1657 wrapSpace : height_ - skin.outerHeight(true), 1658 skinSpace : skin.height() - height 1659 }); 1660 1661 if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) { 1662 inner.height('auto'); 1663 } 1664 }, 1665 1666 _getPosition: function (onlyAbsolute) { 1667 var current = F.current, 1668 viewport = F.getViewport(), 1669 margin = current.margin, 1670 width = F.wrap.width() + margin[1] + margin[3], 1671 height = F.wrap.height() + margin[0] + margin[2], 1672 rez = { 1673 position: 'absolute', 1674 top : margin[0], 1675 left : margin[3] 1676 }; 1677 1678 if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { 1679 rez.position = 'fixed'; 1680 1681 } else if (!current.locked) { 1682 rez.top += viewport.y; 1683 rez.left += viewport.x; 1684 } 1685 1686 rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); 1687 rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); 1688 1689 return rez; 1690 }, 1691 1692 _afterZoomIn: function () { 1693 var current = F.current; 1694 1695 if (!current) { 1696 return; 1697 } 1698 1699 F.isOpen = F.isOpened = true; 1700 1701 F.wrap.css('overflow', 'visible').addClass('fancybox-opened'); 1702 1703 F.update(); 1704 1705 // Assign a click event 1706 if ( current.closeClick || (current.nextClick && F.group.length > 1) ) { 1707 F.inner.css('cursor', 'pointer').bind('click.fb', function(e) { 1708 if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { 1709 e.preventDefault(); 1710 1711 F[ current.closeClick ? 'close' : 'next' ](); 1712 } 1713 }); 1714 } 1715 1716 // Create a close button 1717 if (current.closeBtn) { 1718 $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) { 1719 e.preventDefault(); 1720 1721 F.close(); 1722 }); 1723 } 1724 1725 // Create navigation arrows 1726 if (current.arrows && F.group.length > 1) { 1727 if (current.loop || current.index > 0) { 1728 $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); 1729 } 1730 1731 if (current.loop || current.index < F.group.length - 1) { 1732 $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); 1733 } 1734 } 1735 1736 F.trigger('afterShow'); 1737 1738 // Stop the slideshow if this is the last item 1739 if (!current.loop && current.index === current.group.length - 1) { 1740 F.play( false ); 1741 1742 } else if (F.opts.autoPlay && !F.player.isActive) { 1743 F.opts.autoPlay = false; 1744 1745 F.play(); 1746 } 1747 }, 1748 1749 _afterZoomOut: function ( obj ) { 1750 obj = obj || F.current; 1751 1752 $('.fancybox-wrap').trigger('onReset').remove(); 1753 1754 $.extend(F, { 1755 group : {}, 1756 opts : {}, 1757 router : false, 1758 current : null, 1759 isActive : false, 1760 isOpened : false, 1761 isOpen : false, 1762 isClosing : false, 1763 wrap : null, 1764 skin : null, 1765 outer : null, 1766 inner : null 1767 }); 1768 1769 F.trigger('afterClose', obj); 1770 } 1771 }); 1772 1773 /* 1774 * Default transitions 1775 */ 1776 1777 F.transitions = { 1778 getOrigPosition: function () { 1779 var current = F.current, 1780 element = current.element, 1781 orig = current.orig, 1782 pos = {}, 1783 width = 50, 1784 height = 50, 1785 hPadding = current.hPadding, 1786 wPadding = current.wPadding, 1787 viewport = F.getViewport(); 1788 1789 if (!orig && current.isDom && element.is(':visible')) { 1790 orig = element.find('img:first'); 1791 1792 if (!orig.length) { 1793 orig = element; 1794 } 1795 } 1796 1797 if (isQuery(orig)) { 1798 pos = orig.offset(); 1799 1800 if (orig.is('img')) { 1801 width = orig.outerWidth(); 1802 height = orig.outerHeight(); 1803 } 1804 1805 } else { 1806 pos.top = viewport.y + (viewport.h - height) * current.topRatio; 1807 pos.left = viewport.x + (viewport.w - width) * current.leftRatio; 1808 } 1809 1810 if (F.wrap.css('position') === 'fixed' || current.locked) { 1811 pos.top -= viewport.y; 1812 pos.left -= viewport.x; 1813 } 1814 1815 pos = { 1816 top : getValue(pos.top - hPadding * current.topRatio), 1817 left : getValue(pos.left - wPadding * current.leftRatio), 1818 width : getValue(width + wPadding), 1819 height : getValue(height + hPadding) 1820 }; 1821 1822 return pos; 1823 }, 1824 1825 step: function (now, fx) { 1826 var ratio, 1827 padding, 1828 value, 1829 prop = fx.prop, 1830 current = F.current, 1831 wrapSpace = current.wrapSpace, 1832 skinSpace = current.skinSpace; 1833 1834 if (prop === 'width' || prop === 'height') { 1835 ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start); 1836 1837 if (F.isClosing) { 1838 ratio = 1 - ratio; 1839 } 1840 1841 padding = prop === 'width' ? current.wPadding : current.hPadding; 1842 value = now - padding; 1843 1844 F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) ); 1845 F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) ); 1846 } 1847 }, 1848 1849 zoomIn: function () { 1850 var current = F.current, 1851 startPos = current.pos, 1852 effect = current.openEffect, 1853 elastic = effect === 'elastic', 1854 endPos = $.extend({opacity : 1}, startPos); 1855 1856 // Remove "position" property that breaks older IE 1857 delete endPos.position; 1858 1859 if (elastic) { 1860 startPos = this.getOrigPosition(); 1861 1862 if (current.openOpacity) { 1863 startPos.opacity = 0.1; 1864 } 1865 1866 } else if (effect === 'fade') { 1867 startPos.opacity = 0.1; 1868 } 1869 1870 F.wrap.css(startPos).animate(endPos, { 1871 duration : effect === 'none' ? 0 : current.openSpeed, 1872 easing : current.openEasing, 1873 step : elastic ? this.step : null, 1874 complete : F._afterZoomIn 1875 }); 1876 }, 1877 1878 zoomOut: function () { 1879 var current = F.current, 1880 effect = current.closeEffect, 1881 elastic = effect === 'elastic', 1882 endPos = {opacity : 0.1}; 1883 1884 if (elastic) { 1885 endPos = this.getOrigPosition(); 1886 1887 if (current.closeOpacity) { 1888 endPos.opacity = 0.1; 1889 } 1890 } 1891 1892 F.wrap.animate(endPos, { 1893 duration : effect === 'none' ? 0 : current.closeSpeed, 1894 easing : current.closeEasing, 1895 step : elastic ? this.step : null, 1896 complete : F._afterZoomOut 1897 }); 1898 }, 1899 1900 changeIn: function () { 1901 var current = F.current, 1902 effect = current.nextEffect, 1903 startPos = current.pos, 1904 endPos = { opacity : 1 }, 1905 direction = F.direction, 1906 distance = 200, 1907 field; 1908 1909 startPos.opacity = 0.1; 1910 1911 if (effect === 'elastic') { 1912 field = direction === 'down' || direction === 'up' ? 'top' : 'left'; 1913 1914 if (direction === 'down' || direction === 'right') { 1915 startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance); 1916 endPos[ field ] = '+=' + distance + 'px'; 1917 1918 } else { 1919 startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance); 1920 endPos[ field ] = '-=' + distance + 'px'; 1921 } 1922 } 1923 1924 // Workaround for http://bugs.jquery.com/ticket/12273 1925 if (effect === 'none') { 1926 F._afterZoomIn(); 1927 1928 } else { 1929 F.wrap.css(startPos).animate(endPos, { 1930 duration : current.nextSpeed, 1931 easing : current.nextEasing, 1932 complete : F._afterZoomIn 1933 }); 1934 } 1935 }, 1936 1937 changeOut: function () { 1938 var previous = F.previous, 1939 effect = previous.prevEffect, 1940 endPos = { opacity : 0.1 }, 1941 direction = F.direction, 1942 distance = 200; 1943 1944 if (effect === 'elastic') { 1945 endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px'; 1946 } 1947 1948 previous.wrap.animate(endPos, { 1949 duration : effect === 'none' ? 0 : previous.prevSpeed, 1950 easing : previous.prevEasing, 1951 complete : function () { 1952 $(this).trigger('onReset').remove(); 1953 } 1954 }); 1955 } 1956 }; 1957 1958 /* 1959 * Overlay helper 1960 */ 1961
1962 F.helpers.overlay = { 1963 defaults : { 1964 closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay 1965 speedOut : 200, // duration of fadeOut animation 1966 showEarly : true, // indicates if should be opened immediately or wait until the content is ready 1967 css : {}, // custom CSS properties 1968 locked : !isTouch, // if true, the content will be locked into overlay 1969 fixed : true // if false, the overlay CSS position property will not be set to "fixed" 1970 }, 1971 1972 overlay : null, // current handle 1973 fixed : false, // indicates if the overlay has position "fixed" 1974 el : $('html'), // element that contains "the lock" 1975 1976 // Public methods 1977 create : function(opts) { 1978 opts = $.extend({}, this.defaults, opts); 1979 1980 if (this.overlay) { 1981 this.close(); 1982 } 1983 1984 this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent ); 1985 this.fixed = false; 1986 1987 if (opts.fixed && F.defaults.fixed) { 1988 this.overlay.addClass('fancybox-overlay-fixed'); 1989 1990 this.fixed = true; 1991 } 1992 }, 1993 1994 open : function(opts) { 1995 var that = this; 1996 1997 opts = $.extend({}, this.defaults, opts); 1998 1999 if (this.overlay) { 2000 this.overlay.unbind('.overlay').width('auto').height('auto'); 2001 2002 } else { 2003 this.create(opts); 2004 } 2005 2006 if (!this.fixed) { 2007 W.bind('resize.overlay', $.proxy( this.update, this) ); 2008 2009 this.update(); 2010 } 2011 2012 if (opts.closeClick) { 2013 this.overlay.bind('click.overlay', function(e) { 2014 if ($(e.target).hasClass('fancybox-overlay')) { 2015 if (F.isActive) { 2016 F.close(); 2017 } else { 2018 that.close(); 2019 } 2020 2021 return false; 2022 } 2023 }); 2024 } 2025 2026 this.overlay.css( opts.css ).show(); 2027 }, 2028 2029 close : function() { 2030 var scrollV, scrollH; 2031 2032 W.unbind('resize.overlay'); 2033 2034 if (this.el.hasClass('fancybox-lock')) { 2035 $('.fancybox-margin').removeClass('fancybox-margin'); 2036 2037 scrollV = W.scrollTop(); 2038 scrollH = W.scrollLeft(); 2039 2040 this.el.removeClass('fancybox-lock'); 2041 2042 W.scrollTop( scrollV ).scrollLeft( scrollH ); 2043 } 2044 2045 $('.fancybox-overlay').remove().hide(); 2046 2047 $.extend(this, { 2048 overlay : null, 2049 fixed : false 2050 }); 2051 }, 2052 2053 // Private, callbacks 2054 2055 update : function () { 2056 var width = '100%', offsetWidth; 2057 2058 // Reset width/height so it will not mess 2059 this.overlay.width(width).height('100%'); 2060 2061 // jQuery does not return reliable result for IE 2062 if (IE) { 2063 offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); 2064 2065 if (D.width() > offsetWidth) { 2066 width = D.width(); 2067 } 2068 2069 } else if (D.width() > W.width()) { 2070 width = D.width(); 2071 } 2072 2073 this.overlay.width(width).height(D.height()); 2074 }, 2075 2076 // This is where we can manipulate DOM, because later it would cause iframes to reload 2077 onReady : function (opts, obj) { 2078 var overlay = this.overlay; 2079 2080 $('.fancybox-overlay').stop(true, true); 2081 2082 if (!overlay) { 2083 this.create(opts); 2084 } 2085 2086 if (opts.locked && this.fixed && obj.fixed) { 2087 if (!overlay) { 2088 this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false; 2089 } 2090 2091 obj.locked = this.overlay.append( obj.wrap ); 2092 obj.fixed = false; 2093 } 2094 2095 if (opts.showEarly === true) { 2096 this.beforeShow.apply(this, arguments); 2097 } 2098 }, 2099 2100 beforeShow : function(opts, obj) { 2101 var scrollV, scrollH; 2102 2103 if (obj.locked) { 2104 if (this.margin !== false) { 2105 $('*').filter(function(){ 2106 return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") ); 2107 }).addClass('fancybox-margin'); 2108 2109 this.el.addClass('fancybox-margin'); 2110 } 2111 2112 scrollV = W.scrollTop(); 2113 scrollH = W.scrollLeft(); 2114 2115 this.el.addClass('fancybox-lock'); 2116 2117 W.scrollTop( scrollV ).scrollLeft( scrollH ); 2118 } 2119 2120 this.open(opts); 2121 }, 2122 2123 onUpdate : function() { 2124 if (!this.fixed) { 2125 this.update(); 2126 } 2127 }, 2128 2129 afterClose: function (opts) { 2130 // Remove overlay if exists and fancyBox is not opening 2131 // (e.g., it is not being open using afterClose callback) 2132 //if (this.overlay && !F.isActive) { 2133 if (this.overlay && !F.coming) { 2134 this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this )); 2135 } 2136 } 2137 }; 2138 2139 /* 2140 * Title helper 2141 */ 2142 2143 F.helpers.title = { 2144 defaults : { 2145 type : 'float', // 'float', 'inside', 'outside' or 'over', 2146 position : 'bottom' // 'top' or 'bottom' 2147 }, 2148 2149 beforeShow: function (opts) { 2150 var current = F.current, 2151 text = current.title, 2152 type = opts.type, 2153 title, 2154 target; 2155 2156 if ($.isFunction(text)) { 2157 text = text.call(current.element, current); 2158 } 2159 2160 if (!isString(text) || $.trim(text) === '') { 2161 return; 2162 } 2163 2164 title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">
2164' + text + '</div>'); 2165 2166 switch (type) { 2167 case 'inside': 2168 target = F.skin; 2169 break; 2170 2171 case 'outside': 2172 target = F.wrap; 2173 break; 2174 2175 case 'over': 2176 target = F.inner; 2177 break; 2178 2179 default: // 'float' 2180 target = F.skin; 2181 2182 title.appendTo('body'); 2183 2184 if (IE) { 2185 title.width( title.width() ); 2186 } 2187 2188 title.wrapInner('<span class="child"></span>'); 2189 2190 //Increase bottom margin so this title will also fit into viewport 2191 F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) ); 2192 break; 2193 } 2194 2195 title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target); 2196 } 2197 }; 2198 2199 // jQuery plugin initialization 2200 $.fn.fancybox = function (options) { 2201 var index, 2202 that = $(this), 2203 selector = this.selector || '', 2204 run = function(e) { 2205 var what = $(this).blur(), idx = index, relType, relVal; 2206 2207 if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) { 2208 relType = options.groupAttr || 'data-fancybox-group'; 2209 relVal = what.attr(relType); 2210 2211 if (!relVal) { 2212 relType = 'rel'; 2213 relVal = what.get(0)[ relType ]; 2214 } 2215 2216 if (relVal && relVal !== '' && relVal !== 'nofollow') { 2217 what = selector.length ? $(selector) : that; 2218 what = what.filter('[' + relType + '="' + relVal + '"]'); 2219 idx = what.index(this); 2220 } 2221 2222 options.index = idx; 2223 2224 // Stop an event from bubbling if everything is fine 2225 if (F.open(what, options) !== false) { 2226 e.preventDefault(); 2227 } 2228 } 2229 }; 2230 2231 options = options || {}; 2232 index = options.index || 0; 2233 2234 if (!selector || options.live === false) { 2235 that.unbind('click.fb-start').bind('click.fb-start', run); 2236 2237 } else { 2238 D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); 2239 } 2240 2241 this.filter('[data-fancybox-start=1]').trigger('click'); 2242 2243 return this; 2244 }; 2245 2246 // Tests that need a body at doc ready 2247 D.ready(function() { 2248 var w1, w2; 2249 2250 if ( $.scrollbarWidth === undefined ) { 2251 // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth 2252 $.scrollbarWidth = function() { 2253 var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'), 2254 child = parent.children(), 2255 width = child.innerWidth() - child.height( 99 ).innerWidth(); 2256 2257 parent.remove(); 2258 2259 return width; 2260 }; 2261 } 2262 2263 if ( $.support.fixedPosition === undefined ) { 2264 $.support.fixedPosition = (function() { 2265 var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'), 2266 fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 ); 2267 2268 elem.remove(); 2269 2270 return fixed; 2271 }()); 2272 } 2273 2274 $.extend(F.defaults, { 2275 scrollbarWidth : $.scrollbarWidth(), 2276 fixed : $.support.fixedPosition, 2277 parent : $('body') 2278 }); 2279 2280 //Get real width of page scroll-bar 2281 w1 = $(window).width(); 2282 2283 H.addClass('fancybox-lock-test'); 2284 2285 w2 = $(window).width(); 2286 2287 H.removeClass('fancybox-lock-test'); 2288 2289 $("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head"); 2290 }); 2291 2292}(window, document, jQuery)); 2293 2294 2295$(document).ready(function() { 2296 2297 jQuery("a[class*=lightbox]").each(function(index,link) { 2298 if (link.href.split('#')[0] == (window.location.origin+window.location.pathname)) { 2299 link.href = "#" + link.href.split('#')[1]; 2300 } 2301 }); 2302 2303 2304}); 2305 2306function ww_bzga_matomo_embedTrackingCode() { 2307 2308 const url = "https://piwik.bzga.de/"; 2309 _paq.push(['setTrackerUrl', `${url}piwik.php`]); 2310 2311 const scriptElement = document.createElement("script"); 2312 const firstScript = document.getElementsByTagName("script")[0]; 2313 2314 scriptElement.type = "text/javascript"; 2315 scriptElement.defer = true; 2316 scriptElement.async = true; 2317 scriptElement.src = `${url}piwik.js`; 2318 2319 firstScript.parentNode.insertBefore(scriptElement, firstScript); 2320} 2321 2322function ww_bzga_matomo_getCookie(cookieName) { 2323 const cookies = document.cookie 2324 .split(';') 2325 .map(cookie => cookie.trim()) 2326 .filter(cookie => cookie.startsWith(`${cookieName}=`)); 2327
2328 if (cookies.length === 0) { 2329 return null; 2330 } 2331 2332 return cookies[0].split('=')[1]; 2333} 2334 2335function ww_bzga_matomo_setCookie(name, value, expiryDays, domain, path) { 2336 expiryDays = expiryDays || 365; 2337 var exdate = new Date(); 2338 exdate.setDate(exdate.getDate() + expiryDays); 2339 2340 var cookie = [ 2341 name + '=' + value, 2342 'expires=' + exdate.toUTCString(), 2343 'path=' + path || '/', 2344 'SameSite=Lax', 2345 'secure=true' 2346 ]; 2347 2348 if (domain && 0) cookie.push( 'domain=' + domain); 2349 if (value == 0) cookie.push( 'max-age=0'); 2350 2351 document.cookie = cookie.join(';'); 2352} 2353 2354function ww_bzga_matomo_set_tracking(v, expiryDays) { 2355 expiryDays=parseInt(expiryDays); 2356 2357 if (expiryDays < 1) expiryDays=365; 2358 2359 ww_bzga_matomo_setCookie("ww_bzga_matomo_tracking_allow", v, expiryDays, document.domain, "/"); 2360 2361 ww_bzga_matomo_setCookie("ww_bzga_matomo_cookiebanner_hide", 1, expiryDays, document.domain, "/"); 2362 2363 jQuery("#ww_bzga_matomo_cookiebanner").hide(); 2364} 2365 2366function ww_bzga_matomo_set_moreinfo() { 2367 (function ($) { 2368 var is_expanded = $("#cookiebanner_button_moreinfo").attr("aria-expanded"); 2369 2370 if (is_expanded == "true") { 2371 $("#cookiebanner_description_moreinfo").hide(); 2372 $("#cookiebanner_button_moreinfo").attr("aria-expanded", "false"); 2373 } else { 2374 $("#cookiebanner_description_moreinfo").show(); 2375 $("#cookiebanner_button_moreinfo").attr("aria-expanded", "true"); 2376 } 2377 })(jQuery); 2378} 2379 2380function ww_bzga_matomo_init() { 2381 var hide = ww_bzga_matomo_getCookie("ww_bzga_matomo_cookiebanner_hide"); 2382 var allow = ww_bzga_matomo_getCookie("ww_bzga_matomo_tracking_allow"); 2383 if (allow == null) allow=2; 2384 2385 if (allow == 1) ww_bzga_matomo_embedTrackingCode(); 2386 (function ($) { 2387 2388 if (hide != 1) $("#ww_bzga_matomo_cookiebanner").show(); 2389 var expire = $("#ww_bzga_matomo_cookiebanner").data("expire"); 2390 $("#ww_bzga_matomo_cookiebanner .button-allow").on("click", function() { ww_bzga_matomo_set_tracking(1,expire); location.reload(); }); 2391 $("#ww_bzga_matomo_cookiebanner .button-deny").on("click", function() { ww_bzga_matomo_set_tracking(2,expire); location.reload(); }); 2392 $("#ww_bzga_matomo_cookiebanner .button-moreinfo").on("click", function() { ww_bzga_matomo_set_moreinfo(); }); 2393 2394 $(".ww_bzga_matomo").show(); 2395 if (allow == 2) { 2396 $(".ww_bzga_matomo .optout_yes").show(); 2397 $(".ww_bzga_matomo .optout_no").hide(); 2398 } else { 2399 $(".ww_bzga_matomo .optout_no").show(); 2400 $(".ww_bzga_matomo .optout_yes").hide(); 2401 } 2402 var expire = $(".ww_bzga_matomo").data("expire"); 2403 $(".ww_bzga_matomo .set_optout_yes").on("click", function() { ww_bzga_matomo_set_tracking(2,expire); location.reload(); }); 2404 $(".ww_bzga_matomo .set_optout_no").on("click", function() { ww_bzga_matomo_set_tracking(1,expire); location.reload(); }); 2405 })(jQuery); 2406} 2407 2408jQuery(document).ready(ww_bzga_matomo_init); 2409 2410/* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2411 * Build: http://modernizr.com/download/#-cssanimations-csstransitions-touch-shiv-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes-load 2412 */ 2413;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;
vendor: 7,903 bytes, lines 2413-2428
2413var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.cssanimations=function(){return F("animationName")},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,e.prefixed=function(a,b,c){return b?F(a,b,c):F(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; 2414 $(document).ready(function () { 2415 $("a[href^='tel:']").on("click", function (e) { 2416 _paq.push(['trackEvent', 'Contact', 'called', this.href]); 2417 }); 2418 2419 var playAbleplayer = AblePlayer.prototype.handlePlay; 2420 2421 AblePlayer.prototype.handlePlay = function () { 2422 playAbleplayer.apply(this, arguments); 2423 _paq.push(['trackEvent', 'Video', 'Play', this.media.currentSrc]); 2424 } 2425 }); 2426jQuery(document).ready(function() { jQuery('a[class*=lightbox],a[rel*=lightbox]').fancybox({ 'padding' : 15, 2427 'margin' : 20, 2428 'width' : 800,
2429 'height' : 600, 2430 'minWidth' : 100, 2431 'minHeight' : 100, 2432 'maxWidth' : 9999, 2433 'maxHeight' : 9999, 2434 'autoSize' : true, 2435 'fitToView' : true, 2436 'aspectRatio' : false, 2437 'topRatio' : 0.5, 2438 'fixed' : false, 2439 'scrolling' : 'auto', 2440 'wrapCSS' : '', 2441 'arrows' : true, 2442 'closeBtn' : true, 2443 'closeClick' : false, 2444 'nextClick' : false, 2445 'mouseWheel' : true, 2446 'loop' : true, 2447 'modal' : false, 2448 'autoPlay' : false, 2449 'playSpeed' : 3000, 2450 'index' : 0, 2451 'type' : null, 2452 'href' : null, 2453 'content' : null, 2454 'openEffect' : 'fade', 2455 'closeEffect' : 'fade', 2456 'nextEffect' : 'fade', 2457 'prevEffect' : 'fade', 2458 'openSpeed' : 300, 2459 'closeSpeed' : 300, 2460 'nextSpeed' : 300, 2461 'prevSpeed' : 300, 2462 'openEasing' : 'swing', 2463 'closeEasing' : 'swing', 2464 'nextEasing' : 'swing', 2465 'prevEasing' : 'swing', 2466 'openOpacity' : true, 2467 'closeOpacity' : true, 2468 'openMethod' : 'zoomIn', 2469 'closeMethod' : 'zoomOut', 2470 'nextMethod' : 'changeIn', 2471 'prevMethod' : 'changeOut', 2472 'groupAttr' : 'data-fancybox-group', 2473 'beforeShow' : function(opts) { 2474 this.title = (jQuery(this.group[this.index]).attr('title') != undefined ? jQuery(this.group[this.index]).attr('title') : jQuery(this.group[this.index]).find('img').attr('title')); 2475 }}); });
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.