1(function ($) { 2 3 "use strict"; 4 5 var $html = $('html'), isTouch = $html.hasClass('touchevents'); 6 var $body = $('body'); 7 var $window = $(window); 8 var windowWidth = Math.max($window.width(), window.innerWidth); 9 10 function preventDefault(e) { 11 e = e || window.event; 12 if (e.preventDefault) 13 e.preventDefault(); 14 e.returnValue = false; 15 } 16 17 function preventDefaultForScrollKeys(e) { 18 if (keys[e.keyCode]) { 19 preventDefault(e); 20 return false; 21 } 22 } 23 24 /*Detect browsers*/ 25 var browser = (function(agent){ 26 switch (true) { 27 case agent.indexOf("edge") > -1: return $html.addClass('edge'); 28 case agent.indexOf("edg") > -1: return $html.addClass('edge'); 29 case agent.indexOf("opr") > -1 && !!window.opr: return $html.addClass('opera'); 30 case agent.indexOf("chrome") > -1 && !!window.chrome: return $html.addClass('chrome'); 31 case agent.indexOf("trident") > -1: return $html.addClass('ie'); 32 case agent.indexOf("firefox") > -1: return $html.addClass('firefox'); 33 case agent.indexOf("safari") > -1: return $html.addClass('safari'); 34 default: return "other"; 35 } 36 })(window.navigator.userAgent.toLowerCase()); 37 38 39 40 /*Detect IE*/ 41 function detectIE() { 42 var ua = window.navigator.userAgent; 43 var msie = ua.indexOf('MSIE'); 44 var trident = ua.indexOf('Trident/'); 45 var edge = ua.indexOf('Edge/'); 46 if(msie > 0){ 47 $html.addClass('ie'); 48 } 49 else if(trident > 0){ 50 $html.addClass('ie'); 51 } 52 else{ 53 54 $html.addClass('not-ie'); 55 } 56 return false; 57 } 58 59 detectIE(); 60 61 62 /*Detect ios*/ 63 var mac = !!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i); 64 if(mac){ 65 $html.addClass('ios'); 66 if($html.hasClass('touchevents')){ 67 $html.addClass('touch-ios'); 68 } 69 } 70 71 function iOSversion() { 72 if (/iP(hone|od|ad)/.test(navigator.platform)) { 73 var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); 74 return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)]; 75 } 76 } 77 78 var ver = iOSversion(); 79 80 if(ver && ver[0] < 11) { 81 $html.addClass('no-autoplay-video'); 82 } 83 84 85 /*Ios fix zoom on form elems focus*/ 86 if($html.hasClass('ios')){ 87 var metaViewport = document.querySelector('meta[name=viewport]'); 88 if (metaViewport !== null) { 89 var content = metaViewport.getAttribute('content'); 90 var re = /maximum\-scale=[0-9\.]+/g; 91 92 if (re.test(content)) { 93 content = content.replace(re, 'maximum-scale=1.0'); 94 } else { 95 content = [content, 'maximum-scale=1.0'].join(', ') 96 } 97 metaViewport.setAttribute('content', content); 98 } 99 } 100 101 /*Detect Android*/ 102 var ua = navigator.userAgent.toLowerCase(); 103 var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); 104 if (isAndroid) { 105 $html.addClass('android'); 106 } else { 107 $html.addClass('not-android'); 108 } 109 110 111 /*Tel inp*/ 112 $(".form-control[type='tel']").keypress(function(e){ 113 var keycode = (e.keyCode ? e.keyCode : e.which); 114 if (/[^\d\b+ ()-]/.test(String.fromCharCode(keycode))) { 115 e.preventDefault(); 116 } 117 }); 118 119 /* adblock */ 120 if($('.banner-positions-box .ad-box').length) { 121 document.addEventListener("DOMContentLoaded", function () { 122 var box = $('.banner-positions-box .ad-box'); 123 if (box[0] && !box[0].getBoundingClientRect().width) { 124 $('.banner-positions-box .tabs-wrap').css('display', 'none') 125 } else { 126 $('.subscribe-links').css('display', 'none'); 127 $('.banner-positions-box .tabs-wrap-two').css('display', 'none'); 128 $('.banner-positions-box .tabs-wrap').css('display', 'none') 129 } 130 }); 131 } 132 133 if(!$('.banner-positions-box').find('.banner').length) { 134 $('.banner-positions-box .tabs-wrap').css('display', 'none') 135 } 136 137 138 /*Header*/ 139 var scrollDefaultPosition = 0; 140 var heightTopBanner = 0; 141 142 /*if($('.top-banner-box').length && !$html.hasClass('branding-page') && !$('.top-banner-box').is(":hidden")) { 143 heightTopBanner = $('.top-banner-box').outerHeight(); 144 $('#header').css('top', heightTopBanner) 145 } else { 146 $('.top-banner-box').css('padding', 0) 147 heightTopBanner = 0; 148 $('#header').css('top', heightTopBanner) 149 }*/ 150 151 function stickyHeader(){ 152 var wST = $(window).scrollTop(); 153 var hST = $('#all').offset().top; 154 155 156 157 if(wST > heightTopBanner && wST > scrollDefaultPosition && !$html.hasClass('opened-nav') && !$html.hasClass('branding-page')){ 158 $html.addClass('sticky-header short-header-view'); 159 } else if (wST > hST && wST > scrollDefaultPosition && !$html.hasClass('opened-nav') && $html.hasClass('branding-page')){ 160 $html.addClass('sticky-header short-header-view'); 161 } 162 else{ 163 $html.removeClass('short-header-view'); 164 } 165 166 if (wST <= heightTopBanner && !$html.hasClass('branding-page')) { 167 if ($html.hasClass('sticky-header')) { 168 $html.removeClass('sticky-header'); 169 } 170 } else if (wST <= hST && $html.hasClass('branding-page')){ 171 if ($html.hasClass('sticky-header')) { 172 $html.removeClass('sticky-header'); 173 } 174 } 175 else if (wST <= hST){
176 $html.removeClass('sticky-header'); 177 } 178 179 scrollDefaultPosition = wST; 180 } 181 stickyHeader(); 182 183 184 $('.js-open-search').click(function(){ 185 186 if($(this).parents('#header').length && $html.hasClass('opened-search') || !$(this).parents('#header').length && $html.hasClass('opened-search')){ 187 $html.removeClass('opened-search'); 188 $(this).attr('title', 'ÐоиÑк'); 189 } else { 190 if($html.hasClass('opened-nav')){ 191 $html.removeClass('opened-nav') 192 } 193 $html.addClass('opened-search'); 194 $(this).attr('title', 'ÐакÑÑÑÑ Ð¿Ð¾Ð¸Ñк'); 195 setTimeout(function(){ 196 if(!$html.hasClass('ios')){ 197 $('.search-form-box .search-form .form-control').focus(); 198 } 199 }, 50); 200 201 setTimeout(function(){ 202 if(!$html.hasClass('ios')){ 203 $('.search-form-box .search-form .form-control').focus(); 204 } 205 }, 200); 206 } 207 }); 208 209 /*Nav*/ 210 211 $('#nav li').each(function(){ 212 if($(this).find('.nav-dropdown').length && windowWidth > 1320){ 213 $(this).addClass('has-child'); 214 } 215 }); 216 217 $('#nav .has-child > a').click(function(e){ 218 if($(this).parents('li').hasClass('has-child')){ 219 e.preventDefault(); 220 e.stopPropagation(); 221 } 222 if(windowWidth > 1320){ 223 if(!$(this).next('.nav-dropdown').hasClass('visible')){ 224 $('#nav .has-child').removeClass('opened-dropdown'); 225 $('#nav .nav-dropdown').removeClass('visible').fadeOut(150); 226 $(this).parents('.has-child').addClass('opened-dropdown'); 227 $(this).next('.nav-dropdown').addClass('visible').fadeIn(150); 228 } 229 else{ 230 $(this).parents('.has-child').removeClass('opened-dropdown'); 231 $(this).next('.nav-dropdown').removeClass('visible').fadeOut(150); 232 } 233 if($html.hasClass('opened-search')){ 234 $html.removeClass('opened-search'); 235 } 236 } 237 }); 238 239 $('.touchevents #nav').click(function(e){ 240 if(!$(e.target).is('#nav a')){ 241 e.stopPropagation(); 242 } 243 }); 244 245 $('.js-open-nav').click(function(){ 246 if(!$html.hasClass('opened-nav')){ 247 $html.addClass('opened-nav'); 248 $(this).attr('title', 'ÐакÑÑÑÑ Ð¼ÐµÐ½Ñ'); 249 250 $('#nav > ul > li').each(function(){ 251 if($(this).hasClass('active') && $(this).find('.dropdown').length) { 252 $(this).addClass('opened-dropdown').find('.dropdown').show(); 253 } 254 }); 255 if($html.hasClass('opened-search')) { 256 $html.removeClass('opened-search'); 257 } 258 259 } 260 else { 261 $html.removeClass('opened-nav'); 262 $(this).attr('title', 'ÐенÑ'); 263 setTimeout(function () { 264 $('#nav li').removeClass('opened-dropdown').find('.dropdown').hide(); 265 }, 300); 266 } 267 }); 268 269 270 /* anchor */ 271 $(".anchor").on("click", function (e) { 272 e.preventDefault(); 273 var id = $(this).attr('href'), 274 top = $(id).offset().top - '20'; 275 $('body,html').animate({scrollTop: top}, 1000); 276 }); 277 278 279 /*Keyboard controls*/ 280 $(document).keyup(function (e) { 281 if(e.keyCode == 27){ 282 $('.opened-nav .js-open-nav, .opened-search .js-open-search').trigger('click'); 283 } 284 }); 285 286 /* test game */ 287 $('.js-start-test').on('click', function (e) { 288 e.preventDefault(); 289 $(this).parents('.test-box').addClass('started'); 290 $(this).parents('.test-box').find('.item').eq(0).css('display', 'flex'); 291 }); 292 293 $('.form-questions').on('change', function () { 294 $(this).closest('.item').find('.js-next-question').prop('disabled', false); 295 }); 296 297 $('.js-next-question').on('click', function (e) { 298 e.preventDefault(); 299 $(this).parents('.item').css('display', 'none'); 300 $(this).parents('.item').next().css('display', 'flex'); 301 if ($(this).hasClass('last-step')) { 302 var $testbox = $(this).closest('.test-box'); 303 $testbox.removeClass('started'); 304 $testbox.addClass('result'); 305 $testbox.find('.result-box').find('.info-img-box').remove(); 306 307 var $form = $(this).closest('form.questions-box'); 308 $.post($form.attr('action'), $form.serialize(), function (data) { 309 $testbox.find('.result-box').prepend(data); 310 }, 'html').fail(function () { 311 $testbox.find('.result-box').prepend('<div class="info-img-box"><div class="text-box">' + 312 '<div class="num"><span class="result-num">0</span><span class="total">/0</span></div>' + 313 '<p class="title">
313ЧÑо-Ñо поÑло не Ñак</p>' + 314 '<p class="text">оÑибка полÑÑÐµÐ½Ð¸Ñ ÑезÑлÑÑаÑа.</p>' + 315 '</div></div>'); 316 }); 317 } 318 }); 319 320 $('.reset-btn').on('click', function (e) { 321 e.preventDefault(); 322 $(this).parents('.test-box').removeClass('result'); 323 $(this).parents('.test-box').find('.radiobox-item input[type="radio"]').prop('checked', false); 324 $(this).parents('.test-box').find('.item').find('.js-next-question').prop('disabled', true); 325 }); 326 327 /*if($('.test-box').length){ 328 var questionLength = $('.questions-box').find('.item').length; 329 $('.question-num-box .total').text(questionLength); 330 $('.result-box').find('.total').text('/' + questionLength) 331 $('.questions-box').find('.item').each(function(i){ 332 var indexQuestion = i + 1; 333 $(this).attr('data-question-num', indexQuestion); 334 $(this).find('.question-num-box .current').text(indexQuestion) 335 }) 336 337 $('.js-start-test').on('click', function(e){ 338 e.preventDefault(); 339 $(this).parents('.test-box').addClass('started'); 340 $('.test-box.started .questions-box').find('.item:first-child').css('display', 'flex'); 341 }); 342 343 $('.js-next-question').on('click', function(e){ 344 e.preventDefault(); 345 var nextItem = $(this).parents('.item').next(); 346 $(this).parents('.item').css('display', 'none'); 347 nextItem.css('display', 'flex'); 348 if($(this).parents('.item').attr('data-question-num') == questionLength){ 349 $(this).parents('.test-box').removeClass('started'); 350 $(this).parents('.test-box').addClass('result'); 351 } 352 }); 353 354 $('.reset-btn').on('click', function(e){ 355 e.preventDefault(); 356 $(this).parents('.test-box').removeClass('result'); 357 }) 358 }*/ 359 360 /* show answer */ 361 $('.dropdown-box').hide(); 362 $('.js-show-answer').click(function(){ 363 var el = $(this).parents('.item'); 364 if (el.hasClass('active')) { 365 el.removeClass('active').find('.dropdown-box').slideUp(150); 366 } 367 else { 368 $(el).removeClass('active'); 369 $(el).find('.dropdown-box').hide(); 370 el.addClass('active').find('.dropdown-box').slideDown(150); 371 } 372 window.dispatchEvent(new Event('resize')); 373 }); 374 375 /* show info */ 376 $('.js-show-info').click(function(){ 377 var el = $(this).parents('.donate-root-info'); 378 if (el.hasClass('active')) { 379 el.removeClass('active').find('.dropdown-box').slideUp(250); 380 } 381 else { 382 $(el).removeClass('active'); 383 $(el).find('.dropdown-box').hide(); 384 el.addClass('active').find('.dropdown-box').slideDown(250); 385 } 386 window.dispatchEvent(new Event('resize')); 387 }); 388 389 /* Tabs donuts */ 390 $('.donats-box .tabs-list .tab-link').click(function(){ 391 var tab_id = $(this).attr('data-tab'); 392 $('.donats-box .tabs-list li').removeClass('current'); 393 $('.donats-box .tab-content').removeClass('current'); 394 $(this).addClass('current'); 395 $("#"+tab_id).addClass('current'); 396 }); 397 398 $('.other-sum input').on('input', function(){ 399 this.value = this.value.replace(/[^0-9\.]/g, ''); 400 if($(this).val() < 1) { 401 $(this).parents('.donate-sum-grid').find('.field:first-child input').prop('checked', true); 402 $(this).removeClass('active'); 403 } else { 404 $(this).parents('.donate-sum-grid').find('.field input').prop('checked', false); 405 $(this).addClass('active'); 406 } 407 }) 408 409 $('.donate-sum-grid .field label').on('click', function(){ 410 if($(this).parents('.donate-sum-grid').find('.other-sum input').val() > 0) { 411 $(this).parents('.donate-sum-grid').find('.other-sum input').val('').removeClass('active'); 412 413 } 414 }) 415 416 $('.form-wrap input').on('focus', function(){ 417 if(!$(this).hasClass('focus')){ 418 $(this).addClass('focus'); 419 } 420 }) 421 $('.form-wrap input').on('focusout', function(){ 422 if($(this).hasClass('focus') && $(this).val() < 1){ 423 $(this).removeClass('focus'); 424 } 425 }) 426 427 /* tabs */ 428 $('.tabs-list .tab-link').click(function(){ 429 var tab_id = $(this).attr('data-tab'); 430 $('.tabs-list li').removeClass('current'); 431 $('.tab-content').removeClass('current'); 432 $(this).addClass('current'); 433 $("#"+tab_id).addClass('current'); 434 });
435 436 437 438 function intervalRotator(){ 439 var links = $('.tabs-wrap .tabs-list li'); 440 if($(links[0]).hasClass('current')) { 441 $(links[0]).removeClass('current') 442 $('.tabs-wrap #tab-1').removeClass('current'); 443 $(links[1]).addClass('current') 444 $('.tabs-wrap #tab-2').addClass('current'); 445 } else if ($(links[1]).hasClass('current')) { 446 $(links[1]).removeClass('current') 447 $('.tabs-wrap #tab-2').removeClass('current'); 448 $(links[2]).addClass('current') 449 $('.tabs-wrap #tab-3').addClass('current'); 450 } else if ($(links[2]).hasClass('current')) { 451 $(links[2]).removeClass('current') 452 $('.tabs-wrap #tab-3').removeClass('current'); 453 $(links[0]).addClass('current') 454 $('.tabs-wrap #tab-1').addClass('current'); 455 } 456 } 457 var tabsInterval = setInterval(function(){ 458 intervalRotator(); 459 }, 6000) 460 461 462 if($('.tabs-wrap').length && windowWidth > 1023) { 463 tabsInterval; 464 } 465 466 $('.no-touchevents .tabs-wrap').mouseenter(function(){ 467 clearInterval(tabsInterval); 468 }); 469 470 $('.no-touchevents .tabs-wrap').mouseleave(function(){ 471 tabsInterval = setInterval(function(){ 472 intervalRotator(); 473 }, 6000) 474 }); 475 476 477 478 479 function intervalRotatorSec() { 480 var links = $('.tabs-wrap-two .tabs-list li'); 481 if ($(links[0]).hasClass('current')) { 482 $(links[0]).removeClass('current') 483 $('.tabs-wrap-two #tab-4').removeClass('current'); 484 $(links[1]).addClass('current') 485 $('.tabs-wrap-two #tab-5').addClass('current'); 486 } else if ($(links[1]).hasClass('current')) { 487 $(links[1]).removeClass('current') 488 $('.tabs-wrap-two #tab-5').removeClass('current'); 489 $(links[2]).addClass('current') 490 $('.tabs-wrap-two #tab-6').addClass('current'); 491 } else if ($(links[2]).hasClass('current')) { 492 $(links[2]).removeClass('current') 493 $('.tabs-wrap-two #tab-6').removeClass('current'); 494 $(links[0]).addClass('current') 495 $('.tabs-wrap-two #tab-4').addClass('current'); 496 } 497 } 498 var tabsIntervalSec = setInterval(function(){ 499 intervalRotatorSec(); 500 }, 6000) 501 502 if($('.tabs-wrap-two').length && windowWidth > 1023) { 503 tabsIntervalSec; 504 } 505 506 $('.no-touchevents .tabs-wrap-two').mouseenter(function(){ 507 clearInterval(tabsIntervalSec); 508 }); 509 510 $('.no-touchevents .tabs-wrap-two').mouseleave(function(){ 511 tabsIntervalSec = setInterval(function(){ 512 intervalRotatorSec(); 513 }, 6000) 514 }); 515 516 $(window).on('load', function(){ 517 if($('.tabs-wrap-two .tab-content').length){ 518 var higherHeight = 0; 519 $('.tabs-wrap-two .tab-content').each(function(){ 520 var $thisHeight = $(this).innerHeight(); 521 console.log($thisHeight) 522 if($thisHeight >= higherHeight){ 523 higherHeight = $thisHeight; 524 } 525 }); 526 $('.tabs-wrap-two .tab-content').css('minHeight', higherHeight); 527 } 528 }); 529 530 /* message bottom */ 531 $('.message-bottom .js-close-message').on('click', function(){ 532 $html.addClass('message-hidden'); 533 }) 534 535 /*Footer*/ 536 function stickyFooter(){ 537 var fHeight = $('#footer').innerHeight(); 538 $('#footer').css('marginTop', -fHeight); 539 $('#indent').css('paddingBottom', fHeight); 540 } 541 if($('#footer').length){ 542 stickyFooter(); 543 } 544 545 546 /* poll */ 547 $body.on('change', 'form.form-poll .radiobox-item input', function () { 548 var $form = $(this).closest('form.form-poll'), 549 $container = $form.closest('.poll-box'); 550 if ($form.find('input[type="radio"]:checked').length || $form.find('input[type="checkbox"]:checked').length) { 551 $.post($form.attr('action'), $form.serialize(), function (data) { 552 var $data = $('<div/>'); 553 $data.html(data); 554 555 $form.remove(); 556 557 if ($container.find('.overall-result').length && $data.find('.overall-result').length) { 558 $container.find('.overall-result span').text($data.find('.overall-result span').text()); 559 } 560 561 $container.find('.list-poll-result').html($data.find('.list-poll-result').html()); 562 $container.addClass('result'); 563 }, 'html').fail(function () { 564 alert('Server Error'); 565 }); 566 } 567 });
568 569 /* share box */ 570 if($('.share-box').length) { 571 $('.simple-share').simpleShare(); 572 } 573 //$('.bottom-wrap .simple-share:first-child a:first-child').append('<span>124</span>') 574 575 /* gallery slider */ 576 if($('.gallery-slider').length){ 577 if($('.gallery-slider .thumbs-slider').length){ 578 var thumbsSlider = new Swiper('.gallery-slider .thumbs-slider .swiper-container',{ 579 slidesPerView: 9, 580 slidesPerGroup: 1, 581 spaceBetween: 14, 582 autoHeight: true, 583 slideToClickedSlide: false, 584 navigation: { 585 nextEl: '.gallery-slider .thumbs-slider .swiper-button-next', 586 prevEl: '.gallery-slider .thumbs-slider .swiper-button-prev' 587 }, 588 watchSlidesVisibility: true, 589 watchSlidesProgress: true, 590 breakpoints: { 591 1320: { 592 slidesPerView: 7, 593 spaceBetween: 10, 594 }, 595 650: { 596 slidesPerView: 5, 597 spaceBetween: 10, 598 }, 599 500: { 600 slidesPerView: 3, 601 spaceBetween: 10, 602 }, 603 400: { 604 slidesPerView: 3, 605 spaceBetween: 7, 606 }, 607 } 608 }); 609 } 610 $('.gallery-slider .swiper-wrapper').lightGallery({ 611 selector: '.swiper-slide a', 612 hash: false 613 }); 614 615 var mainSlider = new Swiper('.gallery-slider .main-slider .swiper-container',{ 616 autoHeight: true, 617 thumbs: { 618 swiper: thumbsSlider 619 } 620 }); 621 622 $('.thumbs-slider a').click(function(e){ 623 e.preventDefault(); 624 $(window).trigger('resize'); 625 }); 626 627 mainSlider.on('slideChangeTransitionStart', function(){ 628 var activeSlide = $('.thumbs-slider .swiper-slide-thumb-active').index(); 629 thumbsSlider.slideTo(activeSlide); 630 }); 631 $(window).trigger('resize'); 632 } 633 634 /* index top slider */
635 var indexTopSlider; 636 function indexTopSliderInit(){ 637 indexTopSlider = new Swiper('.top-slider .swiper-container', { 638 slidesPerView: 4, 639 spaceBetween: 30, 640 slidesPerGroup: 4, 641 autoHeight: true, 642 pagination: { 643 el: '.top-slider .swiper-pagination', 644 clickable: true, 645 type: 'bullets' 646 }, 647 navigation: { 648 nextEl: '.top-slider .swiper-button-next', 649 prevEl: '.top-slider .swiper-button-prev', 650 }, 651 breakpoints: { 652 500: { 653 slidesPerView: 1, 654 slidesPerGroup: 1, 655 pagination: { 656 type: 'fraction' 657 } 658 }, 659 800: { 660 slidesPerView: 2, 661 slidesPerGroup: 2, 662 pagination: { 663 type: 'bullets' 664 } 665 }, 666 1150: { 667 slidesPerView: 3, 668 slidesPerGroup: 3, 669 pagination: { 670 type: 'bullets' 671 } 672 } 673 } 674 }); 675 } 676 if($('.top-slider').length){
677 indexTopSliderInit(); 678 } 679 /* read more slider */ 680 var readMoreSlider; 681 function readMoreSliderInit(){ 682 readMoreSlider = new Swiper('.read-more-slider .swiper-container', { 683 slidesPerView: 5, 684 spaceBetween: 32, 685 slidesPerGroup: 5, 686 autoHeight: true, 687 pagination: { 688 el: '.read-more-slider .swiper-pagination', 689 clickable: true, 690 }, 691 navigation: { 692 nextEl: '.read-more-slider .swiper-button-next', 693 prevEl: '.read-more-slider .swiper-button-prev', 694 }, 695 breakpoints: { 696 320: { 697 slidesPerView: 1, 698 slidesPerGroup: 1, 699 pagination: { 700 type: 'fraction', 701 } 702 }, 703 400: { 704 slidesPerView: 1, 705 slidesPerGroup: 1, 706 spaceBetween: 15, 707 pagination: { 708 type: 'fraction', 709 } 710 }, 711 550: { 712 slidesPerView: 2, 713 slidesPerGroup: 2, 714 spaceBetween: 20, 715 pagination: { 716 type: 'fraction', 717 } 718 }, 719 551: { 720 slidesPerView: 2, 721 slidesPerGroup: 2, 722 spaceBetween: 20, 723 pagination: { 724 type: 'bullets' 725 }, 726 }, 727 800: { 728 slidesPerView: 3, 729 slidesPerGroup: 3, 730 spaceBetween: 20, 731 pagination: { 732 type: 'bullets' 733 }, 734 }, 735 1023: { 736 slidesPerView: 4, 737 slidesPerGroup: 4, 738 spaceBetween: 20, 739 pagination: { 740 type: 'bullets' 741 }, 742 }, 743 }, 744 }); 745 } 746 if($('.read-more-slider').length){ 747 readMoreSliderInit(); 748 } 749 750 /* favorites slider */ 751 var favoritesSlider; 752 function favoritesSliderInit(){ 753 favoritesSlider = new Swiper('.favorites-slider .swiper-container', { 754 slidesPerView: 5, 755 spaceBetween: 30, 756 slidesPerGroup: 5, 757 autoHeight: true, 758 pagination: { 759 el: '.favorites-slider .swiper-pagination', 760 clickable: true, 761 type: 'bullets' 762 }, 763 navigation: { 764 nextEl: '.favorites-slider .swiper-button-next', 765 prevEl: '.favorites-slider .swiper-button-prev', 766 }, 767 breakpoints: { 768 320: { 769 slidesPerView: 1, 770 slidesPerGroup: 1, 771 pagination: { 772 type: 'fraction', 773 } 774 }, 775 400: { 776 slidesPerView: 1, 777 slidesPerGroup: 1, 778 spaceBetween: 15, 779 pagination: { 780 type: 'fraction', 781 } 782 }, 783 550: { 784 slidesPerView: 2, 785 slidesPerGroup: 2, 786 spaceBetween: 20, 787 pagination: { 788 type: 'fraction', 789 } 790 }, 791 551: { 792 slidesPerView: 2, 793 slidesPerGroup: 2, 794 spaceBetween: 20, 795 pagination: { 796 type: 'bullets' 797 }, 798 }, 799 800: { 800 slidesPerView: 3, 801 slidesPerGroup: 3, 802 spaceBetween: 20, 803 pagination: { 804 type: 'bullets' 805 }, 806 }, 807 1023: { 808 slidesPerView: 4, 809 slidesPerGroup: 4, 810 spaceBetween: 20, 811 pagination: { 812 type: 'bullets' 813 }, 814 }, 815 }, 816 }); 817 } 818 if($('.favorites-slider').length){ 819 setTimeout(function(){ 820 favoritesSliderInit(); 821 }, 500) 822 } 823 824 /* articles grid slider */ 825 var articlesGridSlider = undefined; 826 function articlesGridSliderInit(){ 827 if(windowWidth <= 1023 && articlesGridSlider == undefined) { 828 articlesGridSlider = new Swiper('.articles-grid .swiper-container',{ 829 slidesPerView: 4, 830 spaceBetween: 20, 831 slidesPerGroup: 1, 832 autoHeight: true, 833 pagination: { 834 el: '.articles-grid .swiper-pagination', 835 clickable: true, 836 type: 'bullets' 837 }, 838 navigation: { 839 nextEl: '.articles-grid .swiper-button-next', 840 prevEl: '.articles-grid .swiper-button-prev', 841 }, 842 breakpoints: { 843 320: { 844 slidesPerView: 1, 845 slidesPerGroup: 1, 846 pagination: { 847 type: 'fraction', 848 } 849 }, 850 400: { 851 slidesPerView: 1, 852 slidesPerGroup: 1, 853 spaceBetween: 15, 854 pagination: { 855 type: 'fraction', 856 } 857 }, 858 550: { 859 slidesPerView: 2, 860 slidesPerGroup: 1, 861 spaceBetween: 20, 862 pagination: { 863 type: 'fraction', 864 } 865 }, 866 551: { 867 slidesPerView: 2, 868 slidesPerGroup: 1, 869 spaceBetween: 20, 870 pagination: { 871 type: 'bullets' 872 }, 873 }, 874 800: { 875 slidesPerView: 3, 876 slidesPerGroup: 1, 877 spaceBetween: 20, 878 pagination: { 879 type: 'bullets' 880 }, 881 } 882 } 883 }); 884 } 885 else if (windowWidth > 1023 && articlesGridSlider !== undefined) { 886 articlesGridSlider.destroy(true, true); 887 articlesGridSlider = undefined; 888 $('.articles-grid .swiper-wrapper').attr('style', ''); 889 $('.articles-grid .swiper-slide').attr('style', ''); 890 } 891 } 892 893 /*if($('.articles-grid').length){ 894 articlesGridSliderInit(); 895 }*/ 896 897 /**/ 898 if($('#main .bottom-wrap').prev('.banner-box').length){ 899 $('#main .bottom-wrap').prev('.banner-box').addClass('last-el'); 900 } 901 902 /* aside opinions slider */ 903 var asideOpinionsSlider = undefined; 904 function asideOpinionsSliderInit(){ 905 $('.opinions .paginations-box').css('display', 'none') 906 if(windowWidth <= 1023 && asideOpinionsSlider == undefined && $('#aside .opinions .swiper-slide').length >= 2) { 907 $('.opinions .paginations-box').css('display', 'flex') 908 asideOpinionsSlider = new Swiper('#aside .opinions .swiper-container',{ 909 observer: true, 910 observeParents: true, 911 slidesPerView: 1, 912 spaceBetween: 30, 913 initialSlide: 0, 914 autoHeight: true, 915 pagination: { 916 el: $('#aside .opinions').find('.swiper-pagination'), 917 clickable: true, 918 }, 919 navigation: { 920 nextEl: '#aside .opinions .swiper-button-next', 921 prevEl: '#aside .opinions .swiper-button-prev', 922 }, 923 breakpoints: { 924 500: { 925 slidesPerView: 1, 926 pagination: { 927 type: 'fraction' 928 } 929 }, 930 } 931 }); 932 933 } 934 else if (windowWidth > 1023 && asideOpinionsSlider !== undefined) { 935 asideOpinionsSlider.destroy(true, true); 936 asideOpinionsSlider = undefined; 937 $('#aside .opinions.swiper-slider .swiper-wrapper').attr('style', ''); 938 $(' .swiper-slide').attr('style', ''); 939 } 940 } 941 942 if($('#aside .opinions.swiper-slider').length){ 943 asideOpinionsSliderInit(); 944 } 945 946 /* aside photoFact slider */ 947 function photoFactPosition(){ 948 if(windowWidth <= 1023 && !$('.bottom-box .photo-fact').length){ 949 $('#aside .photo-fact').insertBefore('#favorites-js-anchor'); 950 $('#aside .infinite-load-box.smile').insertBefore('.photo-fact'); 951 console.log('1') 952 } 953 else if(windowWidth > 1023 && !$('#aside .photo-fact').length){ 954 console.log('2') 955 $('.bottom-box .photo-fact').insertAfter('#aside .most-popular'); 956 $('.bottom-box .infinite-load-box.smile').insertAfter('#aside .infinite-load-box.popular'); 957 } 958 } 959 960 if($('.photo-fact.swiper-slider').length){ 961 photoFactPosition(); 962 } 963 964 var photoFactSlider = undefined; 965 function photoFactSliderInit(){ 966 if(windowWidth <= 1023 && photoFactSlider == undefined) { 967 photoFactSlider = new Swiper('.photo-fact .swiper-container',{ 968 observer: true, 969 observeParents: true, 970 slidesPerView: 2, 971 spaceBetween: 30, 972 initialSlide: 0, 973 autoHeight: true, 974 pagination: { 975 el: $('.photo-fact').find('.swiper-pagination'), 976 clickable: true, 977 }, 978 navigation: { 979 nextEl: '.photo-fact .swiper-button-next', 980 prevEl: '.photo-fact .swiper-button-prev', 981 }, 982 breakpoints: { 983 320: { 984 slidesPerView: 1, 985 slidesPerGroup: 1, 986 pagination: { 987 type: 'fraction', 988 } 989 }, 990 400: { 991 slidesPerView: 1, 992 slidesPerGroup: 1, 993 spaceBetween: 15, 994 pagination: { 995 type: 'fraction', 996 } 997 }, 998 550: { 999 slidesPerView: 2, 1000 slidesPerGroup: 2, 1001 spaceBetween: 15, 1002 pagination: { 1003 type: 'fraction', 1004 } 1005 }, 1006 551: { 1007 slidesPerView: 2, 1008 slidesPerGroup: 2, 1009 spaceBetween: 20, 1010 pagination: { 1011 type: 'bullets' 1012 }, 1013 }, 1014 800: { 1015 slidesPerView: 3, 1016 slidesPerGroup: 3, 1017 spaceBetween: 20, 1018 pagination: { 1019 type: 'bullets' 1020 }, 1021 }, 1022 1023: { 1023 slidesPerView: 4, 1024 slidesPerGroup: 4, 1025 spaceBetween: 20, 1026 pagination: { 1027 type: 'bullets' 1028 }, 1029 }, 1030 }, 1031 }); 1032 1033 } 1034 else if (windowWidth > 1023 && photoFactSlider !== undefined) { 1035 photoFactSlider.destroy(true, true); 1036 photoFactSlider = undefined; 1037 $('#aside .photo-fact.swiper-slider .swiper-wrapper').attr('style', ''); 1038 $(' .swiper-slide').attr('style', ''); 1039 } 1040 } 1041 1042 if($('.photo-fact.swiper-slider').length){ 1043 photoFactSliderInit(); 1044 } 1045 1046 /* Card slider */ 1047 var cardsSlider; 1048 function cardsSliderInit(){ 1049 cardsSlider = new Swiper('.cards-slider .swiper-container', { 1050 slidesPerView: 1, 1051 spaceBetween: 30, 1052 slidesPerGroup: 1, 1053 autoHeight: true, 1054 touchRatio: 0, 1055 allowTouchMove: false, 1056 pagination: { 1057 el: '.cards-slider .swiper-pagination', 1058 type: 'fraction', 1059 clickable: true, 1060 }, 1061 navigation: { 1062 nextEl: '.cards-slider .swiper-button-next', 1063 prevEl: '.cards-slider .swiper-button-prev', 1064 } 1065 }); 1066 } 1067 if($('.cards-slider').length){ 1068 cardsSliderInit(); 1069 } 1070 1071 if($('.sticky-box').length) { 1072 $('.has-aside #aside').css('height', 'auto') 1073 } 1074 1075 /*Sticky elements*/ 1076 if($("#aside .sticky-box").length && windowWidth > 1199){ 1077 $("#aside .sticky-box").stick_in_parent({ 1078 offset_top: 0, 1079 parent: '#aside' 1080 }); 1081 } else { 1082 $("#aside .sticky-box").trigger('sticky_kit:detach'); 1083 } 1084 1085 1086 /* show more */ 1087 var lazyLoadingFlag = false; 1088 $body.on('click', ".js-show-more", function(e){
1089 e.preventDefault(); 1090 if (!lazyLoadingFlag) { 1091 var $this = $(this); 1092 var url = $this.attr('data-url') || $this.attr('href'); 1093 if (url) { 1094 var thisFilterBox = $this.parent('.infinite-load-box'); 1095 thisFilterBox.addClass('loading'); 1096 setTimeout(function () { 1097 infiniteLoadItems(url, thisFilterBox); 1098 }, 500); 1099 } 1100 } 1101 }); 1102 1103 function infiniteLoadItems(url, thisFilterBox) { 1104 $.ajax({ 1105 url: url, 1106 dataType: 'html', 1107 beforeSend: function(){ 1108 lazyLoadingFlag = true; 1109 }, 1110 success: function (data) { 1111 var $data = $('<div/>').html(data); 1112 var content = $data.find('.infinite-load-box .filter-box').html(); 1113 var $pagination = $data.find('.infinite-load-box .js-show-more'); 1114 setTimeout(function () { 1115 thisFilterBox.find('.filter-box').append(content); 1116 thisFilterBox.removeClass('loading'); 1117 if ($pagination.length) { 1118 var url = $pagination.attr('data-url') 1119 thisFilterBox.find('.js-show-more').attr('data-url', url); 1120 } else { 1121 thisFilterBox.find('.js-show-more').remove(); 1122 } 1123 }, 50); 1124 1125 lazyLoadingFlag = false; 1126 }, 1127 error: function () { 1128 lazyLoadingFlag = false; 1129 alert('Page not found!'); 1130 } 1131 }); 1132 } 1133 1134 1135 function figCaptionImgW(){ 1136 $('figure').each(function(){ 1137 if($(this).find('img').length && $(this).find('figcaption').length){ 1138 var imgWidth = $(this).find('img').width(); 1139 $(this).find('figcaption').css({maxWidth: imgWidth, marginLeft: 'auto', marginRight: 'auto', textAlign: 'left'}); 1140 } 1141 }); 1142 } 1143 1144 if($('figure figcaption').length){ 1145 figCaptionImgW(); 1146 } 1147 1148 1149 /*Infinity scroll*/ 1150 if($html.hasClass('articles-infinity-page')){ 1151 window.onbeforeunload = function () { 1152 window.scrollTo(0, 0); 1153 } 1154 1155 $('body,html').animate({ 1156 scrollTop: 0 1157 }, 10); 1158 } 1159 1160 var lazyLoadingArticlesFlag = true; 1161 $body.on('click', ".js-load-articles", function(e){ 1162 e.preventDefault(); 1163 1164 if(!lazyLoadingArticlesFlag){ 1165 alert('Please wait'); 1166 } 1167 else{ 1168 var url = $(this).attr('href'); 1169 1170 setTimeout(function(){ 1171 infinityLoad(url); 1172 }, 200); 1173 } 1174 }); 1175 1176 function infinityLoad(url) { 1177 $.ajax({
1178 url: url, 1179 dataType: 'html', 1180 beforeSend: function(){ 1181 lazyLoadingArticlesFlag = false; 1182 }, 1183 success: function(data){ 1184 1185 $('.infinity-articles-loader').removeClass('loading'); 1186 1187 var ajaxUploadBox = $('.ajax-upload-articles'), content = $(data).find('.main-article-content').html(); 1188 1189 1190 var articleItemTitle = '<p class="article-item-title">'+$(data).find('h1').text()+'</p>'; 1191 1192 if($(data).find('.article-sub-header').length){ 1193 var articleItemSubHeader = '<p class="article-sub-header">'+$(data).find('.article-sub-header').text() + '</p>'; 1194 ajaxUploadBox.append('<article class="article-item" data-url="'+url+'">' + articleItemTitle + articleItemSubHeader + content + '</article>'); 1195 } 1196 else{ 1197 ajaxUploadBox.append('<article class="article-item" data-url="'+url+'">' + articleItemTitle + content + '</article>'); 1198 } 1199 1200 //----- УÐÐÐÐÐÐРСТÐÐÐÐÐЦÐРССЫÐÐÐ ÐÐÐРУÐÐÐÐЫХ СТÐТÐÐ -------- 1201 $('.article-item a').attr('style', ''); 1202 //----- УÐÐÐÐÐÐРСТÐÐÐÐÐЦÐРССЫÐÐÐ ÐÐÐРУÐÐÐÐЫХ СТÐТÐÐ -------- 1203 1204 if($(data).find('.js-load-articles').length){ 1205 var newHref = $(data).find('.js-load-articles').attr('href'); 1206 $('.js-load-articles').attr('href', newHref); 1207 } 1208 else{ 1209 $('.infinity-articles-loader').remove(); 1210 } 1211 1212 lazyLoadingArticlesFlag = true; 1213 infinityScrollFlag = true; 1214 1215 if($('.infinity-articles-loader').length){ 1216 detectLazyLoading(); 1217 } 1218 1219 }, 1220 error: function () { 1221 lazyLoadingArticlesFlag = true; 1222 alert('Page not found!'); 1223 } 1224 }); 1225 } 1226 1227 1228 var infinityScrollFlag = true; 1229 function detectLazyLoading(){ 1230 var lazyBoxOffset = $('.infinity-articles-loader').offset().top; 1231 var lazyBoxHeight = $('.infinity-articles-loader').height(); 1232 if($window.scrollTop() >= (lazyBoxOffset + lazyBoxHeight) - $window.height() && $('.infinity-articles-loader').length && infinityScrollFlag){ 1233 infinityScrollFlag = false; 1234 $('.infinity-articles-loader').addClass('loading'); 1235 $('.js-load-articles').trigger('click'); 1236 } 1237 } 1238 1239 if($('.infinity-articles-loader').length){ 1240 detectLazyLoading(); 1241 } 1242 1243 var initialArticleUrl = window.location.href; 1244 let urlHistory = Array(); 1245 1246 function checkVisibleArticle(){ 1247 var wH = $window.height(); 1248 var wST = $window.scrollTop(); 1249 1250 $('.ajax-upload-articles .article-item').each(function(){ 1251 var $this = $(this); 1252 var articleOffset = $(this).offset().top; 1253 1254 if((articleOffset <= wST + wH/2) && !$this.hasClass('prev') && !$this.hasClass('current-article')){ 1255 // scroll down 1256 $(this).addClass('current-article'); 1257 var $thisDataUrl = $(this).attr('data-url'); 1258 let refererUrl = ''; 1259 1260 //history.replaceState(null, null, $thisDataUrl); 1261 const urlObj = new URL($thisDataUrl); 1262 urlObj.search = ''; 1263 1264 if($(this).prev('.article-item').length > 0){ 1265 $(this).prev('.article-item').addClass('prev').removeClass('current-article'); 1266 refererUrl = new URL($(this).prev('.article-item').attr('data-url')); 1267 } else { 1268 refererUrl = new URL(initialArticleUrl); 1269 } 1270 1271 let url = urlObj.origin + urlObj.pathname; 1272 let result = urlHistory.find(page => page.page === url); 1273 1274 if (typeof result !== 'object') { 1275 let urlHistoryLength = urlHistory.length + 1; 1276 urlObj.search = 'inf_scroll=' + urlHistoryLength; 1277 let current = urlObj.toString(); 1278 1279 urlHistory.push({ 1280 page: url, 1281 number: urlHistoryLength 1282 }); 1283 1284 dataLayer.push({ 1285 'event': 'infinity_load_event', 1286 'referer': refererUrl.origin + refererUrl.pathname, 1287 'current': current 1288 }); 1289 } else { 1290 urlObj.search = 'inf_scroll=' + result.number; 1291 } 1292 1293 history.replaceState(null, null, urlObj.toString()); 1294 } 1295 else if((articleOffset > wST + wH/2) && $this.hasClass('current-article')){ 1296 // scroll up 1297 var $thisPrevDataUrl = $(this).prev().attr('data-url'); 1298 let urlObj = typeof $thisPrevDataUrl !== 'string'
1299 ? new URL(initialArticleUrl) 1300 : new URL($thisPrevDataUrl); 1301 1302 urlObj.search = ''; 1303 let url = urlObj.origin + urlObj.pathname; 1304 let result = urlHistory.find(page => page.page === url); 1305 1306 if (typeof result === 'object') { 1307 urlObj.search = 'inf_scroll=' + result.number; 1308 } 1309 1310 history.replaceState(null, null, urlObj.toString()); 1311 1312 /*if(!$(this).prev('.article-item').length){ 1313 history.pushState(null, null, initialArticleUrl); 1314 }*/ 1315 1316 $this.removeClass('current-article').prev().addClass('current-article').removeClass('prev'); 1317 } 1318 }); 1319 } 1320 1321 if($('.ajax-upload-articles .article-item').length){ 1322 checkVisibleArticle(); 1323 } 1324 1325 1326 /*Window load*/ 1327 $window.on('load', function () { 1328 $.ready.then(function(){ 1329 1330 if($html.hasClass('preload-page')){ 1331 $('html, body').animate({ 1332 scrollTop: 0 1333 }, 5); 1334 1335 if($html.hasClass('preload-page')){ 1336 setTimeout(function(){ 1337 $html.addClass('page-load'); 1338 }, 3000); 1339 } 1340 } 1341 1342 1343 if($('figure figcaption').length){ 1344 figCaptionImgW(); 1345 } 1346 1347 1348 /*if($('.top-banner-box').length && !$html.hasClass('branding-page') && !$('.top-banner-box').is(":hidden")) { 1349 heightTopBanner = $('.top-banner-box').outerHeight(); 1350 $('#header').css('top', heightTopBanner) 1351 } else { 1352 $('.top-banner-box').css('padding', 0) 1353 heightTopBanner = 0; 1354 $('#header').css('top', heightTopBanner) 1355 }*/ 1356 1357 1358 if($('#footer').length){ 1359 stickyFooter(); 1360 } 1361 }); 1362 }); 1363 1364 1365 var resizeEnd; 1366 $window.on('resize', function () { 1367 windowWidth = Math.max($window.width(), window.innerWidth); 1368 1369 if($('figure figcaption').length){ 1370 figCaptionImgW(); 1371 } 1372 1373 clearTimeout(resizeEnd); 1374 resizeEnd = setTimeout(function(){ 1375 if($('#aside .opinions.swiper-slider').length){ 1376 asideOpinionsSliderInit(); 1377 } 1378 if($('.photo-fact.swiper-slider').length){ 1379 photoFactPosition(); 1380 } 1381 if($('.photo-fact.swiper-slider').length){ 1382 photoFactSliderInit(); 1383 } 1384 1385 /*if($('.top-banner-box').length && !$html.hasClass('branding-page') && !$('.top-banner-box').is(":hidden")) { 1386 heightTopBanner = $('.top-banner-box').outerHeight(); 1387 $('#header').css('top', heightTopBanner) 1388 } else { 1389 $('.top-banner-box').css('padding', 0) 1390 heightTopBanner = 0; 1391 $('#header').css('top', heightTopBanner) 1392 }*/ 1393 1394 /* if($('.articles-grid').length){ 1395 articlesGridSliderInit(); 1396 }*/ 1397 1398 1399 if($('.infinity-articles-loader').length){ 1400 detectLazyLoading(); 1401 } 1402 1403 1404 if($('#footer').length){ 1405 stickyFooter(); 1406 } 1407 }, 250); 1408 }); 1409 1410 1411 $window.on('orientationchange', function () { 1412 windowWidth = Math.max($window.width(), window.innerWidth); 1413 1414 1415 clearTimeout(resizeEnd); 1416 resizeEnd = setTimeout(function(){ 1417 if($('#aside .opinions.swiper-slider').length){ 1418 asideOpinionsSliderInit(); 1419 } 1420 if($('.photo-fact.swiper-slider').length){ 1421 photoFactPosition(); 1422 } 1423 if($('.photo-fact.swiper-slider').length){ 1424 photoFactSliderInit(); 1425 } 1426 1427 if($('figure figcaption').length){ 1428 figCaptionImgW(); 1429 } 1430 1431 /*if($('.top-banner-box').length && !$html.hasClass('branding-page') && !$('.top-banner-box').is(":hidden")) { 1432 heightTopBanner = $('.top-banner-box').outerHeight(); 1433 $('#header').css('top', heightTopBanner) 1434 } else { 1435 $('.top-banner-box').css('padding', 0) 1436 heightTopBanner = 0; 1437 $('#header').css('top', heightTopBanner) 1438 }*/ 1439 1440 /*if($('.articles-grid').length){ 1441 articlesGridSliderInit(); 1442 }*/ 1443 1444 1445 if($('.infinity-articles-loader').length){ 1446 detectLazyLoading(); 1447 } 1448 1449 1450 if($('#footer').length){ 1451 stickyFooter(); 1452 } 1453 1454 }, 350); 1455 });
1456 1457 $window.scroll(function(){ 1458 stickyHeader(); 1459 1460 1461 if($('.ajax-upload-articles .article-item').length){ 1462 checkVisibleArticle(); 1463 } 1464 1465 1466 if($('.infinity-articles-loader').length){ 1467 detectLazyLoading(); 1468 } 1469 1470 1471 }); 1472 1473 ///// 1474 1475 $('.rate-article-box span').on('click', function (e) { 1476 e.preventDefault(); 1477 var val = $(this).text(); 1478 var $form = $(".ajax-rating-form"); 1479 $form.find('input[name="ans_num"]').val(val); 1480 $('.rate-article-box').hide(); 1481 $.post($form.attr('action'), $form.serialize()).done(function (data) { 1482 $('.rating-box p').replaceWith(data); 1483 }); 1484 }); 1485 1486 $('a[href^=http]:not([href^="' + frontParams.basePath + '"])').attr('target','_blank'); 1487 1488 if ($('.news-banner.auto').length){ 1489 $(function(){ 1490 var countP = $('.subcontainer-custom > p').length; 1491 if (countP >= frontParams.countP && frontParams.afterP < $('.subcontainer-custom > p').length) { 1492 $('.subcontainer-custom > p').eq(frontParams.afterP - 1).after($('.news-banner.auto').removeClass('hidden')); 1493 } 1494 }); 1495 } 1496 1497 if ($('.news-banner2.auto').length){ 1498 $(function(){ 1499 var countP = $('.block-content > p').length; 1500 if (countP >= frontParams.countP2 && frontParams.afterP2 < $('.block-content > p').length) { 1501 $('.block-content > p').eq(frontParams.afterP2 - 1).after($('.news-banner2.auto').removeClass('hidden')); 1502 } 1503 }); 1504 } 1505 1506 $(".fixed-banner").stick_in_parent({'offset_top' : 10, parent: '.middle'}); 1507 1508 $('blockquote .text').prepend('<div class="quote-top-icon">\n' + 1509 '<svg width="26" height="22" viewBox="0 0 26 22" fill="none" xmlns="http://www.w3.org/2000/svg">\n' + 1510 '<path d="M5.36774 0.128906C7.54839 0.128906 9.19785 1.01544 10.3161 2.78852C11.2667 4.28455 11.7419 6.11303 11.7419 8.27397C11.7419 11.0444 11.0151 13.5378 9.56129 15.7541C8.16344 17.9705 6.01075 19.7435 3.10323 21.0734L2.34839 19.5773C4.08172 18.857 5.56344 17.7211 6.79355 16.1697C8.07957 14.6182 8.72258 13.0391 8.72258 11.4323C8.72258 10.7674 8.63871 10.1856 8.47097 9.68688C7.57634 10.4072 6.54194 10.7674 5.36774 10.7674C3.85806 10.7674 2.57204 10.2964 1.50968 9.35444C0.503226 8.35708 0 7.05498 0 5.44813C0 3.9521 0.503226 2.7054 1.50968 1.70805C2.57204 0.655287 3.85806 0.128906 5.36774 0.128906ZM19.6258 0.128906C21.8065 0.128906 23.4559 1.01544 24.5742 2.78852C25.5247 4.28455 26 6.11303 26 8.27397C26 11.0444 25.2731 13.5378 23.8194 15.7541C22.4215 17.9705 20.2688 19.7435 17.3613 21.0734L16.6065 19.5773C18.3398 18.857 19.8215 17.7211 21.0516 16.1697C22.3376 14.6182 22.9806 13.0391 22.9806 11.4323C22.9806 10.7674 22.8968 10.1856 22.729 9.68688C21.8344 10.4072 20.8 10.7674 19.6258 10.7674C18.1161 10.7674 16.8301 10.2964 15.7677 9.35444C14.7613 8.35708 14.2581 7.05498 14.2581 5.44813C14.2581 3.9521 14.7613 2.7054 15.7677 1.70805C16.8301 0.655287 18.1161 0.128906 19.6258 0.128906Z" fill="#CF172B" fill-opacity="0.95"/>\n' + 1511 '</svg>\n' + 1512 '</div>'); 1513 $('blockquote .text').append('<div class="quote-icon">\n' + 1514 '<svg width="20" height="17" viewBox="0 0 20 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n' + 1515 '<path d="M15.4608 16.0645C13.9008 16.0645 12.7208 15.4245 11.9208 14.1445C11.2408 13.0645 10.9008 11.7445 10.9008 10.1845C10.9008 8.18445 11.4208 6.38445 12.4608 4.78445C13.4608 3.18445 15.0008 1.90445 17.0808 0.944454L17.6208 2.02446C16.3808 2.54446 15.3208 3.36446 14.4408 4.48446C13.5208 5.60445 13.0608 6.74445 13.0608 7.90445C13.0608 8.38445 13.1208 8.80446 13.2408 9.16446C13.8808 8.64446 14.6208 8.38446 15.4608 8.38446C16.5408 8.38446 17.4608 8.72445 18.2208 9.40445C18.9408 10.1245 19.3008 11.0645 19.3008 12.2245C19.3008 13.3045 18.9408 14.2045 18.2208 14.9245C17.4608 15.6845 16.5408 16.0645 15.4608 16.0645ZM5.26078 16.0645C3.70078 16.0645 2.52078 15.4245 1.72078 14.1445C1.04078 13.0645 0.700783 11.7445 0.700783 10.1845C0.700783 8.18445 1.22078 6.38445 2.26078 4.78445C3.26078 3.18445 4.80078 1.90445 6.88078 0.944454L7.42078 2.02446C6.18078 2.54446 5.12078 3.36446 4.24078 4.48446C3.32078 5.60445 2.86078 6.74445 2.8
15156078 7.90445C2.86078 8.38445 2.92078 8.80446 3.04078 9.16446C3.68078 8.64446 4.42078 8.38446 5.26078 8.38446C6.34078 8.38446 7.26078 8.72445 8.02078 9.40445C8.74078 10.1245 9.10078 11.0645 9.10078 12.2245C9.10078 13.3045 8.74078 14.2045 8.02078 14.9245C7.26078 15.6845 6.34078 16.0645 5.26078 16.0645Z" fill="#E9E9E9"/>\n' + 1516 '</svg>\n' + 1517 '</div>'); 1518 1519 if (!$('.read-also-box .text span').length) { 1520 $('.read-also-box .text').prepend('<span class="label">ÑиÑайÑе Ñакже</span>'); 1521 } 1522 if (!$('.read-also-box .mobile-view.label').length) { 1523 $('.read-also-box').prepend('<span class="mobile-view label">ÑиÑайÑе Ñакже</span>'); 1524 } 1525 $('.read-also-box .text a').addClass('title'); 1526 1527 $('.article-top-box a, .subcontainer-custom a').attr('style', ''); 1528 1529})(jQuery);
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.