1var $ = jQuery.noConflict(); 2var docHeight = $(document).height(); 3var position = $(window).scrollTop(); 4var months = [ 5 "×× ××ר", 6 "פ×ר××ר", 7 "×רץ", 8 "×פר××", 9 "×××", 10 "××× ×", 11 "××××", 12 "××××ס×", 13 "ספ×××ר", 14 "×××§×××ר", 15 "× ××××ר", 16 "×צ××ר", 17]; 18var days = ["×", "×", "×", "×", "×", "×", "ש"]; 19if (siteObject.site_lang === "en") { 20 months = [ 21 "January", 22 "February", 23 "March", 24 "April", 25 "May", 26 "June", 27 "July", 28 "August", 29 "September", 30 "October", 31 "November", 32 "December", 33 ]; 34 days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; 35} 36 37var is_rtl = jQuery("html").attr("lang") === "en-US" ? false : true; 38// console.log("is_rtl: ", is_rtl); 39jQuery(document).scroll(function () { 40 if (jQuery("body").hasClass("iphone")) { 41 if (jQuery(".single-exhibition-wrap").length) { 42 jQuery(".single-exhibition-wrap").css( 43 "background-position", 44 "0px " + $(document).scrollTop() + "px" 45 ); 46 } 47 } 48}); 49 50function toptix_open_thankyou_popup() { 51 jQuery.magnificPopup.open({ 52 items: { 53 src: "#toptix-thank-you", 54 }, 55 type: "inline", 56 }); 57} 58 59function init_feedback_slider() { 60 if (jQuery(".feedback-slider").length) { 61 jQuery(".feedback-slider").slick({ 62 dots: true, 63 infinite: false, 64 speed: 300, 65 slidesToShow: 1, 66 slidesToScroll: 1, 67 rtl: is_rtl, 68 arrows: true, 69 responsive: [ 70 { 71 breakpoint: 640, 72 settings: { 73 arrows: false, 74 }, 75 }, 76 ], 77 }); 78 } 79} 80function init_activity_carousel_slider() { 81 if (jQuery(".activity-carousel-slider").length) { 82 if (jQuery(window).width() > 640) { 83 jQuery(".activity-carousel-slider").slick({ 84 dots: true, 85 infinite: false, 86 speed: 300, 87 slidesToShow: 3, 88 slidesToScroll: 1, 89 rtl: is_rtl, 90 responsive: [ 91 { 92 breakpoint: 1024, 93 settings: { 94 slidesToShow: 3, 95 slidesToScroll: 3, 96 infinite: true, 97 dots: true, 98 }, 99 }, 100 { 101 breakpoint: 600, 102 settings: { 103 slidesToShow: 1, 104 slidesToScroll: 1, 105 }, 106 }, 107 { 108 breakpoint: 480, 109 settings: { 110 slidesToShow: 1, 111 slidesToScroll: 1, 112 }, 113 }, 114 ], 115 }); 116 } else { 117 $(".for-mobile.slider-for").slick({ 118 slidesToShow: 1, 119 slidesToScroll: 1, 120 arrows: true, 121 fade: false, 122 rtl: true, 123 infinite: true, 124 asNavFor: ".for-mobile.slider-nav", 125 }); 126 $(".for-mobile.slider-nav").slick({ 127 slidesToShow: 5, 128 slidesToScroll: 1, 129 asNavFor: ".for-mobile.slider-for",
130 dots: false, 131 rtl: true, 132 infinite: true, 133 arrows: false, 134 // centerMode: true, 135 focusOnSelect: true, 136 }); 137 } 138 } 139} 140 141$(document).ready(function () { 142 143 if (jQuery("body").hasClass("single-mt_exhibition")) { 144 // Block form and show loader. 145 jQuery(".single-buy-now-form").addClass("blocked"); 146 jQuery(".sidebar .single-buy-now-form").append( 147 '<span class="ajax-loader"></span>' 148 ); 149 } 150 151 init_activity_carousel_slider(); 152 init_feedback_slider(); 153 154 $(".popup-youtube").magnificPopup({ 155 type: "iframe", 156 mainClass: "mfp-fade", 157 removalDelay: 160, 158 preloader: false, 159 fixedContentPos: false, 160 }); 161 162 if (is_rtl) { 163 moment.locale("he"); 164 } else { 165 moment.locale("en"); 166 } 167 168 // if ( ! $('body').hasClass('home') ) { 169 // const scroller = new LocomotiveScroll({ 170 // // el: document.querySelector('[data-scroll-container]'), 171 // smooth: true 172 // }); 173 // } 174 175 // Open cart and user via popup - TOPTIX 176 $(".cart-menu-btn, .user-menu-btn").on("click", function (e) { 177 e.preventDefault(); 178 var source = $(this).attr("href"); 179 if (source && source != "#") { 180 $.magnificPopup.open({ 181 items: { 182 src: source, 183 }, 184 type: "iframe", 185 iframe: { 186 patterns: { 187 yourcustomsource: { 188 index: "", 189 src: "%id%", 190 }, 191 }, 192 }, 193 // other options 194 }); 195 } 196 }); 197 198 toggle_dark_mode(); 199 init_select(); 200 init_footer_logos_slider(); 201 init_homepage_functions(); 202 mobile_nav(); 203 main_nav_submenu(); // Mobile navigation 204 mobile_footer_nav_init(); // Turn mobile footer navigation into accordion 205 a11y_menu(); // Accessibility for main menu 206 fancybox_init(); // fancyBox init 207 fast_contact_form(); // Fast contact form init 208 search_box_init(); // Toggle search box 209 btn_scroll_to(); // Scroll-to button 210 ajax_load_more(); // Ajax load more 211 side_menu(); 212 buy_now_form(); 213 // ajax_form(); 214 sticky_header_init(); 215 /* Blocks */ 216 init_block_hero_slider(); // Block hero slider 217 init_block_slider_with_thumbnails(); // Block slider with thumbnails 218 init_block_slider_testimonials(); // Block slider testimonials 219 init_block_slider_images(); // Block slider images 220 init_block_slider_posts(); // Block slider posts 221 init_block_tabs(); // Block tabs 222 init_block_accordion(); // Block accordion 223 224 // reorder magazine posts 225 if (jQuery(".mag-posts-wrap .entry-article").length) { 226 var divList = jQuery(".mag-posts-wrap .entry-article"); 227 divList.sort(function (a, b) { 228 return ( 229 $(b).data("date_strtotime") - 230 jQuery(a).data("date_strtotime") 231 ); 232 }); 233 jQuery(".mag-posts-wrap").html(divList); 234 } 235 236}); 237 238$(window).load(function() { 239 if( typeof fullpage !=='undefined'){ 240 $.fn.fullpage.reBuild(); 241 } 242 243 fade_in_init(); // Fade-in init 244 245 window.dispatchEvent( new Event('resize') ); 246 247 jQuery(".events-results .results-wrap .entry-result").each(function() { 248 var this_item = jQuery(this); 249 var row_item = this_item.find(".entry-body .custom-row"); 250 // console.log(row_item.html().length); 251 if (13 == row_item.html().length) { 252 row_item.html( 253 '<span class="no-posts">×××××××× ×¡××ר, × ×ª×¨×× ×××× ××ר!</span>' 254 ); 255 } 256 }); 257}); 258 259function init_select() { 260 $("select") 261 .not(".month-select, .year-select, .buy-now-date-picker-a11y") 262 .selectize({ 263 create: false, 264 showEmptyOptionInDropdown: true, 265 closeAfterSelect: true, 266 onChange: function (data) { 267 // console.log("onChange"); 268 hide_mobile_keyboard(); 269 }, 270 }); 271} 272function hide_mobile_keyboard() { 273 document.activeElement.blur(); 274} 275function toggle_dark_mode() { 276 if (Cookies.get("darkMode")) { 277 $("body").addClass("dark-theme"); 278 } 279 280 $(".dark-mode-btn").on("click", function () { 281 if ($("body").hasClass("dark-theme")) { 282 $("body").removeClass("dark-theme"); 283 Cookies.remove("darkMode"); 284 } else { 285 $("body").addClass("dark-theme"); 286 Cookies.set("darkMode", true); 287 } 288 }); 289} 290 291function is_home() { 292 if ($("body").hasClass("home")) { 293 return true; 294 } else { 295 return false; 296 } 297} 298
299function is_rtl() { 300 if ($("body").hasClass("rtl")) { 301 return true; 302 } else { 303 return false; 304 } 305} 306 307function is_mobile(width) { 308 if (!width) { 309 width = 992; 310 } 311 312 if ($(window).width() < width) { 313 return true; 314 } else { 315 return false; 316 } 317} 318 319function buy_now_form() { 320 var buy_now_form = { 321 date_picker: $(".buy-now-date-picker"), 322 hours_select: $("select.hour-select"), 323 current_date: "", 324 selected_post_id: "", 325 current_form: "", 326 327 get_post_ajax: function (post_id) { 328 var form = buy_now_form.current_form; 329 form.parent().find(".buy-now-results").empty(); 330 form.find(".hour-select").remove(); 331 form.find(".hidden-fields").slideUp(); 332 333 form.append('<span class="ajax-loader"></span>'); 334 335 if (typeof buy_now_form.date_picker_obj != "undefined") { 336 form.find(".buy-now-date-picker").val(""); 337 buy_now_form.date_picker_obj.remove(); 338 } 339 340 $.ajax({ 341 type: "POST", 342 dataType: "json", 343 url: siteObject.ajaxurl, 344 data: { 345 action: "ajax_get_post", 346 post_id: post_id, 347 }, 348 success: function (results) { 349 // console.log("ajax_get_posts"); 350 form.find(".ajax-loader").remove(); 351 352 // remove disabled class from events inside the calendar datepicker. 353 jQuery(".qs-datepicker-container .qs-event.qs-disabled").removeClass( 354 "qs-disabled" 355 ); 356 357 if (results.ok && results.dates && results.html) { 358 buy_now_form.html_append = results.html; 359 // console.log( 'results.dates', results.dates ); 360 buy_now_form.show_date_picker(results.dates, form); 361 362 // build a11y date_picker select 363 if (results.dates) { 364 // console.log("empty a11y select"); 365 $("select.buy-now-date-picker-a11y").html(""); 366 var dates_options = '<option value="">×××¨× ×ª×ר××</option>'; 367 $.each(results.dates, function (key, item) { 368 var i = new Date(item); 369 var date = moment(i); 370 var new_val = date.format("ddd - D.M.YYYY"); 371 dates_options += 372 '<option value="' + 373 item + 374 '">' + 375 "××× " + 376 new_val + 377 "</option>"; 378 }); 379 380 //console.log(dates_options); 381 382 $("select.buy-now-date-picker-a11y").prop("disabled", false); 383 $("select.buy-now-date-picker-a11y").html(dates_options); 384 385 window.localStorage.removeItem("thanks-image"); 386 var thanks_image = results.thumbnail; 387 if (thanks_image) { 388 window.localStorage.setItem("thanks-image", thanks_image); 389 } 390 } 391 } 392 }, 393 }); 394 }, 395 396 show_date_picker: function (dates, form, append) { 397 var formatted_dates = []; 398 var parent_class = form.attr("class").replace(" ", "."); 399 if (Array.isArray(dates)) { 400 dates.forEach((element) => { 401 formatted_dates.push(new Date(element.replace(" ", "T"))); 402 }); 403 } else { 404 formatted_dates = [new Date(dates)]; 405 } 406 407 // console.log("formatted_dates"); 408 409 buy_now_form.date_picker_obj = datepicker( 410 "." + parent_class + " .buy-now-date-picker", 411 { 412 showAllDates: true, 413 customDays: days, 414 customMonths: months, 415 customOverlayMonths: months, 416 startDate: formatted_dates[0], 417 minDate: formatted_dates[0], 418 // maxDate: formatted_dates[ formatted_dates.length - 1 ], 419 events: formatted_dates, 420 onShow: (instance) => { 421 // console.log("on show"); 422 hide_mobile_keyboard(); 423 }, 424 onSelect: (instance) => { 425 // console.log("on select"); 426 form.append('<span class="ajax-loader"></span>'); 427 // This will display the date as `1/1/2019`. 428 if (instance.dateSelected) { 429 var i = new Date(instance.dateSelected); 430 var date = moment(i); 431 var new_val = date.format("ddd - D.M.YYYY"); 432 if (is_rtl) { 433 form.find(".buy-now-date-picker").val("××× " + new_val); 434 } else { 435 form.find(".buy-now-date-picker").val(new_val); 436 } 437 438 buy_now_form.ajax_get_date_hours( 439 date.format("DD.MM.YYYY"), 440 buy_now_form.selected_post_id 441 ); 442 } 443 }, 444 } 445 ); 446 $(".buy-now-date-picker").prop("disabled", false); 447 448 // build a11y date_picker select 449 if (formatted_dates) { 450 $("select.buy-now-date-picker-a11y").html(""); 451 var dates_options = '<option value="">×××¨× ×ª×ר××</option>'; 452 $.each(formatted_dates, function (key, item) { 453 var i = new Date(item); 454 var date = moment(i); 455 var new_val = date.format("ddd - D.M.YYYY"); 456 dates_options += 457 '<option value="' + item + '">' + "××× " + new_val + "</option>"; 458 }); 459 460 //console.log(dates_options); 461 462 $("select.buy-now-date-picker-a11y").prop("disabled", false); 463 $("select.buy-now-date-picker-a11y").html(dates_options); 464 $("select.buy-now-date-picker-a11y").on("change", function () { 465 hide_mobile_keyboard(); 466 467 buy_now_form.ajax_get_date_hours( 468 jQuery(this).val(), 469 buy_now_form.selected_post_id 470 ); 471 }); 472 } 473 }, 474 475 ajax_get_date_hours: function (date, post_id) { 476 var form = buy_now_form.current_form; 477 478 form.find(".hour-select").remove(); 479 form.find(".btn").attr("href", ""); 480 481 jQuery(".single-buy-now-form").find(".btn.orange").addClass("disabled"); 482 jQuery(".single-buy-now-form").find(".btn.orange").prop("disabled", true); 483 484 // Block form and show loader. 485 jQuery(".single-buy-now-form").addClass("blocked"); 486 jQuery(".side-menu-wrap .buy-form").addClass("blocked"); 487 488 jQuery(".sidebar .single-buy-now-form").append( 489 '<span class="ajax-loader"></span>' 490 ); 491 jQuery(".side-menu-wrap .buy-form").append( 492 '<span class="ajax-loader"></span>' 493 ); 494 495 $.ajax({
496 type: "POST", 497 dataType: "json", 498 url: siteObject.ajaxurl, 499 data: { 500 action : "ajax_get_post_date_hours", 501 post_id: post_id, 502 date : date, 503 }, 504 success: function (results) { 505 506 $(".side-menu-wrap .ajax-loader").remove(); 507 508 console.log( 'results', results); 509 510 if (results.ok && results.hours) { 511 // NEW SELECT with labels 512 513 // remove origin hour select if exists 514 if (form.find(".hour-select-origin").length) { 515 // console.log("remove prev hour select"); 516 jQuery(".hour-select-origin").remove(); 517 } 518 // remove MsDropdown if exists 519 520 if (form.find(".ms-dd.ms-pr").length) { 521 // console.log("remove prev MsDropdown if exists"); 522 form.find(".ms-dd.ms-pr").remove(); 523 } 524 525 if( jQuery('.box-wrap.black .banner-buy-form .single-buy-now-form .ms-dd.ms-pr').length ){ 526 // console.log('remove black box selector'); 527 jQuery('.box-wrap.black .banner-buy-form .single-buy-now-form .ms-dd.ms-pr').first().remove() 528 } 529 530 var html = 531 '<select class="hour-select hour-select-origin" style="display="none">'; 532 $.each(results.hours, function (key, val) { 533 var option_url = val.url; 534 var stock_label = val.stock_label; 535 var left_ticket = val.left_ticket; 536 var image_url = ""; 537 var option_disabled = ""; 538 if( left_ticket.show && left_ticket.tickets <= 0 ){ 539 image_url = siteObject.out_of_stock; 540 } 541 else if( left_ticket.show && left_ticket.tickets <= 10 ){ 542 image_url = siteObject.latest_in_stock; 543 } 544 // else if (stock_label.stock === "last") { 545 // image_url = siteObject.latest_in_stock; 546 // } else if (stock_label.stock === "sold") { 547 // image_url = siteObject.out_of_stock; 548 // //option_disabled = 'disabled'; 549 // } 550 html += '<option value="' + option_url + '" data-image="' + image_url + '"" ' + option_disabled + ">" + val.date + 551 "</option>"; 552 }); 553 554 html += "</select>"; 555 556 // append event href to the button 557 if (results.main_link) { 558 form.find(".btn").attr("href", results.main_link); 559 } 560 561 // append hours select after last selectbox 562 if (jQuery("body").hasClass("VA_keyboardNav")) { 563 form.find(".a11y-date-picker-selector").after(html); 564 } else { 565 form.find(".date-picker-wrap").after(html); 566 //init_select(); 567 // console.log("init dd select"); 568 569 var current_event_title = form 570 .find('input[name="current_event_title"]') 571 .val(); 572 if ( 573 typeof current_event_title != "undefined" && 574 current_event_title 575 ) { 576 window.localStorage.setItem("event-title", current_event_title); 577 } 578 579 var event_date = form.find(".buy-now-date-picker").val(); 580 console.log( 'event_date', event_date ); 581 if (event_date) { 582 window.localStorage.removeItem("chosen-date"); 583 window.localStorage.setItem("chosen-date", event_date); 584 } 585 586 new MsDropdown(".hour-select-origin"); 587 588 jQuery(".hour-select-origin").on("change", function () { 589 var selected_hour = jQuery(this).find("option:selected").text(); 590 $.each(results.hours, function (key, val) { 591 var stock = val.stock_label.stock; 592 if (selected_hour === val.date) { 593 if (stock === "sold") { 594 form.find(".hidden-fields a.btn").addClass("disabled"); 595 jQuery(".single-buy-now-form") 596 .find(".btn.orange") 597 .addClass("disabled"); 598 jQuery(".single-buy-now-form") 599 .find(".btn.orange") 600 .prop("disabled", true); 601 } else { 602 form.find(".hidden-fields a.btn").removeClass("disabled"); 603 jQuery(".single-buy-now-form") 604 .find(".btn.orange") 605 .removeClass("disabled"); 606 jQuery(".single-buy-now-form") 607 .find(".btn.orange") 608 .prop("disabled", false); 609 } 610 } 611 }); 612 // console.log("hour-select-origin change"); 613 614 var event_hour_txt = form 615 .find("select.hour-select-origin") 616 .val(); 617 618 var event_hour_ms = jQuery('.single-buy-now-form .ms-dd-header .option-selected .ms-middle .ms-dd-option-content .ms-dd-label').text(); 619 var event_hours = ""; 620 if (event_hour_txt) { 621 // console.log("event_hour_txt: ", event_hour_txt); 622 var main_hour_link = event_hour_txt; 623 event_hours = event_hour_txt.replace(/\D/g, ""); 624 } 625 626 if(event_hour_ms){ 627 window.localStorage.removeItem("chosen-hours"); 628 window.localStorage.setItem("chosen-hours", event_hour_ms); 629 } else if (event_hours) { 630 event_hours = event_hours.slice(-4); 631 // console.log("event_hours: ", event_hours); 632 window.localStorage.removeItem("chosen-hours"); 633 window.localStorage.setItem("chosen-hours", event_hours); 634 } 635 636 if (form.find('input[name="current_event_thumbnail"]').length) { 637 var thanks_image = form 638 .find('input[name="current_event_thumbnail"]') 639 .val(); 640 if (thanks_image) { 641 window.localStorage.setItem("thanks-image", thanks_image); 642 } 643 } 644 645 if (main_hour_link) { 646 form.find(".btn").attr("href", main_hour_link); 647 form.find(".hidden-fields .btn").attr("href", main_hour_link); 648 } 649 650 hide_mobile_keyboard(); 651 }); 652 jQuery(".hour-select-origin").trigger("change"); 653 //hide_mobile_keyboard(); 654 } 655 656 // get main link per selected hour
657 var hour_link = jQuery(".hour-select-origin").val(); 658 659 form.find(".hidden-fields").slideDown(); 660 form 661 .parent() 662 .find(".buy-now-results") 663 .html(buy_now_form.html_append); 664 665 // setTimeout( function(){ 666 // if( hour_link ) { 667 // form.find('.btn').attr('href', hour_link ); 668 // form.find('.hidden-fields .btn').attr('href', hour_link ); 669 // } else if ( results.main_link ) { 670 // form.find('.hidden-fields .btn').attr('href', results.main_link ); 671 // } 672 // }, 1000 ); 673 } 674 675 //v2 676 form.find(".ajax-loader").remove(); 677 jQuery(".single-buy-now-form").removeClass("blocked"); 678 jQuery(".side-menu-wrap .buy-form").removeClass("blocked"); 679 680 var hours_exists = true; 681 if( results.hours ) { 682 var hours_array = []; 683 $.each(results.hours, function (key, val) { 684 var hour = val.date.slice(0, -3); 685 hours_array.push(parseInt(hour)); 686 }); 687 // console.log(hours_array); 688 let last_available_hour = hours_array[hours_array.length - 1]; 689 const d = new Date(); 690 let current_hour = parseInt(d.getHours()); 691 //current_hour = 17; 692 693 // console.log(last_available_hour); 694 // console.log(current_hour); 695 696 if( last_available_hour < current_hour ) { 697 hours_exists = false; 698 } 699 } 700 701 jQuery('body.single-mt_exhibition .activity-details .col4 .box-wrap .hours-end-message').remove(); 702 703 if( ! hours_exists ) { 704 console.log('Not Available hours today'); 705 var single_form_wrapper = jQuery('.exhibition-content .sidebar .box-wrap'); 706 var hours_message = '×סת×××× ×ר×××©× ×××××. × × ××××ר ת×ר×× ××ר'; 707 if( jQuery('html').attr('lang') === 'en-US' ) { 708 hours_message = 'Todayâs ticket sales have ended, please select a different date.'; 709 } 710 711 // if( single_form_wrapper.length ) { 712 // single_form_wrapper.append('<div class="hours-end-message">'+hours_message+'</div>'); 713 // } else { 714 // jQuery('body.single-mt_exhibition .activity-details .col4 .box-wrap').append('<div class="hours-end-message">'+hours_message+'</div>'); 715 // } 716 717 718 //jQuery('.single-buy-now-form .ms-dd').hide(); 719 720 } else { 721 console.log('Available hours today'); 722 jQuery('.single-buy-now-form .ms-dd').show(); 723 } 724 }, 725 }); 726 }, 727 728 init: (function () { 729 $(".buy-form .btn, .buy-btn").on("click", function (e) { 730 e.preventDefault(); 731 if (!jQuery(this).hasClass("disabled")) { 732 var source = $(this).attr("href"); 733 734 if (source && source != "#") { 735 close_side_menu(); 736 737 $.magnificPopup.open({ 738 items: { 739 src: source, 740 }, 741 type: "iframe", 742 iframe: { 743 patterns: { 744 yourcustomsource: { 745 index: "", 746 src: "%id%", 747 }, 748 }, 749 }, 750 }); 751 } 752 } 753 }); 754 755 $("form.buy-now-form select.event-select").on("change", function () { 756 buy_now_form.current_form = $(this).parents("form"); 757 buy_now_form.selected_post_id = $(this).val(); 758 // console.log("event-select changed"); 759 760 var event_title = $(this) 761 .parents("form") 762 .find(".event-select option:selected") 763 .text(); 764 765 if (event_title) { 766 window.localStorage.removeItem("event-title"); 767 window.localStorage.setItem("event-title", event_title); 768 } 769 770 if (buy_now_form.selected_post_id) { 771 buy_now_form.get_post_ajax(buy_now_form.selected_post_id); 772 } 773 }); 774 775 $("body").on("change", "select.hour-select", function () { 776 var val = $(this).val(); 777 var parent = $(this).parents("form"); 778 if (val) { 779 parent.find(".btn").attr("href", val); 780 } 781 }); 782 783 if ($(".single-buy-now-form").length) { 784 $(".single-buy-now-form").each(function (index, value) { 785 var form = $(this); 786 var post_id = $(this).attr("data-post-id"); 787 var dates = $.parseJSON( $(this).attr("data-dates") ); 788 console.log('dates', dates); 789 790 var formatted_dates = []; 791 var items = []; 792 var parent_class = $(this).parent().attr("class"); 793 794 if (Array.isArray(dates)) {
795 dates.forEach(function (item) { 796 var date = moment(item, moment.defaultFormat); 797 if (!items.includes(item)) { 798 formatted_dates.push(new Date(date.toDate())); 799 items.push(item); 800 } 801 }); 802 } 803 804 // console.log( formatted_dates ); 805 // console.log(items); 806 807 if (formatted_dates[0]) { 808 setTimeout(function () { 809 buy_now_form.current_form = form; 810 console.log('3'); 811 buy_now_form.ajax_get_date_hours( 812 moment(formatted_dates[0]).format("DD.MM.YYYY"), 813 post_id 814 ); 815 }, 1000); 816 } 817 818 datepicker($(this).find(".buy-now-date-picker")[0], { 819 showAllDates: true, 820 customDays: days, 821 customMonths: months, 822 customOverlayMonths: months, 823 dateSelected: formatted_dates[0], 824 minDate: formatted_dates[0], 825 startDate: formatted_dates[0], 826 maxDate: formatted_dates[formatted_dates.length - 1], 827 events: formatted_dates, 828 formatter: (input, date, instance) => { 829 var i = new Date(instance.dateSelected); 830 var date = moment(i); 831 if (siteObject.site_lang === "en") { 832 var new_val = date.format("D.M.YYYY"); 833 input.value = new_val; // selected date placeholder 834 } else { 835 var new_val = date.format("ddd - D.M.YYYY"); 836 // console.log(new_val); 837 input.value = "××× " + new_val; // selected date placeholder 838 } 839 }, 840 onShow: (instance) => { 841 // console.log("onShow"); 842 // fix disabled events. 843 jQuery(".qs-datepicker-container .qs-squares .qs-event").each( 844 function () { 845 if (jQuery(this).hasClass("qs-disabled")) { 846 jQuery(this).removeClass("qs-disabled"); 847 } 848 } 849 ); 850 hide_mobile_keyboard(); 851 }, 852 onMonthChange: (instance) => { 853 // console.log("onMonthChange"); 854 jQuery(".qs-datepicker-container .qs-squares .qs-event").each( 855 function () { 856 if (jQuery(this).hasClass("qs-disabled")) { 857 jQuery(this).removeClass("qs-disabled"); 858 } 859 } 860 ); 861 }, 862 onSelect: (instance) => { 863 // console.log("onSelect"); 864 865 if (instance.dateSelected) { 866 // if is single event page show loader 867 if (jQuery("body").hasClass("single-mt_exhibition")) { 868 form.append('<span class="ajax-loader"></span>'); 869 } 870 871 var i = new Date(instance.dateSelected); 872 var date = moment(i); 873 var new_val = date.format("ddd - D.M.YYYY"); 874 875 buy_now_form.current_form = $(this); 876 // console.log("new_val: ", new_val); 877 if (is_rtl) { 878 $(this).find(".buy-now-date-picker").val("××× " + new_val); 879 } else { 880 $(this).find(".buy-now-date-picker").val(new_val); 881 } 882 883 buy_now_form.ajax_get_date_hours( 884 date.format("DD.MM.YYYY"), 885 post_id 886 ); 887 } 888 }, 889 }); 890 }); 891 } 892 })(), 893 }; 894} 895 896function fade_in_init() { 897 $(".fade-in").css("opacity", 1); 898} 899 900function mobile_nav() { 901 mobileNav = { 902 triggerClick: function () { 903 $(".mobile-menu-btn").on("click", function () { 904 $(".mobile-menu-wrap").slideDown(700); 905 $("body").addClass("menu-open"); 906 }); 907 908 $(".mobile-menu-close-btn").on("click", function () { 909 $(".mobile-menu-wrap").slideUp(700); 910 $("body").removeClass("menu-open"); 911 }); 912 913 $(".mobile-menu-wrap .menu-item-has-children > .icon").on( 914 "click", 915 function (e) { 916 e.preventDefault(); 917 918 var parent = $(this).parent(); 919 920 parent.siblings().slideToggle(700, function () {}); 921 parent.toggleClass("is-active"); 922 } 923 ); 924 }, 925 926 menuItemClick: function () { 927 $(".mn-menu ul > li.menu-item-has-children > a, .toggle-sub-menu").click( 928 function (e) { 929 e.preventDefault(); 930 $(this) 931 .parent() 932 .toggleClass("menu-item-open") 933 .find("> ul.sub-menu") 934 .slideToggle(); 935 } 936 ); 937 938 $(".mn-menu li:not(.menu-item-has-children) a").click(function () { 939 $("body").removeClass("mn-active"); 940 }); 941 }, 942 943 swipe: function () { 944 $(".mn-menu").on("swiperight", function () { 945 $("body").removeClass("mn-active"); 946 }); 947 }, 948 949 init: function () { 950 mobileNav.triggerClick(); 951 mobileNav.menuItemClick(); 952 mobileNav.swipe(); 953 }, 954 }; 955 956 mobileNav.init(); 957} 958 959function main_nav_submenu() { 960 $(".main-navigation .menu > li.menu-item-has-children").hover( 961 function () { 962 // $(this).find('> .sub-menu').slideDown(500); 963 $(".site-header").addClass("menu-open"); 964 }, 965 function () { 966 // $(this).find('> .sub-menu').slideUp(500); 967 $(".site-header").removeClass("menu-open"); 968 } 969 ); 970} 971 972function open_side_menu() { 973 $("body").addClass("menu-open"); 974 $(".side-menu-wrap").addClass("active"); 975 976 if ($("body").hasClass("home")) { 977 if( typeof fullpage_api !=='undefined'){ 978 fullpage_api.setAllowScrolling(false); 979 } 980 } 981 982 if ($(".mobile-menu-wrap").length) {
983 $(".mobile-menu-wrap").slideUp(700); 984 } 985} 986 987function close_side_menu() { 988 $(".side-menu-wrap").removeClass("active"); 989 $("body").removeClass("menu-open"); 990 991 if ($("body").hasClass("home")) { 992 if( typeof fullpage_api !=='undefined'){ 993 fullpage_api.setAllowScrolling(true); 994 } 995 } 996} 997 998function side_menu() { 999 $(".buy-now-btn").on("click", function () { 1000 open_side_menu(); 1001 }); 1002 1003 $(".side-menu-close-btn").on("click", function () { 1004 close_side_menu(); 1005 }); 1006 1007 $(document).mouseup(function (e) { 1008 var container = $(".side-menu-wrap"); 1009 1010 if (!container.is(e.target) && container.has(e.target).length === 0) { 1011 if (container.hasClass("active")) { 1012 container.removeClass("active"); 1013 $("body").removeClass("menu-open"); 1014 1015 if (typeof fullpage_api != "undefined") { 1016 fullpage_api.setAllowScrolling(true); 1017 } 1018 } 1019 } 1020 }); 1021} 1022 1023function sticky_header_init() { 1024 var sticky = $("header.site-header"), 1025 body = $("body"); 1026 1027 $(window).on("scroll", function (e) { 1028 //$('html').bind('mousewheel DOMMouseScroll',function(e){ 1029 1030 var scroll = $(window).scrollTop(); 1031 1032 /* if ( $(window).width() >= 320) { 1033 if (scroll < 100) { 1034 sticky.removeClass('is-sticky'); 1035 body.removeClass('is-sticky'); 1036 1037 } else { 1038 sticky.addClass('is-sticky'); 1039 body.addClass('is-sticky'); 1040 } 1041 } */ 1042 if (scroll > position) { 1043 if (scroll > 250) { 1044 sticky.addClass("is-hide"); 1045 } 1046 } else { 1047 if (scroll > 0) { 1048 sticky.addClass("is-sticky"); 1049 body.addClass("is-sticky"); 1050 if (scroll >= 250) { 1051 sticky.removeClass("is-hide"); 1052 } 1053 if (scroll < 250) { 1054 sticky.addClass("is-hide"); 1055 } 1056 } else { 1057 sticky.removeClass("is-hide"); 1058 sticky.removeClass("is-sticky"); 1059 body.removeClass("is-sticky"); 1060 } 1061 } 1062 1063 position = scroll; 1064 }); 1065} 1066function init_homepage_functions() { 1067 if ($("body").hasClass("home")) { 1068 var sticky = $("header.site-header"); 1069 var grid = $(".cols3"); 1070 var news_bar = $(".news-bar-ticker"); 1071 // new fullpage("#content", { // FullPage 3 1072 $('#content').fullpage({ // FullPage 2 1073 autoScrolling : true, 1074 scrollOverflow : true, 1075 scrollBar : false, 1076 fixedElements : "#wpadminbar", 1077 onLeave : function (origin, destination, direction) { 1078 var loadedSection = this; 1079 //using index 1080 1081 // if( origin.index == 0 ) { // FullPage 3 1082 if( destination > 1 ) { // FullPage 2 1083 sticky.addClass("is-sticky"); 1084 } 1085 //using anchorLink 1086 // if (destination.index == 0) { // FullPage 3 1087 if (destination == 1) { // FullPage 2 1088 sticky.removeClass("is-sticky"); 1089 } 1090 1091 if (destination.index == 3 && direction == "down") { 1092 setTimeout(function () { 1093 $( 1094 ".featured-wrap .entry-wrap:first-child, .featured-wrap .entry-wrap:last-child" 1095 ).css("transform", "translateY(0)"); 1096 }, 300); 1097 } 1098 }, 1099 }); 1100 $(".slider-section .menu-wrap .button").on("click", function () { 1101 if ($(this).hasClass("next")) { 1102 fullpage_api.moveSectionDown(); 1103 } else { 1104 fullpage_api.moveSectionUp(); 1105 } 1106 }); 1107 var galleryThumbs = new Swiper(".activities-slider", { 1108 slidesPerView: 1, 1109 loop: true, 1110 navigation: { 1111 nextEl: ".activities-slider .button-next", 1112 prevEl: ".activities-slider .button-prev", 1113 }, 1114 }); 1115 if (news_bar.length) { 1116 $(".news-bar-ticker").AcmeTicker({ 1117 autoplay: 10, 1118 type: "marquee" /*horizontal/horizontal/Marquee/type*/, 1119 direction: "left" /*up/down/left/right*/, 1120 pauseOnFocus: false, 1121 pauseOnHover: true, 1122 speed: 0.05 /*true/false/number*/ /*For vertical/horizontal 600*/ /*For marquee 0.05*/ /*For typewriter 50*/, 1123 controls: { 1124 toggle: $( 1125 ".acme-news-ticker-pause" 1126 ) /*Can be used for horizontal/horizontal/typewriter*/ /*not work for marquee*/, 1127 }, 1128 }); 1129 1130 $(".acme-news-ticker-pause").on("click", function () { 1131 $(this).toggleClass("play"); 1132 }); 1133 } 1134 } 1135} 1136 1137function mobile_footer_nav_init() { 1138 if ($(window).width() <= 990) { 1139 $(".footer-col-menu .entry-title").click(function (e) { 1140 e.preventDefault(); 1141 1142 if (!$(this).parent().hasClass("active")) { 1143 $(this).parent().addClass("active").find(".footer-nav").slideDown(100); 1144 $(this) 1145 .parent() 1146 .siblings() 1147 .removeClass("active") 1148 .find(".footer-nav") 1149 .slideUp(100); 1150 } else { 1151 $(this).parent().removeClass("active").find(".footer-nav").slideUp(100); 1152 } 1153 });
1154 } 1155} 1156 1157function a11y_menu() { 1158 $("#main-navigation ul li.menu-item-has-children a").on( 1159 "focusin", 1160 function (e) { 1161 e.preventDefault(); 1162 var this_el = $(this); 1163 this_el.parent().addClass("hover"); 1164 } 1165 ); 1166 1167 $("body").on( 1168 "focusout", 1169 "#main-navigation ul li.menu-item-has-children.hover ul li:last-child a", 1170 function (e) { 1171 e.preventDefault(); 1172 var this_el = $(this); 1173 this_el.parent().parent().parent().removeClass("hover"); 1174 } 1175 ); 1176} 1177 1178function fancybox_init() { 1179 $("[data-fancybox]").fancybox({ 1180 loop: true, 1181 baseClass: "fancybox-gallery", 1182 }); 1183} 1184 1185function fast_contact_form() { 1186 $(".btn-hidden-form-toggle, .btn-close-hidden-form").click(function (e) { 1187 e.preventDefault(); 1188 $(this).toggleClass("active"); 1189 $(".bottom-strip-hidden-form, .header-hidden-form").toggleClass("active"); 1190 }); 1191} 1192 1193function search_box_init() { 1194 $(".search-btn").click(function () { 1195 $(".header-search").toggleClass("open"); 1196 $(".header-search").find(".search-input").focus(); 1197 }); 1198 1199 $(".search-close").click(function () { 1200 $(".header-search").toggleClass("open"); 1201 }); 1202 1203 $(".search").submit(function (e) { 1204 if (!$(this).find(".search-input").val()) { 1205 e.preventDefault(); 1206 } 1207 }); 1208 1209 $(document).mouseup(function (e) { 1210 var container = $(".header-search"); 1211 1212 if (!container.is(e.target) && container.has(e.target).length === 0) { 1213 if (container.hasClass("open")) { 1214 container.removeClass("open"); 1215 } 1216 } 1217 }); 1218} 1219 1220function btn_scroll_to() { 1221 $("body").on("click", ".btn-scroll-to", function (e) { 1222 e.preventDefault(); 1223 1224 target = $($(this).data("scrollto")); 1225 $("html, body").animate({ scrollTop: target.offset().top }, 700); 1226 return false; 1227 }); 1228 1229 $(window).scroll(function () { 1230 if ($(window).scrollTop() > 0) { 1231 $(".btn-scroll-to-top").fadeIn(300); 1232 } else { 1233 $(".btn-scroll-to-top").fadeOut(300); 1234 } 1235 }); 1236} 1237 1238function ajax_load_more() { 1239 $(".btn-load-more").click(function (e) { 1240 btn = $(this); 1241 append = $(this).data("append"); 1242 query = $(this).data("query"); 1243 load = $(this).data("load"); 1244 offset = $(this).data("offset"); 1245 template = $(this).data("template"); 1246 1247 e.preventDefault(); 1248 if (!$(".loader-wrap .loader").length) { 1249 $(".loader-wrap").append('<div class="loader"></div>'); 1250 } 1251 1252 $.ajax({
1253 type: "POST", 1254 dataType: "json", 1255 url: siteObject.ajaxurl, 1256 data: { 1257 action: "ajax_load_more", 1258 args: query, 1259 offset: offset, 1260 load: load, 1261 template: template, 1262 }, 1263 1264 success: function (results) { 1265 $(append).append(results.html); 1266 $(".loader-wrap .loader").remove(); 1267 if (!results.more) { 1268 $(".btn-load-more").remove(); 1269 } 1270 }, 1271 }); 1272 1273 offset = $(this).data("offset") + load; 1274 btn.attr("data-offset", offset).data("offset", offset); 1275 }); 1276} 1277 1278function share_buttons() { 1279 $("a.btn-share").click(function (e) { 1280 e.preventDefault(); 1281 var popup_window; 1282 1283 var width = 555; 1284 var height = 500; 1285 var center_left = screen.width / 2 - width / 2; 1286 var center_top = screen.height / 2 - height / 2; 1287 var url = $(this).attr("href"); 1288 1289 popup_window = window.open( 1290 url, 1291 "Title", 1292 "scrollbars=1, width=" + 1293 width + 1294 ", height=" + 1295 height + 1296 ", left=" + 1297 center_left + 1298 ", top=" + 1299 center_top 1300 ); 1301 popup_window.focus(); 1302 }); 1303} 1304 1305function ajax_form() { 1306 $(".form-ajax").on("submit", function (e) { 1307 e.preventDefault(); 1308 1309 var $form = $(this); 1310 var $status = $form.find(".form-status"); 1311 var action = $form.attr("action"); 1312 1313 $status.html('<div class="loader"></div>'); 1314 1315 $.post({ 1316 dataType: "json", 1317 url: siteObject.ajaxurl, 1318 data: { 1319 action: action, 1320 data: $(this).serialize(), 1321 nonce: siteObject.nonce, 1322 }, 1323 1324 success: function (response) { 1325 $status.html( 1326 '<div class="form-message form-message-' + 1327 response.status + 1328 '">' + 1329 response.message + 1330 "</div>" 1331 ); 1332 1333 if ( 1334 (action == "ajax_login" || action == "ajax_register") && 1335 response.status === "success" 1336 ) { 1337 document.location.href = siteObject.homeurl; 1338 } 1339 }, 1340 }); 1341 }); 1342} 1343 1344function init_block_hero_slider() { 1345 $(".slider-hero").each(function () { 1346 var swiper = new Swiper($(this)[0], { 1347 effect: "fade", 1348 fadeEffect: { 1349 crossFade: true, 1350 }, 1351 loop: true, 1352 autoplay: { 1353 delay: 5000, 1354 }, 1355 keyboard: { 1356 enabled: true, 1357 onlyInViewport: true, 1358 }, 1359 a11y: { 1360 prevSlideMessage: siteObject.strings.prev_slide, 1361 nextSlideMessage: siteObject.strings.next_slide, 1362 }, 1363 navigation: { 1364 nextEl: ".swiper-button-next", 1365 prevEl: ".swiper-button-prev", 1366 }, 1367 }); 1368 }); 1369} 1370 1371function init_footer_logos_slider() { 1372 var galleryThumbs = new Swiper(".footer-logos", { 1373 spaceBetween: 20, 1374 slidesPerView: 4, 1375 autoplay: is_mobile(), 1376 loop: true, 1377 breakpoints: { 1378 640: { 1379 slidesPerView: 4, 1380 }, 1381 768: { 1382 slidesPerView: 6, 1383 }, 1384 1024: { 1385 slidesPerView: 6, 1386 }, 1387 1440: { 1388 slidesPerView: 9, 1389 }, 1390 }, 1391 }); 1392} 1393 1394function init_block_slider_with_thumbnails() { 1395 var galleryThumbs = new Swiper(".gallery-thumbs", { 1396 spaceBetween: 10, 1397 slidesPerView: 5, 1398 loop: true, 1399 centeredSlides: true, 1400 keyboard: { 1401 enabled: true, 1402 onlyInViewport: true, 1403 }, 1404 }); 1405 1406 var galleryTop = new Swiper(".gallery-top", { 1407 loop: true, 1408 thumbs: { 1409 swiper: galleryThumbs, 1410 }, 1411 keyboard: { 1412 enabled: true, 1413 onlyInViewport: true, 1414 }, 1415 }); 1416} 1417 1418function init_block_slider_testimonials() { 1419 $(".slider-testimonials").each(function () { 1420 var swiper = new Swiper($(this)[0], { 1421 effect: "fade", 1422 fadeEffect: { 1423 crossFade: true, 1424 }, 1425 loop: true, 1426 autoplay: { 1427 delay: 5000, 1428 }, 1429 keyboard: { 1430 enabled: true, 1431 onlyInViewport: true, 1432 }, 1433 }); 1434 }); 1435} 1436 1437function init_block_slider_images() { 1438 $(".slider-images").each(function () { 1439 var swiper = new Swiper($(this)[0], { 1440 effect: "fade", 1441 loop: true, 1442 autoplay: { 1443 delay: 5000, 1444 }, 1445 keyboard: { 1446 enabled: true, 1447 onlyInViewport: true, 1448 }, 1449 });
1450 }); 1451} 1452 1453function init_block_slider_posts() { 1454 $(".slider-posts").each(function () { 1455 var swiper = new Swiper($(this)[0], { 1456 spaceBetween: 10, 1457 slidesPerView: 5, 1458 loop: true, 1459 a11y: { 1460 prevSlideMessage: siteObject.strings.next_slide, 1461 nextSlideMessage: siteObject.strings.next_slide, 1462 }, 1463 navigation: { 1464 nextEl: ".swiper-button-next", 1465 prevEl: ".swiper-button-prev", 1466 }, 1467 keyboard: { 1468 enabled: true, 1469 onlyInViewport: true, 1470 }, 1471 }); 1472 }); 1473} 1474 1475function init_block_tabs() { 1476 $(".tabs-nav a").click(function (e) { 1477 e.preventDefault(); 1478 var tab = $(this).data("tab"); 1479 1480 $(".tabs-nav .tab-item").removeClass("tab-item-active"); 1481 $(this).parent().addClass("tab-item-active"); 1482 1483 $("[data-tabcontent]").removeClass("tab-content-active"); 1484 $('[data-tabcontent="' + tab + '"]').addClass("tab-content-active"); 1485 history.pushState({}, null, "#" + tab); 1486 }); 1487} 1488 1489function init_block_accordion() { 1490 var accordion = { 1491 closeItems: function ($siblings) { 1492 $siblings 1493 .removeClass("active") 1494 .attr("aria-expanded", false) 1495 .find(".icon") 1496 .removeClass("meditech-minus1") 1497 .addClass("meditech-plus") 1498 .parents(".qa-item") 1499 .find(".entry-body") 1500 .slideUp(500); 1501 }, 1502 1503 openItem: function ($item) { 1504 $item 1505 .addClass("active") 1506 .attr("aria-expanded", true) 1507 .find(".icon") 1508 .removeClass("meditech-plus") 1509 .addClass("meditech-minus1") 1510 .parents(".qa-item") 1511 .find(".entry-body") 1512 .slideDown(500); 1513 }, 1514 1515 init: (function () { 1516 $(".qa-item .entry-header").click(function () { 1517 var $this = $(this).parent(); 1518 var $siblings = $this.siblings(); 1519 1520 accordion.closeItems($siblings); 1521 1522 if (!$this.hasClass("active")) { 1523 accordion.openItem($this); 1524 } else { 1525 accordion.closeItems($this); 1526 } 1527 }); 1528 })(), 1529 }; 1530} 1531 1532/***********************************/ 1533 1534//Attach the iframe navigated event handler 1535$esro.attachEventHandler("navigationRequired", navigationHandler); 1536 1537function redirect_to_thankyou_page() { 1538 if (typeof siteObject.thank_you_page != "undefined") { 1539 window.location.assign(siteObject.thank_you_page); 1540 } else { 1541 // console.log("thank_you_page not configured"); 1542 } 1543} 1544 1545//adjust iframe height according to esro parameter 1546function receiveMessage(event) { 1547 if (event.data.DocumentHeight != undefined) { 1548 if ($("#myIframe").length) { 1549 $("#myIframe").height(event.data.DocumentHeight); 1550 } 1551 } 1552 //console.log('event:', event ); 1553 // console.log("EventData: ", event.data); 1554 // console.log("SCREEN: ", event.data.screen); 1555 //if( event.data.screen === 'confirmation.aspx' || event.data.screen === 'opsconfirmation.aspx' ) { 1556 if (event.data.screen === "confirmation.aspx") { 1557 // console.log("redirect to thank page!"); 1558 redirect_to_thankyou_page(); 1559 } else if ("errors.aspx" === event.data.screen) { 1560 console.log("error"); 1561 // console.log(event); 1562 } 1563} 1564window.addEventListener("message", receiveMessage, false); 1565 1566function navigationHandler(url) { 1567 // console.log(url); 1568} 1569//open calendar links 1570$(".js_openCalLinks").click(function () { 1571 $("body").addClass("calLinksOpen"); 1572}); 1573 1574// Close calendar links on blur 1575$(document).on("click", "html", function () { 1576 if ($(".js_openCalLinks").length) { 1577 if (!$(".js_openCalLinks").is(":hover")) { 1578 $("body").removeClass("calLinksOpen"); 1579 } 1580 } 1581}); 1582 1583 1584//Horizontal Smooth Scroll 1585if(document.querySelector(".horizontal-smooth-scroll-ltr")){ 1586 var hssParent = document.querySelector('.horizontal-smooth-scroll-ltr').parentNode; 1587 var resetLeft = document.querySelector('.horizontal-smooth-scroll-ltr').clientWidth * -1; 1588 newshorizontalSmoothScroll_ltr( resetLeft ); 1589 //Left to Right 1590 function newshorizontalSmoothScroll_ltr(left,play){ 1591 var self = document.querySelectorAll('.horizontal-smooth-scroll-ltr')[0]; 1592 window.news = setInterval(function(){ 1593 left++; 1594 for(var i = 0; i < document.querySelectorAll('.horizontal-smooth-scroll-ltr').length; i++){ 1595 document.querySelectorAll('.horizontal-smooth-scroll-ltr')[i].style.left = left+'px'; 1596 }; 1597 if(self.offsetLeft >= hssParent.clientWidth){ 1598 hssParent.appendChild(self); 1599 for(var i = 0; i < document.querySelectorAll('.horizontal-smooth-scroll-ltr').length; i++){ 1600 document.querySelectorAll('.horizontal-smooth-scroll-ltr')[i].style.left = resetLeft; 1601 }; 1602 clearInterval(window.news); 1603 newshorizontalSmoothScroll_ltr( resetLeft ); 1604 } 1605 },20); 1606 }; 1607 //Stop news 1608 document.querySelector('.horizontal-smooth-scroll-pause-btn').addEventListener('click',function(){ 1609 this.classList.remove('active'); 1610 document.querySelector('.horizontal-smooth-scroll-play-btn').classList.add('active'); 1611 document.querySelector('.horizontal-smooth-scroll-play-btn').focus(); 1612 clearInterval(window.news); 1613 }); 1614 //Play news 1615 document.querySelector('.horizontal-smooth-scroll-play-btn').addEventListener('click',function(){ 1616 this.classList.remove('active'); 1617 document.querySelector('.horizontal-smooth-scroll-pause-btn').classList.add('active'); 1618 document.querySelector('.horizontal-smooth-scroll-pause-btn').focus(); 1619 var left = document.querySelectorAll('.horizontal-smooth-scroll-ltr')[0].style.left.replace('px',''); 1620 newshorizontalSmoothScroll_ltr(left); 1621 }); 1622 //Stop news on mouse over 1623 document.querySelector('.top-news-text-wrap').addEventListener('mouseover',function(){ 1624 clearInterval(window.news); 1625 }); 1626 //Play news on mouse out 1627 document.querySelector('.top-news-text-wrap').addEventListener('mouseout',function(){ 1628 if(!document.querySelector('.horizontal-smooth-scroll-play-btn.active')){ 1629 var left = document.querySelectorAll('.horizontal-smooth-scroll-ltr')[0].style.left.replace('px',''); 1630 newshorizontalSmoothScroll_ltr(left); 1631 } 1632 }); 1633}
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.