1(function ($) { 2 'use strict'; 3 4 window.PX = { 5 6 PX_slider: function() { 7 //'use strict'; 8 $('.slide-container').each(function () { 9 10 var initOnload = $(this).data("init-onload"); 11 12 /** 13 * if the slide-container has a data attr init-load = false then 14 * don't initilize the slider. 15 */ 16 if( typeof initOnload === "boolean" && initOnload == false ) { 17 console.info( this + " not initilized"); 18 return; 19 } 20 21 22 if($(this).hasClass("disable-auto")) { 23 $(this).flexslider({ 24 controlNav: true, 25 prevText: "<i class='icon icon-left'></i>", 26 nextText: "<i class='icon icon-right'></i>", 27 smoothHeight: false, 28 slideshow: false, 29 animation: "slide" 30 }); 31 } else { 32 $(this).flexslider({ 33 controlNav: false, 34 prevText: "<i class='icon icon-left'></i>", 35 nextText: "<i class='icon icon-right'></i>", 36 smoothHeight: false, 37 slideshow: true 38 }); 39 } 40 }); 41 }, 42 43 PX_scrollTop: function () { 44 //'use strict'; 45 $(window).scroll(function () { 46 var top = $(window).scrollTop(); 47 48 if(top > 5) 49 $(".site-bottom").addClass("show"); 50 else 51 $(".site-bottom").removeClass("show"); 52 }); 53 $("#scroll-up").click(function () { 54 $("html, body").animate({scrollTop : 0}, 400, function() { 55 // DK09012018 Scrollposition anpassen 56 57 var el = $('.site-search'); 58 console.log(el.scrollTop()); 59 60 61 el.css({'position':'absolute','top':'150px','margin-top':'0'}); 62 }); 63 64 65 }); 66 }, 67 68 PX_DesktopScroll: function () { 69 //'use strict'; 70 71 var header = { 72 ElementScroll : $(".scroll-navigation"), 73 Height : $(".scroll-navigation").outerHeight() + $(".line-transparent").outerHeight(), 74 HeightFix : $("#header").outerHeight() + $(".line-transparent").outerHeight() 75 }; 76 77 header.ElementScroll.css({ 78 "top": -header.Height, 79 "opacity": 0 80 }); 81 var topWindow; 82 $(window).scroll(function () { 83 topWindow = $(this).scrollTop(); 84 85 if( topWindow >= header.HeightFix ) { 86 header.ElementScroll 87 .css({ 88 "position" : "fixed", 89 "top": 0, 90 "opacity":1 91 }); 92 //$(".dropdown-carousel:not(.scroll-navigation .dropdown-carousel)").removeClass("open"); 93 //$(".has-dropdownSlider:not(.scroll-navigation .has-dropdownSlider)").removeClass("active"); 94 } else { 95 header.ElementScroll 96 .css({ 97 "position" : "fixed", 98 "top": -header.Height, 99 "opacity":0 100 }); 101 } 102 }); 103 }, 104 105 PX_popupSearch: function() { 106 //'use strict'; 107 108 if ( !$('.site-search').length ) 109 return false; 110 111 /* Popup search utilities function */ 112 var popup = $('#filter-popup'), 113 evt = $('.popup-detail'), 114 evt2 = $('.search-toggle-open'); 115 116 117 /* popup click event */ 118 evt.click(function(e) { 119 120 $(".has-dropdownSlider").removeClass("active"); 121 122 var //headScroll = $('.scroll-navigation'), 123 //headScrollLine = headScroll.find('.line-transparent').outerHeight(), 124 //headScrollHeight = (headScroll.outerHeight() + headScrollLine ), 125 //elTop = ( $('.site-search').offset().top - 30 ), 126 detailScroll = 0; 127 128 $('.dropdown-carousel').removeClass('open'); 129 $('.has-profile > ul').hide(); 130 $('.has-profile .btn-profile').removeClass('active'); 131 132 if ( $('.site-search').css('z-index') == 800 ) 133 detailScroll = $('.site-search-offset-top').offset().top - $('.search-form').outerHeight(); 134 135 if ( !$('#filter-popup').hasClass('open') ) { 136 /*$('.site-search').animate({'margin-top': 0}, 200); 137 $('body, html').animate({'scrollTop': $("#header").outerHeight()}, 500, function(){ 138 popup.addClass("open"); 139 evt.addClass("active"); 140 e.stopPropagation(); 141 }); DK12012016*/ 142 143 popup.addClass("open"); 144 evt.addClass("active"); 145 e.stopPropagation(); 146 147 148 // Leere Suche ausführen um die Selectboxen zu füllen. 149 if( $("#suche").val() === "" ){
150 window.sendRequestRecherche(2); 151 }else{ 152 window.durchsucheSuche(); 153 } 154 155 156 157 } else { 158 popup.removeClass("open"); 159 evt.removeClass("active"); 160 $('#subpage_detailsearch_preview').attr('data-subpageOpenDetail',-1); 161 162 } 163 164 return false; 165 }); 166 167 evt2.click(function(){ 168 $(".has-dropdownSlider").removeClass("active"); 169 $('.dropdown-carousel').removeClass('open'); 170 $('.has-profile > ul').hide(); 171 $('.has-profile .btn-profile').removeClass('active'); 172 $('.site-search, .site-search .search-form-wrap').toggleClass('open'); 173 $('#subpage_detailsearch_preview').toggleClass('open'); 174 $('.site-search #filter-popup').removeClass('open'); 175 $('#subpage_detailsearch_preview').attr('data-subpageOpenDetail',-1); 176 return false; 177 }); 178 179 /* close popup when click out of popup element */ 180 $('html, body').click(function(e){ 181 var target = $(e.target), 182 target_id = target.attr('id'), 183 target_par_id = target.closest('.site-search').attr('id'); 184 if ( target_id != 'site-search' && target_par_id != 'site-search' ) { 185 $('#filter-popup, .search-form-wrap').removeClass("open"); 186 evt.removeClass("active"); 187 $('.site-search').removeClass('open'); 188 $('#subpage_detailsearch_preview').attr('data-subpageOpenDetail',-1); 189 } 190 }); 191 192 // reset button 193 $('.popup-reset').click(function(){ 194 var popup = $('.filter-popup'); 195 popup.find('.dropdown [data-bind="label"]').empty(); 196 popup.find('.checkbox-selection li a').removeClass("checked").next().prop("checked", false); 197 }); 198 199 200 /* popup scroll animation */ 201 var el = $('.site-search'), 202 head = $('.site-header'), 203 parent = $('.site-media'); 204 205 $(window).scroll(function(){ 206 207 208 var headHeight = (head.outerHeight() + parent.find('.line-transparent').outerHeight()); 209 var elScroll = ($(window).scrollTop() - headHeight); 210 var gapDistance = (parent.offset().top + parent.outerHeight()) - (el.offset().top - el.height()); 211 var range = 25; 212 213 if (parent.hasClass('site-media-result')) 214 215 216 217 range = 145; 218 219 220 if(!el.hasClass('site-search-invisible')){var lastPosition;var scrollPosition = jQuery(document).scrollTop();if($(window).scrollTop()>headHeight&&$('.site-search').css('z-index')==800&&!$('.filter-popup').hasClass('open')&&!$('.filter-popup').hasClass('open')){var top=(elScroll*gapDistance)/parent.outerHeight();if(elScroll>=0&&elScroll<(parent.outerHeight()-head.outerHeight()-((el.outerHeight()-range)/2))){el.removeClass('anim-open');el.css({'position':'absolute','top':$('.site-search-offset-top').position().top,'margin-top':top});}else{el.addClass('anim-open');el.css({'position':'absolute','top':scrollPosition,'margin-top':'-97px'});}lastPosition = scrollPosition;}else{if(el.parents('.filter-popup').hasClass('open')){/*el.removeClass('anim-open');*/el.css({'position':'absolute','top':lastPosition,'margin-top':'0'});}/*console.log("open");*/}} 221 222 }); 223 224 }, 225 226 PX_mobileFixNav: function () { 227 //'use strict'; 228 229 var nav = $("#container-mobile"), 230 header = $("#header").outerHeight(); 231 $(window).resize(function () { 232 header = $("#header").outerHeight(); 233 }); 234/**/ 235 $(window).scroll(function () { 236 var winTop = $(window).scrollTop(); 237 238 if(winTop >= header) 239 nav.addClass("fixed"); 240 else 241 nav.removeClass("fixed"); 242 }); 243 }, 244 245 PX_toggleButton: function() { 246 //'use strict'; 247
248 $(".btn-toggle").click(function () { 249 var id = $(this).data("id"); 250 $(this).toggleClass("active"); 251 $("#"+id).toggleClass("open"); 252 }); 253 var visited = false; 254 $(".remove-hover").hover(function() { 255 visited = true; 256 }, function () { 257 visited = false; 258 }); 259 260 $('html,body').click(function() { 261 if(visited === false) { 262 $(".remove-hover").removeClass("open"); 263 $(".btn-toggle").removeClass('active'); 264 } 265 }); 266 267 /*$('.social-toggle').click(function() { 268 $('.social-toggle').toggleClass('on'); 269 $('.social-container').toggleClass('disabled'); 270 });*/ 271 272 }, 273 274 PX_switchButton: function() { 275 //'use strict'; 276 277 var v = false, 278 plus = $("#container-mobile").outerHeight() -1, 279 width = $(window).width(); 280 281 $(window).resize(function () { 282 plus = $("#container-mobile").outerHeight() -1; 283 width = $(window).width(); 284 if (width < 768) { 285 $(".item-dropdown").addClass("item-switch"); 286 } 287 }); 288 289 /* 290 function getplus() { 291 return plus; 292 } 293 */ 294 if (width < 768) { 295 $(".item-dropdown").addClass("item-switch"); 296 } 297 298 $(".btn-switch").click(function (e) { 299 $(this).toggleClass("active"); 300 $(".btn-switch").not(this).removeClass("active"); 301 302 if ($(this).hasClass("active")) { 303 $(".container-mobile .blue-frame").addClass("hide"); 304 } else { 305 $(".container-mobile .blue-frame").removeClass("hide"); 306 } 307 var id = $(".active").data("id") //, 308 //target = $(".item-switch") 309 ; 310 311 $(".btn-switch").each(function () { 312 $("#"+$(this).data("id")).not("#"+id).removeClass("open"); 313 }); 314 315 $("#"+id).toggleClass("open"); 316 317 if($(this).hasClass("active")) { 318 319 // DK17012018 Wurde deaktiviert, da man hier zum Top Scrollt wenn die 320 // Suche geöffnet wird. 321 //$("html,body").stop(true, true).animate({scrollTop : 0}, 400); 322 } 323 324 // for special popup ( search ) 325 if (id == "filter-popup") { 326 $("#"+id).closest('.site-search').find('.search-form-wrap').toggleClass('open'); 327 $('.popup-detail').toggleClass("active"); 328 if($(".search-form-wrap").hasClass("open")) { 329 } 330 } else { 331 $('.site-search').find('.search-form-wrap').removeClass('open'); 332 $('.popup-detail').removeClass("active"); 333 } 334 e.stopPropagation(); 335 }); 336 337 $(".item-switch").hover(function (){ 338 v = true; 339 }, function () { 340 v = false; 341 }); 342 343 $("html,body").click(function () { 344 if(v === false) { 345 $(".btn-switch").removeClass("active"); 346 $(".item-switch").removeClass("open"); 347 } 348 }); 349 }, 350 351 352 PX_menuDropdown: function() { 353 //'use strict'; 354 355 global(); 356 function global() { 357 $(".site-menu:not(.nav-toggle-tablet) > ul > .has-profile").click(function () { 358 $(this).find("ul").stop(true, true).fadeToggle(200); 359 $(this).toggleClass("active"); 360 $(".site-search").removeClass("open"); 361 }); 362 } 363 $(".nav-toggle-tablet ul .has-profile").click(function (e) { 364 $('.search-form-wrap, .filter-popup').removeClass('open'); 365 $('#subpage_detailsearch_preview').attr('data-subpageOpenDetail',-1); 366 $('.dropdown-carousel').removeClass('open'); 367 $(this).find("ul").fadeToggle(200); 368 $(this).find(".btn-profile").toggleClass("active"); 369 $(".site-search").removeClass("open"); 370 e.stopPropagation(); 371 }); 372 }, 373 374 375 PX_checkbox: function () { 376 //'use strict'; 377 var page = $("#site-container").data("page"); 378 379 $(".checkbox-selection .checkbox").each(function () { 380 if ($(this).is(':disabled')) { 381 $(this).next().addClass("disabled"); 382 $(this).prev().addClass("disabled"); 383 } 384 if($(this).is(':checked')) { 385 $(this).prev().addClass("checked"); 386 } 387 }); 388 389 // DK24022017 $(".checkbox-selection .overlay-checked:not('.disabled')").unbind("click"). 390 391 $(".checkbox-selection .overlay-checked").unbind("click").click(function () {
392 var overlay = $(this); 393 394 if(!overlay.hasClass("forcedisabled")){ 395 overlay.toggleClass("checked"); 396 overlay.next().prop("checked" , true); 397 398 if(!(overlay.hasClass("checked"))) { 399 overlay.next().prop("checked", false); 400 } 401 402 403 404 405 if(overlay.hasClass("parents-checked checked")) { 406 overlay.closest(".checkbox-selection") 407 .find(".overlay-checked") 408 .addClass("checked"); // DK24022017 .find(".overlay-checked:not('.disabled')") 409 410 overlay.closest(".checkbox-selection") 411 .find(".overlay-checked") 412 .next().prop("checked", true); // DK24022017 .find(".overlay-checked:not('.disabled')") 413 } 414 415 // Workaround to trigger the onclick event of the "real" checkbox input 416 var element = $(this).next(); 417 if(element.attr("callback")){ 418 window[element.attr("callback")](element); 419 } 420 } 421 }); 422 423 }, 424 425 PX_radiobox: function() { 426 427 $(".radiobox-selection .radiobox").each(function () { 428 if ($(this).is(':disabled')) { 429 $(this).prev().addClass("disabled"); 430 } 431 if($(this).is(':checked') === true) { 432 $(this).prev().find(".overlay-checked").addClass("checked"); 433 } 434 }); 435 436 $(".radiobox-selection .radio-checked:not('.disabled')").click(function() { 437 438 $(this).next().prop("checked", "checked"); 439 440 $('.radiobox-selection .radiobox').each(function(){ 441 if ($(this).is(':checked')) { 442 $(this).prev().find(".overlay-checked").addClass('checked'); 443 } else { 444 $(this).prev().find(".overlay-checked").removeClass('checked'); 445 } 446 }); 447 448 // Workaround to trigger the onclick event of the "real" radio input 449 var element = $(this).next(); 450 if(element.attr("callback")){ 451 window[element.attr("callback")](element); 452 } 453 454 }); 455 }, 456 457 PX_excerptPost: function() { 458 // 'use strict'; 459 460 $('.text-down').each(function () { 461 if($(this).hasClass("slide-location")) { 462 $(this).pascutter({ 463 toggle : { 464 open: '<span class="icon icon-down"></span>', 465 close: '<span class="icon icon-down"></span>', 466 classes: 'excerpt-more' 467 }, 468 height: 90 469 }); 470 } else { 471 $(this).pascutter({ 472 toggle : { 473 open: '<span class="icon icon-down"></span>', 474 close: '<span class="icon icon-down"></span>', 475 classes: 'excerpt-more' 476 }, 477 height: 100 478 }); 479 } 480 }); 481 }, 482 483 /** 484 $("#myCarousel").flexisel({ 485 visibleItems: 4, 486 itemsToScroll: 3, 487 animationSpeed: 400, 488 infinite: true, 489 navigationTargetSelector: null, 490 autoPlay: { 491 enable: false, 492 interval: 5000, 493 pauseOnHover: true 494 }, 495 responsiveBreakpoints: { 496 portrait: { 497 changePoint:480, 498 visibleItems: 1, 499 itemsToScroll: 1 500 }, 501 landscape: { 502 changePoint:640, 503 visibleItems: 2, 504 itemsToScroll: 2 505 }, 506 tablet: { 507 changePoint:768, 508 visibleItems: 3, 509 itemsToScroll: 3 510 } 511 } 512 }); 513 **/ 514 PX_carouselPost: function() { 515 //'use strict'; 516 517 if( $().flexisel ) { 518 519 520 521 $(".carousel-post").flexisel({ 522 visibleItems: 3, 523 itemsToScroll: 1, 524 autoPlay: false, 525 animationSpeed: 700, /**5000**/ 526 navigationTargetSelector: null, 527 enableResponsiveBreakpoints: true, 528 responsiveBreakpoints: { 529 portrait: { 530 changePoint:773, 531 visibleItems: 1 532 }, 533 tablet: { 534 changePoint:1029, 535 visibleItems: 2 536 } 537 } 538 }); 539 setTimeout(lazyload,1000); 540 } 541 }, 542 543 PX_carouselDropdown: function () { 544 // 'use strict'; 545 546 $(".carousel-world").each(function () { 547 $(this).flexisel({ 548 visibleItems: 6, 549 autoPlay: { enable: true, interval: 7000, pauseOnHover: true }, 550 itemsToScroll: 1, 551 animationSpeed : 400, 552 autoPlaySpeed : 6000, 553 enableResponsiveBreakpoints: true, 554 responsiveBreakpoints: { 555 portrait: { 556 changePoint:705, 557 visibleItems: 1 558 }, 559 tablet: { 560 changePoint:1029, 561 visibleItems: 4 562 }, 563 smallDesktop: { 564 changePoint:1250, 565 visibleItems: 5 566 } 567 } 568 }); 569 }); 570 571 $(".carousel-info").each(function () { 572 $(this).flexisel({ 573 visibleItems: 5, 574 autoPlay: { enable: false, interval: 7000, pauseOnHover: true }, 575 animationSpeed : 3000, 576 itemsToScroll: 1, 577 578 enableResponsiveBreakpoints: true, 579 responsiveBreakpoints: { 580 portrait: { 581 changePoint:705, 582 autoPlay: true, 583 visibleItems: 1 584 }, 585 tablet : { 586 changePoint: 1029, 587 visibleItems: 3 588 } 589 }, 590 loaded: function(object) { setTimeout( function() { object.css({'left': 0})}, 1500); } 591 }); 592 }); 593 }, 594 595 PX_dropdownSlider: function () { 596 // 'use strict'; 597 598 $(".nav-toggle-tablet .has-dropdownSlider").click(function () { 599 var id = $(this).children().data("id"); 600 var topdefault = $(window).scrollTop(); 601 if(topdefault >= 1) { 602 $("#"+id).css({"margin-top": (topdefault+$(".nav-toggle-tablet .has-dropdownSlider").outerHeight()+8)+ "px"}); 603 }else { 604 $("#"+id).css({"margin-top": "30px"}); 605 } 606 $("#"+id).removeClass("none-transition"); 607 $(window).scroll(function () { 608 var top = $(this).scrollTop(); 609 $("#"+id).addClass("none-transition"); 610 if(top >= 1) { 611 $("#"+id).css({"margin-top": (top+$(".nav-toggle-tablet .has-dropdownSlider").outerHeight()+8)+ "px"}); 612 } else if(top < 1) { 613 $("#"+id).css({"margin-top": "30px"}); 614 } 615 }); 616 }); 617 var visited = false; 618 $(".has-dropdownSlider").click(function (e) { 619 $(".site-search").removeClass("open"); 620 621 $('.search-form-wrap, .filter-popup').removeClass('open'); 622 $('#subpage_detailsearch_preview').attr('data-subpageOpenDetail',-1); 623 624 625 $('.has-profile > ul').hide(); 626 $('.has-profile .btn-profile').removeClass('active'); 627 628 $(this).find("a").toggleClass("active"); 629 $(".has-dropdownSlider").not(this).find("a").removeClass("active"); 630 $(".has-dropdownSlider").not(this).removeClass("active"); 631 var id = $(this).find(".active").data("id"), 632 li = $(this); 633 634 $(".has-dropdownSlider a").each(function () { 635 $("#"+$(this).data("id")).removeClass("open"); 636 }); 637 638 $("#" + id).toggleClass("open"); 639 li.toggleClass("active"); 640 e.stopPropagation(); 641 }); 642 643 $(".dropdown-carousel").hover(function () { 644 return ( visited = true ); 645 }, function () { 646 return ( visited = false ); 647 }); 648 649 $("html,body").click(function () { 650 if (visited === false) { 651 $(".dropdown-carousel").removeClass("open"); 652 $(".has-dropdownSlider").removeClass("active"); 653 $(".has-dropdownSlider a").removeClass("active"); 654 } 655 }); 656 }, 657 658 PX_dropDown: function() { 659 // 'use strict'; 660 661 $('.dropdown-toggle').unbind("click").click( function( evt ) { 662 663 var $parent = $( evt.currentTarget ).closest('.dropdown'); 664 665 666//console.log( $parent ); 667 668 if( $parent.hasClass('multiple-selections') && $parent.hasClass('open')) return; 669 670 if($parent.hasClass("open")){
671 window.sendRequestRecherche(); 672 window.fillSelectFieldsRecherche(); 673 } 674 675 $('.dropdown').not($parent).removeClass('open'); 676 $parent.toggleClass('open'); 677 678 // var masonry = $(this).next().find('.dropdown-list').masonry({ 679 // columnWidth: 'li', 680 // itemSelector : 'li', 681 // transitionDuration: 0 682 // }); 683 684 window.DK($parent); 685 686 687 /**/ 688 return false; 689 690 }); 691 692 $( 'body' ).unbind("click").click(function(e) { 693 694 var el = $(e.target); 695 696 if ( !el.hasClass('dropdown-modal') && !el.parents('.dropdown-menu').hasClass('dropdown-modal') ){ 697 if($("#filter-popup").find('.dropdown').hasClass("open")){ 698 window.sendRequestRecherche(); 699 window.fillSelectFieldsRecherche(); 700 } 701 $('.dropdown').removeClass('open'); 702 703 } 704 }); 705 706 $('.dropdown-menu:not(.dropdown-modal) li').unbind("click").click(function( event ) { 707 708 var $target = $( event.currentTarget ).find('.txt'); 709 710 if( $target.hasClass("no-data") ) return; 711 712 var dropdown = $target.closest( '.btn-group' ) 713 .find( '[data-bind="label"]' ).html( $target.html() ) 714 .end() 715 .closest('.dropdown'); 716 717 dropdown.removeClass('open') 718 .find('.dropdown-menu li').removeClass('selected'); 719 720 $(this).addClass('selected'); 721 722 /** 723 * Workaround to have a possibility to use the selected item. 724 */ 725 726 if( dropdown.data("callback")) { 727 window[dropdown.data("callback")]($target); 728 } 729 730 return false; 731 732 }); 733 734 $('.dropdown-menu li.selected').each(function(){ 735 var $target = $(this).find('.txt'); 736 $target.closest('.btn-group').find( '[data-bind="label"]' ).html( $target.html() ); 737 }); 738 739 /*$('.dropdown-check .btn-reset-check').unbind("click").click(function() { 740 $(this).closest('.dropdown-check') 741 .find('.checkbox-selection .overlay-checked').removeClass("checked").next().prop("checked", false); 742 return false; 743 });*/ 744 745 }, 746 747 PX_menuDropDown: function() { 748 749 $('.menu-dropdown').each(function(){ 750 var menuHasChild = $(this).find('li'); 751 752 menuHasChild.each(function(){ 753 if ( $(this).find('ul').length > 0 ){ 754 $(this).addClass('has-child'); 755 756 if ( !$(this).find('a').hasClass('open') ) 757 $(this).find('ul').hide(); 758 } 759 }); 760 761 $(this).find('.has-child > a').click(function(e){ 762 $(this).toggleClass('open').next('ul').stop(true, true).slideToggle(); 763 return false; 764 }); 765 766 }); 767 768 }, 769 770 PX_fancyPopup: function () { 771 772 if( $().fancybox ) { 773 $('.fancybox-media').fancybox({ 774 padding : 0, 775 height : 'auto', 776 autoSize : false, 777 scrolling : 'no', 778 779 tpl : { 780 closeBtn : '<div class="close-wrap"><a title="Close" class="fancybox-item popup-close btn btn-action" href="javascript:;"><span class="icon icon-close"></span>Schliessen</a></div>' 781 }, 782 helpers : { 783 overlay : { 784 css : {'background': 'rgba(255, 255, 255, 0.95)'} 785 } 786 }, 787 afterLoad: function() { 788 $(this.wrap).addClass($(this.element).data('wrapper')); 789 if ( this.title === "" ) $(this.wrap).find('.fancybox-outer').addClass('no-title'); 790 dkVideoRatioCheck(); 791 } 792 }); 793 } 794 795 }, 796 797 PX_contentSlideDown: function() { 798 799 $('.toggle-slide-down').unbind("click").bind("click", function() { 800 var evt = $(this), 801 par = evt.parents('.container-slide-down'), 802 target = par.find('.content-slide-down'), 803 alternatives_layer = target.siblings(".alternative-content-slide-down"), 804 is_ongoing = evt.data("isongoing") === true; 805 806 807 808 // if alternative reisen layer is visible, hide it first 809 if( alternatives_layer.is(':visible') ) { 810 alternatives_layer.removeClass('active'); 811 par.removeClass('open'); 812 alternatives_layer.slideUp(); 813 } 814 815 816 817 if( target.find(".dates-loader").length > 0 ) { 818 819 if( !!target.data("idobject") ) { 820 $.ajax({
821 url: "/?pm=uebersicht&action=crusiedates&idobject=" + target.data("idobject") + "&isOngoingCruise=" + is_ongoing, 822 }) 823 .done( function( data ) { 824 target.find(".dates-loader").replaceWith(data); 825 /* 826 setTimeout( function() { 827 target.stop(true, true).slideToggle(50, function(){ 828 if ( $('.result-date-item').length > 0 ) 829 window.PX.PX_resultDateItem(); 830 831 evt.toggleClass('active'); 832 par.toggleClass('open'); 833 }); 834 }, 100 ) 835 */ 836 $('html, body').animate({ scrollTop: (par.offset().top)}, 'slow'); 837 target.toggleClass("show"); 838 evt.toggleClass('active'); 839 par.toggleClass('open'); 840 841 842 843 window.PX.PX_bootstrap(); 844 }); 845 } 846 } else { 847 /* 848 target.stop(true, true).slideToggle(50, function(){ 849 if ( $('.result-date-item').length > 0 ) 850 window.PX.PX_resultDateItem(); 851 852 evt.toggleClass('active'); 853 par.toggleClass('open'); 854 }); 855 */ 856 $('html, body').animate({ scrollTop: (par.offset().top)}, 'slow'); 857 target.toggleClass("show"); 858 evt.toggleClass('active'); 859 par.toggleClass('open'); 860 861 862 } 863 864 }); 865 866 return this; 867 }, 868 869 PX_alternativeSlideDown: function() { 870 871 872 $('.toggle-slide-down-alternative').unbind("click").bind("click", function() { 873 var evt = $(this), 874 par = evt.parents('.container-slide-down'), 875 target = par.find('.alternative-content-slide-down'), 876 dates_layer = target.siblings(".date-item-dropdown"); 877 878 879 // if cruise dates layer is visible, hide it first 880 if( dates_layer.is(':visible') ) { 881 dates_layer.removeClass('show'); 882 par.removeClass('open'); 883 //dates_layer.slideUp(); 884 } 885 886 evt.toggleClass('active'); 887 par.toggleClass('open'); 888 target.stop(true, true).slideToggle(500, function(){ 889 if ( $('.result-date-item').length > 0 ) 890 window.PX.PX_resultDateItem(); 891 }); 892 893 if( target.find(".alternatives-loader").length > 0 ) { 894 895 if( !!target.data("idobjects") ) { 896 $.ajax({
897 url: "/?pm=uebersicht&action=alternatives&idlist=" + target.data("idobjects"), 898 }) 899 .done( function( data ) { 900 target.find(".alternatives-loader").replaceWith(data); 901 window.PX.PX_bootstrap(); 902 903 // Load images 904 lazyload(); 905 }); 906 } 907 } 908 909 }); 910 911 return this; 912 }, 913 914 915 PX_bootstrap : function (){ 916 917 if( $().tooltip ) { 918 919 $('.ball-popover').tooltip({ 920 container : 'body', 921 922 c : function(context, source){ 923 var elem = $(source), 924 position = elem.offset(), 925 posleft = position.left, 926 posRight = ($(window).width() - (elem.outerWidth() + position.left) ); 927 928 if ( posleft < 150 && posRight < 150 ) { 929 return 'top'; 930 } else if ( posRight < 150 ) { 931 return 'left'; 932 } else { 933 return 'right'; 934 } 935 936 }, 937 delay: {show: 50, hide: 300}, 938 /**/ 939 trigger : 'hover', 940 template : '<div class="tooltip tooltip-ball" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' 941 }); 942 943 $('.entry-tooltip').tooltip({ 944 container : 'body', 945 placement : function(context, source){ 946 var elem = $(source), 947 position = elem.offset(), 948 posLeft = position.left, 949 posRight = ($(window).width() - (elem.outerWidth() + position.left) ); 950 951 console.log(posLeft, posRight) 952 953 if (posLeft < 220 && posRight < 220 ) { 954 return 'top'; 955 } else if ( posRight < 220 ) { 956 return 'left'; 957 } else { 958 return 'right'; 959 } 960 961 }, 962 delay: {show: 50, hide: 300}, 963 trigger : 'hover', 964 template : '<div class="tooltip tooltip-ball tooltip-text" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' 965 }); 966 } 967 968 }, 969 970 PX_resultDateItem: function() { 971 972 var setContentHeight = function() { 973 974 $('.result-date-item .item-inner').each(function(){ 975 var parent = $(this).parent(), 976 pos = parent.find('.detail-item').css('position'); 977 978 if ( pos == 'absolute' ) { 979 $(this).children('.content-item').css('min-height', $(this).children('.detail-item').outerHeight()); 980 } else { 981 $(this).children('.content-item').css('min-height', 0); 982 } 983 }); 984 }; 985 986 setContentHeight(); 987 $(window).resize(function(){setContentHeight();}); 988 989 }, 990 991 PX_tabContent: function() { 992 993 $('.tab-nav .nav').click(function(e){ 994 995 var evt = $(this), 996 id = evt.attr('data-tab'), 997 nav = evt.parents('.tab-nav'), 998 container = evt.parents('.tab-container'), 999 content = container.find('.tab-content'); 1000 1001 if ( evt.hasClass('active') ) 1002 return false; 1003 1004 nav.find('.nav').removeClass('active'); 1005 evt.addClass('active'); 1006 1007 content.removeClass('fade-in'); 1008 var fadeIn = setTimeout(function(){ 1009 content.removeClass('open'); 1010 container.find('#'+id).addClass('open fade-in'); 1011 clearTimeout(fadeIn); 1012 }, 320); 1013 1014 e.preventDefault(); 1015 1016 }); 1017 1018 }, 1019 1020 PX_collapse: function() { 1021 1022 $('.collapse-toggle').off("click").click(function(e){
1023 var parent = $(this).data('parent'), 1024 parent_evt = $(this).parents('.collapse-container'), 1025 content = parent_evt.find('.collapse-content'); 1026 1027 $('.collapse-toggle-all[data-target="'+ parent +'"]').removeClass('open'); 1028 1029 1030 $(parent).find('.collapse-container').not(parent_evt).removeClass('open'); 1031 parent_evt.toggleClass('open'); 1032 1033 $(parent).find('.collapse-content').not(content).stop(true, true).slideUp(300); 1034 $(this).parents('.collapse-container') 1035 .find('.collapse-content').stop(true, true).slideToggle(300, function() { 1036 if( $(this).is(":visible") ) { 1037 $('html,body').animate({ 1038 scrollTop: $(this).offset().top - 140 1039 }, 200); 1040 } 1041 }); 1042 1043 e.preventDefault(); 1044 return false; 1045 }); 1046 1047 $('.collapse-toggle-all').off("click").click(function(e){ 1048 var obj = $(this); 1049 var target = $(this).data('target'); 1050 console.log(target); 1051 1052 1053 if ( $(this).hasClass('open') ) 1054 $(target).find('.collapse-container').removeClass('open') 1055 .find('.collapse-content').stop(true, true).slideUp(function(){ 1056 if(obj.hasClass("phx_txt_switch")) 1057 obj.find(".txt").html(obj.find(".txt").attr("data-txtopen")); 1058 }); 1059 else 1060 $(target).find('.collapse-container').addClass('open') 1061 .find('.collapse-content').stop(true, true).slideDown(function(){ 1062 if(obj.hasClass("phx_txt_switch")) 1063 obj.find(".txt").html(obj.find(".txt").attr("data-txtclose")); 1064 }); 1065 1066 $(this).toggleClass('open'); 1067 1068 e.preventDefault(); 1069 return false; 1070 }); 1071 1072 }, 1073 1074 PX_collapse2: function() { 1075 1076 1077 $('.verlauf-toggle').off("click").click(function(e) { 1078 /* 1079 var elem = $(this), 1080 parent = elem.data('parent'), 1081 parent_evt = elem.parents('tr[class^=alter]'), 1082 container = parent_evt.next('.verlauf-container'); 1083 */ 1084 var elem = $(this), 1085 parent = elem.data('parent'), 1086 parent_evt = $(this).closest('tr'), // elem.parents('tr[class^=alter]'), 1087 container = parent_evt.next('.verlauf-container'); 1088 1089 $('.verlauf-toggle-all[data-target="'+ parent +'"]').removeClass('open'); 1090 1091 1092 1093 1094 if( elem.hasClass('open') ) { 1095 elem.removeClass('open'); 1096 container.find('.verlauf-content').stop(true, true).slideUp(300, function() { 1097 container.hide(); 1098 }); 1099 1100 return; 1101 } 1102 1103 1104 1105 1106 $(parent).find('.verlauf-toggle').not( elem ).removeClass('open'); 1107 1108 elem.toggleClass('open'); 1109 1110 $(parent).find('.verlauf-container').not(container).hide(); 1111 //$(parent).find('.verlauf-container').hide() 1112 1113 container.show().find('.verlauf-content').stop(true, true).slideDown(300, function() { 1114 console.info(this); 1115 1116 if( $(this).is(":visible")) { 1117 $('html,body').animate({ 1118 scrollTop: $(this).offset().top - 140 1119 }, 200); 1120 } 1121 if( !$(this).is(":visible") ) { 1122 container.hide(); 1123 } 1124 }); 1125 1126 e.preventDefault(); 1127 return false; 1128 }); 1129 1130 $('.verlauf-toggle-all').off("click").click(function(e){ 1131 var obj = $(this); 1132 var target = $(this).data('target'); 1133 1134 if ( $(this).hasClass('open') ) { 1135 $(target).find("a.verlauf-toggle").removeClass("open"); 1136 1137 $(target).find('.verlauf-container') 1138 .find('.verlauf-content').stop(true, true).slide
1138Up(300, function() { 1139 $(this).parents(".verlauf-container").hide(); 1140 }); 1141 1142 if(obj.hasClass("phx_txt_switch")) 1143 obj.find(".txt").html(obj.find(".txt").attr("data-txtopen")); 1144 } 1145 else { 1146 $(target).find("a.verlauf-toggle").addClass("open"); 1147 1148 $(target).find('.verlauf-container').show() 1149 .find('.verlauf-content').stop(true, true).slideDown(); 1150 $(target).find('.verlauf-container-hide').hide(); //gh 20180411 1151 1152 if(obj.hasClass("phx_txt_switch")) 1153 obj.find(".txt").html(obj.find(".txt").attr("data-txtclose")); 1154 } 1155 1156 $(this).toggleClass('open'); 1157 1158 e.preventDefault(); 1159 return false; 1160 }); 1161 1162 }, 1163 PX_ScrollNav: function() { 1164 1165 var nav = $('.sticky-scroll-nav'), 1166 anchor = $('.sticky-scroll-anchor'), 1167 mind = $('.container-nav-touch'), 1168 line = $('.site-media .line-transparent'); 1169 1170 if ( nav.length < 1 ) 1171 return false; 1172 1173 // Sticky function 1174 var navMind = 0; 1175 1176 if ( mind.css('display') == 'block' ) 1177 navMind = mind.outerHeight() + line.height(); 1178 1179 1180 1181 $(window).resize(function(){ 1182 navMind = 0; 1183 if ( mind.css('display') == 'block' ) 1184 navMind = mind.outerHeight() + line.height(); 1185 1186 var navTop = anchor.offset().top - navMind; 1187 }); 1188 $(window).on('scroll touchstart touchmove', function(){ 1189 1190 var navTop = anchor.offset().top - navMind; 1191 1192 if ( $(window).scrollTop() >= navTop ) { 1193 nav.addClass('fixed'); 1194 } 1195 else { 1196 nav.removeClass('fixed'); 1197 } 1198 }); 1199 1200 // Clik scroll function 1201 nav.find('li a').click(function(e){ 1202 var target = $(this).attr('href'), 1203 targetTop = $(target).offset().top; 1204 1205 if ( typeof targetTop != 'undefined' ) 1206 $('html, body').stop(true, true).animate({'scrollTop' : targetTop - nav.outerHeight() - navMind}, 500, function() { targetTop = $(target).offset().top; $('html, body').stop(true, true).animate({'scrollTop' : targetTop - nav.outerHeight() - navMind}, 500); }); 1207 1208 e.preventDefault(); 1209 return false; 1210 }); 1211 1212 }, 1213 1214 PX_elementFixTo: function() { 1215 $('.entry-fixto').fixTo('.entry-fixUp', { 1216 mind: '.entry-fixMind', 1217 top: 20 1218 }); 1219 $('.fixto').fixTo('.entry-fixUp', { 1220 mind: '.entry-fixMind', 1221 top: 50 1222 }); 1223 1224 }, 1225 1226 PX_draggableNav: function() { 1227 1228 var $draggable = $( ".draggable-nav" ); 1229 if($(window).width() > 570) { 1230 $(".draggable-zoom").css({"margin-top": -554.5 }); //-359.333 1231 1232 } 1233 $(window).resize(function () { 1234 if($(this) > 570) { 1235 $(".draggable-zoom").css({"margin-top": -554.5 }); //-359.333 1236 } 1237 }); 1238 $draggable.css( {"top":"50%", "transform": "translateY(-50%)" } ); 1239 1240 // Draggabillies Kabin Deck 1241 1242 1243 for ( var i=0, len = $draggable.length; i < len; i++ ) { 1244 $draggable.eq(i).attr("id", "draggie-"+i); 1245 1246 1247 1248 $("#draggie-"+i.toString()).draggabilly({ 1249 axis: "y", 1250 containment: $(this).parent(".drag-area") 1251 }); 1252 1253 1254 1255 $("#draggie-"+i.toString()).on( 'dragMove', function(){ 1256 1257 var draggie = $(this).data('draggabilly'), 1258 containerHeight = $(this).closest('.draggable-container').find('.draggable-zoom').outerHeight(), 1259 draggableHeight = $(this).closest('.draggable-container').find('.draggable-target').outerHeight(), 1260 1261 1262 zoom = containerHeight / draggableHeight; 1263 1264 1265 1266 $(this).closest('.draggable-container').find('.draggable-zoom') 1267 .css({ 1268 'margin-top' : - ( draggie.position.y * zoom ) 1269 }); 1270 1271 }); 1272 } 1273 1274 1275 // LOCATION DRAG 1276 1277 if ( $(".location-drag").length < 1 ) 1278 return false; 1279 1280 var $locationdrag = $( ".location-drag .drag-nav" ).draggabilly({ 1281 axis: "x", 1282 containment: ".drag-area" 1283 }); 1284 1285 1286 1287 1288 // Set inital data. 1289 $locationdrag.find('.drag-popover').addClass('open'); 1290 1291 var today = $('.drag-line-inner .line-day:last'), 1292 date = today.data('date'), 1293 place = today.data('place'); 1294 1295 $locationdrag.find('.drag-popover .popover-title').html( date ); 1296 $locationdrag.find('.drag-popover .popover-content').html( place ); 1297 1298 var draggie = $locationdrag.data('draggabilly'), 1299 line = $locationdrag.closest('.location-drag').find('.drag-line-inner'), 1300 left = line.position().left; 1301 1302 1303 // Dragger richtig positionieren start DK 20151020 1304 // Für Dragger 1305 $locationdrag.css("left",(parseInt(($locationdrag.parent().css("width")).replace("px", ""))-24) + "px"); 1306
1307 // Für Zeitstrahl 1308 if($(window).width()<768) 1309 $(".drag-line-inner").css("left", "-" + ((line.css("width")).replace("px", "")-($locationdrag.parent().outerWidth())) + "px"); 1310 else 1311 $(".drag-line-inner").css("left", "-" + ((line.css("width")).replace("px", "")-($locationdrag.parent().outerWidth()+78)) + "px"); 1312 // Dragger richtig positionieren ende 1313 1314 var dragPopoverPos = function() { 1315 1316 if ( draggie.position.x < ($locationdrag.find('.drag-popover').outerWidth() / 2) ){ 1317 $locationdrag.addClass('left'); 1318 } else { 1319 $locationdrag.removeClass('left'); 1320 } 1321 1322 if (draggie.position.x > ($locationdrag.parent().outerWidth() - $locationdrag.width() - ($locationdrag.find('.drag-popover').outerWidth() / 2))) { 1323 $locationdrag.addClass('right'); 1324 } else { 1325 $locationdrag.removeClass('right'); 1326 } 1327 1328 $('.drag-line-inner .line-day').map(function(){ 1329 1330 1331 if ( $(this).offset().left >= $locationdrag.offset().left && $(this).offset().left <= $locationdrag.offset().left + ( $(this).outerWidth() ) ) { 1332 var date = $(this).data('date'), 1333 place = $(this).data('place'); 1334 1335 $locationdrag.find('.drag-popover .popover-title').html(date); 1336 $locationdrag.find('.drag-popover .popover-content').html(place); 1337 1338 $locationdrag.data("day", this); 1339 } 1340 }); 1341 1342 }; 1343 1344 /* 1345 var overlaps = (function () { 1346 function getPositions( elem ) { 1347 var pos, width, height; 1348 pos = $( elem ).position(); 1349 width = $( elem ).width(); 1350 height = $( elem ).height(); 1351 return [ [ pos.left, pos.left + width ], [ pos.top, pos.top + height ] ]; 1352 } 1353 1354 function comparePositions( p1, p2 ) { 1355 1356 var r1, r2; 1357 r1 = p1[0] < p2[0] ? p1 : p2; 1358 r2 = p1[0] < p2[0] ? p2 : p1; 1359 return r1[1] > r2[0] || r1[0] === r2[0]; 1360 } 1361 1362 return function ( a, b ) { 1363 var pos1 = getPositions( a ), 1364 pos2 = getPositions( b ); 1365 return comparePositions( pos1[0], pos2[0] ) && comparePositions( pos1[1], pos2[1] ); 1366 }; 1367 })(); 1368 */ 1369 var timeLeft = null, 1370 timeRight = null; 1371 1372 $locationdrag.on( 'dragMove', function(e, p, mv) { 1373 var less = 5; 1374 1375 //$locationdrag.find('.drag-popover').removeClass('open'); 1376 var dragNav = $(this); 1377 1378 if ( draggie.position.x === 0 ){ 1379 1380 if ( timeLeft === null ) { 1381 timeLeft = setInterval(function(){ 1382 left = left + less; 1383 line.css({ 1384 'left' : left 1385 }); 1386 1387 if ( line.position().left > dragNav.parent().position().left ) 1388 clearInterval(timeLeft); 1389 }, 5); 1390 } 1391 } else { 1392 clearInterval(timeLeft); 1393 timeLeft = null; 1394 } 1395 1396 1397 if ( draggie.position.x == ($(this).parent().outerWidth() - $(this).width()) ){ 1398 if ( timeRight === null ) { 1399 timeRight = setInterval(function(){ 1400 1401 left = left - less; 1402 line.css({ 1403 'left' : left 1404 }); 1405 1406 if ( line.position().left < ((dragNav.closest('.location-drag').outerWidth() - dragNav.parent().position().left ) - line.outerWidth()) ) 1407 clearInterval(timeRight); 1408 }, 5);
1409 } 1410 } else { 1411 clearInterval(timeRight); 1412 timeRight = null; 1413 } 1414 1415 dragPopoverPos(); 1416 1417 1418 1419 1420 1421 }); 1422 1423 1424 $locationdrag.on( 'dragEnd', function(e, p){ 1425 1426 1427 /* 1428 $('.drag-line-inner .line-day').map(function(){ 1429 var day = this; 1430 1431 if ( $(this).offset().left >= $locationdrag.offset().left && $(this).offset().left <= $locationdrag.offset().left + ( $(this).outerWidth() ) ) { 1432 var date = $(this).data('date'), 1433 place = $(this).data('place'); 1434 1435 $locationdrag.find('.drag-popover .popover-title').html(date); 1436 $locationdrag.find('.drag-popover .popover-content').html(place); 1437 $locationdrag.find('.drag-popover').addClass('open'); 1438 1439 // Get file name from date 1440 var dateparts = date.split("."); 1441 var data_selected = dateparts[2] + "-" + dateparts[1] + "-" + dateparts[0]; 1442 var filename = data_selected + ".txt"; 1443 updateShipInfoForDate( data_selected ) 1444 updateShipPositions( filename ); 1445 1446 1447 } 1448 }); 1449 */ 1450 var day = $($locationdrag.data("day")); 1451 1452 var date = day.data('date'); 1453 1454 // Get file name from date 1455 var dateparts = date.split("."); 1456 var data_selected = dateparts[2] + "-" + dateparts[1] + "-" + dateparts[0]; 1457 //var filename = data_selected + ".txt"; 1458 window.updateShipInfoForDate( data_selected ); 1459 //updateShipPositions( filename ); 1460 1461 }); 1462 1463 1464 dragPopoverPos(); 1465 1466 }, 1467 1468 PX_scrollSpace: function() { 1469 // 'use strict'; 1470 1471 $(".space-area").scroll(function () { 1472 $(this).prev().fadeOut(200); 1473 clearTimeout($.data(this, 'scrollTimer')); 1474 $.data(this, 'scrollTimer', setTimeout(function() { 1475 $(".space-area").prev().fadeIn(200); 1476 }, 200)); 1477 }); 1478 1479 }, 1480 1481 PX_visibleOverflow: function () { 1482 //'use strict'; 1483 1484 var content = $(".content-Overflow"), 1485 btn = $(".btn-Overflow"); 1486 $(content).css({"max-height" : "70px"}); 1487 1488 btn.click(function () { 1489 var style = { 1490 Height : $(this).prev().children().height(), 1491 speed: 500 1492 }; 1493 $(this).toggleClass("active"); 1494 $(this).prev().toggleClass("visible"); 1495 1496 if($(this).prev().hasClass("visible")) 1497 $(this).prev().stop().animate({"max-height" : style.Height + "px"}, style.speed); 1498 else 1499 $(this).prev().animate({"max-height" : "70px"}, style.speed); 1500 }); 1501 }, 1502 1503 PX_widgetCollapse: function() { 1504 // 'use strict'; 1505 1506 var btn = $(".widget-collapse"); 1507 1508 $(".widget-content-collapse").each(function () { 1509 if($(this).hasClass("open")) { 1510 $(this).slideDown(); 1511 $(this).prev(".widget-collapse").addClass("active"); 1512 } 1513 }); 1514 btn.click(function () { 1515 $(this).toggleClass("active"); 1516 1517 var content = $(this).data("content"); 1518 $("#"+content).toggleClass("open"); 1519 1520 if ($("#"+content).hasClass("open")) 1521 $("#"+content).stop(true).slideDown(500); 1522 else 1523 $("#"+content).stop(true).slideUp(200); 1524 }); 1525 }, 1526 1527 PX_worldMap: function() { 1528 if( $('.worldmap-container .icon-worldmap').length > 0 ) { 1529 $('.worldmap-container .icon-worldmap').fitText(0.17); 1530 } 1531 }, 1532 1533 PX_boardHeight: function() { 1534 var elem = $('.location-board .board-column .board-item'), 1535 setHeight = function() { 1536 var heights = elem.map(function(){ 1537 return $(this).outerHeight(); 1538 }).get(), 1539 1540 maxHeight = Math.max.apply(null, heights); 1541 1542 $('.location-board .board-column').height(maxHeight); 1543 }; 1544 1545 setHeight(); 1546 $(window).resize(function(){setHeight();}); 1547 1548 }, 1549 1550 PX_ieTester: function () { 1551 //'use strict'; 1552 1553 function getIEversion() { 1554 var rv = -1, 1555 ua = null, 1556 re = null; 1557 1558 if (navigator.appName == 'Microsoft Internet Explorer'){ 1559 ua = navigator.userAgent; 1560 re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 1561 if (re.exec(ua) !== null) 1562 rv = parseFloat( RegExp.$1 ); 1563 1564 } else if (navigator.appName == 'Netscape') { 1565 ua = navigator.userAgent; 1566 re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})"); 1567 if (re.exec(ua) !== null) 1568 rv = parseFloat( RegExp.$1 ); 1569 } 1570 return rv; 1571 } 1572 function checkVersion(){ 1573 var ver = getIEversion(); 1574 1575 if ( ver > -1 ){ 1576 $(".bg-blur-image").addClass("IE-blur"); 1577 } 1578 } 1579 checkVersion(); 1580 }, 1581 1582 ready: function () { 1583 1584 window.PX.PX_scrollSpace(); 1585 window.PX.PX_popupSearch(); 1586 window.PX.PX_excerptPost(); 1587 window.PX.PX_carouselPost(); 1588 window.PX.PX_slider(); 1589 window.PX.PX_toggleButton(); 1590 window.PX.PX_mobileFixNav(); 1591 window.PX.PX_checkbox(); 1592 window.PX.PX_radiobox();
1593 window.PX.PX_dropDown(); 1594 window.PX.PX_carouselDropdown(); 1595 window.PX.PX_dropdownSlider(); 1596 window.PX.PX_menuDropdown(); 1597 window.PX.PX_scrollTop(); 1598 window.PX.PX_switchButton(); 1599 window.PX.PX_menuDropDown(); 1600 window.PX.PX_fancyPopup(); 1601 window.PX.PX_contentSlideDown(); 1602 window.PX.PX_alternativeSlideDown(); 1603 window.PX.PX_bootstrap(); 1604 window.PX.PX_resultDateItem(); 1605 window.PX.PX_tabContent(); 1606 window.PX.PX_collapse(); 1607 window.PX.PX_collapse2(); 1608 window.PX.PX_ScrollNav(); 1609 //PX.PX_elementFixTo(); 1610 window.PX.PX_draggableNav(); 1611 window.PX.PX_visibleOverflow(); 1612 window.PX.PX_widgetCollapse(); 1613 window.PX.PX_worldMap(); 1614 window.PX.PX_boardHeight(); 1615 window.PX.PX_ieTester(); 1616 window.PX.PX_DesktopScroll(); 1617 1618 1619 1620 } 1621 1622 }; 1623 1624 $(window.PX.ready); 1625 1626})( window.jQuery ); 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651var map; 1652var mapkey = "PezamNmPGfsoerAT446z"; 1653var mapBasicMode = "CIC"; // "MAPTILER"; 1654 1655// Select maptiles via url: ?useCICTiles=1 OR ?useMaptilerTiles=1 1656if(window.location.href.indexOf("useCICTiles") > -1){ 1657 mapBasicMode = "CIC"; 1658} 1659if(window.location.href.indexOf("useMaptilerTiles") > -1){ 1660 mapBasicMode = "MAPTILER"; 1661} 1662 1663function initWoSindDieSchiffeHeute(){ 1664 $("body").addClass("wsdsh"); 1665 1666 if (mapBasicMode == "CIC") { 1667 var basic = L.tileLayer('https://phoenix.tiles.maporio.de/tile/{z}/{x}/{y}.png', { 1668 attribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors', 1669 minZoom: 1, 1670 maxZoom: 15, 1671 crossOrigin: true, 1672 scrollWheelZoom: true, 1673 }); 1674 } else { 1675 var basic = L.tileLayer('https://api.maptiler.com/maps/41a52c9b-e364-4133-a39a-18fec0e71940/{z}/{x}/{y}.png?key=' + mapkey, { 1676 attribution: '', 1677 tileSize: 512, 1678 zoomOffset: -1, 1679 minZoom: 1, 1680 maxZoom: 15, 1681 crossOrigin: true, 1682 scrollWheelZoom: true, 1683 }); 1684 } 1685 1686 var satallite = L.tileLayer('https://api.maptiler.com/maps/70ae15fb-46e2-4891-9829-b14f1803d8c9/{z}/{x}/{y}.jpg?key=' + mapkey, { 1687 attribution: '', 1688 tileSize: 512, 1689 zoomOffset: -1, 1690 minZoom: 1, 1691 maxZoom: 15, 1692 scrollWheelZoom: true, 1693 crossOrigin: true 1694 }); 1695 1696 1697 1698 map = L.map('map', { 1699 fullscreenControl: { 1700 pseudoFullscreen: false 1701 }, 1702 center: [49.593106,-17.444075], 1703 zoom: 4, 1704 maxZoom: 15, 1705 scrollWheelZoom: true, 1706 layers: [basic], 1707 updateInterval:200, 1708 updateWhenIdle:0, 1709 updateWhenZooming:0, 1710 keepBuffer:1000 1711 }); 1712 1713 var baseMaps = { 1714 "Karte": basic, 1715 "Satellit": satallite 1716 }; 1717 1718 L.control.layers(baseMaps,null,{collapsed:false}).addTo(map); 1719 1720 1721 showWoSindDieSchiffeHeute(); 1722} 1723function showWoSindDieSchiffeHeute(date){ 1724 1725 var IconShip1 = L.icon({ 1726 iconUrl: 'public/img/wosinddieschiffeheute/ship1.png', 1727 1728 iconSize: [60, 15], // size of the icon 1729 iconAnchor: [30, 7], // point of the icon which will correspond to marker's location 1730 popupAnchor: [0, -10] // point from which the popup should open relative to the iconAnchor 1731 }); 1732 var IconShip2 = L.icon({ 1733 iconUrl: 'public/img/wosinddieschiffeheute/ship2.png', 1734 1735 iconSize: [45, 12.5], // size of the icon 1736 iconAnchor: [22.5, 6.25], // point of the icon which will correspond to marker's location 1737 popupAnchor: [0, -10] // point from which the popup should open relative to the iconAnchor 1738 }); 1739 var IconDot = L.icon({ 1740 iconUrl: 'public/img/wosinddieschiffeheute/dot.png', 1741 1742 iconSize: [15, 15], // size of the icon 1743 iconAnchor: [7.5, 7.5], // point of the icon which will correspond to marker's location 1744 popupAnchor: [0, -10] // point from which the popup should open relative to the iconAnchor 1745 }); 1746 1747 var date = date || new Date(), 1748 day = ('0' + date.getDate()).slice(-2), 1749 month = ( '0' + (date.getMonth() + 1) ).slice(-2), 1750 year = date.getFullYear(), 1751 filename = year + '-' + month + '-' + day + '.txt', 1752 data = [], 1753 uebersichtContainer = $("#ship-uebersicht-container"), 1754 locationContainer = $("#ship-location-container"), 1755 foldername = uebersichtContainer.length && uebersichtContainer.data('location') 1756 ? uebersichtContainer.data('location') 1757 : locationContainer.length && locationContainer.data('location') 1758 ? locationContainer.data('location') 1759 : 'hochseeschiffe', 1760 1761 ajaxuri = "/public/xml/Summary/" + filename, 1762 markerArray = []; 1763 1764 1765 console.log(ajaxuri); 1766 1767 $.ajax({
1768 url: ajaxuri, 1769 cache: false 1770 }) 1771 .done( function(res) { 1772 data = JSON.parse(res); 1773 1774 for( var i = 0; i < data.length; i++ ) { 1775 1776 // MS Deutschland gehört nicht mehr zur Flotte - auch in historischen Summary-Dateien ausblenden 1777 if( data[i].SHIPCODE && data[i].SHIPCODE.trim().toUpperCase() === 'DEU' ) { continue; } 1778 1779 var href = '/hier-ist-die-' + data[i].SHIPNAME.trim().toLowerCase().replace(" ", "-") + '-heute-.html' + "?" + new Date().getTime(); 1780 1781 if(uebersichtContainer.length>0){ 1782 // Neue Methode weil Name über dem Icon gewünscht wurde. 1783 var currentMarker = L.marker([data[i].LATITUDE, data[i].LONGITUDE], { 1784 icon: new L.DivIcon({ 1785 className: 'wsdsh_ue_marker_container', 1786 html: '<div class="wsdsh_ue_marker_txt">' + data[i].SHIPCODE + '</div><img class="wsdsh_ue_marker_icon" src="public/img/wosinddieschiffeheute/dot.png"/>' 1787 }) 1788 }).bindPopup('<div class="popover">' + 1789 '<a class="ship-popover" href="' + href + '">' + 1790 '<h3 class="popover-title">' + data[i].SHIPNAME + '</h3>' + 1791 '<div class="popover-content">' + 1792 '<ul class="content-list">' + 1793 '<li><span class="key">Position:</span><span class="value">' + data[i].POSITION + '</span></li>' + 1794 '<li><span class="key">Bordzeit:</span><span class="value">' + data[i].BORDZEIT + '</span></li>' + 1795 '<li><span class="key">Wetter:</span><span class="value">' + data[i].WETTER + '</span></li>' + 1796 '</ul>' + 1797 '</div>' + 1798 '</a>' + 1799 '</div>'). 1800 on('click', function (e) { 1801 this.openPopup(); 1802 }). 1803 on('mouseout', function (e) { 1804 //this.closePopup(); 1805 }); 1806 }else{ 1807 1808 if(locationContainer.data("shipname").trim()==data[i].SHIPNAME.trim()) 1809 var IconShip = IconShip1; 1810 else 1811 var IconShip = IconShip2; 1812 1813 var currentMarker = L.marker([data[i].LATITUDE, data[i].LONGITUDE], {icon: IconShip}).bindPopup('<div class="popover">' + 1814 '<a class="ship-popover" href="' + href + '">' + 1815 '<h3 class="popover-title">' + data[i].SHIPNAME + '</h3>' + 1816 '<div class="popover-content">' + 1817 '<ul class="content-list">' + 1818 '<li><span class="key">Position:</span><span class="value">' + data[i].POSITION + '</span></li>' + 1819 '<li><span class="key">Bordzeit:</span><span class="value">' + data[i].BORDZEIT + '</span></li>' + 1820 '<li><span class="key">Wetter:</span><span class="value">' + data[i].WETTER + '</span></li>' + 1821 '</ul>' + 1822 '</div>' + 1823 '</a>' + 1824 '</div>'). 1825 on('click', function (e) { 1826 this.openPopup(); 1827 }). 1828 on('mouseout', function (e) { 1829 //this.closePopup(); 1830 }); 1831 1832 1833 1834 1835 1836 } 1837 1838 1839 1840 1841 1842 currentMarker.addTo(map); 1843 1844 1845 if(uebersichtContainer.length==0){ 1846 if(locationContainer.data("shipname").trim()==data[i].SHIPNAME.trim()){ 1847 //currentMarker.openPopup();
1848 map.setView([data[i].LATITUDE, data[i].LONGITUDE], (5)); 1849 } 1850 } 1851 1852 markerArray.push(L.marker([data[i].LATITUDE, data[i].LONGITUDE])); 1853 1854 1855 } 1856 1857 if(uebersichtContainer.length>0){ 1858 // Alle Schiffe in einer Ansicht zeigen. Dieser Code Zentriert die Karte zwischen alle Marker und zoomt diese eine Stufe raus. 1859 var shipMarkers = L.featureGroup(markerArray); 1860 var shipBounds = shipMarkers.getBounds(); 1861 1862 console.log(shipBounds); 1863 1864 shipBounds._northEast.lat = (shipBounds._northEast.lat +0.6); 1865 shipBounds._southWest.lat = (shipBounds._southWest.lat -0.6); 1866 1867 map.fitBounds(shipBounds); 1868 //map.setView(map.getCenter(), (map.getZoom())); 1869 }else{ 1870 1871 //Laufende Kreuzfahrten 1872 setTimeout(function(){ 1873 var basicLink = $("#dk_laufende_kreuzfahrt_link").attr("href"); 1874 $("#dk_laufende_kreuzfahrt_link").attr("href", basicLink + $("#dk_id_ship").html() ); 1875 },300); 1876 } 1877 }); 1878 1879 1880 1881 1882 1883} 1884
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.