1// (function () { 2// 'use strict'; 3// 4// let loadedTLAnalytics = false, 5// timerId; 6// 7// window.addEventListener('scroll', loadTLAnalytics); 8// window.addEventListener('touchstart', loadTLAnalytics); 9// document.addEventListener('mouseenter', loadTLAnalytics); 10// document.addEventListener('click', loadTLAnalytics); 11// document.addEventListener('DOMContentLoaded', loadFallback); 12// 13// function loadFallback() { 14// timerId = setTimeout(loadTLAnalytics, 5000); 15// } 16// 17// function loadTLAnalytics(e) { 18// 19// if (e && e.type) { 20// console.log(e.type); 21// } else { 22// console.log('DOMContentLoaded'); 23// } 24// 25// if (loadedTLAnalytics) { 26// return; 27// } 28// 29// setTimeout( 30// function () { 31// 32// //код Ñ Ð¾ÑложеннÑм запÑÑком 33// 34// }, 35// 100 36// ); 37// 38// loadedTLAnalytics = true; 39// 40// clearTimeout(timerId); 41// 42// window.removeEventListener('scroll', loadTLAnalytics); 43// window.removeEventListener('touchstart', loadTLAnalytics); 44// document.removeEventListener('mouseenter', loadTLAnalytics); 45// document.removeEventListener('click', loadTLAnalytics); 46// document.removeEventListener('DOMContentLoaded', loadFallback); 47// } 48// })() 49 50function initPhoneMask() { 51 $(".phone-mask").inputmask("+7 (999) 999-99-99"); 52} 53 54BX.addCustomEvent('onAjaxSuccess', function (e, dd) { 55 initPhoneMask() 56}) 57 58$(document).ready(function () { 59 let UseBlackTemplate = $("body").hasClass("template-black"), 60 arrowsStatus = true, 61 dotsStatus = true, 62 CountShow = "", 63 CountScroll = "", 64 product_main_head_mob = ".product-main-head-mob" 65 66 if ($(product_main_head_mob).length) { 67 $(".product-main-head .product-main__title") 68 .clone() 69 .prependTo(product_main_head_mob) 70 } 71 72 console.log(BX.message("LANGUAGE_ID")) 73 74 $.ajax({ 75 url: "/local/include/ajax/components.php?position=geoip", 76 data: { LANGUAGE_ID: BX.message("LANGUAGE_ID") }, 77 type: "post", 78 dataType: "html", 79 success: function (result) { 80 $("#geoip-header-ajax").html(result) 81 $("#mob-geoip-header-ajax").html(result) 82 83 let $geoipCity = $("#geoip-header-ajax [data-geo-city]").first(), 84 geoipData = { 85 city: $geoipCity.attr("data-geo-city") || $.trim($("#geoip-header-ajax .toper__city span").first().text()), 86 region: $geoipCity.attr("data-geo-region") || "", 87 }; 88 89 window.jeelexHeaderGeoData = geoipData; 90 $(document).trigger("jeelex:geoipReady", [geoipData]); 91 }, 92 }) 93 94 if ($('input[name="form_text_124"]').length) { 95 $('input[name="form_text_124"]').val($("h1").text()) 96 } 97 98 if ($(".product__video-list").length) { 99 $(".product__video-list") 100 .not(".slick-initialized") 101 .slick({ 102 autoplay: false, 103 dots: true, 104 responsive: [ 105 { 106 breakpoint: 1120, 107 settings: { 108 dots: false, 109 }, 110 }, 111 ], 112 }) 113 } 114 115 if ($(".index-about__slides-list").length) { 116 $(".index-about__slides-list") 117 .not(".slick-initialized") 118 .slick({ 119 autoplay: true, 120 dots: true, 121 arrows: false, 122 responsive: [ 123 { 124 breakpoint: 1120, 125 settings: { 126 dots: false, 127 }, 128 }, 129 ], 130 }) 131 } 132 133 if ($(".basic-category__list").length) { 134 $(".basic-category__list") 135 .not(".slick-initialized") 136 .slick({ 137 dots: true, 138 slidesToShow: 4, 139 slidesToScroll: 4, 140 responsive: [ 141 { 142 breakpoint: 1560, 143 settings: { 144 slidesToShow: 3, 145 slidesToScroll: 3, 146 }, 147 }, 148 { 149 breakpoint: 1360, 150 settings: { 151 slidesToShow: 3, 152 slidesToScroll: 3, 153 }, 154 }, 155 { 156 breakpoint: 1120, 157 settings: { 158 slidesToShow: 2, 159 slidesToScroll: 2, 160 dots: false, 161 }, 162 }, 163 { 164 breakpoint: 768, 165 settings: { 166 slidesToShow: 1, 167 slidesToScroll: 1, 168 dots: false, 169 }, 170 }, 171 ], 172 }) 173 } 174 175 if ($(".index-partner__slider").length) { 176 $(".index-partner__slider") 177 .not(".slick-initialized") 178 .slick({ 179 arrows: true, 180 dots: true, 181 slidesToShow: 4, 182 slidesToScroll: 4, 183 responsive: [ 184 { 185 breakpoint: 1560, 186 settings: { 187 slidesToShow: 4, 188 slidesToScroll: 4, 189 dots: true, 190 }, 191 }, 192 { 193 breakpoint: 1024, 194 settings: { 195 slidesToShow: 3, 196 slidesToScroll: 3, 197 dots: false, 198 }, 199 }, 200 { 201 breakpoint: 600, 202 settings: { 203 slidesToShow: 1, 204 slidesToScroll: 1, 205 dots: false, 206 }, 207 }, 208 ], 209 }) 210 } 211 212 if ($(".media-foto__slider").length) { 213 $(".media-foto__slider") 214 .not(".slick-initialized") 215 .slick({ 216 dots: true, 217 slidesToShow: 4, 218 slidesToScroll: 4, 219 responsive: [ 220 { 221 breakpoint: 1240, 222 settings: { 223 slidesToShow: 3, 224 slidesToScroll: 3, 225 dots: true, 226 }, 227 }, 228 { 229 breakpoint: 768, 230 settings: { 231 slidesToShow: 2, 232 slidesToScroll: 2, 233 dots: false, 234 }, 235 }, 236 { 237 breakpoint: 480, 238 settings: { 239 slidesToShow: 1, 240 slidesToScroll: 1, 241 dots: false, 242 }, 243 }, 244 ], 245 }) 246 } 247 248 if ($(".media-video__slider").length) { 249 $(".media-video__slider") 250 .not(".slick-initialized") 251 .slick({ 252 dots: true, 253 slidesToShow: 4, 254 slidesToScroll: 4, 255 responsive: [ 256 { 257 breakpoint: 1240, 258 settings: { 259 slidesToShow: 3, 260 slidesToScroll: 3, 261 dots: true, 262 }, 263 }, 264 { 265 breakpoint: 768, 266 settings: { 267 slidesToShow: 2, 268 slidesToScroll: 2, 269 dots: false, 270 }, 271 }, 272 { 273 breakpoint: 480, 274 settings: { 275 slidesToShow: 1, 276 slidesToScroll: 1, 277 dots: false, 278 }, 279 }, 280 ], 281 }) 282 } 283 284 if ($(".product__select-model").length) { 285 $(".product__select-model") 286 .not(".slick-initialized") 287 .slick({ 288 slidesToShow: 2, 289 slidesToScroll: 1, 290 responsive: [ 291 { 292 breakpoint: 1024, 293 settings: { 294 slidesToShow: 3, 295 slidesToScroll: 1, 296 dots: false, 297 }, 298 }, 299 { 300 breakpoint: 768, 301 settings: { 302 slidesToShow: 2, 303 slidesToScroll: 1, 304 dots: false, 305 }, 306 }, 307 { 308 breakpoint: 480, 309 settings: { 310 slidesToShow: 1, 311 slidesToScroll: 1, 312 dots: false, 313 }, 314 }, 315 ], 316 }) 317 } 318 319 if ($(".with-this-buy__slider").length) { 320 $(".with-this-buy__slider") 321 .not(".slick-initialized") 322 .slick({ 323 slidesToShow: 4, 324 slidesToScroll: 1, 325 responsive: [ 326 { 327 breakpoint: 1240, 328 settings: { 329 slidesToShow: 3, 330 slidesToScroll: 1, 331 dots: false, 332 }, 333 }, 334 { 335 breakpoint: 1024, 336 settings: { 337 slidesToShow: 2, 338 slidesToScroll: 1, 339 dots: false, 340 }, 341 }, 342 { 343 breakpoint: 480, 344 settings: { 345 slidesToShow: 1, 346 slidesToScroll: 1, 347 dots: false, 348 }, 349 }, 350 ], 351 }) 352 } 353 354 if ($(".tape-event__slider").length) { 355 $(".tape-event__slider") 356 .not(".slick-initialized") 357 .slick({ 358 dots: true, 359 slidesToShow: 3, 360 slidesToScroll: 3, 361 responsive: [ 362 { 363 breakpoint: 1240, 364 settings: { 365 slidesToShow: 2, 366 slidesToScroll: 2, 367 dots: false, 368 }, 369 }, 370 { 371 breakpoint: 768, 372 settings: { 373 slidesToShow: 1, 374 slidesToScroll: 1, 375 dots: false, 376 }, 377 }, 378 ], 379 }) 380 } 381 382 if ($(".specific-catalog__slider").length) { 383 if (UseBlackTemplate) { 384 dotsStatus = false 385 CountShow = 3 386 CountScroll = 3 387 } else { 388 dotsStatus = true 389 CountShow = 4 390 CountScroll = 4 391 } 392 $(".specific-catalog__slider") 393 .not(".slick-initialized") 394 .slick({ 395 slidesToShow: CountShow, 396 slidesToScroll: CountScroll, 397 dots: dotsStatus, 398 responsive: [ 399 { 400 breakpoint: 1360, 401 settings: { 402 slidesToShow: 3, 403 slidesToScroll: 3, 404 dots: false, 405 }, 406 }, 407 { 408 breakpoint: 1024, 409 settings: { 410 slidesToShow: 2, 411 slidesToScroll: 2, 412 dots: false, 413 }, 414 }, 415 { 416 breakpoint: 480, 417 settings: { 418 slidesToShow: 1, 419 slidesToScroll: 1, 420 dots: false, 421 }, 422 }, 423 ], 424 }) 425 } 426 427 if ($(".wide-slider-bottom__slider").length) { 428 $(".wide-slider-bottom__slider") 429 .not(".slick-initialized") 430 .slick({ 431 arrow: true, 432 slidesToShow: 1, 433 slidesToScroll: 1, 434 dots: true, 435 responsive: [ 436 { 437 breakpoint: 1024, 438 settings: { 439 dots: false, 440 }, 441 }, 442 ], 443 }) 444 } 445 446 if ($(".tape__slider").length) { 447 $(".tape__slider") 448 .not(".slick-initialized") 449 .slick({ 450 dots: true, 451 slidesToShow: 3, 452 slidesToScroll: 3, 453 responsive: [ 454 { 455 breakpoint: 1240, 456 settings: { 457 slidesToShow: 2, 458 slidesToScroll: 2, 459 dots: false, 460 }, 461 }, 462 { 463 breakpoint: 768, 464 settings: { 465 slidesToShow: 1, 466 slidesToScroll: 1, 467 dots: false, 468 }, 469 }, 470 ], 471 }) 472 } 473 474 if ($(".see-also__slider").length) { 475 $(".see-also__slider") 476 .not(".slick-initialized") 477 .slick({ 478 dots: true, 479 slidesToShow: 3, 480 slidesToScroll: 3, 481 responsive: [ 482 { 483 breakpoint: 1240, 484 settings: { 485 slidesToShow: 2, 486 slidesToScroll: 2, 487 dots: false, 488 }, 489 }, 490 { 491 breakpoint: 768, 492 settings: { 493 slidesToShow: 1, 494 slidesToScroll: 1, 495 dots: false, 496 }, 497 }, 498 ], 499 }) 500 } 501 502 if ($(".patented-developments__slider").length) { 503 $(".patented-developments__slider").not(".slick-initialized").slick({ 504 arrow: true, 505 dots: true, 506 slidesToShow: 1, 507 slidesToScroll: 1, 508 }) 509 } 510 511 if ($(".media-foto__slider").length) { 512 $(".media-foto__slider") 513 .not(".slick-initialized") 514 .slick({ 515 dots: true, 516 slidesToShow: 4, 517 slidesToScroll: 4, 518 responsive: [ 519 { 520 breakpoint: 1240, 521 settings: { 522 slidesToShow: 3, 523 slidesToScroll: 3, 524 dots: true, 525 }, 526 }, 527 { 528 breakpoint: 1024, 529 settings: { 530 slidesToShow: 2, 531
531 slidesToScroll: 2, 532 dots: false, 533 }, 534 }, 535 { 536 breakpoint: 480, 537 settings: { 538 slidesToShow: 1, 539 slidesToScroll: 1, 540 dots: false, 541 }, 542 }, 543 ], 544 }) 545 } 546 547 $.ajax({ 548 url: "/local/include/ajax/components.php?position=index", 549 data: { LANGUAGE_ID: BX.message("LANGUAGE_ID") }, 550 type: "post", 551 dataType: "html", 552 beforeSend: function () { 553 $("#subscribe-index-ajax").addClass("loading-round") 554 }, 555 success: function (result) { 556 $("#subscribe-index-ajax").html(result) 557 $("#subscribe-index-ajax").removeClass("loading-round") 558 }, 559 }) 560 561 $(".js-btn-subscribe-footer").on("click", function () { 562 $.ajax({ 563 url: "/local/include/ajax/components.php?position=footer", 564 data: { LANGUAGE_ID: BX.message("LANGUAGE_ID") }, 565 type: "post", 566 dataType: "html", 567 beforeSend: function () { 568 $("#subscribe-footer-ajax").addClass("loading-round") 569 }, 570 success: function (result) { 571 $("#subscribe-footer-ajax").html(result) 572 $("#subscribe-footer-ajax").removeClass("loading-round") 573 }, 574 }) 575 }) 576 577 // $.ajax({ 578 // url: "/local/include/ajax/components.php?position=banners", 579 // data: {"LANGUAGE_ID": BX.message('LANGUAGE_ID')}, 580 // type: 'post', 581 // dataType: 'html', 582 // success: function (result) { 583 // $("#banners-index-ajax").html(result); 584 // $('.index-top-slide').not('.slick-initialized').slick({ 585 // autoplay: true, 586 // dots: true, 587 // responsive: [ 588 // { 589 // breakpoint: 1240, 590 // settings: { 591 // dots: false, 592 // } 593 // } 594 // ] 595 // }); 596 // $("#banners-index-ajax").removeClass("loading-round"); 597 // } 598 // }); 599 600 $("table").wrap('<div class="out-tabel"></div>') 601 602 $(".popup").on("click", function (event) { 603 event.preventDefault() 604 var popupid = $(this).attr("rel") 605 606 $("#" + popupid).fadeIn() 607 $("#fade").fadeIn() 608 popuphight = $("#" + popupid).outerHeight() 609 windowhight = $(window).outerHeight() 610 var HtmlWidth = $("html").width() 611 var popuptopmargin = popuphight / 2 612 613 if (popuphight > windowhight / 1.4) { 614 $("#" + popupid).addClass("bigpopup") 615 popuptopmargin = $(window).scrollTop() + 50 616 popuptopmargin = -popuptopmargin 617 } 618 619 $("#" + popupid).css({ 620 "margin-top": -popuptopmargin, 621 }) 622 }) 623 $("body").on("click", "#fade, .close-popupbox", function () { 624 $("#fade, .popupbox").fadeOut() 625 $(".popupbox").removeClass("bigpopup") 626 return false 627 }) 628 629 /*СÑаÑÑ Ð¼Ð°Ð½Ð¸Ð¿ÑлÑÑий Ñ Ð¿Ð¾Ð»Ñми в ÑоÑÐ¼Ð°Ñ */ 630 $("select").change(function () { 631 $(this).removeClass("form__control-placeholder") 632 }) 633 634 $('input[type="file"]').on("change", function (event, files, label) { 635 var file_name = this.value.replace(/\\/g, "/").replace(/.*\//, "") 636 $(this) 637 .parents(".label-add-file") 638 .find(".input-add-file-name") 639 .val(file_name) 640 }) 641 /*ÐÐ¾Ð½ÐµÑ Ð¼Ð°Ð½Ð¸Ð¿ÑлÑÑий Ñ Ð¿Ð¾Ð»Ñми в ÑоÑÐ¼Ð°Ñ */ 642 643 /*СÑаÑÑ Ð²ÑбоÑа ÑзÑка*/ 644 $(".header-language__selected").on("click", function () { 645 if ($(this).parents(".header-language__block").hasClass("hover")) { 646 $(this).parents(".header-language__block").removeClass("hover") 647 } else { 648 $(".header-language__block").removeClass("hover") 649 $(this).parents(".header-language__block").addClass("hover") 650 } 651 }) 652 $(".header-language__block").on("mouseleave", function () { 653 $(this).removeClass("hover") 654 }) 655 $(document).scroll(function () { 656 $(".header-language__block").removeClass("hover") 657 }) 658 /*ÐÐ¾Ð½ÐµÑ Ð²ÑбоÑа ÑзÑка*/ 659 660 /*ÐолÑÑаем обÑие ÑазмеÑÑ*/ 661 var htmlwidth = $("html").width() 662 663 if (htmlwidth <= 1024) { 664 $(".fancyboxclick-iframe").removeClass("fancyboxclick-iframe--yes") 665 $(".index-news .article__list") 666 .not(".slick-initialized") 667 .slick({ 668 dots: false, 669 slidesToShow: 2, 670 slidesToScroll: 2, 671 responsive: [ 672 { 673 breakpoint: 600, 674 settings: { 675 slidesToShow: 1, 676 slidesToScroll: 1, 677 dots: false, 678 }, 679 }, 680 ], 681 }) 682 } else { 683 $(".fancyboxclick-iframe").addClass("fancyboxclick-iframe--yes") 684 } 685 686 $(".fancyboxclick-iframe--yes").fancybox() 687 688 if (htmlwidth <= 1560) { 689 /*ÐÑопоÑÑионалÑно ÑеÑайзим ÑÑеймÑ*/ 690 $("iframe,.youtube").each(function () { 691 var iframewidth = $(this).attr("width") 692 if (iframewidth == "100%") { 693 iframewidth = $(this).outerWidth() 694 var iframeheight = iframewidth * 0.5625 695 } else { 696 var iframeheight = $(this).attr("height") 697 } 698 var iframeproporciya = iframewidth / iframeheight 699 var iframenewheight = $(this).width() / iframeproporciya 700 $(this).css("height", iframenewheight + "px") 701 }) 702 } 703 704 var nav = document.getElementById(".top-nav") 705 706 if (!!nav) { 707 window.onscroll = function () { 708 myFunction() 709 } 710 711 var sticky = nav.offsetTop 712 713 function myFunction() { 714 if (window.pageYOffset >= sticky) { 715 nav.classList.add("sticky") 716 } else { 717 nav.classList.remove("sticky") 718 } 719 } 720 } 721 722 /*Start UP*/ 723 var speed = 500 724 $("#scrollTop").on("click", function (e) { 725 e.preventDefault() 726 $("html:not(:animated),body:not(:animated)").animate( 727 { 728 scrollTop: 0, 729 }, 730 speed 731 ) 732 }) 733 var UpScrollTopOld = 0 734 function show_scrollTop() { 735 var UpScrollTop = $(window).scrollTop() 736 if ($(window).scrollTop() > 300 && UpScrollTopOld > UpScrollTop) { 737 $("#scrollTop").show() 738 } else { 739 $("#scrollTop").hide() 740 } 741 UpScrollTopOld = UpScrollTop 742 } 743 $(window).scroll(function () { 744 show_scrollTop() 745 }) 746 show_scrollTop() 747 /*End UP*/ 748 749 $(".fancybox").fancybox() 750 751 $.fn.equivalent = function () { 752 //запиÑем знаÑение jQuery вÑбоÑки к коÑоÑой бÑÐ´ÐµÑ Ð¿Ñименена ÑÑа ÑÑнкÑÐ¸Ñ Ð² локалÑнÑÑ Ð¿ÐµÑеменнÑÑ $blocks 753 var $blocks = $(this), 754 //пÑимем за макÑималÑнÑÑ Ð²ÑÑоÑÑ - вÑÑоÑÑ Ð¿ÐµÑвого блока в вÑбоÑке и запиÑем ее в пеÑеменнÑÑ maxH 755 maxH = $blocks.eq(0).height() 756 757 //делаем ÑÑавнение вÑÑоÑÑ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ блока Ñ Ð¼Ð°ÐºÑималÑной 758 $blocks.each(function () { 759 maxH = $(this).height() > maxH ? $(this).height() : maxH 760 /* 761 ÐÑÐ¾Ñ Ð±Ð»Ð¾Ðº можно запиÑаÑÑ Ñак: 762 if ( $(this).height() > maxH ) { 763 maxH = $(this).height(); 764 } 765 */ 766 }) 767 768 //ÑÑÑанавливаем найденное макÑималÑное знаÑение вÑÑоÑÑ Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ блока jQuery вÑбоÑки 769 $blocks.height(maxH) 770 } 771 772 function debounce(func, wait) { 773 let timeout
774 return function executedFunction() { 775 const later = () => { 776 clearTimeout(timeout) 777 func() 778 } 779 clearTimeout(timeout) 780 timeout = setTimeout(later, wait) 781 } 782 } 783 784 //задаÑм иÑÑ Ð¾Ð´Ð½ÑÑ Ð²ÑÑоÑÑ ÐºÐ°ÑÑоÑек 785 function initEquivalent() { 786 if ($(".with-this-buy__item").length) { 787 $(".with-this-buy__item").equivalent() 788 } 789 if ($(".categories__item").length) { 790 $(".categories__item").equivalent() 791 } 792 if ($(".basic-category__item").length) { 793 $(".basic-category__item").equivalent() 794 } 795 if ( 796 $(".specific-catalog__grid .specific-catalog__product-item").length 797 ) { 798 $( 799 ".specific-catalog__grid .specific-catalog__product-item" 800 ).equivalent() 801 } 802 } 803 804 initEquivalent() 805 806 $(window).on( 807 "resize", 808 debounce(function () { 809 initEquivalent() 810 }, 200) 811 ) 812 813 initPhoneMask(); 814 815 /*$('body').on('submit', 'form[name="SIMPLE_FORM_1"]', function(e){ 816 e.preventDefault(); 817 $.post('/send-forms.php', function(data){ 818 console.log(data); 819 }); 820 });*/ 821 822 var slideWrapper = $(".index-top-slide"), 823 iframes = slideWrapper.find(".embed-player"), 824 lazyImages = slideWrapper.find(".slide-image"), 825 lazyCounter = 0 826 827 // POST commands to YouTube or Vimeo API 828 function postMessageToPlayer(player, command) { 829 if (player == null || command == null) return 830 player.contentWindow.postMessage(JSON.stringify(command), "*") 831 } 832 833 // When the slide is changing 834 function playStopVideo(slick, control) { 835 var currentSlide, slideType, startTime, player, video 836 837 currentSlide = slick.find(".slick-current") 838 slideType = currentSlide 839 .find(".index-top-slide__item") 840 .attr("class") 841 .split(" ")[1] 842 player = currentSlide.find("iframe").get(0) 843 startTime = currentSlide 844 .find(".index-top-slide__item") 845 .data("video-start") 846 847 if (slideType === "vimeo") { 848 switch (control) { 849 case "play": 850 if ( 851 startTime != null && 852 startTime > 0 && 853 !currentSlide.hasClass("started") 854 ) { 855 currentSlide.addClass("started") 856 postMessageToPlayer(player, { 857 method: "setCurrentTime", 858 value: startTime, 859 }) 860 } 861 postMessageToPlayer(player, { 862 method: "play", 863 value: 1, 864 }) 865 break 866 case "stop": 867 postMessageToPlayer(player, { 868 method: "unload", 869 value: 1, 870 }) 871 break 872 } 873 } else if (slideType === "youtube") { 874 switch (control) { 875 case "play": 876 postMessageToPlayer(player, { 877 event: "command", 878 func: "mute", 879 }) 880 postMessageToPlayer(player, { 881 event: "command", 882 func: "playVideo", 883 }) 884 break 885 case "stop": 886 postMessageToPlayer(player, { 887 event: "command", 888 func: "stopVideo", 889 }) 890 break 891 } 892 } else if (slideType === "video") { 893 video = currentSlide.find("video").get(0) 894 if (video != null) { 895 if (control === "play") { 896 video.play() 897 } else { 898 video.load() 899 } 900 } 901 } 902 } 903 904 // Resize player 905 function resizePlayer(iframes, ratio) { 906 /*if (!iframes[0]) return; 907 var win = $(".index-top-slide"), 908 width = win.width(), 909 playerWidth, 910 height = win.height(),
911 playerHeight, 912 ratio = ratio || 16 / 9; 913 914 iframes.each(function () { 915 var current = $(this); 916 if (width / ratio < height) { 917 playerWidth = Math.ceil(height * ratio); 918 current.width(playerWidth).height(height).css({ 919 left: (width - playerWidth) / 2, 920 top: 0 921 }); 922 } else { 923 playerHeight = Math.ceil(width / ratio); 924 current.width(width).height(playerHeight).css({ 925 left: 0, 926 top: (height - playerHeight) / 2 927 }); 928 } 929 });*/ 930 } 931 932 // DOM Ready 933 $(function () { 934 // Initialize 935 slideWrapper.on("init", function (slick) { 936 slick = $(slick.currentTarget) 937 setTimeout(function () { 938 playStopVideo(slick, "play") 939 }, 1000) 940 resizePlayer(iframes, 16 / 9) 941 }) 942 slideWrapper.on("beforeChange", function (event, slick) { 943 slick = $(slick.$slider) 944 setTimeout(function () { 945 playStopVideo(slick, "stop") 946 }, 300) 947 }) 948 slideWrapper.on("afterChange", function (event, slick) { 949 slick = $(slick.$slider) 950 setTimeout(function () { 951 playStopVideo(slick, "play") 952 }, 200) 953 }) 954 slideWrapper.on( 955 "lazyLoaded", 956 function (event, slick, image, imageSource) { 957 lazyCounter++ 958 if (lazyCounter === lazyImages.length) { 959 lazyImages.addClass("show") 960 } 961 } 962 ) 963 }) 964 965 if (UseBlackTemplate) { 966 arrowsStatus = false 967 } else { 968 arrowsStatus = true 969 } 970 971 // if (slideWrapper.length) { 972 slideWrapper.not(".slick-initialized").slick({ 973 lazyLoad: "progressive", 974 autoplay: true, 975 arrows: arrowsStatus, 976 autoplaySpeed: 7000, 977 // adaptiveHeight: true, 978 dots: true, 979 /*speed: 600,*/ 980 edgeFriction: 0.1, 981 touchThreshold: 20, 982 /*cssEase: "cubic-bezier(0.87, 0.03, 0.41, 0.9)",*/ 983 responsive: [ 984 { 985 breakpoint: 1240, 986 settings: { 987 dots: false, 988 }, 989 }, 990 ], 991 }) 992 // } 993 994 // Resize event 995 $(window).on("resize.slickVideoPlayer", function () { 996 resizePlayer(iframes, 16 / 9) 997 }) 998 $(window).on("load.slickVideoPlayer", function () { 999 resizePlayer(iframes, 16 / 9) 1000 }) 1001}) 1002;(function (window) { 1003 if (!!window.JCReaspektGeobase) { 1004 return 1005 } 1006 1007 window.JCReaspektGeobase = function (arParams) { 1008 this.letters = "" 1009 this.timer = "0" 1010 1011 if (typeof arParams === "object") { 1012 this.params = arParams 1013 } 1014 } 1015 1016 window.JCReaspektGeobase.prototype.onClickReaspektGeobase = function ( 1017 city_id 1018 ) { 1019 var obClass = this 1020 1021 this.showPreloaderReaspektGeobase() 1022 1023 $.ajax({ 1024 url: this.params.AJAX_URL.SELECT, 1025 dataType: "html", 1026 data: { 1027 CITY_ID: city_id, 1028 }, 1029 type: "POST", 1030 success: function (data) { 1031 var dataJSON = JSON.parse(data) 1032 1033 if (dataJSON.STATUS == "Y") { 1034 console.log("close") 1035 obClass.onClickReaspektSaveCity("Y") 1036 } else { 1037 console.log("Error, change city!") 1038 } 1039 }, 1040 }) 1041 } 1042 1043 window.JCReaspektGeobase.prototype.onClickReaspektSaveCity = function ( 1044 reload 1045 ) { 1046 var obClass = this 1047 1048 $("." + obClass.params.CLASS.WRAP_QUESTION_REASAPEKT).fadeOut("700") 1049 1050 $.ajax({ 1051 url: this.params.AJAX_URL.SAVE, 1052 dataType: "html", 1053 data: {}, 1054 type: "GET", 1055 success: function (data) { 1056 var dataJSON = JSON.parse(data) 1057 if (dataJSON.STATUS == "Y") { 1058 console.log("save") 1059 $( 1060 "." + obClass.params.CLASS.WRAP_QUESTION_REASAPEKT 1061 ).remove() 1062 1063 if (reload == "Y") { 1064 document.location.reload() 1065 } 1066 } else { 1067 console.log("Error, no save change!") 1068 } 1069 $(".ReaspektPopupOverlay").hide() 1070 }, 1071 }) 1072 } 1073 1074 window.JCReaspektGeobase.prototype.inpKeyReaspektGeobase = function (e) { 1075 e = e || window.event 1076 1077 var obClass = this 1078 var t = window.event ? window.event.srcElement : e.currentTarget 1079 var list = $(".reaspektGeobaseCities") 1080 var sFind = BX.util.trim(t.value) 1081 1082 if (this.letters == sFind) return // if nothing has changed, do not do heavy load server 1083 1084 this.letters = sFind 1085 1086 if (this.timer) { 1087 clearTimeout(this.timer) 1088 this.timer = 0 1089 } 1090 1091 if (this.letters.length < 2) { 1092 return 1093 } 1094 1095 this.timer = window.setTimeout(this.loadReaspektGeobase.bind(this), 190) 1096 } 1097 1098 window.JCReaspektGeobase.prototype.loadReaspektGeobase = function () { 1099 var obClass = this 1100 1101 this.showPreloaderReaspektGeobase() 1102 1103 this.timer = 0 1104 var list = $(".reaspektGeobaseFind") 1105 1106 $.ajax({ 1107 type: "POST", 1108 url: this.params.AJAX_URL.GET, 1109 dataType: "html", 1110 data: { 1111 city_name: this.letters, 1112 }, 1113 timeout: 10000, 1114 success: function (data) { 1115 if ($(".reaspektResultCityAjax").length) { 1116 $(".reaspektResultCityAjax").remove() 1117 } 1118 list.append( 1119 '<div class="reaspektResultCityAjax">' + data + "</div>" 1120 )
1121 $.fn.ReaspektModalBox("rePosition") 1122 1123 obClass.hidePreloaderReaspektGeobase() 1124 }, 1125 }) 1126 } 1127 1128 window.JCReaspektGeobase.prototype.showPreloaderReaspektGeobase = function ( 1129 el 1130 ) { 1131 $(".reaspektGeobaseWrapperPopup").append( 1132 '<span id="reaspekt_preloader"></span>' 1133 ) 1134 $("#reaspekt_preloader").animate({ opacity: 1 }, 500) 1135 } 1136 1137 window.JCReaspektGeobase.prototype.hidePreloaderReaspektGeobase = function ( 1138 el 1139 ) { 1140 if ($("#reaspekt_preloader").length) { 1141 $("#reaspekt_preloader").remove() 1142 } 1143 } 1144})(window) 1145 1146document.addEventListener("DOMContentLoaded", function () { 1147 const accHeads = document.querySelectorAll(".acc_head") 1148 1149 accHeads.forEach((head) => { 1150 head.addEventListener("click", function () { 1151 const body = this.nextElementSibling 1152 body.classList.toggle("accordion-body-show") 1153 this.classList.toggle("accordion-close") 1154 1155 // Ðзменение иконки 1156 const icon = this.querySelector("i") 1157 icon.classList.toggle("icon-open") 1158 }) 1159 }) 1160}) 1161 1162/** 1163 * ÐбÑабоÑÑик клика по кнопке Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ ÑоваÑа в ÑпиÑок ÑÑÐ°Ð²Ð½ÐµÐ½Ð¸Ñ 1164 * 1165 * - Ðнопка должна имеÑÑ ÐºÐ»Ð°ÑÑ .js-addToCompare 1166 * - РодиÑелÑÑкий ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ñ ÐºÐ»Ð°ÑÑом .js-element-id должен ÑодеÑжаÑÑ Ð°ÑÑибÑÑ data-id Ñ Ð¸Ð´ÐµÐ½ÑиÑикаÑоÑом ÑоваÑа 1167 */ 1168document.body.addEventListener("click", function (e) { 1169 let target = e.target.closest(".js-addToCompare") 1170 if (!target) return 1171 1172 let productAdd = target.classList.contains("add") ? "Y" : "N" 1173 let productId = target.closest(".js-element-id").dataset.id 1174 let action = 1175 productAdd === "Y" ? "DELETE_FROM_COMPARE_LIST" : "ADD_TO_COMPARE_LIST" 1176 1177 if (!productId) return 1178 1179 fetch(`/local/include/ajax/compare.php?action=${action}&id=${productId}`, { 1180 method: "GET", 1181 credentials: "same-origin", 1182 }) 1183 .then(() => { 1184 if (productAdd === "Y") { 1185 target.classList.remove("add") 1186 } else { 1187 target.classList.add("add") 1188 } 1189 1190 return fetch( 1191 `/local/include/ajax/compare.php?action=UPDATE_COMPARE_LIST`, 1192 { 1193 method: "GET", 1194 credentials: "same-origin", 1195 } 1196 ) 1197 }) 1198 .then((response) => response.text()) 1199 .then((responseText) => { 1200 let response = JSON.parse(responseText) 1201 const el = document.querySelector(".js-count-compare") 1202 1203 if (el) { 1204 if (response.COUNT === 0) { 1205 el.classList.add("hide") 1206 } else { 1207 el.classList.remove("hide") 1208 el.textContent = response.COUNT 1209 } 1210 } 1211 }) 1212}) 1213 1214/** 1215 * AJAX-запÑÐ¾Ñ Ð´Ð»Ñ Ð¿Ð¾Ð»ÑÑÐµÐ½Ð¸Ñ ÑпиÑка ÑоваÑов, добавленнÑÑ Ð² ÑÑавнение. 1216 * 1217 * ÐбновлÑеÑÑÑ ÑоÑÑоÑние кнопок ÑÑÐ°Ð²Ð½ÐµÐ½Ð¸Ñ Ð½Ð° ÑÑÑаниÑе. 1218 * */ 1219document.addEventListener("DOMContentLoaded", function () { 1220 fetch("/local/include/ajax/comparelist.php", { 1221 method: "GET", 1222 credentials: "same-origin", 1223 }) 1224 .then((response) => response.text()) 1225 .then((responseText) => { 1226 if (!responseText) return 1227 1228 let data = JSON.parse(responseText) 1229 if (data.items && data.items.length > 0) { 1230 data.items.forEach(function (item) { 1231 let els = document.querySelectorAll( 1232 '.js-element-id[data-id="' + item + '"]' 1233 ) 1234 if (!els.length) return 1235 1236 els.forEach((el) => { 1237 let addToCompareBtn = 1238 el.querySelector(".js-addToCompare") 1239 if (addToCompareBtn) { 1240 addToCompareBtn.classList.add("add") 1241 } 1242 }) 1243 }) 1244 } 1245 }) 1246}) 1247 1248document.addEventListener("DOMContentLoaded", function () { 1249 const elements = document.querySelectorAll(".shine-anim-visual") 1250 1251 const observer = new IntersectionObserver( 1252 (entries) => {
1253 entries.forEach((entry) => { 1254 if (entry.isIntersecting) { 1255 entry.target.classList.add("visible") 1256 } else { 1257 entry.target.classList.remove("visible") 1258 } 1259 }) 1260 }, 1261 { 1262 threshold: 0.1, // ÑÑабаÑÑваеÑ, когда 10% ÑлеменÑа Ð²Ð¸Ð´Ð½Ñ 1263 } 1264 ) 1265 1266 elements.forEach((el) => observer.observe(el)) 1267}) 1268 1269/*ÐÐ»Ñ ÑабоÑÑ vk video*/ 1270jQuery(function ($) { 1271 1272 $('[data-fancybox="wide-slider-bottom-1"]').each(function () { 1273 var $link = $(this); 1274 var href = $link.attr('href'); 1275 1276 if ( 1277 href && 1278 href.indexOf('vkvideo.ru/video_ext.php') !== -1 1279 ) { 1280 $link.attr({ 1281 'data-type': 'iframe', 1282 'data-preload': 'false' 1283 }); 1284 } 1285 }); 1286 1287 $('[data-fancybox="wide-slider-bottom-1"]').fancybox({ 1288 1289 iframe: { 1290 preload: false 1291 }, 1292 1293 afterShow: function (instance, slide) { 1294 1295 if (slide.type === 'iframe') { 1296 slide.$content.css({ 1297 width: '80vw', 1298 maxWidth: '960px', 1299 aspectRatio: '16 / 9' 1300 }); 1301 1302 slide.$content.find('iframe').css({ 1303 width: '100%', 1304 height: '100%' 1305 }); 1306 } 1307 1308 } 1309 }); 1310 1311});
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.