1$(function () { 2 $('.js-share-btn').on('click', function (e) { 3 e.preventDefault(); 4 const $popup = $(this).siblings('.news-detail__share-popup'); 5 $popup.toggleClass('active'); 6 }); 7 8 $(document).on('click', function (e) { 9 if (!$(e.target).closest('.news-detail__share-wrapper').length) { 10 $('.news-detail__share-popup').removeClass('active'); 11 } 12 }); 13 14 $('.js-share-vk').on('click', function (e) { 15 e.preventDefault(); 16 const url = $(this).closest('.news-detail__share-wrapper').find('.js-share-btn').data('url'); 17 window.open(`https://vk.com/share.php?url=${encodeURIComponent(url)}`, '_blank', 'width=600,height=400'); 18 $(this).closest('.news-detail__share-popup').removeClass('active'); 19 }); 20 21 $('.js-share-ok').on('click', function (e) { 22 e.preventDefault(); 23 const url = $(this).closest('.news-detail__share-wrapper').find('.js-share-btn').data('url'); 24 const title = document.title; 25 window.open(`https://connect.ok.ru/offer?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}&description=${encodeURIComponent(title)}`, '_blank', 'width=600,height=400'); 26 $(this).closest('.news-detail__share-popup').removeClass('active'); 27 }); 28 29 $('.js-share-mail').on('click', function (e) { 30 e.preventDefault(); 31 const url = $(this).closest('.news-detail__share-wrapper').find('.js-share-btn').data('url'); 32 window.open(`https://connect.mail.ru/share?url=${encodeURIComponent(url)}`, '_blank', 'width=600,height=400'); 33 $(this).closest('.news-detail__share-popup').removeClass('active'); 34 }); 35 36 $('.js-share-max').on('click', function (e) { 37 e.preventDefault(); 38 const url = $(this).closest('.news-detail__share-wrapper').find('.js-share-btn').data('url'); 39 window.open(`https://max.ru/:share?text=${encodeURIComponent(url)}`, '_blank', 'width=600,height=400'); 40 $(this).closest('.news-detail__share-popup').removeClass('active'); 41 }); 42 43 $('.js-share-copy').on('click', function (e) { 44 e.preventDefault(); 45 const url = $(this).closest('.news-detail__share-wrapper').find('.js-share-btn').data('url'); 46 navigator.clipboard.writeText(url).then(() => { 47 alert('СÑÑлка ÑкопиÑована'); 48 $(this).closest('.news-detail__share-popup').removeClass('active'); 49 }); 50 }); 51 52 $('.js-share-telegram').on('click', function (e) { 53 e.preventDefault(); 54 const url = $(this).closest('.news-detail__share-wrapper').find('.js-share-btn').data('url'); 55 window.open(`https://t.me/share/url?url=${encodeURIComponent(url)}`, '_blank', 'width=600,height=400'); 56 $(this).closest('.news-detail__share-popup').removeClass('active'); 57 }); 58 59 60 $('.mobile-menu-open').on('click', function () { 61 $(this).toggleClass('active'); 62 $('.header__nav').toggleClass('active'); 63 }); 64 65 $('.close-menu').on('click', function () { 66 $('.mobile-menu-open').removeClass('active'); 67 $('.header__nav').removeClass('active'); 68 }); 69 70 $('.js-open-popular').on('click', function () { 71 $('.popular-column').toggleClass('active'); 72 $('.last-column').removeClass('active'); 73 }); 74 75 $('.js-open-last').on('click', function () { 76 $('.last-column').toggleClass('active'); 77 $('.popular-column').removeClass('active'); 78 }); 79 80 $(window).on('scroll', function () { 81 if ($(this).scrollTop() > 300) { 82 $('.to-top').addClass('active'); 83 } else { 84 $('.to-top').removeClass('active'); 85 } 86 }); 87 88 $('.to-top').on('click', function (e) { 89 e.preventDefault(); 90 $('html, body').animate({ scrollTop: 0 }, 300); 91 }); 92}); 93 94
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.