1(function($){ 2 "use strict"; 3 4 var traveltour_display = 'desktop'; 5 if( typeof(window.matchMedia) == 'function' ){ 6 $(window).on('resize traveltour-set-display', function(){ 7 if( window.matchMedia('(max-width: 419px)').matches ){ 8 traveltour_display = 'mobile-portrait'; 9 }else if( window.matchMedia('(max-width: 767px)').matches ){ 10 traveltour_display = 'mobile-landscape' 11 }else if( window.matchMedia('(max-width: 959px)').matches ){ 12 traveltour_display = 'tablet' 13 }else{ 14 traveltour_display = 'desktop'; 15 } 16 }); 17 $(window).trigger('traveltour-set-display'); 18 }else{ 19 $(window).on('resize traveltour-set-display', function(){ 20 if( $(window).innerWidth() <= 419 ){ 21 traveltour_display = 'mobile-portrait'; 22 }else if( $(window).innerWidth() <= 767 ){ 23 traveltour_display = 'mobile-landscape' 24 }else if( $(window).innerWidth() <= 959 ){ 25 traveltour_display = 'tablet' 26 }else{ 27 traveltour_display = 'desktop'; 28 } 29 }); 30 $(window).trigger('traveltour-set-display'); 31 } 32 33 // ref : http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ 34 // ensure 1 is fired 35 var traveltour_debounce = function(func, threshold, execAsap){ 36 37 var timeout; 38 39 return function debounced(){ 40 41 var obj = this, args = arguments; 42 43 function delayed(){ 44 if( !execAsap ){ 45 func.apply(obj, args); 46 } 47 timeout = null; 48 }; 49 50 if( timeout ){ 51 clearTimeout(timeout); 52 }else if( execAsap ){ 53 func.apply(obj, args); 54 } 55 timeout = setTimeout(delayed, threshold); 56 }; 57 } 58 59 // reduce the event occurance 60 var traveltour_throttling = function(func, threshold){ 61 62 var timeout; 63 64 return function throttled(){ 65 var obj = this, args = arguments; 66 67 function delayed(){ 68 func.apply(obj, args); 69 timeout = null; 70 }; 71 72 if( !timeout ){ 73 timeout = setTimeout(delayed, threshold); 74 } 75 }; 76 } 77 78 ///////////////////////// 79 // menu handle function 80 ///////////////////////// 81 var traveltour_sf_menu = function( menu ){ 82 83 if( menu.length == 0 ) return; 84 85 this.main_menu = menu; 86 87 this.slide_bar = this.main_menu.children('.traveltour-navigation-slide-bar'); 88 this.slide_bar_val = { width: 0, left: 0 }; 89 this.slide_bar_offset = '3'; 90 if( this.slide_bar.attr('data-size-offset') ){ 91 this.slide_bar_offset = parseInt(this.slide_bar.attr('data-size-offset')); 92 } 93 94 this.slide_bar_width = 0; 95 if( this.slide_bar.attr('data-width') ){ 96 this.slide_bar_width = parseInt(this.slide_bar.attr('data-width')); 97 } 98 99 this.current_menu = this.main_menu.children('.sf-menu').children('.current-menu-item, .current-menu-ancestor').children('a'); 100 101 this.init(); 102 103 } // traveltour_sf_menu 104 105 traveltour_sf_menu.prototype = { 106 107 init: function(){ 108 109 var t = this; 110 111 // sf menu mod 112 t.sf_menu_mod(); 113 114 // init superfish menu 115 if(typeof($.fn.superfish) == 'function'){ 116 t.main_menu.superfish({ delay: 400, speed: 'fast' }); 117 118 t.sf_menu_position(); 119 $(window).resize(traveltour_debounce(function(){ 120 t.sf_menu_position(); 121 }, 300)); 122 } 123 124 // init the slidebar 125 if( t.slide_bar.length > 0 ){ 126 t.init_slidebar(); 127 } 128 129 }, // init 130 131 sf_menu_mod: function(){ 132 133 // create the mega menu script 134 this.main_menu.find('.sf-mega > ul').each(function(){ 135 var mega_content = $('<div></div>'); 136 var mega_row = $('<div class="sf-mega-section-wrap" ></div>'); 137 var mega_column_size = 0; 138 139 $(this).children('li').each(function(){ 140 var column_size = parseInt($(this).attr('data-size')); 141 if( mega_column_size + column_size <= 60 ){ 142 mega_column_size += column_size; 143 }else{ 144 mega_column_size = column_size; 145 mega_content.append(mega_row); 146 mega_row = $('<div class="sf-mega-section-wrap" ></div>'); 147 } 148 149 mega_row.append( $('<div class="sf-mega-section" ></div>') 150 .addClass('traveltour-column-' + column_size) 151 .html( $('<div class="sf-mega-section-inner" ></div>') 152 .addClass($(this).attr('class')) 153 .attr('id', $(this).attr('id')) 154 .html($(this).html()) 155 ) 156 ); 157 }); 158 159 mega_content.append(mega_row); 160 $(this).replaceWith(mega_content.html()); 161 }); 162 163 }, // sf_menu_mod 164 165 sf_menu_position: function(){ 166 167 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ) return; 168 169 // submenu of normal menu 170 var sub_normal_menu = this.main_menu.find('.sf-menu > li.traveltour-normal-menu .sub-menu'); 171 172 sub_normal_menu.css({display: 'block'}
172).removeClass('sub-menu-right'); 173 if( $("body").hasClass("rtl") ){ 174 sub_normal_menu.each(function(){ 175 if( $(this).offset().left < 0 ){ 176 $(this).addClass('sub-menu-right'); 177 } 178 }); 179 }else{ 180 sub_normal_menu.each(function(){ 181 if( $(this).offset().left + $(this).width() > $(window).width() ){ 182 $(this).addClass('sub-menu-right'); 183 } 184 }); 185 } 186 sub_normal_menu.css({display: 'none'}); 187 188 // submenu of mega menu 189 this.main_menu.find('.sf-menu > li.traveltour-mega-menu .sf-mega').each(function(){ 190 if( !$(this).hasClass('sf-mega-full') ){ 191 192 $(this).css({ display: 'block' }); 193 194 // set the position 195 $(this).css({ right: '', 'margin-left': -(($(this).width() - $(this).parent().outerWidth()) / 2) }); 196 197 // if exceed the screen 198 if( $(this).offset().left + $(this).width() > $(window).width() ){ 199 $(this).css({ right: 0, 'margin-left': '' }); 200 } 201 202 $(this).css({ display: 'none' }); 203 } 204 205 }); 206 207 }, // sf_menu_position 208 209 init_slidebar: function(){ 210 211 var t = this; 212 213 t.init_slidebar_pos(); 214 $(window).on('load', function(){ t.init_slidebar_pos(); }); 215 216 // animate slidebar 217 t.main_menu.children('.sf-menu').children('li').on({ 218 mouseenter: function(){ 219 var nav_element = $(this).children('a'); 220 221 if( nav_element.length > 0 ){ 222 223 if( t.slide_bar_width > 0 ){ 224 var sbw = t.slide_bar_width; 225 if( t.slide_bar.hasClass('traveltour-left') ){ 226 var sbl = nav_element.position().left - t.slide_bar_offset; 227 }else{ 228 var sbl = nav_element.position().left + ((nav_element.outerWidth() - sbw)/2) - t.slide_bar_offset; 229 } 230 }else{ 231 var sbw = nav_element.outerWidth() + (2 * t.slide_bar_offset); 232 var sbl = nav_element.position().left - t.slide_bar_offset; 233 } 234 235 t.slide_bar.animate({ width: sbw, left: sbl }, { queue: false, duration: 250 }); 236 } 237 }, 238 mouseleave: function(){ 239 t.slide_bar.animate({ width: t.slide_bar_val.width, left: t.slide_bar_val.left }, { queue: false, duration: 250 }); 240 } 241 }); 242 243 // window resize event 244 $(window).on('resize', function(){ t.init_slidebar_pos(); }); 245 $(window).on('traveltour-navigation-slider-bar-init', function(){ 246 t.current_menu = t.main_menu.children('.sf-menu').children('.current-menu-item, .current-menu-ancestor').children('a'); 247 t.animate_slidebar_pos(); 248 }); 249 $(window).on('traveltour-navigation-slider-bar-animate', function(){ t.animate_slidebar_pos(); }); 250 251 }, // init_slidebar 252 253 init_slidebar_pos: function(){ 254 255 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ) return; 256 257 var t = this; 258 259 if( t.current_menu.length > 0 ){ 260 if( t.slide_bar_width > 0 ){ 261 var sbw = t.slide_bar_width; 262 if( t.slide_bar.hasClass('traveltour-left') ){ 263 var sbl = t.current_menu.position().left - t.slide_bar_offset; 264 }else{ 265 var sbl = t.current_menu.position().left + ((t.current_menu.outerWidth() - sbw)/2) - t.slide_bar_offset; 266 } 267 }else{ 268 var sbw = t.current_menu.outerWidth() + (2 * t.slide_bar_offset); 269 var sbl = t.current_menu.position().left - t.slide_bar_offset; 270 } 271 t.slide_bar_val = { width: sbw, left: sbl }; 272 }else{ 273 t.slide_bar_val = { width: 0 } 274 275 var first_child = t.main_menu.children('ul').children('li:first-child'); 276 if( typeof(first_child.position()) != 'undefined' ){ 277 t.slide_bar_val.left = first_child.position().left; 278 }else{ 279 t.slide_bar_val.left = 0; 280 } 281 } 282 t.slide_bar.css({ width: t.slide_bar_val.width, left: t.slide_bar_val.left, display: 'block' }); 283 284 }, // set_slidebar_pos 285 animate_slidebar_pos: function(){ 286 287 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ) return; 288 289 var t = this; 290 291 if( t.current_menu.length > 0 ){ 292 if( t.slide_bar_width > 0 ){ 293 var sbw = t.slide_bar_width; 294 if( t.slide_bar.hasClass('traveltour-left') ){ 295 var sbl = t.current_menu.position().left - t.slide_bar_offset; 296 }else{ 297 var sbl = t.current_menu.position().left + ((t.current_menu.outerWidth() - sbw)/2) - t.slide_bar_offset ; 298 } 299 }else{ 300 var sbw = t.current_menu.outerWidth() + (2 * t.slide_bar_offset); 301 var sbl = t.current_menu.position().left - t.slide_bar_offset; 302 } 303 t.slide_bar_val = { width: sbw, left: sbl }; 304 }else{ 305 t.slide_bar_val = { width: 0 } 306 307 var first_child = t.main_menu.children('ul').children('li:first-child'); 308 if( typeof(first_child.position()) != 'undefined' ){ 309 t.slide_bar_val.left = first_child.position().left; 310 }else{ 311 t.slide_bar_val.left = 0; 312 } 313 } 314 t.slide_bar.css('display', 'block'); 315 t.slide_bar.animate({ width: t.slide_bar_val.width, left: t.slide_bar_val.left }, { queue: false, duration: 250 }); 316 317 } // set_slidebar_pos 318 319 }; // traveltour_sf_menu.prototype 320 321 ///////////////////////// 322 // mobile menu 323 ///////////////////////// 324 $.fn.traveltour_mobile_menu = function( args ){ 325 326 var menu_button = $(this).siblings('.traveltour-mm-menu-button'); 327 var options = { 328 navbar: { title: '<span class="mmenu-custom-close" ></span>' }, 329 extensions: [ 'pagedim-black' ], 330 331 }; 332 var extensions = { 333 offCanvas: { pageNodetype: '.traveltour-body-outer-wrapper' } 334 }; 335 336 // remove the wrap for submenu 337 $(this).find('a[href="#"]').each(function(){ 338 var content = $(this).html(); 339 $('<span class="traveltour-mm-menu-blank" ></span>').html(content).insertBefore($(this)); 340 $(this).remove(); 341 }); 342
343 if( $(this).attr('data-slide') ){ 344 var html_class = 'traveltour-mmenu-' + $(this).attr('data-slide'); 345 $('html').addClass(html_class); 346 347 options.offCanvas = { position : $(this).attr('data-slide') }; 348 } 349 350 $(this).mmenu(options, extensions); 351 352 var menu_api = $(this).data('mmenu'); 353 $(this).find('a').not('.mm-next, .mm-prev').click(function(){ 354 menu_api.close(); 355 }); 356 $(this).find('.mmenu-custom-close').click(function(){ 357 menu_api.close(); 358 }); 359 360 // add class active to button 361 menu_api.bind('open', function($panel){ 362 menu_button.addClass('traveltour-active'); 363 }); 364 menu_api.bind('close', function($panel){ 365 menu_button.removeClass('traveltour-active'); 366 }); 367 368 } 369 370 ///////////////////////// 371 // overlay menu 372 ///////////////////////// 373 var traveltour_overlay_menu = function( menu ){ 374 375 this.menu = menu; 376 this.menu_button = menu.children('.traveltour-overlay-menu-icon'); 377 this.menu_content = menu.children('.traveltour-overlay-menu-content'); 378 this.menu_close = this.menu_content.children('.traveltour-overlay-menu-close'); 379 380 this.init(); 381 } 382 traveltour_overlay_menu.prototype = { 383 384 init: function(){ 385 386 var t = this; 387 388 // add transition delay for each menu 389 var delay_count = 0; 390 t.menu_content.appendTo('body'); 391 t.menu_content.find('ul.menu > li').each(function(){ 392 $(this).css('transition-delay', (delay_count * 150) + 'ms'); 393 394 delay_count++; 395 }); 396 397 // bind the menu button 398 t.menu_button.click(function(){ 399 $(this).addClass('traveltour-active'); 400 401 t.menu_content.fadeIn(200, function(){ 402 $(this).addClass('traveltour-active'); 403 }); 404 405 return false; 406 }); 407 408 // bind the menu close button 409 t.menu_close.click(function(){ 410 t.menu_button.removeClass('traveltour-active'); 411 412 t.menu_content.fadeOut(400, function(){ 413 $(this).removeClass('traveltour-active'); 414 }); 415 t.menu_content.find('.sub-menu').slideUp(200).removeClass('traveltour-active'); 416 417 return false; 418 }); 419 420 // menu item click 421 t.menu_content.find('a').click(function(e){ 422 var sub_menu = $(this).siblings('.sub-menu'); 423 if( sub_menu.length > 0 ){ 424 if( !sub_menu.hasClass('traveltour-active') ){ 425 var prev_active = sub_menu.closest('li').siblings().find('.sub-menu.traveltour-active'); 426 if( prev_active.length > 0 ){ 427 prev_active.removeClass('traveltour-active').slideUp(150); 428 sub_menu.delay(150).slideDown(400, 'easeOutQuart').addClass('traveltour-active'); 429 }else{ 430 sub_menu.slideDown(400, 'easeOutQuart').addClass('traveltour-active'); 431 } 432 433 $(this).addClass('traveltour-no-preload'); 434 return false; 435 }else{ 436 $(this).removeClass('traveltour-no-preload'); 437 } 438 }else{ 439 t.menu_close.trigger('click'); 440 } 441 }); 442 443 } 444 445 }; // traveltour_overlay_menu.prototype 446 447 ///////////////////////// 448 // header side navigation 449 ///////////////////////// 450 var traveltour_header_side_nav = function( side_nav ){ 451 452 if( side_nav.length == 0 ) return; 453 454 this.prev_scroll = 0; 455 456 this.side_nav = side_nav; 457 this.side_nav_content = side_nav.children(); 458 459 this.init(); 460 461 } // traveltour_header_side_nav 462 463 traveltour_header_side_nav.prototype = { 464 465 init: function(){ 466 467 var t = this; 468 469 t.init_nav_bar_element(); 470 471 $(window).resize(function(){ 472 t.init_nav_bar_element(); 473 }); 474 475 $(window).scroll(function(){ 476 477 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ) return; 478 479 // if content longer than screen height 480 if( t.side_nav.hasClass('traveltour-allow-slide') ){ 481 482 var admin_bar_height = parseInt($('html').css('margin-top')); 483 var scroll_down = ($(window).scrollTop() > t.prev_scroll); 484 t.prev_scroll = $(window).scrollTop(); 485 486 // if scroll down 487 if( scroll_down ){ 488 489 if( !t.side_nav.hasClass('traveltour-fix-bottom') ){ 490 if( t.side_nav.hasClass('traveltour-fix-top') ){ 491 t.side_nav.css('top', t.side_nav.offset().top); 492 t.side_nav.removeClass('traveltour-fix-top'); 493 494 }else if( $(window).height() + $(window).scrollTop() > t.side_nav_content.offset().top + t.side_nav_content.outerHeight() ){ 495 if( !t.side_nav.hasClass('traveltour-fix-bottom') ){ 496 t.side_nav.addClass('traveltour-fix-bottom'); 497 t.side_nav.css('top', ''); 498 } 499 } 500 } 501 502 // if scroll up 503 }else{ 504 505 if( !t.side_nav.hasClass('traveltour-fix-top') ){ 506 if( t.side_nav.hasClass('traveltour-fix-bottom') ){ 507 var top_pos = $(window).scrollTop() + ($(window).height() - admin_bar_height) - t.side_nav_content.outerHeight(); 508 t.side_nav.css('top', top_pos); 509 t.side_nav.removeClass('traveltour-fix-bottom'); 510 511 }else if( $(window).scrollTop() + admin_bar_height < t.side_nav_content.offset().top ){ 512 if( !t.side_nav.hasClass('traveltour-fix-top') ){ 513 t.side_nav.addClass('traveltour-fix-top'); 514 t.side_nav.css('top', ''); 515 } 516 } 517 } 518 519 } 520 521 } 522 }); 523 524 }, 525 526 init_nav_bar_element: function(){ 527 528 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ) return; 529 530 var t = this; 531 var middle_pos = t.side_nav_content.children('.traveltour-pos-middle').addClass('traveltour-active'); 532 var bottom_pos = t.side_nav_content.children('.traveltour-pos-bottom').addClass('traveltour-active'); 533 534 // remove all additional space 535 t.side_nav_content.children('.traveltour-pre-spaces').remove(); 536 537 // add class depends on the screen size/content 538 if( $(window).height() < t.side_nav_content.height() ){ 539 t.side_nav.addClass('traveltour-allow-slide'); 540 }else{ 541 t.side_nav.removeClass('traveltour-allow-slide traveltour-fix-top traveltour-fix-bottom').css('top', ''); 542 543 // set the middle position 544 if( t.side_nav.hasClass('traveltour-style-middle') ){ 545 middle_pos.each(function(){ 546 var top_padding = parseInt($(this).css('padding-top')); 547 var prespace = ((t.side_nav.height() - (t.side_nav_content.height() - top_padding)) / 2) - top_padding; 548 549 if( prespace > 0 ){ 550 $('<div class="traveltour-pre-spaces" ></div>').css('height', prespace).insertBefore($(this)); 551 } 552 }); 553 } 554 555 // set the bottom position 556 bottom_pos.each(function(){ 557 var prespace = t.side_nav.height() - t.side_nav_content.height(); 558 559 if( prespace > 0 ){ 560 $('<div class="traveltour-pre-spaces" ></div>').css('height', prespace).insertBefore($(this)); 561 } 562 }); 563 564 } 565 } 566 567 }; // traveltour_sf_menu.prototype 568 569 ///////////////////////// 570 // anchoring 571 ///////////////////////// 572 573 var traveltour_anchor = function(){ 574 575 this.anchor_link = $('a[href^="#"]').not('[href="#"]').filter(function(){ 576 577 // for mm-menu plugin 578 if( $(this).is('.traveltour-mm-menu-button, .mm-next, .mm-prev, .mm-title, .gdlr-core-ilightbox') ){ 579 return false;
580 } 581 582 // for additional plugins 583 if( $(this).is('.fbx-btn-transition') ){ 584 return false; 585 } 586 587 // for woocommerce 588 if( !$(this).hasClass('traveltour-footer-back-to-top-button') ){ 589 if( $(this).parent('.description_tab, .reviews_tab').length || $(this).closest('.woocommerce').length ){ 590 return false; 591 } 592 } 593 594 595 return true; 596 }); 597 598 if( this.anchor_link.length ){ 599 this.menu_anchor = $('#traveltour-main-menu, #traveltour-bullet-anchor, #tourmaster-content-navigation-item-outer'); 600 this.home_anchor = this.menu_anchor.find('ul.sf-menu > li.current-menu-item > a, ul.sf-menu > li.current-menu-ancestor > a, .traveltour-bullet-anchor-link.current-menu-item, .tourmaster-content-navigation-tab.tourmaster-active'); 601 602 this.init(); 603 } 604 } 605 traveltour_anchor.prototype = { 606 607 init: function(){ 608 609 var t = this; 610 611 t.animate_anchor(); 612 t.scroll_section(); 613 614 // init bullet anchor height 615 t.menu_anchor.filter('#traveltour-bullet-anchor').each(function(){ 616 $(this).css('margin-top', - t.menu_anchor.height() / 2).addClass('traveltour-init'); 617 }); 618 619 // initialize if the page hash exists 620 // wait for all element to initialize ( eg. flexslider ) 621 var url_hash = window.location.hash; 622 if( url_hash ){ 623 setTimeout(function(){ 624 625 var current_menu = t.menu_anchor.find('a[href*="' + url_hash + '"]'); 626 if( !current_menu.is('.current-menu-item, .current-menu-ancestor') ){ 627 current_menu.addClass('current-menu-item').siblings().removeClass('current-menu-item current-menu-ancestor'); 628 629 $(window).trigger('traveltour-navigation-slider-bar-init'); 630 } 631 632 t.scroll_to(url_hash, false, 300); 633 }, 500); 634 } 635 636 }, 637 638 animate_anchor: function(){ 639 640 var t = this; 641 642 // home anchor 643 t.home_anchor.click(function(){ 644 645 if( window.location.href == this.href ){ 646 $('html, body').animate({ scrollTop: 0 }, { duration: 1500, easing: 'easeOutQuart' }); 647 return false; 648 } 649 650 }); 651 652 // normal anchor 653 t.anchor_link.click(function() { 654 if( location.hostname == this.hostname && location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') ){ 655 return t.scroll_to(this.hash, true); 656 } 657 }); 658 659 }, // animate anchor 660 661 scroll_to: function( hash, redirect, duration ){ 662 663 // start scrolling 664 if( hash == '#traveltour-top-anchor' ){ 665 var scroll_position = 0; 666 }else{ 667 668 var target = $(hash); 669 670 if( target.length ){ 671 var scroll_position = target.offset().top; 672 } 673 } 674 675 if( typeof(scroll_position) != 'undefined' ){ 676 677 // offset for wordpress admin bar 678 scroll_position = scroll_position - parseInt($('html').css('margin-top')); 679 680 // offset for fixed nav bar 681 if( typeof(window.traveltour_anchor_offset) != 'undefined' ){ 682 scroll_position = scroll_position - parseInt(window.traveltour_anchor_offset); 683 } 684 685 if( scroll_position < 0 ) scroll_position = 0; 686 687 $('html, body').animate({ scrollTop: scroll_position }, { duration: 1500, easing: 'easeOutQuart', queue: false }); 688 689 return false; 690 691 }else if( redirect ){ 692 693 if( hash != '#tourmaster-single-review' ){ 694 window.location.href = traveltour_script_core.home_url + hash; 695 } 696 697 return false; 698 } 699 700 }, // scroll to 701 702 scroll_section: function(){ 703 704 var t = this; 705 706 // have anchor in anchor menu 707 var menu_link_anchor = this.menu_anchor.find('a[href*="#"]').not('[href="#"]'); 708 if( !menu_link_anchor.length ){ return; } 709 710 // get anchor section 711 var home_anchor_section = $('#traveltour-page-wrapper'); 712 var anchor_section = home_anchor_section.find('[id]').filter(function(){ 713 var hashId = $(this).attr('id'); 714 if( menu_link_anchor.filter('a[href*="#' + hashId + '"]').length ){ 715 return true; 716 } 717 return false; 718 }); 719 720 if( !anchor_section.length ){ return; } 721 722 // add data for faster query 723 menu_link_anchor.each(function(){ 724 if( $(this.hash).length ){ 725 $(this).attr('data-anchor', this.hash); 726 } 727 }); 728 729 // check section on scroll event 730 $(window).scroll(function(){ 731 732 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' ) return; 733 734 if( t.home_anchor.length && $(window).scrollTop() < home_anchor_section.offset().top ){ 735 736 t.home_anchor.each(function(){ 737 if( $(this).hasClass('tourmaster-content-navigation-tab') ){ 738 $(this).addClass('tourmaster-active').siblings().removeClass('tourmaster-active tourmaster-slidebar-active'); 739 }else if( $(this).hasClass('traveltour-bullet-anchor-link') ){ 740 $(this).addClass('current-menu-item').siblings().removeClass('current-menu-item'); 741 $(this).parent('.traveltour-bullet-anchor').attr('data-anchor-section', 'traveltour-home'); 742 }else if( !$(this).parent('.current-menu-item, .current-menu-ancestor').length ){ 743 $(this).parent().addClass('current-menu-item').siblings().removeClass('current-menu-item current-menu-ancestor');
744 $(window).trigger('traveltour-navigation-slider-bar-init'); 745 } 746 }); 747 748 }else{ 749 var section_position = $(window).scrollTop() + ($(window).height() * 0.3); 750 751 anchor_section.each(function(){ 752 if( $(this).css('display') == 'none' || $(this).closest('.tourmaster-tour-booking-bar-wrap').length || $(this).is('#tourmaster-page-wrapper') ) return; 753 754 var top_offset_pos = $(this).offset().top; 755 756 if( (section_position > top_offset_pos) && (section_position < top_offset_pos + $(this).outerHeight()) ){ 757 var section_id = $(this).attr('id'); 758 759 menu_link_anchor.filter('[data-anchor="#' + section_id + '"]').each(function(){ 760 if( $(this).hasClass('tourmaster-content-navigation-tab') ){ 761 $(this).addClass('tourmaster-active').siblings().removeClass('tourmaster-active tourmaster-slidebar-active'); 762 $(this).closest('#tourmaster-content-navigation-item-outer').trigger('tourmaster-change'); 763 }else if( $(this).hasClass('traveltour-bullet-anchor-link') ){ 764 $(this).addClass('current-menu-item').siblings().removeClass('current-menu-item'); 765 $(this).parent('.traveltour-bullet-anchor').attr('data-anchor-section', section_id); 766 }else if( $(this).parent('li.menu-item').length && !$(this).parent('li.menu-item').is('.current-menu-item, .current-menu-ancestor') ){ 767 $(this).parent('li.menu-item').addClass('current-menu-item').siblings().removeClass('current-menu-item current-menu-ancestor'); 768 $(window).trigger('traveltour-navigation-slider-bar-init'); 769 } 770 }); 771 772 return false; 773 } 774 775 }); 776 } 777 778 }); 779 780 } // scroll section 781 782 }; 783 784 var traveltour_sticky_navigation = function(){ 785 786 this.sticky_nav = $('.traveltour-with-sticky-navigation .traveltour-sticky-navigation'); 787 this.logo_height = 35; 788 789 if( this.sticky_nav.length ){ 790 this.mobile_menu = $('#traveltour-mobile-header'); 791 792 this.init(); 793 } 794 795 } 796 traveltour_sticky_navigation.prototype = { 797 798 init: function(){ 799 800 var t = this; 801 802 if( t.sticky_nav.hasClass('traveltour-style-fixed') ){ 803 t.style_fixed(); 804 }else if( t.sticky_nav.hasClass('traveltour-style-slide') ){ 805 t.style_slide(); 806 } 807 t.style_mobile_slide(); 808 809 if( t.sticky_nav.hasClass('traveltour-sticky-navigation-height') ){ 810 window.traveltour_anchor_offset = t.sticky_nav.outerHeight(); 811 $(window).resize(function(){ 812 window.traveltour_anchor_offset = t.sticky_nav.outerHeight(); 813 }); 814 }else{ 815 window.traveltour_anchor_offset = 75; 816 } 817 818 $(window).trigger('traveltour-set-sticky-navigation'); 819 $(window).trigger('traveltour-set-sticky-mobile-navigation'); 820 }, 821 822 style_fixed: function(){ 823 824 var t = this; 825 var placeholder = $('<div class="traveltour-sticky-menu-placeholder" ></div>'); 826 827 $(window).on('scroll traveltour-set-sticky-navigation', function(){ 828 829 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ) return; 830 831 var page_offset = parseInt($('html').css('margin-top')); 832 833 if( !t.sticky_nav.hasClass('traveltour-fixed-navigation') ){ 834 835 if( $(window).scrollTop() + page_offset > t.sticky_nav.offset().top ){ 836 if( !t.sticky_nav.hasClass('traveltour-without-placeholder') ){ 837 placeholder.height(t.sticky_nav.outerHeight()); 838 } 839 placeholder.insertAfter(t.sticky_nav); 840 $('body').append(t.sticky_nav); 841 t.sticky_nav.addClass('traveltour-fixed-navigation'); 842 843 setTimeout(function(){ t.sticky_nav.addClass('traveltour-animate-fixed-navigation'); }, 10); 844 setTimeout(function(){ 845 t.sticky_nav.css('height', ''); 846 $(window).trigger('traveltour-navigation-slider-bar-animate'); 847 }, 200); 848 } 849 }else{ 850 851 if( $(window).scrollTop() + page_offset <= placeholder.offset().top ){ 852 if( !t.sticky_nav.hasClass('traveltour-without-placeholder') ){ 853 t.sticky_nav.height(placeholder.height()); 854 } 855 t.sticky_nav.insertBefore(placeholder); 856 t.sticky_nav.removeClass('traveltour-fixed-navigation'); 857 placeholder.remove(); 858 859 setTimeout(function(){ t.sticky_nav.removeClass('traveltour-animate-fixed-navigation traveltour-animate-logo-height'); }, 10); 860 setTimeout(function(){ 861 t.sticky_nav.css('height', '');
862 $(window).trigger('traveltour-navigation-slider-bar-animate'); 863 }, 200); 864 } 865 } 866 }); 867 868 }, // style_fixed 869 870 style_slide: function(){ 871 872 var t = this; 873 var placeholder = $('<div class="traveltour-sticky-menu-placeholder" ></div>'); 874 875 $(window).on('scroll traveltour-set-sticky-navigation', function(){ 876 877 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ){ return; } 878 879 var page_offset = parseInt($('html').css('margin-top')); 880 881 if( !t.sticky_nav.hasClass('traveltour-fixed-navigation') ){ 882 883 if( $(window).scrollTop() + page_offset > t.sticky_nav.offset().top + t.sticky_nav.outerHeight() + 200 ){ 884 885 if( !t.sticky_nav.hasClass('traveltour-without-placeholder') ){ 886 placeholder.height(t.sticky_nav.outerHeight()); 887 } 888 placeholder.insertAfter(t.sticky_nav); 889 t.sticky_nav.css('display', 'none'); 890 891 $('body').append(t.sticky_nav); 892 t.sticky_nav.addClass('traveltour-fixed-navigation traveltour-animate-fixed-navigation'); 893 t.sticky_nav.slideDown(200); 894 $(window).trigger('traveltour-navigation-slider-bar-animate'); 895 } 896 }else{ 897 898 if( $(window).scrollTop() + page_offset <= placeholder.offset().top + placeholder.height() + 200 ){ 899 var clone = t.sticky_nav.clone(); 900 clone.insertAfter(t.sticky_nav); 901 clone.slideUp(200, function(){ $(this).remove(); }); 902 903 t.sticky_nav.insertBefore(placeholder); 904 placeholder.remove(); 905 t.sticky_nav.removeClass('traveltour-fixed-navigation traveltour-animate-fixed-navigation'); 906 t.sticky_nav.css('display', 'block'); 907 908 $(window).trigger('traveltour-navigation-slider-bar-animate'); 909 } 910 } 911 }); 912 913 }, // style_slide 914 915 style_mobile_slide: function(){ 916 917 var t = this; 918 var placeholder = $('<div class="traveltour-sticky-mobile-placeholder" ></div>'); 919 920 $(window).on('scroll traveltour-set-sticky-mobile-navigation', function(){ 921 922 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' || traveltour_display == 'tablet' ){ 923 924 var page_offset = parseInt($('html').css('margin-top')); 925 926 if( !t.mobile_menu.hasClass('traveltour-fixed-navigation') ){ 927 if( $(window).scrollTop() + page_offset > t.mobile_menu.offset().top + t.mobile_menu.outerHeight() + 200 ){ 928 placeholder.height(t.mobile_menu.outerHeight()).insertAfter(t.mobile_menu); 929 $('body').append(t.mobile_menu); 930 t.mobile_menu.addClass('traveltour-fixed-navigation'); 931 t.mobile_menu.css('display', 'none').slideDown(200); 932 } 933 }else{ 934 if( $(window).scrollTop() + page_offset <= placeholder.offset().top + placeholder.height() + 200 ){ 935 var clone = t.mobile_menu.clone(); 936 clone.insertAfter(t.mobile_menu); 937 clone.slideUp(200, function(){ $(this).remove(); }); 938 939 t.mobile_menu.insertBefore(placeholder); 940 placeholder.remove(); 941 t.mobile_menu.removeClass('traveltour-fixed-navigation'); 942 t.mobile_menu.css('display', 'block'); 943 } 944 } 945 } 946 947 }); 948 949 }, // style_slide 950 951 }; 952 953 var traveltour_font_resize = function(){ 954 955 this.heading_font = $('h1, h2, h3, h4, h5, h6'); 956 957 this.init(); 958 959 } 960 traveltour_font_resize.prototype = { 961 962 init: function(){ 963 964 var t = this; 965 966 t.resize(); 967 $(window).on('resize', traveltour_throttling(function(){ 968 t.resize(); 969 }, 100)); 970 971 }, 972 973 resize: function(){ 974 975 var t = this; 976 977 if( traveltour_display == 'mobile-landscape' || traveltour_display == 'mobile-portrait' ){ 978 979 t.heading_font.each(function(){ 980 if( parseInt($(this).css('font-size')) > 40 ){ 981 if( !$(this).attr('data-orig-font') ){ 982 $(this).attr('data-orig-font', $(this).css('font-size')); 983 } 984 985 $(this).css('font-size', '40px'); 986 } 987 }); 988 989 // return font to normal 990 }else{ 991 992 t.heading_font.filter('[data-orig-font]').each(function(){ 993 $(this).css('font-size', $(this).attr('data-orig-font')); 994 }); 995 996 } 997 } 998 999 }; 1000 1001 1002 //////////////////////////////// 1003 // starting running the script 1004 //////////////////////////////// 1005 $(document).ready(function(){ 1006 1007 // resize font on mobile 1008 new traveltour_font_resize(); 1009 1010 // init main navigation menu 1011 $('#traveltour-main-menu, #traveltour-right-menu, #traveltour-mobile-menu').each(function(){ 1012 if( $(this).hasClass('traveltour-overlay-menu') ){ 1013 new traveltour_overlay_menu( $(this) ); 1014 }else if( $(this).hasClass('traveltour-mm-menu-wrap') ){ 1015 $(this).traveltour_mobile_menu(); 1016 }else{ 1017 new traveltour_sf_menu( $(this) ); 1018 } 1019 }); 1020 1021 $('#traveltour-top-search, #traveltour-mobile-top-search').each(function(){ 1022 1023 var search_wrap = $(this).siblings('.traveltour-top-search-wrap'); 1024 search_wrap.appendTo('body'); 1025 1026 // bind click button 1027 $(this).click(function(){ 1028 search_wrap.fadeIn(200, function(){ 1029 $(this).addClass('traveltour-active'); 1030 }); 1031 }); 1032 1033 // bind close button 1034 search_wrap.find('.traveltour-top-search-close').click(function(){ 1035 search_wrap.fadeOut(200, function(){ 1036 $(this).addClass('traveltour-active'); 1037 }); 1038 }); 1039 1040 // bind search button 1041 search_wrap.find('.search-submit').click(function(){ 1042 if( search_wrap.find('.search-field').val().length == 0 ){ 1043 return false;
1044 } 1045 }); 1046 }); 1047 1048 $('#traveltour-main-menu-cart, #traveltour-mobile-menu-cart').each(function(){ 1049 1050 $(this).hover(function(){ 1051 $(this).addClass('traveltour-active traveltour-animating'); 1052 }, function(){ 1053 var menu_cart = $(this); 1054 menu_cart.removeClass('traveltour-active'); 1055 setTimeout(function(){ 1056 menu_cart.removeClass('traveltour-animating'); 1057 }, 400) 1058 }); 1059 }); 1060 1061 // wpml 1062 $('#traveltour-dropdown-wpml-flag').hover(function(){ 1063 $(this).children('.traveltour-dropdown-wpml-list').fadeIn(200); 1064 }, function(){ 1065 $(this).children('.traveltour-dropdown-wpml-list').fadeOut(200); 1066 }); 1067 1068 // additional space for header transparent 1069 $('.traveltour-header-boxed-wrap, .traveltour-header-background-transparent, .traveltour-navigation-bar-wrap.traveltour-style-transparent').each(function(){ 1070 var header_transparent = $(this); 1071 var header_transparent_sub = $('.traveltour-header-transparent-substitute'); 1072 1073 header_transparent_sub.height(header_transparent.outerHeight()); 1074 $(window).on('load resize', function(){ 1075 header_transparent_sub.height(header_transparent.outerHeight()); 1076 }); 1077 }); 1078 1079 // full screen for 404 not found 1080 $('body.error404, body.search-no-results').each(function(){ 1081 1082 var wrap = $(this).find('#traveltour-full-no-header-wrap'); 1083 var body_wrap_offset = parseInt($(this).children('.traveltour-body-outer-wrapper').children('.traveltour-body-wrapper').css('margin-bottom')); 1084 1085 var padding = ($(window).height() - wrap.offset().top - wrap.outerHeight() - body_wrap_offset) / 2; 1086 if( padding > 0 ){ 1087 wrap.css({ 'padding-top': padding, 'padding-bottom': padding }); 1088 } 1089 1090 $(window).on('load resize', function(){ 1091 wrap.css({ 'padding-top': 0, 'padding-bottom': 0 }); 1092 padding = ($(window).height() - wrap.offset().top - wrap.outerHeight() - body_wrap_offset) / 2; 1093 if( padding > 0 ){ 1094 wrap.css({ 'padding-top': padding, 'padding-bottom': padding }); 1095 } 1096 }); 1097 }); 1098 1099 // back to top button 1100 var back_to_top = $('#traveltour-footer-back-to-top-button'); 1101 if( back_to_top.length ){ 1102 $(window).on('scroll', function(){ 1103 if( $(window).scrollTop() > 300 ){ 1104 back_to_top.addClass('traveltour-scrolled'); 1105 }else{ 1106 back_to_top.removeClass('traveltour-scrolled'); 1107 } 1108 }); 1109 } 1110 1111 // page preload 1112 $('body').children('#traveltour-page-preload').each(function(){ 1113 var page_preload = $(this); 1114 var animation_time = parseInt(page_preload.attr('data-animation-time')); 1115 1116 $('a[href]').not('.chaty-tooltip, [href^="tel:"], [href^="mailto:"], [href^="#"], [target="_blank"], .gdlr-core-js, .strip, .add_to_cart_button, .sf-with-ul, .comment-reply-link').click(function(e){ 1117 if( e.which != 1 || $(this).hasClass('traveltour-no-preload') ) return; 1118 if( $(this).closest('.woocommerce-cart-form').length ) return; 1119 1120 if( window.location.href != this.href ){ 1121 page_preload.addClass('traveltour-out').fadeIn(animation_time); 1122 } 1123 }); 1124 1125 $(window).on('load', function(){ 1126 page_preload.fadeOut(animation_time); 1127 }); 1128 }); 1129 1130 }); 1131 1132 // fix back button for preload 1133 $(window).bind('pageshow', function(event) { 1134 $('body').children('#traveltour-page-preload').each(function(){ 1135 $(this).fadeOut(400); 1136 }); 1137 }); 1138 // $(window).on('beforeunload', function(){ 1139 // $('body').children('#traveltour-page-preload').each(function(){ 1140 // $(this).fadeOut(400); 1141 // }); 1142 // }); 1143 1144 $(window).load(function(){ 1145 1146 // fixed footer 1147 $('#traveltour-fixed-footer').each(function(){ 1148 var fixed_footer = $(this); 1149 var placeholder = $('<div class="traveltour-fixed-footer-placeholder" ></div>'); 1150 1151 placeholder.insertBefore(fixed_footer); 1152 placeholder.height(fixed_footer.outerHeight()); 1153 $(window).resize(function(){ placeholder.height(fixed_footer.outerHeight()); }); 1154 }); 1155 1156 // side navigation bar 1157 new traveltour_header_side_nav( $('#traveltour-header-side-nav') ); 1158 1159 // sticky navigation 1160 if( !$('body').hasClass('single-tour') && !$('body').hasClass('tourmaster-template-payment') ){ 1161 new traveltour_sticky_navigation(); 1162 } 1163 1164 // anchoring 1165 new traveltour_anchor(); 1166 1167 }); 1168 1169})(jQuery); 1170 1171/***********/ 1172/* Plugins */ 1173/***********/ 1174 1175/* 1176 * jQuery mmenu v5.6.1 1177 */ 1178!function(e){function t(){e[n].glbl||(r={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},i={},a={},o={},e.each([i,a,o],function(e,t){t.add=function(e){e=e.split(" ");for(var n=0,s=e.length;s>n;n++)t[e[n]]=t.mm(e[n])}}),i.mm=function(e){return"mm-"+e},i.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),i.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},a.mm=function(e){return"mm-"+e},a.add("parent sub"),o.mm=function(e){return e+".mm"},o.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[n]._c=i,e[n]._d=a,e[n]._e=o,e[n].glbl=r)}var n="mmenu",s="5.6.1";if(!(e[n]&&e[n].version>s)){e[n]=function(e,t,n){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=t,this.conf=n,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[n].version=s,e[n].addons={},e[n].uniqueId=0,e[n].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[n].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[n].prototype={init:function(e){e=e.not("."+i.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+i.listview).children().removeClass(i.selected),e.addClass(i.selected),this.trigger("setSelected",e)},openPanel:function(t){var s=t.parent(),a=this;if(s.hasClass(i.vertical)){var o=s.parents("."+i.subopened);
1178if(o.length)return void this.openPanel(o.first());s.addClass(i.opened),this.trigger("openPanel",t),this.trigger("openingPanel",t),this.trigger("openedPanel",t)}else{if(t.hasClass(i.current))return;var r=this.$pnls.children("."+i.panel),l=r.filter("."+i.current);r.removeClass(i.highest).removeClass(i.current).not(t).not(l).not("."+i.vertical).addClass(i.hidden),e[n].support.csstransitions||l.addClass(i.hidden),t.hasClass(i.opened)?t.nextAll("."+i.opened).addClass(i.highest).removeClass(i.opened).removeClass(i.subopened):(t.addClass(i.highest),l.addClass(i.subopened)),t.removeClass(i.hidden).addClass(i.current),a.trigger("openPanel",t),setTimeout(function(){t.removeClass(i.subopened).addClass(i.opened),a.trigger("openingPanel",t),a.__transitionend(t,function(){a.trigger("openedPanel",t)},a.conf.transitionDuration)},this.conf.openingInterval)}},closePanel:function(e){var t=e.parent();t.hasClass(i.vertical)&&(t.removeClass(i.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+i.listview).children().removeClass(i.selected).filter("."+i.vertical).removeClass(i.opened);var e=this.$pnls.children("."+i.panel),t=e.first();this.$pnls.children("."+i.panel).not(t).removeClass(i.subopened).removeClass(i.opened).removeClass(i.current).removeClass(i.highest).addClass(i.hidden),this.openPanel(t)},togglePanel:function(e){var t=e.parent();t.hasClass(i.vertical)&&this[t.hasClass(i.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,t){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(t)},trigger:function(){var e=this,t=Array.prototype.slice.call(arguments),n=t.shift();if(this.cbck[n])for(var s=0,i=this.cbck[n].length;i>s;s++)this.cbck[n][s].apply(e,t)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each(function(){e(this).attr("id",i.mm(e(this).attr("id")))})),this.$menu.contents().each(function(){3==e(this)[0].nodeType&&e(this).remove()}),this.$pnls=e('<div class="'+i.panels+'" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(i.wrapper);var t=[i.menu];this.opts.slidingSubmenus||t.push(i.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&t.push(this.opts.extensions),this.$menu.addClass(t.join(" "))},_initPanels:function(t){var n=this,s=this.__findAddBack(t,"ul, ol");this.__refactorClass(s,this.conf.classNames.inset,"inset").addClass(i.nolistview+" "+i.nopanel),s.not("."+i.nolistview).addClass(i.listview);var o=this.__findAddBack(t,"."+i.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(t,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=t.add(t.find("."+i.panel)).add(this.__findAddBack(t,"."+i.listview).children().children(this.conf.panelNodetype)).not("."+i.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(i.vertical),l.each(function(){var t=e(this),s=t;t.is("ul, ol")?(t.wrap('<div class="'+i.panel+'" />'),s=t.parent()):s.addClass(i.panel);var a=t.attr("id");t.removeAttr("id"),s.attr("id",a||n.__getUniqueId()),t.hasClass(i.vertical)&&(t.removeClass(n.conf.classNames.vertical),s.add(s.parent()).addClass(i.vertical)),r=r.add(s)});var d=e("."+i.panel,this.$menu);r.each(function(t){var s,o,r=e(this),l=r.parent(),d=l.children("a, span").first();if(l.is("."+i.panels)||(l.data(a.sub,r),r.data(a.parent,l)),l.children("."+i.next).length||l.parent().is("."+i.listview)&&(s=r.attr("id"),o=e('<a class="'+i.next+'" href="#'+s+'" data-target="#'+s+'" />').insertBefore(d),d.is("span")&&o.addClass(i.fullsubopen)),!r.children("."+i.navbar).length&&!l.hasClass(i.vertical)){l.parent().is("."+i.listview)?l=l.closest("."+i.panel):(d=l.closest("."+i.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=d.closest("."+i.panel));var c=e('<div class="'+i.navbar+'" />');if(l.length){switch(s=l.attr("id"),n.opts.navbar.titleLink){case"anchor":_url=d.attr("href");break;case"panel":case"parent":_url="#"+s;break;default:_url=!1}c.append('<a class="'+i.btn+" "+i.prev+'" href="#'+s+'" data-target="#'+s+'" />').append(e('<a class="'+i.title+'"'+(_url?' href="'+_url+'"':"")+" />").text(d.text())).prependTo(r),n.opts.navbar.add&&r.addClass(i.hasnavbar)}else n.opts.navbar.title&&(c.append('<a class="'+i.title+'">'+n.opts.navbar.title+"</a>").prependTo(r),n.opts.navbar.add&&r.addClass(i.hasnavbar))}});var c=this.__findAddBack(t,"."+i.listview).children("."+i.selected).removeClass(i.selected).last(
1178).addClass(i.selected);c.add(c.parentsUntil("."+i.menu,"li")).filter("."+i.vertical).addClass(i.opened).end().each(function(){e(this).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).addClass(i.subopened)}),c.children("."+i.panel).not("."+i.vertical).addClass(i.opened).parentsUntil("."+i.menu,"."+i.panel).not("."+i.vertical).first().addClass(i.opened).addClass(i.subopened);var p=d.filter("."+i.opened);return p.length||(p=r.first()),p.addClass(i.opened).last().addClass(i.current),r.not("."+i.vertical).not(p.last()).addClass(i.hidden).end().filter(function(){return!e(this).parent().hasClass(i.panels)}).appendTo(this.$pnls),r},_initAnchors:function(){var t=this;r.$body.on(o.click+"-oncanvas","a[href]",function(s){var a=e(this),o=!1,r=t.$menu.find(a).length;for(var l in e[n].addons)if(e[n].addons[l].clickAnchor.call(t,a,r)){o=!0;break}var d=a.attr("href");if(!o&&r&&d.length>1&&"#"==d.slice(0,1))try{var c=e(d,t.$menu);c.is("."+i.panel)&&(o=!0,t[a.parent().hasClass(i.vertical)?"togglePanel":"openPanel"](c))}catch(p){}if(o&&s.preventDefault(),!o&&r&&a.is("."+i.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){t.__valueOrFn(t.opts.onClick.setSelected,a)&&t.setSelected(e(s.target).parent());var h=t.__valueOrFn(t.opts.onClick.preventDefault,a,"#"==d.slice(0,1));h&&s.preventDefault(),t.__valueOrFn(t.opts.onClick.close,a,h)&&t.close()}})},_initAddons:function(){var t;for(t in e[n].addons)e[n].addons[t].add.call(this),e[n].addons[t].add=function(){};for(t in e[n].addons)e[n].addons[t].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=i.umm(e)),e},__api:function(){var t=this,n={};return e.each(this._api,function(e){var s=this;n[s]=function(){var e=t[s].apply(t,arguments);return"undefined"==typeof e?n:e}}),n},__valueOrFn:function(e,t,n){return"function"==typeof e?e.call(t[0]):"undefined"==typeof e&&"undefined"!=typeof n?n:e},__refactorClass:function(e,t,n){return e.filter("."+t).removeClass(t).addClass(i[n])},__findAddBack:function(e,t){return e.find(t).add(e.filter(t))},__filterListItems:function(e){return e.not("."+i.divider).not("."+i.hidden)},__transitionend:function(e,t,n){var s=!1,i=function(){s||t.call(e[0]),s=!0};e.one(o.transitionend,i),e.one(o.webkitTransitionEnd,i),setTimeout(i,1.1*n)},__getUniqueId:function(){return i.mm(e[n].uniqueId++)}},e.fn[n]=function(s,i){return t(),s=e.extend(!0,{},e[n].defaults,s),i=e.extend(!0,{},e[n].configuration,i),this.each(function(){var t=e(this);if(!t.data(n)){var a=new e[n](t,s,i);a.$menu.data(n,a.__api())}})},e[n].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&"undefined"!=typeof Modernizr.csstransitions)return Modernizr.csstransitions;var e=document.body||document.documentElement,t=e.style,n="transition";if("string"==typeof t[n])return!0;var s=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var i=0;i<s.length;i++)if("string"==typeof t[s[i]+n])return!0;return!1}()};var i,a,o,r}}(jQuery),/* 1179 * jQuery mmenu offCanvas addon 1180 * mmenu.frebsite.nl 1181 * 1182 * Copyright (c) Fred Heusschen 1183 */ 1184function(e){var t="mmenu",n="offCanvas";e[t].addons[n]={setup:function(){if(this.opts[n]){var i=this.opts[n],a=this.conf[n];o=e[t].glbl,this._api=e.merge(this._api,["open","close","setPage"]),("top"==i.position||"bottom"==i.position)&&(i.zposition="front"),"string"!=typeof a.pageSelector&&(a.pageSelector="> "+a.pageNodetype),o.$allMenus=(o.$allMenus||e()).add(this.$menu),this.vars.opened=!1;var r=[s.offcanvas];"left"!=i.position&&r.push(s.mm(i.position)),"back"!=i.zposition&&r.push(s.mm(i.zposition)),this.$menu.addClass(r.join(" ")).parent().removeClass(s.wrapper),this.setPage(o.$page),this._initBlocker(),this["_initWindow_"+n](),this.$menu[a.menuInjectMethod+"To"](a.menuWrapperSelector);var l=window.location.hash;if(l){var d=this._getOriginalMenuId();d&&d==l.slice(1)&&this.open()}}},add:function(){s=e[t]._c,i=e[t]._d,a=e[t]._e,s.add("offcanvas slideout blocking modal background opening blocker page"),i.add("style"),a.add("resize")},clickAnchor:function(e,t){if(!this.opts[n])return!1;var s=this._getOriginalMenuId();if(s&&e.is('[href="#'+s+'"]'))return this.open(),!0;if(o.$page)return s=o.$page.first().attr("id"),s&&e.is('[href="#'+s+'"]')?(this.close(),!0):!1}},e[t].defaults[n]={position:"left",zposition:"back",blockUI:!0,moveBackgroun
1184d:!0},e[t].configuration[n]={pageNodetype:"div",pageSelector:null,noPageSelector:[],wrapPageIfNeeded:!0,menuWrapperSelector:"body",menuInjectMethod:"prepend"},e[t].prototype.open=function(){if(!this.vars.opened){var e=this;this._openSetup(),setTimeout(function(){e._openFinish()},this.conf.openingInterval),this.trigger("open")}},e[t].prototype._openSetup=function(){var t=this,r=this.opts[n];this.closeAllOthers(),o.$page.each(function(){e(this).data(i.style,e(this).attr("style")||"")}),o.$wndw.trigger(a.resize+"-"+n,[!0]);var l=[s.opened];r.blockUI&&l.push(s.blocking),"modal"==r.blockUI&&l.push(s.modal),r.moveBackground&&l.push(s.background),"left"!=r.position&&l.push(s.mm(this.opts[n].position)),"back"!=r.zposition&&l.push(s.mm(this.opts[n].zposition)),this.opts.extensions&&l.push(this.opts.extensions),o.$html.addClass(l.join(" ")),setTimeout(function(){t.vars.opened=!0},this.conf.openingInterval),this.$menu.addClass(s.current+" "+s.opened)},e[t].prototype._openFinish=function(){var e=this;this.__transitionend(o.$page.first(),function(){e.trigger("opened")},this.conf.transitionDuration),o.$html.addClass(s.opening),this.trigger("opening")},e[t].prototype.close=function(){if(this.vars.opened){var t=this;this.__transitionend(o.$page.first(),function(){t.$menu.removeClass(s.current).removeClass(s.opened),o.$html.removeClass(s.opened).removeClass(s.blocking).removeClass(s.modal).removeClass(s.background).removeClass(s.mm(t.opts[n].position)).removeClass(s.mm(t.opts[n].zposition)),t.opts.extensions&&o.$html.removeClass(t.opts.extensions),o.$page.each(function(){e(this).attr("style",e(this).data(i.style))}),t.vars.opened=!1,t.trigger("closed")},this.conf.transitionDuration),o.$html.removeClass(s.opening),this.trigger("close"),this.trigger("closing")}},e[t].prototype.closeAllOthers=function(){o.$allMenus.not(this.$menu).each(function(){var n=e(this).data(t);n&&n.close&&n.close()})},e[t].prototype.setPage=function(t){var i=this,a=this.conf[n];t&&t.length||(t=o.$body.find(a.pageSelector),a.noPageSelector.length&&(t=t.not(a.noPageSelector.join(", "))),t.length>1&&a.wrapPageIfNeeded&&(t=t.wrapAll("<"+this.conf[n].pageNodetype+" />").parent())),t.each(function(){e(this).attr("id",e(this).attr("id")||i.__getUniqueId())}),t.addClass(s.page+" "+s.slideout),o.$page=t,this.trigger("setPage",t)},e[t].prototype["_initWindow_"+n]=function(){o.$wndw.off(a.keydown+"-"+n).on(a.keydown+"-"+n,function(e){return o.$html.hasClass(s.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0});var e=0;o.$wndw.off(a.resize+"-"+n).on(a.resize+"-"+n,function(t,n){if(1==o.$page.length&&(n||o.$html.hasClass(s.opened))){var i=o.$wndw.height();(n||i!=e)&&(e=i,o.$page.css("minHeight",i))}})},e[t].prototype._initBlocker=function(){var t=this;this.opts[n].blockUI&&(o.$blck||(o.$blck=e('<div id="'+s.blocker+'" class="'+s.slideout+'" />')),o.$blck.appendTo(o.$body).off(a.touchstart+"-"+n+" "+a.touchmove+"-"+n).on(a.touchstart+"-"+n+" "+a.touchmove+"-"+n,function(e){e.preventDefault(),e.stopPropagation(),o.$blck.trigger(a.mousedown+"-"+n)}).off(a.mousedown+"-"+n).on(a.mousedown+"-"+n,function(e){e.preventDefault(),o.$html.hasClass(s.modal)||(t.closeAllOthers(),t.close())}))};var s,i,a,o}(jQuery),/* 1185 * jQuery mmenu scrollBugFix addon 1186 * mmenu.frebsite.nl 1187 * 1188 * Copyright (c) Fred Heusschen 1189 */ 1190function(e){var t="mmenu",n="scrollBugFix";e[t].addons[n]={setup:function(){var i=this,r=this.opts[n];this.conf[n];if(o=e[t].glbl,e[t].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.modal&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),r=this.opts[n]=e.extend(!0,{},e[t].defaults[n],r),r.fix)){var l=this.$menu.attr("id"),d=!1;this.bind("opening",function(){this.$pnls.children("."+s.current).scrollTop(0)}),o.$docu.on(a.touchmove,function(e){i.vars.opened&&e.preventDefault()}),o.$body.on(a.touchstart,"#"+l+"> ."+s.panels+"> ."+s.current,function(e){i.vars.opened&&(d||(d=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),d=!1))}).on(a.touchmove,"#"+l+"> ."+s.panels+"> ."+s.current,function(t){i.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&t.stopPropagation()}),o.$wndw.on(a.orientationchange,function(){i.$pnls.children("."+s.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})})}},add:function(){s=e[t]._c,i=e[t]._d,a=e[t]._e},clickAnchor:function(e,t){}},e[t].defaults[n]={fix:!0};var s,i,a,o}(jQuery); 1191/* 1192 * jQuery Superfish Menu Plugin 1193 * Copyright (c) 2013 Joel Birch 1194 * 1195 * Dual licensed under the MIT and GPL licenses: 1196 * http://www.opensource.org/licenses/mit-license.php 1197 * http://www.gnu.org/licenses/gpl.html 1198 */ 1199!function(e,s){"use strict";var o=function(){var o={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},t=function(){var s=/^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);return s&&e("html").css("cursor","pointer").on("click",e.noop),s}(),n=function(){var e=document.documentElement.style;return"behavior"in e&&"fill"in e&&/iemobile/i.test(navigator.userAgent)}(),i=function(){return!!s.PointerEvent}(),r=function(e,s){var t=o.menuClass;s.cssArrows&&(t+=" "+o.menuArrowClass),e.toggleClass(t)},a=function(s,t){return s.find("li."+t.pathClass).slice(0,t.pathLevels).addClass(t.hoverClass+" "+o.bcClass).filter(function(){return e(this).children(t.popUpSelector).hide().show().length}).removeClass(t.pathClass)},l=function(e){e.children("a").toggleClass(o.anchorClass)},h=function(e){var s=e.css("ms-touch-action"),o=e.css("touch-action");o=o||s,o="pan-y"===o?"auto":"pan-y",e.css({"ms-touch-action":o,"touch-action":o})},u=function(s,o){var r="li:has("+o.popUpSelector+")";e.fn.hoverIntent&&!o.disableHI?s.hoverIntent(c,f,r):s.on("mouseenter.superfish",r,c).on("mouseleave.
1199superfish",r,f);var a="MSPointerDown.superfish";i&&(a="pointerdown.superfish"),t||(a+=" touchend.superfish"),n&&(a+=" mousedown.superfish"),s.on("focusin.superfish","li",c).on("focusout.superfish","li",f).on(a,"a",o,p)},p=function(s){var o=e(this),t=m(o),n=o.siblings(s.data.popUpSelector);return t.onHandleTouch.call(n)===!1?this:void(n.length>0&&n.is(":hidden")&&(o.one("click.superfish",!1),"MSPointerDown"===s.type||"pointerdown"===s.type?o.trigger("focus"):e.proxy(c,o.parent("li"))()))},c=function(){var s=e(this),o=m(s);clearTimeout(o.sfTimer),s.siblings().superfish("hide").end().superfish("show")},f=function(){var s=e(this),o=m(s);t?e.proxy(d,s,o)():(clearTimeout(o.sfTimer),o.sfTimer=setTimeout(e.proxy(d,s,o),o.delay))},d=function(s){s.retainPath=e.inArray(this[0],s.$path)>-1,this.superfish("hide"),this.parents("."+s.hoverClass).length||(s.onIdle.call(v(this)),s.$path.length&&e.proxy(c,s.$path)())},v=function(e){return e.closest("."+o.menuClass)},m=function(e){return v(e).data("sf-options")};return{hide:function(s){if(this.length){var o=this,t=m(o);if(!t)return this;var n=t.retainPath===!0?t.$path:"",i=o.find("li."+t.hoverClass).add(this).not(n).removeClass(t.hoverClass).children(t.popUpSelector),r=t.speedOut;if(s&&(i.show(),r=0),t.retainPath=!1,t.onBeforeHide.call(i)===!1)return this;i.stop(!0,!0).animate(t.animationOut,r,"easeOutQuad",function(){var s=e(this);t.onHide.call(s)})}return this},show:function(){var e=m(this);if(!e)return this;var s=this.addClass(e.hoverClass),o=s.children(e.popUpSelector);return e.onBeforeShow.call(o)===!1?this:(o.stop(!0,!0).animate(e.animation,e.speed,"easeOutQuad",function(){e.onShow.call(o)}),this)},destroy:function(){return this.each(function(){var s,t=e(this),n=t.data("sf-options");return n?(s=t.find(n.popUpSelector).parent("li"),clearTimeout(n.sfTimer),r(t,n),l(s),h(t),t.off(".superfish").off(".hoverIntent"),s.children(n.popUpSelector).attr("style",function(e,s){return s.replace(/display[^;]+;?/g,"")}),n.$path.removeClass(n.hoverClass+" "+o.bcClass).addClass(n.pathClass),t.find("."+n.hoverClass).removeClass(n.hoverClass),n.onDestroy.call(t),void t.removeData("sf-options")):!1})},init:function(s){return this.each(function(){var t=e(this);if(t.data("sf-options"))return!1;var n=e.extend({},e.fn.superfish.defaults,s),i=t.find(n.popUpSelector).parent("li");n.$path=a(t,n),t.data("sf-options",n),r(t,n),l(i),h(t),u(t,n),i.not("."+o.bcClass).superfish("hide",!0),n.onInit.call(this)})}}}();e.fn.superfish=function(s,t){return o[s]?o[s].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof s&&s?e.error("Method "+s+" does not exist on jQuery.fn.superfish"):o.init.apply(this,arguments)},e.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:e.noop,onBeforeShow:e.noop,onShow:e.noop,onBeforeHide:e.noop,onHide:e.noop,onIdle:e.noop,onDestroy:e.noop,onHandleTouch:e.noop}}(jQuery,window);
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.