1document.addEventListener('DOMContentLoaded', function() { 2 const reglinks = document.querySelectorAll('.regions li a'); 3 reglinks.forEach(function(link) { 4 link.addEventListener('click', function(event) { 5 const url = event.target.href; 6 const reg = url.substring(url.lastIndexOf('/') + 1); 7 const exp = reg === '' ? 'Thu, 01 Jan 1970 00:00:00 GMT' : 'Fri, 31 Dec 9999 23:59:59 GMT'; 8 const val = reg === '' ? 'reg=rossiya' : 'reg=' + reg; 9 document.cookie = val + '; expires=' + exp + '; sameSite=Lax; path=/'; 10 }); 11 }); 12}); 13const loadNextPage = function() { 14 const nextLink = document.getElementById('next_link'); 15 if (!nextLink || nextLink.dataset.loading) return; 16 const items = document.getElementById('items'); 17 18 const wBottom = window.pageYOffset + window.innerHeight; 19 const elBottom = items.offsetTop + items.offsetHeight; 20 21 if (wBottom > (elBottom - 350)) { 22 nextLink.click(); 23 nextLink.dataset.loading = true; 24 } 25}; 26 27window.addEventListener('resize', loadNextPage); 28window.addEventListener('scroll', loadNextPage); 29window.addEventListener('load', loadNextPage); 30 31document.addEventListener('click', function(e) { 32 if (e.target.id !== 'next_link') return; 33 34 e.preventDefault(); 35 36 const url = e.target.getAttribute('href'); 37 const headers = { 38 'Accept': 'application/javascript', 39 'X-Requested-With': 'XMLHttpRequest' 40 }; 41 if (e.target.dataset.feed) { 42 headers['Feed'] = e.target.dataset.feed; 43 } 44 45 const fetchData = (attempt = 1) => { 46 fetch(url, { 47 method: 'GET', 48 headers: headers, 49 }) 50 .then(response => { 51 if (!response.ok) { 52 throw new Error('Network response was not ok'); 53 } 54 return response.text(); 55 }) 56 .then(jsCode => { 57 eval(jsCode); 58 e.target.dataset.loading = false; // Снимаем Ñлаг загÑÑзки 59 }) 60 .catch(error => { 61 if (attempt < 3) { 62 setTimeout(() => fetchData(attempt + 1), 2000); 63 } else { 64 e.target.dataset.loading = false; // Снимаем Ñлаг загÑÑзки 65 } 66 }); 67 }; 68 fetchData(); 69}); 70document.addEventListener('DOMContentLoaded', () => { 71 const isYandexBrowser = /yabrowser/i.test(navigator.userAgent); 72 const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 73 74 if (isYandexBrowser && isMobileDevice) return; 75 76 const btn = document.getElementById('scrollBtn'); 77 // const menu = document.getElementById('menu'); 78 let lastScrollTop = 0; 79 80 const scrollFunction = () => { 81 const scrollTop = window.pageYOffset || document.documentElement.scrollTop; 82 const isScrollingDown = scrollTop > lastScrollTop && scrollTop > 20; 83 const isScrollingUp = scrollTop < lastScrollTop && scrollTop > 20; 84 85 // menu.classList.toggle('visbl', isScrollingUp); 86 btn.classList.toggle('visbl', isScrollingUp); 87 // menu.classList.toggle('hid', isScrollingDown || !isScrollingUp); 88 btn.classList.toggle('hid', isScrollingDown || !isScrollingUp); 89 90 91 lastScrollTop = scrollTop; 92 93 if (isScrollingUp) { 94 clearTimeout(btn.timeoutId); 95 btn.timeoutId = setTimeout(() => { 96 // menu.classList.remove('visbl'); 97 btn.classList.remove('visbl'); 98 // menu.classList.add('hid'); 99 btn.classList.add('hid'); 100 }, 2600); 101 } 102 }; 103 104 window.onscroll = scrollFunction; 105 106 btn.addEventListener('click', () => { 107 window.scrollTo({ top: 0, behavior: 'smooth' }); 108 }); 109}); 110document.addEventListener('DOMContentLoaded', function() { 111 const key = '_ean_cookieExpTime' 112 if (checkCookieExpTime(key)) { 113 const notify = document.createElement('div'); 114 notify.id = 'cookie-notify'; 115 notify.innerHTML = `<p>Ðа ÑайÑе иÑполÑзÑÑÑÑÑ cookie-ÑÐ°Ð¹Ð»Ñ Ð¸ ÑеÑÐ²Ð¸Ñ Ð´Ð»Ñ Ð°Ð½Ð°Ð»Ð¸Ð·Ð° даннÑÑ Ð¯Ð½Ð´ÐµÐºÑ.ÐеÑÑика. ÐÑи инÑÑÑÑменÑÑ Ð¿Ð¾Ð¼Ð¾Ð³Ð°ÑÑ ÑлÑÑÑаÑÑ ÑабоÑÑ ÑайÑа, понимаÑÑ Ð¸Ð½ÑеÑеÑÑ Ð½Ð°ÑÐ¸Ñ Ð¿Ð¾Ð»ÑзоваÑелей и опÑимизиÑоваÑÑ ÐºÐ¾Ð½ÑенÑ. ÐÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¾Ð±ÑабаÑÑваеÑÑÑ Ð² обезлиÑенном виде и иÑполÑзÑеÑÑÑ ÑолÑко Ð´Ð»Ñ ÑÑаÑиÑÑиÑеÑкого анализа. ÐÑÐ¾Ð´Ð¾Ð»Ð¶Ð°Ñ Ð¸ÑполÑзоваÑÑ ÑайÑ, Ð²Ñ ÑоглаÑаеÑеÑÑ Ñ Ð½Ð°Ñей <a href="/privacy-policy">ÐолиÑикой обÑабоÑки пеÑÑоналÑнÑÑ Ð´Ð°Ð½Ð½ÑÑ </a>.</p> 116 <button id="cookie-accept">ÐÑинимаÑ</button>`; 117 document.body.appendChild(notify); 118 119 document.getElementById('cookie-accept').addEventListener('click', function() { 120 const expTime = new Date().getTime() + (30 * 24 * 60 * 60 * 1000); 121 localStorage.setItem(key, expTime); 122 notify.remove(); 123 }); 124 } 125}); 126 127function checkCookieExpTime(key) { 128 const expTime = localStorage.getItem(key); 129 if (!expTime) return true; 130 131 const currentTime = new Date().getTime(); 132 133 if (currentTime < expTime) { 134 return false;
135 } else { 136 localStorage.removeItem(key); 137 return true; 138 } 139}; 140document.addEventListener('DOMContentLoaded', () => { 141 142 const key = '_ean_cookieExpTime'; 143 const viewKey = '_ean_expTgBanner'; 144 145 if (!checkCookieExpTime(key) && checkCookieExpTime(viewKey)) { 146 const tgLink = document.querySelector('.ico.max'); 147 const tgHref = tgLink ? tgLink.getAttribute('href') : 'https://max.ru/eanews'; 148 let container = document.createElement('div'); 149 container.id = 'subscribe'; 150 document.body.appendChild(container); 151 container.innerHTML = `<a href="${tgHref}" rel="nofollow noopener noreferrer" target="_blank"><div class="title">ÐодпиÑÑвайÑÑ Ð½Ð° канал ÐÐРв Max</div><div class="desc">У вÑÐµÑ ÐºÐ¾Ð½ÑенÑ, а Ñ Ð½Ð°Ñ â новоÑÑи</div></a><span class="close"></span>`; 152 const close = container.querySelector('.close'); 153 154 if (close) { 155 close.addEventListener('click', function() { 156 container.style.display = 'none'; 157 const viewTime = new Date().getTime() + (2 * 24 * 60 * 60 * 1000); 158 localStorage.setItem(viewKey, viewTime); 159 container.remove(); 160 }); 161 } 162 } 163}); 164 165 166 167
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.