1"use strict"; 2//вÑÑавка модÑлей ÑеÑез плагин gulp-rigger 3function maskedTel(){ 4 $('.masked-tel').mask("+7 999 999 99 99",{ 5 completed: function(){ 6 $(this).removeClass('error-input'); 7 } 8 }); 9 $('.masked-tel').keyup(function(){ 10 if($(this).val().indexOf('_')>-1){ 11 $(this).addClass('error-input'); 12 }else{ 13 $(this).removeClass('error-input'); 14 } 15 }); 16}; 17function slickInit() { 18 var btnNext = '<button type="button" class="btn btn_next"></button>', 19 btnPrev = '<button type="button" class="btn btn_prev"></button>'; 20 $('.carousel').slick({ 21/*AGT*/ lazyLoad: 'ondemand', 22 arrows: true, 23 dots: true, 24 fade: true, 25 autoplay: true, 26 autoplaySpeed: 5000, 27 nextArrow: btnNext, 28 prevArrow: btnPrev 29 }); 30 31 $('.js-home-video-slide').each(function(index,el){ 32 var slide = $(el); 33 slide.slick({ 34/*AGT*/ lazyLoad: 'ondemand', 35/*AGT*/ slidesToShow: 3, 36 arrows: true, 37 variableWidth: false, // true AGT 38 nextArrow: btnNext, 39 prevArrow: btnPrev, 40 appendArrows: slide.parent().prev(), 41 responsive: [ 42 { 43 breakpoint: 768, 44 settings: { 45/*AGT*/ slidesToShow: 1, 46 variableWidth: false, 47 adaptiveHeight: false, // true AGT 48 fade: true, 49 } 50 } 51 ] 52 }); 53 }); 54 55 $('.js-story-video-slide').each(function(index,el){ 56 var slide = $(el); 57 slide.slick({ 58 arrows: true, 59 nextArrow: '<button type="button" class="btn btn_next"></button>', 60 prevArrow: '<button type="button" class="btn btn_prev"></button>', 61 slidesToShow: 3, 62 swipeToSlide: true, 63 responsive: [ 64 { 65 breakpoint: 960, 66 settings: { 67 slidesToShow: 2 68 } 69 }, 70 { 71 breakpoint: 768, 72 settings: { 73 slidesToShow: 1 74 } 75 } 76 ] 77 }); 78 }); 79 80 $('.js-story-models-slide').each(function(index,el){ 81 var slide = $(el); 82 slide.slick({ 83 arrows: true, 84 nextArrow: '<button type="button" class="btn btn_next"></button>', 85 prevArrow: '<button type="button" class="btn btn_prev"></button>', 86 slidesToShow: 4, 87 swipeToSlide: true, 88 responsive: [ 89 { 90 breakpoint: 960, 91 settings: { 92 slidesToShow: 3, 93 } 94 }, 95 { 96 breakpoint: 720, 97 settings: { 98 slidesToShow: 2, 99 } 100 }, 101 { 102 breakpoint: 576, 103 settings: { 104 slidesToShow: 1, 105 } 106 } 107 ] 108 }); 109 }); 110 111 112/*AGT*/ 113 $(".js_product").each(function(){ 114 var idx = $(this).attr('data-idx'); 115 if ( $(".js_thumbs_for_"+idx).length ){ 116 $(this).slick({arrows: !0, nextArrow: btnNext, prevArrow: btnPrev, asNavFor: ".js_thumbs_for_"+idx}); 117 } else { 118 $(this).slick({arrows: !0, nextArrow: btnNext, prevArrow: btnPrev}); 119 } 120 if ( $(".js_thumbs_for_"+idx).length ){ 121 $(".js_thumbs_for_"+idx).slick({arrows: !1, variableWidth: !0, focusOnSelect: !0, asNavFor: ".js_product_"+idx/*, centerMode: true, infinite: !1*/}); 122 } 123 }); 124/*END_AGT*/ 125/*AGT 126 $('#product').slick({ 127 arrows: true, 128 nextArrow: btnNext, 129 prevArrow: btnPrev, 130 asNavFor: '#product_thumbs' 131 }); 132 $('#product_thumbs').slick({ 133 arrows: false, 134 variableWidth: true, 135 focusOnSelect: true, 136 asNavFor: '#product' 137 }); 138*/ 139 140 $('.product-video-carousel').each(function(index,el){ 141 var slider = $(el); 142 slider.slick({ 143 arrows: true, 144 dots: false, 145 slidesToShow: 3, 146 slidesToScroll: 1, 147 infinite: true, 148 /*fade: true,*/ 149 nextArrow: btnNext, 150 prevArrow: btnPrev, 151 /*appendArrows: slider.next(),*/ 152 responsive: [ 153 { 154 breakpoint: 768, 155 settings: { 156 slidesToShow: 2 157 } 158 }, 159 { 160 breakpoint: 641, 161 settings: { 162 slidesToShow: 1, 163 } 164 } 165 ] 166 }); 167 }); 168 169 $('.carousel-3').slick({ 170 arrows: true, 171 nextArrow: btnNext, 172 prevArrow: btnPrev, 173 slidesToShow: 3, 174 responsive: [ 175 { 176 breakpoint: 768, 177 settings: { 178 slidesToShow: 2 179 } 180 }, 181 { 182 breakpoint: 641, 183 settings: { 184 slidesToShow: 1, 185 adaptiveHeight: true 186 } 187 } 188 ] 189 }); 190 191 $('.compare__content').slick({
192 arrows: false, 193 variableWidth: true, 194 infinite: false, 195 swipeToSlide: true 196 }); 197 198 $('.carousel-2').slick({ 199 arrows: true, 200 nextArrow: btnNext, 201 prevArrow: btnPrev, 202 slidesToShow: 2, 203 responsive: [ 204 { 205 breakpoint: 992, 206 settings: { 207 slidesToShow: 1 208 } 209 } 210 ] 211 }) 212} 213function fancyInit(){ 214 $.fancybox.defaults.buttons = [ 215 // 'slideShow', 216 // 'fullScreen', 217 // 'thumbs', 218 // 'share', 219 //'download', 220 //'zoom', 221 'close' 222 ]; 223 $('.gallery__item').each(function(index,el){ 224 $(el).find('[data-fancybox]').fancybox(); 225 }); 226//AGT var product = $('#product.slick-slider'); 227 var product = $('.js_product.slick-slider'); 228 product.find('.fancy-product a').click(function(e){ 229 e.preventDefault(); 230 var imgs = [], 231 currentImg = $(this).attr('href'), 232 indexImg = 0; 233//AGT product.find('.slick-slide').each(function(index,el){ 234 $(this).closest('.slick-list').find(".slick-slide").each(function(index,el){ 235 if(!$(el).hasClass('slick-cloned')){ 236 var img = $(el).find('.fancy-product a').attr('href'); 237 if(img === currentImg){ 238 indexImg = product.slick('slickCurrentSlide'); 239 } 240 imgs.push({src:img}); 241 } 242 }); 243 $.fancybox.open( 244 imgs, 245 { 246 thumbs : { 247 autoStart : true, 248 axis : 'x' 249 }, 250 mobile: { 251 thumbs: false 252 } 253 } 254 ); 255 $.fancybox.getInstance('jumpTo', indexImg); 256 }); 257} 258// оÑкÑÑÑие попап Ñ ÑекÑÑовÑм ÑообÑением 259function popupShow(text) { 260 $.fancybox.open({ 261 src: '<div class="popups__msg">'+text+'</div>', 262 type : 'inline' 263 }); 264} 265function customInputNumber() { 266 267 $('<button type="button" class="quantity__up"></button><button class="quantity__down" type="button"></botton>').insertAfter('.quantity input'); 268 $('.quantity').each(function () { 269 var spinner = $(this), 270 input = spinner.find('input[type="number"]'), 271 btnUp = spinner.find('.quantity__up'), 272 btnDown = spinner.find('.quantity__down'), 273 min = input.attr('min') || 1, 274 max = input.attr('max') || 100000; 275 276 btnUp.click(function () { 277 var oldValue = Math.round(parseFloat(input.val())); 278 var newVal = oldValue + 1; 279 newVal = acceptNumber(newVal); 280 input.val(newVal).trigger('change'); 281 }); 282 283 btnDown.click(function () { 284 var oldValue = Math.round(parseFloat(input.val())); 285 var newVal = oldValue - 1; 286 newVal = acceptNumber(newVal); 287 input.val(newVal).trigger('change'); 288 }); 289 290 function acceptNumber(number){ 291 var number_new; 292 if( number >= min && number <= max){ 293 number_new = number; 294 }else{ 295 if(number > max) number_new = max; 296 if(number < min) number_new = min; 297 } 298 return number_new; 299 } 300 301 input.change(function(){ 302 var oldValue = Math.round(parseFloat(input.val())); 303 var newVal = acceptNumber(oldValue); 304 input.val(newVal); 305 }); 306 }); 307} 308function menuControl(){ 309 310 var menu = $('#menu'); 311 var btn = $('#menu-btn'); 312 var overlay = $('#overlay'); 313 var btnSearch = $('#search-toggle'); 314 var searchBox = $('#search-top'); 315 316 btn.click(function(e){ 317 if(!btn.hasClass('active')){ 318 overlay.fadeIn('fast'); 319 menu.slideDown('fast'); 320 btn.addClass('active'); 321 }else{ 322 overlay.fadeOut('fast'); 323 menu.slideUp('fast'); 324 btn.removeClass('active'); 325 } 326 }); 327 328 btnSearch.click(function(e){ 329 e.preventDefault(); 330 searchBox.slideToggle('fast'); 331 }); 332 333 overlay.click(function(){ 334 overlay.fadeOut('fast'); 335 menu.slideUp('fast'); 336 btn.removeClass('active'); 337 }); 338 339 $(document).click(function (e){ 340 if($(window).width<992){ 341 if ( (!searchBox.is(e.target) && !btnSearch.is(e.target)) 342 && (searchBox.has(e.target).length === 0 && btnSearch.has(e.target).length === 0) ) { 343 searchBox.slideUp('fast'); 344 } 345 } 346 }); 347} 348function catalogControl(){ 349 350 var catalog = $('#catalog'); 351 var categories = catalog.find('.catalog__categories'); 352 var btnCatalog = $('#btn-catalog'); 353 354 catalog.find('.catalog__scroll').mCustomScrollbar({ 355 autoHideScrollbar: true 356 }); 357 358 categories.click(function(e){ 359 var menu = $(this); 360 var sub = menu.parents('li').find('.catalog__sub'); 361 if($(window).width()<992){ 362 if(sub.length > 0){ 363 e.preventDefault(); 364 if(!menu.hasClass('active')){ 365 categories.removeClass('active'); 366 catalog.find('.catalog__sub').removeClass('active'); 367 sub.addClass('active'); 368 menu.addClass('active'); 369 }else{ 370 categories.removeClass('active'); 371 catalog.find('.catalog__sub').removeClass('active'); 372 373 } 374 } 375 }else{ 376 if(!$('html').hasClass('desktop')){ 377 if(sub.length > 0){ 378 e.preventDefault(); 379 } 380 } 381 } 382 }); 383 384 btnCatalog.click(function(e){ 385 btnCatalog.find('.btn_menu').toggleClass('active'); 386 catalog.slideToggle('fast'); 387 }); 388}
389function tabsInit(){ 390 391 $('.tabs__menu a').click(function (e) { 392 e.preventDefault(); 393 var menuLink = $(this), 394 tabsWrap = menuLink.parents('.tabs'), 395 menu = menuLink.parents('ul'), 396 tab = menuLink.attr('href'), 397 tabsActive = tabsWrap.find('.tabs__item.active'); 398 399 if(!menuLink.hasClass('active')){ 400 tabsActive.removeClass('active'); 401 menu.find('a').removeClass('active'); 402 menuLink.addClass('active'); 403 $(tab).addClass('active'); 404 } 405 }); 406 407 $('.tabs__btn').click(function (e) { 408 e.preventDefault(); 409 var menuLink = $(this), 410 tabsWrap = menuLink.parents('.tabs'), 411 tab = menuLink.attr('href'), 412 tabsActive = tabsWrap.find('.tabs__item.active'); 413 if(!menuLink.hasClass('active')){ 414 tabsWrap.find('.tabs__btn.active').removeClass('active'); 415 menuLink.addClass('active'); 416 tabsActive.removeClass('active').hide(0); 417 $(tab).slideDown('fast').addClass('active'); 418 }else{ 419 menuLink.removeClass('active'); 420 $(tab).removeClass('active').slideUp('fast'); 421 } 422 }); 423/*AGT*/ 424 $(".js_product_review_all_lnk").click(function(t){ 425 t.preventDefault(); 426 $('.js_product_review_tab').click(); 427 }); 428/*END_AGT*/ 429} 430function rangeInit(){ 431 $('.range-double').each(function(inde,el){ 432 var range = $(el).find('.range-double__slide'), 433 from = $(el).find('.range-double__from'), 434 to = $(el).find('.range-double__to'), 435 min = Number(range.data('min')), 436 max = Number(range.data('max')); 437 range.ionRangeSlider({ 438 type: "double", 439 grid: false, 440 hide_min_max: true, 441 hide_from_to: true, 442 min: min, 443 max: max, 444 onStart: rangeUpdate, 445 onChange: rangeUpdate, 446/*AGT*/ 447 onFinish: function(){ 448 from.change(); 449 to.change(); 450 } 451/*END_AGT*/ 452 }); 453 var slider = range.data("ionRangeSlider"); 454 from.change(function(){ 455 var vals = Number(from.val()); 456 if (vals < min){ 457 vals = min; 458 from.val(min) 459 } 460 slider.update({ 461 from: vals 462 }) 463 }); 464 to.change(function(){ 465 var vals = Number(to.val()); 466 if (vals > max){ 467 vals = max; 468 to.val(max); 469 } 470 slider.update({ 471 to: vals 472 }) 473 }); 474 function rangeUpdate(data){ 475 from.val(data.from); 476 to.val(data.to); 477 } 478 }); 479} 480 481//----------------------------------------------------- 482$(document).ready(function () { 483 484 $('.block_link.mh').columnConform(); 485 $(window).resize(function(){ 486 $('.block_link.mh').columnConform(); 487 }); 488 489 device.default; 490 491 maskedTel(); 492 493 slickInit(); 494 495 fancyInit(); 496 497 menuControl(); 498 499 catalogControl(); 500 501 tabsInit(); 502 503 $.parallaxify(); 504 505//AGT customInputNumber(); 506 507 rangeInit(); 508 509 //cutom-select 510 $('.select-custom-search').each(function(index,el){ 511 $(el).customSelect({ 512 transition: 150, 513 search: true, 514 includeValue: true, 515 placeholder: $(el).data('placeholder') || false, 516 hideCallback: function(){ 517 var rq = $(this).parents('.select').hasClass('select_required'); 518 var select = $(this).parents('.select').find('select'); 519 if(rq){ 520 if(select.val()){ 521 $(this).addClass('custom-select--change'); 522 } 523 } 524 } 525 }); 526 }); 527 $('.select-custom').each(function(index,el){ 528 $(el).customSelect({ 529 transition: 150, 530 includeValue: true, 531 placeholder: $(el).data('placeholder') || false, 532 hideCallback: function(){ 533 var rq = $(this).parents('.select').hasClass('select_required'); 534 var select = $(this).parents('.select').find('select'); 535 if(rq){ 536 if(select.val()){ 537 $(this).addClass('custom-select--change'); 538 } 539 } 540 } 541 }); 542 }); 543 544 //form reset, reset custom-select(set first option in select) 545 $(document).on('reset','form',function(){ 546 $(this).find('.custom-select__dropdown').each(function(index,el){ 547 var option = $(el).find('.custom-select__option')[0]; 548 if(option){ 549 $(option).click(); 550 } 551 }); 552 }); 553 554 $('.tooltips').append("<span></span>"); 555 $('.tooltips:not([tooltip-position])').attr('tooltip-position','bottom'); 556 557 $(".tooltips").mouseenter(function(){ 558 $(this).find('span').empty().append($(this).attr('tooltip')); 559 }); 560 561 //more toggle 562 $('.btn_more').click(function(e){ 563 e.preventDefault(); 564 $(this).toggleClass('active').next().slideToggle('fast'); 565 }); 566 567 //scroll-top 568 $('#gotop').click(function(e){ 569 e.preventDefault(); 570 $('html, body').animate({scrollTop: 0}, 1000); 571 }); 572 573 //input file 574 $('.input-file input').change(function(e){ 575 $(this).next('.input-file__label').text(this.files[0].name) 576 }); 577 578 //input correct blur 579 $('.input-place input').each(function(index,el){ 580 if($(el).val()){ 581 $(el).addClass('has-value'); 582 }else{ 583 $(el).removeClass('has-value'); 584 } 585 $(el).blur(function(){ 586 if($(this).val()){ 587 $(this).addClass('has-value'); 588 }else{ 589 $(this).removeClass('has-value'); 590 } 591 }); 592 }); 593 594 //stiky 595 $('#sticky-menu').sticky({topSpacing:0}); 596 $(document).on('click','#sticky-menu .tabs__menu a',function(e){ 597 e.preventDefault(); 598 var dest = $($(this).attr('href')).offset().top - $('#sticky-menu').height() || 0; 599 $('html, body').animate({scrollTop: dest}, 1000); 600 }); 601}); 602 603$(function() { 604 $('.accordeon_content').hide(); 605 606 $('.accordeon_title').click(function(){ 607 $(this).parent().toggleClass('active').siblings().removeClass('active'); 608 $('.accordeon_content').slideUp(); 609 610 if(!$(this).next().is(":visible")) { 611 $(this).next().slideDown(); 612 } 613 }); 614}); 615 616$('.tabgroup > div').hide(); 617$('.tabs-nav').each(function(){ 618 var activeTab = $(this).find('.active').attr('href'), 619 tabGroup = $(this).attr('data-tabgroup'); 620 $('#'+ tabGroup).find(activeTab).show(); 621}); 622$('.tabs-nav a:not(.lnk)').click(function(e){ 623 e.preventDefault(); 624 var $this = $(this), 625 tabgroup = '#'+$this.parents('.tabs-nav').data('tabgroup'), 626 others = $this.closest('li').siblings().children('a'), 627 target = $this.attr('href'); 628 others.removeClass('active'); 629 $this.addClass('active'); 630 $(tabgroup).children('div').hide(); 631 $(target).show(); 632}); 633 634$('.about-slider').slick({ 635 dots: false, 636 infinite: true, 637 nextArrow: '<button type="button" class="btn btn_next"></button>', 638 prevArrow: '<button type="button" class="btn btn_prev"></button>', 639 slidesToShow: 3, 640 slidesToScroll: 3, 641 responsive: [ 642 { 643 breakpoint: 600, 644 settings: { 645 slidesToShow: 2, 646 slidesToScroll: 2 647 } 648 }, 649 { 650 breakpoint: 480, 651 settings: { 652 slidesToShow: 1, 653 slidesToScroll: 1 654 } 655 } 656 ] 657}); 658 659$(".dealers_item_nav").click(function() { 660 $("html, body").animate({ 661 scrollTop : $("#dealers-tab-group").offset().top 662 }, 400) 663}); 664$(".service_item_nav").click(function() { 665 $("html, body").animate({ 666 scrollTop : $("#first-tab-group").offset().top 667 }, 400) 668}); 669 670(function($){ 671 $.fn.columnConform = function(){ 672 $(this).each(function(){ $(this).css("height", "auto"); }); 673 var currentTallest = 0, 674 currentRowStart = 0, 675 rowDivs = new Array(); 676 function setConformingHeight(el, newHeight){ 677 // set the height to something new, but remember the original height in case things change 678 el.data("originalHeight", (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight"))); 679 el.height(newHeight); 680 } 681 function getOriginalHeight(el){ 682 // if the height has changed, send the originalHeight 683 return (el.data("originalHeight") == undefined) ? (el.height()) : (el.data("originalHeight")); 684 } 685 // find the tallest DIV in the row, and set the heights of all of the DIVs to match it. 686 $(this).each(function(){ 687 // "caching" 688 var $el = $(this); 689 var topPosition = $el.position().top; 690 if (currentRowStart != topPosition) { 691 // we just came to a new row. Set all the heights on the completed row 692 for (var currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++){ setConformingHeight(rowDivs[currentDiv], currentTallest); } 693 // set the variables for the new row 694 rowDivs.length = 0; // empty the array 695 currentRowStart = topPosition; 696 currentTallest = getOriginalHeight($el); 697 rowDivs.push($el); 698 } else { 699 // another div on the current row. Add it to the list and check if it's taller 700 rowDivs.push($el); 701 currentTallest = (currentTallest < getOriginalHeight($el)) ? (getOriginalHeight($el)) : (currentTallest); 702 } 703 // do the last row 704 for (var currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++){ setConformingHeight(rowDivs[currentDiv], currentTallest); } 705 }); 706 $(this).each(function(){ $(this).removeData("originalHeight"); }); 707 }; 708})($); 709 710 711$('.js-read-more').click(function () { 712 if ( $(this).hasClass('inactive')) { 713 $(this).prev().removeClass('collapsed'); 714 $(this).text('СвеÑнÑÑÑ'); 715 $(this).removeClass('inactive'); 716 } else { 717 $(this).prev().addClass('collapsed'); 718 $(this).text('ÐодÑобнее'); 719 $(this).addClass('inactive'); 720 } 721});
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.