1var sliders = []; 2 3$(function() { 4 init(); 5 6 $(document).ajaxSuccess(function () { 7 init(); 8 }); 9 10 BX.addCustomEvent('onAjaxSuccess', function() { 11 init(); 12 }); 13 14 BX.addCustomEvent('onFrameDataReceived', function() { 15 init(); 16 }); 17 18 var header = $('#header'), 19 parallax_scroll = $('#parallax-scroll'), 20 scroll_before = 0, 21 freshnewsbtn = $('.fresh-news-btn'); 22 23 $(window).on('scroll resize', function () { 24 var scroll = $(this).scrollTop(); 25 26 if (scroll > header.parent().offset().top) { 27 header.addClass('fixed'); 28 29 if (scroll > scroll_before) { 30 header.addClass('up'); 31 freshnewsbtn.removeClass('down'); 32 } else { 33 header.removeClass('up'); 34 freshnewsbtn.addClass('down'); 35 } 36 } else { 37 header.removeClass('fixed'); 38 } 39 40 if (parallax_scroll.length && parallax_scroll.offset().top - scroll == 0) 41 parallax_scroll[0].scrollTop += (scroll - scroll_before) / 3; 42 43 scroll_before = scroll; 44 }).scroll(); 45 46 $(document).on('click', '[data-modal]', function (e) { 47 e.preventDefault(); 48 49 var cover = $('.b-modal-cover'), 50 modal = $('#' + $(this).data('modal')); 51 52 $('.b-modal').removeClass('active'); 53 $('[data-modal]').not(this).removeClass('active'); 54 55 $(this).toggleClass('active'); 56 57 if ($(this).is('.active')) { 58 if (!$('body').is('.scroll-disabled')) { 59 var bar = window.innerWidth - $(document).width(), 60 header_style = { 61 'padding-right': bar + 'px' 62 }; 63 64 if (!header.is('.fixed')) 65 header_style['margin-right'] = -bar + 'px'; 66 67 $('body').addClass('scroll-disabled'); 68 $('body, .b-modal').css({ 69 'margin-right': bar + 'px' 70 }); 71 72 header.css(header_style); 73 cover.addClass('active'); 74 } 75 76 modal.addClass('active'); 77 78 setTimeout(function () { 79 $('input', modal).first().focus(); 80 }, 500); 81 } else { 82 $('body').removeClass('scroll-disabled'); 83 $('body, .b-modal').removeAttr('style'); 84 85 header.removeAttr('style'); 86 cover.removeClass('active'); 87 } 88 }); 89 90 $('.js-menu-swipe').each(function () { 91 new Swiper($(this)[0], { 92 slidesPerView: 'auto', 93 freeMode: true, 94 watchOverflow: true, 95 96 observer: true, 97 observeParents: true, 98 observerUpdate: true, 99 observeSlideChildren: true, 100 }); 101 102 $('.swiper-slide', this).last().addClass('last'); 103 }); 104 105 $('.js-date-swipe').each(function () { 106 new Swiper($(this)[0], { 107 slidesPerView: 'auto', 108 freeMode: true, 109 watchOverflow: true, 110 slideToClickedSlide: true, 111 112 observer: true, 113 observeParents: true, 114 observerUpdate: true, 115 observeSlideChildren: true, 116 }); 117 118 $('.swiper-slide', this).last().addClass('last'); 119 }); 120 121 $('.js-slider2').each(function(i) { 122 var navigation = $(this).parents('section').find('.navigation'); 123 124 sliders[i] = new Swiper($(this)[0], { 125 slidesPerView: 3, 126 127 observer: true, 128 observeParents: true, 129 observerUpdate: true, 130 observeSlideChildren: true, 131 132 navigation: { 133 prevEl: $('.prev', navigation)[0], 134 nextEl: $('.next', navigation)[0] 135 }, 136 137 breakpoints: { 138 320: { 139 slidesPerView: 'auto', 140 freeMode: true, 141 watchOverflow: true, 142 slidesPerGroup: 3, 143 144 observer: true, 145 observeParents: true, 146 observerUpdate: true, 147 observeSlideChildren: true, 148 }, 149 768: { 150 slidesPerView: 3, 151 freeMode: false, 152 153 observer: true, 154 observeParents: true, 155 observerUpdate: true, 156 observeSlideChildren: true, 157 } 158 } 159 }); 160 161 $('.swiper-slide', this).last().addClass('last'); 162 163 $(this).data('slider', i); 164 }); 165 166 new Swiper('#js-slider-channel', { 167 spaceBetween: 20, 168 loop: true, 169 170 autoplay: { 171 delay: 3000, 172 }, 173 174 pagination: { 175 el: '.swiper-pagination', 176 type: 'bullets' 177 } 178 }); 179 180 $(document).on('click', '[data-filter]', function (e) { 181 e.preventDefault(); 182 183 var parent = $(this).parents('.js-slider-filter'), 184 filter = $(this).data('filter'), 185 186 slider = sliders[$('.js-slider', parent).data('slider')]; 187 188 $('[data-filter]', parent).removeClass('active'); 189 $('[data-category]', parent).removeClass('swiper-slide last').hide(); 190 191 $(this).addClass('active'); 192 193 $('[data-category*=' + filter + ']', parent).addClass('swiper-slide').show(); 194 $('[data-category*=' + filter + ']', parent).last().addClass('last'); 195
196 slider.update(); 197 slider.slideTo(0); 198 }); 199 200 $(document).on('click', '[data-tab]', function (e) { 201 e.preventDefault(); 202 203 var parent = $(this).parents('.js-tabs'); 204 205 $('[data-tab]', parent).removeClass('active'); 206 $('[data-content]', parent).hide(); 207 208 $(this).addClass('active'); 209 $('[data-content=' + $(this).data('tab') + ']', parent).show(); 210 }); 211 212 tippy('.js-dropdown', { 213 content(reference) { 214 return reference.getElementsByClassName('hidden')[0].innerHTML; 215 }, 216 217 onShow(instance) { 218 instance.reference.getElementsByClassName('icon-chevron-down')[0].classList.add('rotate'); 219 }, 220 221 onHide(instance) { 222 instance.reference.getElementsByClassName('icon-chevron-down')[0].classList.remove('rotate'); 223 }, 224 225 trigger: 'click', 226 allowHTML: true, 227 interactive: true, 228 229 appendTo: () => document.body, 230 placement: 'bottom-start', 231 duration: 100, 232 233 theme: 'dropdown', 234 arrow: false 235 }); 236 237 var search_calendar_from_input = $('#search-calendar-from'), 238 search_calendar_to_input = $('#search-calendar-to'), 239 240 search_calendar_from = search_calendar_from_input.val(), 241 search_calendar_to = search_calendar_to_input.val(), 242 243 search_calendar = $('#search-calendar').datepicker({ 244 range: true, 245 dateFormat: 'dd.mm.yyyy', 246 maxDate: new Date(), 247 248 multipleDatesSeparator: '-', 249 clearButton: true, 250 autoClose: true, 251 252 navTitles: { 253 days: 'MM', 254 months: 'yyyy' 255 }, 256 257 prevHtml: '<i class="icon-chevron-left"></i>', 258 nextHtml: '<i class="icon-chevron-right"></i>', 259 260 onSelect: function onSelect(fd) { 261 search_calendar_from_input.val(fd.split('-')[0]); 262 search_calendar_to_input.val(fd.split('-')[1]); 263 } 264 }).data('datepicker'); 265 266 if (search_calendar_from && search_calendar_to) { 267 var from = search_calendar_from.split('.'), 268 to = search_calendar_to.split('.'); 269 270 search_calendar.selectDate(new Date(from[2], + from[1] - 1, from[0])); 271 search_calendar.selectDate(new Date(to[2], + to[1] - 1, to[0])); 272 } 273 274 $('.js-period').datepicker({ 275 inline: true, 276 calendars: 2, 277 range: true, 278 279 multipleDatesSeparator: '-', 280 281 navTitles: { 282 days: 'MM', 283 months: 'yyyy' 284 }, 285 286 prevHtml: '<i class="icon-chevron-left"></i>', 287 nextHtml: '<i class="icon-chevron-right"></i>' 288 }); 289 290 $(document).on({ 291 mouseenter: function () { 292 var preview = $('[data-preview]', this); 293 preview.addClass('active'); 294 295 $('<img>', { 296 src: preview.data('preview') 297 }).on('load', function () { 298 if (preview.is('.active')) 299 preview.html(this).fadeIn(100); 300 }); 301 }, 302 303 mouseleave: function () { 304 $('[data-preview]', this).removeClass('active').fadeOut(100, function () { 305 $(this).empty(); 306 }) 307 } 308 }, '.js-preview'); 309 310 $(document).on('click', '.js-description-show .description-show', function (e) { 311 e.preventDefault(); 312 313 $('i', this).toggleClass('rotate'); 314 $('.description', $(this).parents('.js-description-show')).slideToggle(100); 315 }); 316 317 $(document).on('click', '.js-map-show .map-show', function (e) { 318 e.preventDefault(); 319 320 $('.map', $(this).parents('.js-map-show')).slideToggle(100); 321 }); 322 323 $(document).on('click', '.js-share-show .share-show', function (e) { 324 e.preventDefault(); 325 326 $('.hidden', $(this).parents('.js-share-show')).toggle(); 327 }); 328 329 $(document).on('click', '.js-share-show .share-close', function (e) { 330 e.preventDefault(); 331 332 $('.hidden', $(this).parents('.js-share-show')).hide(); 333 }); 334 335 $(document).on('click', '.js-share', function (e) { 336 e.preventDefault(); 337 338 window.open($(this).attr('href'), 'share', 'width=600, height=400'); 339 }); 340 341 $(document).mouseup(function (e) { 342 var object = $('.js-click-out'); 343 344 if (!object.is(e.target) && object.has(e.target).length === 0) 345 object.hide(); 346 }); 347 348 $('input[type="tel"]').mask("+7 (999) 999-99-99"); 349 350 $(document).on('change', 'input:file', function() { 351 var input = $(this); 352 353 input.next('span').text(input.val().split(/(\\|\/)/g).pop()); 354 }); 355 356 $('.accordion-title').click(function (event) { 357 event.preventDefault(); 358 $(this).siblings(".accordion-content").slideToggle(); 359 $(this).parent().toggleClass('active'); 360 $('.accordion-title').not($(this)).parent().removeClass('active'); 361 $('.accordion-title').not($(this)).siblings('.accordion-content').slideUp(); 362 }); 363 364 $(function () { 365 $('.btn-hamburger').click(function (event) { 366 $(this).toggleClass('active'); 367 $('body').toggleClass('mobile-menu-open'); 368 }) 369 }) 370 371 $(function () { 372 $('.b-flash .close').click(function (event) { 373 $('.b-flash').hide(); 374 }) 375 }) 376 377 $(function () { 378 $('.cookie span').click(function (event) { 379 $('.cookie').hide(); 380 }) 381 }) 382 383 // $(window).scroll(function () { 384 // let sTop = $(window).scrollTop(); 385 // let bPosition = $('.b-news-aside').offset(); 386 387 // if (sTop > bPosition.top) { 388 // $('.fresh-news-btn').addClass('show') 389 // } else { 390 // $('.fresh-news-btn').removeClass('show'); 391 // } 392 // }); 393 394 $('main iframe').each(function () { 395 var iframe = $(this); 396 397 if (iframe.parent('.e-iframe').length === 0) 398 iframe.wrap('<div class="e-iframe" style="padding-bottom: ' + (iframe.height() / iframe.width() * 100) + '%"></div>'); 399 }); 400 401 var load_more = false, 402 load_next = false; 403 404 $(window).on('scroll resize', function() { 405 if ($(window).scrollTop() + $(window).height() >
405 $(document).height() - 5000) { 406 var pager = $('.js-ajax-pager-auto'); 407 408 if (!load_more && pager.length) { 409 load_more = true; 410 411 var component = pager.parents('[id^=comp_]'); 412 413 $.get(pager.attr('href'), {bxajaxid: component.attr('id').replace('comp_', '')}, function(data) { 414 $('.js-ajax-content', component).append($(data).findAll('.js-ajax-content').html()); 415 416 pager.replaceWith($(data).findAll('.js-ajax-pager-auto')); 417 load_more = false; 418 419 $(window).resize(); 420 }); 421 } 422 } 423 424 var last = $('[data-next]:last'); 425 426 if (!load_next && last.length && $(window).scrollTop() + $(window).height() > $(document).height() - 5000) { 427 load_next = true; 428 429 var component = last.parents('[id^=comp_]'); 430 431 $.get('/ajax/next.php', {next: last.data('next')}, function(data) { 432 $.get(data, {bxajaxid: component.attr('id').replace('comp_', '')}, function(data) { 433 $('.js-ajax-content', component).append($(data).findAll('.js-ajax-content').html()); 434 435 load_next = false; 436 }); 437 }); 438 } 439 440 $('[data-state]').each(function(){ 441 var top = $(this).offset().top, 442 443 state = $(this).data('state'), 444 title = $(this).data('title'), 445 446 viewport = $(window).scrollTop() + 100, 447 referrer = document.URL; 448 449 if (viewport >= top && top + $(this).outerHeight() > viewport && state != location.href) { 450 history.replaceState(null, title, state); 451 document.title = title; 452 453 yaCounter10446865.hit(state, {title: title}); 454 _tmr.pageView({id: '1445896', url: state}); 455 456 new Image().src = 'https://counter.yadro.ru/hit?r' + escape(referrer) + ((typeof(screen) == 'undefined') ? '': ';s' + screen.width + '*' + screen.height + '*' + (screen.colorDepth ? screen.colorDepth : screen.pixelDepth)) + ';u' + escape(state) + ';h'+ escape(title.substring(0,150)) + ';' + Math.random(); 457 } 458 }); 459 }).scroll(); 460 461 $(document).on('click', '.js-copy-link', function(e) { 462 e.preventDefault(); 463 464 message('СÑÑлка ÑкопиÑована'); 465 }); 466 467 var search_suggest; 468 469 $(document).on('input change', '#suggest-search-input', function() { 470 var input = $(this); 471 472 window.clearTimeout(search_suggest); 473 474 search_suggest = window.setTimeout(function() { 475 $.get('/ajax/search.php', { 476 suggest: input.val() 477 }, function(data) { 478 $('#suggest-search-result').html(data); 479 }); 480 }, 500); 481 }); 482 483 $(document).ajaxStart(function() { 484 BX.showWait(); 485 }); 486 487 $(document).ajaxStop(function() { 488 BX.closeWait(); 489 }); 490}); 491 492function init() { 493 $('[data-svg]:not(.loaded)').each(function() { 494 var $i = $(this).addClass('loaded'); 495 496 $.get($i.data('svg'), function(data) { 497 var $svg = $(data).find('svg'); 498 499 $svg.attr('class', $i.attr('class')); 500 $i.replaceWith($svg); 501 }, 'xml'); 502 }); 503 504 $('[data-src]:not(.loaded)').each(function() { 505 var img = $(this).addClass('loaded'); 506 507 img.on('load', function() { 508 img.removeAttr('data-src'); 509 }).attr('src', img.data('src')); 510 }); 511 512 $('.js-gallery').fotorama({ 513 shadows: false, 514 width: '100%', 515 ratio: 16 / 9, 516 transitionduration: 250, 517 arrows: 'always', 518 nav: 'dots', 519 transition: 'crossfade' 520 }); 521 522 $('.b-article a:contains("instagram.com/p"):not(.loading)').each(function() { 523 var link = $(this).addClass('loading'); 524 525 $.get('/ajax/instagram.php', {url: link.attr('href')}, function(data) { 526 link.replaceWith(data); 527 }); 528 }); 529 530 tippy('.js-tippy [title]', { 531 content(reference) { 532 const title = reference.getAttribute('title'); 533 534 reference.classList.add('tooltip'); 535 reference.removeAttribute('title'); 536 537 return title; 538 }, 539 540 theme: 'tooltip', 541 duration: 100 542 }); 543 544 new ClipboardJS('.js-copy-link'); 545 546 $('.js-slider:not(.swiper-container-initialized)').each(function(i) { 547 var navigation = $(this).parents('section').find('.navigation'); 548 549 sliders[i] = new Swiper($(this)[0], { 550 slidesPerView: 'auto', 551 freeMode: true, 552 watchOverflow: true, 553 slidesPerGroup: 3, 554 555 observer: true, 556 observeParents: true, 557 observerUpdate: true, 558 observeSlideChildren: true, 559 560 navigation: { 561 prevEl: $('.prev', navigation)[0], 562 nextEl: $('.next', navigation)[0] 563 } 564 }); 565
566 $('.swiper-slide', this).last().addClass('last'); 567 568 $(this).data('slider', i); 569 }); 570} 571 572$.fn.findAll = function (selector) { 573 return this.filter(selector).add(this.find(selector)); 574}; 575 576function message(text) { 577 var wrapper = $('#messages'); 578 579 wrapper.prepend('<div class="item">' + text + '</div>'); 580 581 $('.item:first', wrapper).slideDown(100).delay(3000).fadeOut(100, function(){ 582 $(this).remove(); 583 }); 584} 585 586BX.showWait = function() { 587 588}; 589 590BX.closeWait = function() { 591 592};
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.