PageSourceSearch

https://nationmagazine.ru/bitrix/cache/js/s1/nation_2022/template_…89c64b23862b30c93ccf0_v1.js?177510248038218

js nationmagazine.ru collected 2026-10-02 10:09:53 UTC 38,218 bytes, 956 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:69:"/local/templates/nation_2022/js/cookie/cookie_popup.js?17573809221887";s:6:"source";s:54:"/local/templates/nation_2022/js/cookie/cookie_popup.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3document.addEventListener('DOMContentLoaded', function() {
4    'use strict';
5
6    function getCookie(name) {
7        var matches = document.cookie.match(new RegExp("(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
8        return matches ? decodeURIComponent(matches[1]) : undefined;
9    }
10
11    function setCookieApprove() {
12        let cookie_date = new Date();
13        cookie_date.setMonth(cookie_date.getMonth() + 12); // на 12 месяцев
14        document.cookie = "approval_cookie=Y;path=/;domain=." + window.location.hostname + ";secure;expires=" + cookie_date.toUTCString();
15        closeApprove();
16    }
17
18    
19    let approval = getCookie('approval_cookie'),
20        popup = document.createElement('div')
21
22    function closeApprove() {
23        popup.remove();
24    }
25
26    if(approval != 'Y') {
27        let text = document.createElement('h3'),
28            text2 = document.createElement('p'),
29            btn = document.createElement('button'),
30            close = document.createElement('div');
31        popup.id = 'approve_cookie';
32        btn.className = 'approve_btn';
33        btn.innerText = 'Согласен';
34        text.innerHTML = '<b>Сайт использует Cookie</b>';
35        text2.innerHTML = 'Продолжая пользоваться сайтом, вы соглашаетесь на обработку персональных данных в&nbsp;соответствии с&nbsp;<a href="/policy/" target="_blank">политикой конфиденциальности</a>.';
36        close.className = 'approve_close';
37        popup.appendChild(text);
38        popup.appendChild(text2);
39        popup.appendChild(btn);
40        popup.appendChild(close);
41        document.body.appendChild(popup);
42
43        close.addEventListener('click', closeApprove);
44        btn.addEventListener('click', setCookieApprove);
45    }
46
47});
48/* End */
49;
50; /* Start:"a:4:{s:4:"full";s:54:"/local/templates/nation_2022/js/app.js?165969675715045";s:6:"source";s:38:"/local/templates/nation_2022/js/app.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
51var c = !1; // глобальная переменная состояния меню (открыто-закрыто)
52
53var t = document.getElementById("menu_button"),
54    w = document.getElementById("menu_button_wrap"),
55    tx = document.getElementById("body-click"),
56    nav = document.getElementById("nav_menu"),
57    o = nav.classList,
58    u = document.getElementsByTagName("header")[0],
59    i = t.classList,
60    txi = tx.classList;
61
62var speed = 100; // Скорость открытия/закрытия, мс
63if (window.innerWidth <= 520) {
64nav.style.transition = 'transform '+(speed/1000)+'s ease-in-out';
65}
66
67!function(n) {
68    function t(o) {
69        if (e[o])
70            return e[o].exports;
71        var u = e[o] = {
72            exports: {},
73            id: o,
74            loaded: !1
75        };
76        return n[o].call(u.exports, u, u.exports, t), u.loaded = !0, u.exports
77    }
78    var e = {};
79    return t.m = n, t.c = e, t.p = "", t(0)
80}([function(n, t, e) {
81    e(1), e(49)
82}, function(n, t, e) {
83    e(2), e(6), e(8), e(12), e(16), e(18), e(20), e(22), e(24), e(29), e(31), e(33), e(35), e(37), e(39), e(41), e(43), e(45), e(47)
84}, function() {}, , , , function() {}, , function() {}, , , , function() {}, , , , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , , , , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , function() {}, , function() {
85    function n() {
86        return u.offsetHeight > 200 ? u.offsetHeight : window.screen.height
87    }
88    t.onclick = function() {
89        c ? closeNav() : openNav();
90        return false;
91    }
92    tx.onclick = function() {
93        closeNav();
94    }
95}]);
96
97var openNav = function() { // Открытие меню
98        if (document.documentElement.clientWidth < 768) disableScroll();
99
100        c = !0;
101        w.classList.add('open'),
102        o.remove("nav_menu_hidden"),
103        i.add("header_menu_button_showed"),
104        txi.add("showed"),
105        o.add("nav_menu_showed"),
106        document.body.addEventListener('keypress', listener, false);
107}
108
109var closeNav = function() { // Закрытие меню
110        enableScroll();
111
112        c = !1;
113        w.classList.remove('open'),
114        o.add("nav_menu_hidden"),
115        i.remove("header_menu_button_showed"),
116        txi.remove("showed"),
117        setTimeout(function() { o.remove("nav_menu_showed"), nav.style.height = "", nav.style.left = null; }, speed),
118        document.body.removeEventListener('keypress', listener, false);
119}
120
121var listener = function (e) {
122  if (e.key == "Escape") {
123        closeNav();
124      }
125};
126
127
128
129/************* Отключение скролла (vanilla JS) **************/
130/************* https://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily   **************/
131
132// left: 37, up: 38, right: 39, down: 40,
133// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
134var keys = {37: 1, 38: 1, 39: 1, 40: 1};
135
136function preventDefault(e) {
137  e.preventDefault();
138}
139
140function preventDefaultForScrollKeys(e) {
141  if (keys[e.keyCode]) {
142    preventDefault(e);
143    return false;
144  }
145}
146
147// modern Chrome requires { passive: false } when adding event
148var supportsPassive = false;
149try {
150  window.addEventListener("test", null, Object.defineProperty({}, 'passive', {
151    get: function () { supportsPassive = true; } 
152  }));
153} catch(e) {}
154
155var wheelOpt = supportsPassive ? { passive: false } : false;
156var wheelEvent = 'onwheel' in document.createElement('div') ? 'wheel' : 'mousewheel';
157
158// call this to Disable
159function disableScroll() {
160  window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF
161  window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop
162  window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile
163  window.addEventListener('keydown', preventDefaultForScrollKeys, false);
164}
165
166// call this to Enable
167function enableScroll() {
168  window.removeEventListener('DOMMouseScroll', preventDefault, false);
169  window.removeEventListener(wheelEvent, preventDefault, wheelOpt); 
170  window.removeEventListener('touchmove', preventDefault, wheelOpt);
171  window.removeEventListener('keydown', preventDefaultForScrollKeys, false);
172}
173
174
175
176
177
178
179/************* Обработка свайпов (vanilla JS) **************/
180/************* https://web3r.ru/swipe-event   **************/
181/**
182 * Object.assign() polyfill
183 */
184Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,
184configurable:!0,writable:!0,value:function(a,b){"use strict";if(void 0===a||null===a)error("Cannot convert first argument to object");for(var c=Object(a),d=1;d<arguments.length;d++){var e=arguments[d];if(void 0!==e&&null!==e)for(var f=Object.keys(Object(e)),g=0,h=f.length;g<h;g++){var i=f[g],j=Object.getOwnPropertyDescriptor(e,i);void 0!==j&&j.enumerable&&(c[i]=e[i])}}return c}});
185
186/**
187 * CustomEvent() polyfill
188 */
189!function(){if("function"==typeof window.CustomEvent)return;function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}t.prototype=window.Event.prototype,window.CustomEvent=t}();
190
191
192/**
193 * Функция определения события swipe на элементе.
194 * @param {Object} el - элемент DOM.
195 * @param {Object} settings - объект с предварительными настройками.
196 */
197var swipe = function(el, settings) {
198
199    // настройки по умолчанию
200    var settings = Object.assign({}, {
201        minDist: 60,  // минимальная дистанция, которую должен пройти указатель, чтобы жест считался как свайп (px)
202        maxDist: 120, // максимальная дистанция, не превышая которую может пройти указатель, чтобы жест считался как свайп (px)
203        maxTime: 700, // максимальное время, за которое должен быть совершен свайп (ms)
204        minTime: 50   // минимальное время, за которое должен быть совершен свайп (ms)
205    }, settings);
206
207    // коррекция времени при ошибочных значениях
208    if (settings.maxTime < settings.minTime) settings.maxTime = settings.minTime + 500;
209    if (settings.maxTime < 100 || settings.minTime < 50) {
210        settings.maxTime = 700;
211        settings.minTime = 50;
212    }
213
214    var dir,                // направление свайпа (horizontal, vertical)
215        swipeType,            // тип свайпа (up, down, left, right)
216        dist,                 // дистанция, пройденная указателем
217        isMouse = false,      // поддержка мыши (не используется для тач-событий)
218        isMouseDown = false,  // указание на активное нажатие мыши (не используется для тач-событий)
219        startX = 0,           // начало координат по оси X (pageX)
220        distX = 0,            // дистанция, пройденная указателем по оси X
221        startY = 0,           // начало координат по оси Y (pageY)
222        distY = 0,            // дистанция, пройденная указателем по оси Y
223        startTime = 0,        // время начала касания
224        support = {           // поддерживаемые браузером типы событий
225            pointer: !!("PointerEvent" in window || ("msPointerEnabled" in window.navigator)),
226            touch: !!(typeof window.orientation !== "undefined" || /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || "ontouchstart" in window || navigator.msMaxTouchPoints || "maxTouchPoints" in window.navigator > 1 || "msMaxTouchPoints" in window.navigator > 1)
227        };
228
229    /**
230     * Опредление доступных в браузере событий: pointer, touch и mouse.
231     * @returns {Object} - возвращает объект с доступными событиями.
232     */
233    var getSupportedEvents = function() {
234        switch (true) {
235            case support.pointer:
236                events = {
237                    type:   "pointer",
238                    start:  "PointerDown",
239                    move:   "PointerMove",
240                    end:    "PointerUp",
241                    cancel: "PointerCancel",
242                    leave:  "PointerLeave"
243                };
244                // добавление префиксов для IE10
245                var ie10 = (window.navigator.msPointerEnabled && Function('/*@cc_on return document.documentMode===10@*/')());
246                for (var value in events) {
247                    if (value === "type") continue;
248                    events[value] = (ie10) ? "MS" + events[value] : events[value].toLowerCase();
249                }
250                break;
251            case support.touch:
252                events = {
253                    type:   "touch",
254                    start:  "touchstart",
255                    move:   "touchmove",
256                    end:    "touchend",
257                    cancel: "touchcancel"
258                };
259                break;
260            default:
261                events = {
262                    type:  "mouse",
263                    start: "mousedown",
264                    move:  "mousemove",
265                    end:   "mouseup",
266                    leave: "mouseleave"
267                };
268                break;
269        }
270        return events;
271    };
272
273
274    /**
275     * Объединение событий mouse/pointer и touch.
276     * @param e {Event} - принимает в качестве аргумента событие.
277     * @returns {TouchList|Event} - возвращает либо TouchList, либо оставляет событие без изменения.
278     */
279    var eventsUnify = function(e) {
280        return e.changedTouches ? e.changedTouches[0] : e;
281    };
282
283
284    /**
285     * Обрабочик начала касания указателем.
286     * @param e {Event} - получает событие.
287     */
288    var checkStart = function(e) {
289        var event = eventsUnify(e);
290        if (support.touch && typeof e.touches !== "undefined" && e.touches.length !== 1) return; // игнорирование касания несколькими пальцами
291        dir = "none";
292        swipeType = "none";
293        dist = 0;
294        startX = event.pageX;
295        startY = event.pageY;
296        startTime = new Date().getTime();
297        if (isMouse) isMouseDown = true; // поддержка мыши
298    };
299
300    /**
301     * Обработчик движения указателя.
302     * @param e {Event} - получает событие.
303     */
304    var checkMove = function(e) {
305        if (isMouse && !isMouseDown) return; // выход из функции, если мышь перестала быть активна во время движения
306        var event = eventsUnify(e);
307        distX = event.pageX - startX;
308        distY = event.pageY - startY;
309            if(distX < 0) {
310                myBlock.style.left = distX+"px";
311            }
312        if (Math.abs(distX) > Math.abs(distY)) dir = (distX < 0) ? "left" : "right";
313        else dir = (distY < 0) ? "up" : "down";
314    };
315
316    /**
317     * Обработчик окончания касания указателем.
318     * @param e {Event} - получает событие.
319     */
320    var checkEnd = function(e) {
321        if (isMouse && !isMouseDown) { // выход из функции и сброс проверки нажатия мыши
322            isMouseDown = false;
323            return;
324        }
325        var endTime = new Date().getTime();
326        var time = endTime - startTime;
327        if (time >= settings.minTime && time <= settings.maxTime) { // проверка времени жеста
328            if (Math.abs(distX) >= settings.minDist && Math.abs(distY) <= settings.maxDist) {
329                swipeType = dir; // определение типа свайпа как "left" или "right"
330            } else if (Math.abs(distY) >= settings.minDist && Math.abs(distX) <= settings.maxDist) {
331                swipeType = dir; // определение типа свайпа как "top" или "down"
332            }
333        }
334
335        isMouseDown = false; // Сброс нажатия мыши
336        // myBlock.style.left = null; // Сброс перетаскивания
337        setTimeout(function() { myBlock.style.left = null; }, speed);
338
339        // myBlock.style.transform = 'translate3d(-100%,0,0)';
340
341        dist = (dir === "left" || dir === "right") ? Math.abs(distX) : Math.abs(distY); // опредление пройденной указателем дистанции
342
343        // генерация кастомного события swipe
344        if (swipeType !== "none" && dist >= settings.minDist) {
345            var swipeEvent = new CustomEvent("swipe", {
346                bubbles: true,
347                cancelable: true,
348                detail: {
349                    full: e, // полное событие Event
350                    dir:  swipeType, // направление свайпа
351                    dist: dist, // дистанция свайпа
352                    time: time // время, потраченное на свайп
353                }
354            });
355            el.dispatchEvent(swipeEvent);
356        } else {
357            myBlock.style.left = '0px';
358        }
359    };
360
361    // добавление поддерживаемых событий
362    var events = getSupportedEvents();
363
364    // проверка наличия мыши
365    if ((support.pointer && !support.touch) || events.type === "mouse") isMouse = true;
366
367    // добавление обработчиков на элемент
368    el.addEventListener(events.start, checkStart);
369    el.addEventListener(events.move, checkMove);
370    el.addEventListener(events.end, checkEnd);
371    if(support.pointer && support.touch) {
372        el.addEventListener('lostpointercapture', checkEnd);
373    }
374};
375
376
377if (document.documentElement.clientWidth < 768) {
378    // Если меню есть на странице, то вешаем слушатель свайпов
379    if(document.getElementById("nav_menu")) {
380        var myBlock = document.getElementById("nav_menu");
381
382        // вызов функции swipe с предварительными настройками
383        swipe(myBlock, { maxTime: 2000, minTime: 100, maxDist: 500,  minDist: 50 });
384
385        // обработка свайпов
386        myBlock.addEventListener("swipe", function(e) {
387            if(e.detail.dir == "left") {
388                closeNav();
389            }
390        });
391    }
392}
393/* End */
394;
395; /* Start:"a:4:{s:4:"full";s:68:"/local/templates/nation_2022/js/vanilla_frontpage.js?165969728316015";s:6:"source";s:52:"/local/templates/nation_2022/js/vanilla_frontpage.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
396document.addEventListener("DOMContentLoaded", function () {
397    'use strict';
398
399    // Disable double-tap Safari zoom on mobiles
400    if (window.innerWidth <= 520) {
401        document.addEventListener('dblclick', () => {});
402    }
403
404    var yet = document.getElementById('yet'),
405        content = document.getElementById('content'),
406        postcontent = document.getElementById('postContent'),
407        err404 = document.getElementById('err404'),
408        main_top_news = document.getElementById('main_top_news'),
409        article_header = document.getElementById('article_header'),
410        yetInitialText,
411        ctrlpanel,
412        row;
413
414    function loadXMLDoc(url, closestIDelem = false) {
415        var xmlhttp = new XMLHttpRequest(),
416            newYet = null,
417            posts = null,
418            i = null,
419            error = false,
420            postsContainer;
421
422        xmlhttp.onreadystatechange = function () {
423
424            if (xmlhttp.readyState === XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
425                if (xmlhttp.status === 200) {
426
427                    // Парсим в DOM и находим элементы post
428                    var newDoc = new DOMParser().parseFromString(xmlhttp.responseText, "text/html");
429
430                    if(closestIDelem) {
431                        postsContainer = newDoc.getElementById(close
431stIDelem.id);
432                        if(!postsContainer) {
433                            postsContainer = newDoc;
434                        }
435                    } else {
436                        postsContainer = newDoc;
437                    }
438
439                    if(postsContainer) {
440                        posts = postsContainer.querySelectorAll('.post');
441                    } else {
442                        error = "Контейнер с id «"+closestIDelem.id+"» не найден в запросе "+url+"\n";
443                    }
444
445                    if (posts) {
446
447                        // Заменяем href в кнопке и возвращаем текст
448                        newYet = postsContainer.querySelector('#yet');
449        
450                        if (newYet !== null) {
451                            yet.href = newYet.href;
452                            yet.innerHTML = yetInitialText;
453                            yet.disabled = false;
454
455                            // Если внутри row
456                            if (yet.parentNode.parentNode !== null &&
457                                yet.parentNode.parentNode.classList.contains('row')) {
458                                if(yet.parentNode.id == 'ctrl_panel') {
459                                    ctrlpanel = yet.parentNode;
460                                    ctrlpanel.parentNode.removeChild(ctrlpanel);
461                                }
462                            }
463                        } else {
464                            yet.parentNode.removeChild(yet);
465                        }
466
467                        // Добавляем элементы
468                        if(closestIDelem) {
469                            row = closestIDelem.querySelector('.row');
470                        } else if (postcontent !== null) {
471                            row = postcontent.querySelector('.row');
472                        } else {
473                            row = false;
474                            error += '#postContent не найден';
475                        }
476
477                        if(row) {
478                            for (i = 0; i < posts.length; i++) {
479                                row.appendChild(posts[i]);
480                            }
481                            if (ctrlpanel !== undefined) {
482                                row.appendChild(ctrlpanel);
483                            }
484                        }
485
486                    } else {
487                        error += 'Элементы .post не найдены';
488                    }
489
490                    if (error) { console.warn(error); }
491
492                } else if (xmlhttp.status == 400) {
493                    console.warn('Ошибка 400 в ajax-запросе');
494                } else {
495                    console.warn('Неизвестная ошибка в ajax-запросе');
496                }
497            }
498        };
499
500        xmlhttp.open("GET", url, true);
501        xmlhttp.send();
502    }
503
504    function getClosestIDelem(el) {
505      while (el && el.parentNode) {
506        el = el.parentNode;
507        
508        if (el && typeof el.id != 'undefined' && el.id != 'ctrl_panel') {
509          return el;
510        }
511      }
512      
513      return null;
514    }
515
516    function ShowMoreClick(yet) {
517        yet.addEventListener("click", function (e) {
518            yetInitialText = yet.innerText;
519            yet.innerHTML = 'Загрузка…';
520            yet.disabled = true;
521            if (this.href.indexOf('ajax_get') !== -1) {
522                loadXMLDoc(this.href, getClosestIDelem(yet));
523            } else {
524                loadXMLDoc(this.href + '&ajax_get=Y', getClosestIDelem(yet));
525            }
526            e.preventDefault(); // Cancel the native event
527            e.stopPropagation(); // Don't bubble/capture the event any further
528        }, false);
529    }
530
531    if (yet !== null) {
532        ShowMoreClick(yet);
533    }
534
535/*
536    // Stycky ADS
537    if (window.innerWidth >= 768) {
538        sticky();
539        // setTimeout(sticky, 2500);
540    }
541
542    function sticky() {
543        var wrapper = null,
544            P = 80,
545            RC = document.getElementById('rightcolumn');
546
547        if (RC === null) return false;
548        if (document.getElementById('bx-panel') !== null) { P += 39; }
549
550        Ascroll();
551        window.addEventListener('scroll', Ascroll, false);
552
553        function Ascroll() {
554            
555            if (postcontent === null) return false;
556
557            var i = 0;
558            if (wrapper === null) {
559                wrapper = document.createElement('div');
560                wrapper.style.cssText = 'box-sizing: border-box; width: ' + RC.getBoundingClientRect().width + 'px;';
561                RC.insertBefore(wrapper, RC.firstChild);
562                var l = RC.childNodes.length;
563                for (i = 1; i < l; i++) {
564                    wrapper.appendChild(RC.childNodes[1]);
565                }
566            }
567
568            let wrapHeight = wrapper.getBoundingClientRect().height,
569                RCrect = RC.getBoundingClientRect(),
570                // селектор блока, при достижении нижнего края которого нужно открепить прилипающий элемент
571                R = Math.round(
572                    RCrect.top
573                     + wrapHeight
574                     - postcontent.getBoundingClientRect().bottom
575                    ),
576                wHeight = window.innerHeight,
577                pathToScroll = wrapHeight - wHeight,
578                shift = Math.abs(RCrect.top - P) * ((pathToScroll+P) / Math.abs(R)),
579                moreThanWindow = -(wHeight - P - wrapHeight);
580
581            if ((RCrect.top - P) <= 0) {
582                wrapper.className = 'sticky';
583                wrapper.style.top = (moreThanWindow > 0)? P-shift + 'px' : P + 'px';
584            } else {
585                wrapper.className = '';
586                wrapper.style.top = '';
587            }
588            window.addEventListener('resize', function () {
589                RC.children[0].style.width = getComputedStyle(RC, '').width;
590            }, false);
591        }
592    }
593
594*/
595
596    function position() {
597        return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop;
598    }
599
600    function HeadOpacity() {
601        if (position() > 250) {
602            htmc.add("opacity");
603        } else {
604            htmc.remove("opacity");
605        }
606    }
607
608    var htm = document.getElementById("header_top_menu"),
609        htmc = htm.classList;
610
611    if (htm !== null && htmc.contains('index_top_menu')) {
612        window.addEventListener('scroll', HeadOpacity, false);
613    }
614
615
616
617
618
619
620    // Search
621
622    var searchForm = document.getElementById("search-form"),
623        sfCl = searchForm.classList,
624        searchInput = document.getElementById("searchInput"),
625        siCl = searchInput.classList,
626        searchButton = document.getElementById("searchButtonFullRes");
627
628    searchButton.onclick = function (e) {
629        if (siCl.contains('hidden')) {
630            openSearch();
631        } else {
632            if (searchInput.value !== "") loadSearch(searchInput.value);
633            closeSearch();
634        }
635        e.preventDefault();
636    };
637
638    function openSearch() {
639        searchInput.focus();
640        siCl.remove('hidden');
641        sfCl.remove('hidden');
642    }
643
644    function closeSearch() {
645        searchInput.blur();
646        siCl.add('hidden');
647        sfCl.add('hidden');
648        searchInput.value = "";
649    }
650
651
652    searchInput.addEventListener("keypress", function (event) {
653        if (event.key === "Escape") {
654            closeSearch();
655            event.preventDefault();
656        }
657        if (event.key === "Enter") {
658            loadSearch(searchInput.value);
659            closeSearch();
660            event.preventDefault();
661        }
662    });
663
664
665
666    function insertHeader(text) {
667        // Create sHeader
668        let sHeader = document.getElementById('s_header');
669        if (sHeader === null) {
670            sHeader = document.createElement('h1');
671            sHeader.id = 's_header';
672            postcontent.appendChild(sHeader);
673        }
674        sHeader.innerHTML = text;
675    }
676
677    function loadSearch(query) {
678        var xmlhttp = new XMLHttpRequest(),
679            newYet = false,
680            noteText,
681            topContent = null,
682            posts = null,
683            notes = null,
684            firstUpper = null;
685        var yet = document.getElementById("yet");
686
687        xmlhttp.onreadystatechange = function () {
688
689            if (xmlhttp.readyState === XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
690                if (xmlhttp.status === 200) {
691
692                    // Парсим в DOM и находим элементы post
693                    var newDoc = new DOMParser().parseFromString(xmlhttp.responseText, "text/html");
694
695                    if ((topContent = document.getElementById('topContent'))) topContent.parentNode.removeChild(topContent);
696
697                    posts = newDoc.querySelectorAll('.post');
698                    if (posts.length > 0) {
699                        if (content !== null) {
700
701                            if (err404 !== null) err404.remove();
702                            if (main_top_news !== null) main_top_news.remove();
703                            if (article_header !== null) article_header.remove();
704
705                            let inter_post_head = document.querySelector('.inter_post_head'),
706                                editor_top_menu = document.querySelector('.editor-top-menu');
707                            if(inter_post_head !== null) inter_post_head.remove();
708                            if(editor_top_menu !== null) editor_top_menu.remove();
709                            
710                            if(postcontent !== null && postcontent.classList.contains('col-5')) {
711                                postcontent.classList.add('col-6');
712                                postcontent.classList.remove('col-5');
713                                if(postcontent.previousElementSibling.classList.contains('col-1'))
714                                    postcontent.previousElementSibling.remove();
715                            }
716
717
718                            window.scrollTo(0, 0);
719
720                            if (postcontent === null) {
721                                postcontent = document.createElement('div');
722                                postcontent.id = 'postContent';
723                                postcontent.classList.add('posts', 'posts-index', 'columns', 'small-12', '__width_fix', 'search');
724                                content.innerHTML = "";
725                                content.appendChild(postcontent);
726                            } else {
727                                postcontent.innerHTML = "";
728                                postcontent.classList.add('search');
729                            }
730                            insertHeader('Найдено в Нации: ' + query);
731
732                            // Create .row
733                            row = document.createElement('div');
734                            row.classList.add('row');
735                            postcontent.appendChild(row);
736
737                            // Create #ctrlpanel
738                            ctrlpanel = document.createElement('div');
739                            ctrlpanel.id = 'ctrl_panel';
740                            postcontent.appendChild(ctrlpanel);
741
742                            // Create yet
743                            yet = document.createElement('a');
744                            yet.classList.add('button');
745                            yet.id = 'yet';
746                            ctrlpanel.appendChild(yet);
747                            ShowMoreClick(yet);
748
749                            // Добавляем элементы
750                            for (let i = 0; i < posts.length; i++) {
751                                row.appendChild(posts[i]);
752                            }
753
754                            // Заменяем href в кнопке и возвращаем текст
755                            newYet = newDoc.getElementById('yet');
756                            if (newYet !== null) {
757                                yet.href = newYet.href;
758                                yet.innerHTML = newYet.innerHTML;
759                                yet.disabled = false;
760                            } else {
761                                yet.parentNode.removeChild(yet);
762                            }
763                        } else {
764                            console.warn('id="content" не найден');
765                        }
766
767                    } else {
768                        if (postcontent !== null) {
769                            row = postcontent.querySelector('.row');
770                            row.innerHTML = "";
771                        }
772                        notes = newDoc.getElementById('s_header');
773                        noteText = newDoc.querySelectorAll('.error-empty');
774                        if (notes !== null) {
775                            insertHeader(notes.innerHTML);
776                        }
777                        if (noteText.length > 0) {
778                            postcontent.appendChild(noteText[0]);
779                        }
780                            
781                        if (yet !== null) {
782                            yet.parentNode.removeChild(yet);
783                        }
784                        console.warn(query + ': элементы .post не найдены');
785                    }
786                    firstUpper = (query.charAt(0).toUpperCase() + query.slice(1));
787                    document.title = firstUpper + " в Нации | Поиск";
788                    setLocation('/search/?q=' + query); // Изменение строки в браузере
789                } else if (xmlhttp.status == 400) {
790                    console.warn('Ошибка 400 в ajax-запросе');
791                } else {
792                    console.warn('Неизвестная ошибка в ajax-запросе');
793                }
794            }
795        };
796
797        xmlhttp.open("GET", '/search/?q=' + query + '&ajax_get=Y', true);
798        xmlhttp.send();
799    }
800
801    function setLocation(location) {
802        try {
803            history.pushState(null, null, location);
804            return;
805        } catch (e) {
806            console.warn('history.pushState error: '+e);
807        }
808        location.hash = '#' + location;
809    }
810
811    // function imageExists(image_url){
812    //     var http = new XMLHttpRequest();
813    //     http.open('HEAD', image_url, false);
814    //     http.send();
815    //     return http.status != 404;
816    // }
817
818});
819/* End */
820;
821; /* Start:"a:4:{s:4:"full";s:60:"/local/templates/nation_2022/js/delay_load.js?16761206184112";s:6:"source";s:45:"/local/templates/nation_2022/js/delay_load.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
822document.addEventListener("DOMContentLoaded", function () {
823    'use strict';
824
825    function seedr () 
826    {
827        let sectionLink = document.querySelector('.section-link');
828
829        if(sectionLink != null) {
830
831            (function (a, b, c, d, e, f, g, h) {
832                 g = b.createElement(c);
833                 g.src = d;
834                 g.type = "application/javascript";
835                 g.async = !0;
836                 h = b.getElementsByTagName(c)[0];
837                 h.parentNode.insertBefore(g, h);
838                 a[f] = [];
839                 a[e] = function () {
840                     a[f].push(Array.prototype.slice.apply(arguments));
841                }
842            }) (window, document, "script", "https://cdn01.nativeroll.tv/js/seedr-player.min.js", "SeedrPlayer",
843        "seedrInit");
844
845            SeedrPlayer({
846                container: '.inter_post_text',
847                desiredOffset: 50,
848                // maxWidth: 600,
849                margin: '30px auto',
850                category: sectionLink.innerHTML, // рекомендуется
851                gid: '5cb735559762b6cb778b4573',
852                onError: function (e) { 
853                console.log(e); 
854                }
855            });
856        }
857    }
858
859    function audioInit ()
860    {
861        if(document.getElementById('audio_wrapper')) {
862            let howler = document.createElement('script'),
863                player = document.createElement('script');
864            howler.src = "/local/templates/nation_2022/js/audio/howler.core.min.js";
865            player.src = "/local/templates/nation_2022/js/audio/player_start.min.js?v=1.4";
866
867            document.head.appendChild(howler);
868            document.head.appendChild(player);
869        }
870    }
871
872    function fancyInit ()
873    {
874        if(document.querySelector('[data-fancybox]')) {
875            console.log(document.querySelector('[data-fancybox]'));
876            let jquery = document.createElement('script'),
877                fancy = document.createElement('script');
878            jquery.src = "/local/templates/nation_2022/js/jquery-3.6.0.min.js";
879            fancy.src = "/local/templates/nation_2022/js/jquery.fancybox.min.js";
880
881            document.head.appendChild(jquery);
882            document.head.appendChild(fancy);
883        }
884    }
885
886    function yartb2 () 
887    {
888        if(document.getElementById('yandex_rtb_R-A-347391-2')) {
889            window.yaContextCb.push(()=>{
890                // eslint-disable-next-line no-undef
891                Ya.Context.AdvManager.render({
892                    renderTo: 'yandex_rtb_R-A-347391-2',
893                    blockId: 'R-A-347391-2'
894                })
895            })
896        }
897    }
898
899    function yartb3 () 
900    {
901        if(document.getElementById('yandex_rtb_R-A-347391-3')) {
902            window.yaContextCb.push(()=>{
903                // eslint-disable-next-line no-undef
904                Ya.Context.AdvManager.render({
905                    renderTo: 'yandex_rtb_R-A-347391-3',
906                    blockId: 'R-A-347391-3'
907                })
908            })
909        }
910    }
911
912
913    function yandexInit () {
914        let context = document.createElement('script');
915        context.src = "https://yandex.ru/ads/system/context.js";
916        window.yaContextCb = window.yaContextCb || [];
917
918        document.head.appendChild(context);
919        yartb2();
920        yartb3();
921    }
922
923    var i = false,
924        scrollTop = window.pageYOffset || document.documentElement.scrollTop;
925
926    function scrollSeedr() {
927        scrollTop = window.pageYOffset || document.documentElement.scrollTop;
928        if (!i && scrollTop > 300) {
929            i = true;
930            if (window.innerWidth <= 575) {
931                fancyInit();
932            }
933            audioInit();
934            seedr();
935            yandexInit();
936            window.removeEventListener("scroll", scrollSeedr, false);
937        }
938    }
939
940    if (!i && scrollTop > 300) {
941        if (window.innerWidth <= 575) {
942            fancyInit();
943        }
944        audioInit();
945        seedr();
946        yandexInit();
947    } else {
948        window.addEventListener('scroll', scrollSeedr, false)
949    }
950
951});
952/* End */
953;; /* /local/templates/nation_2022/js/cookie/cookie_popup.js?17573809221887*/
954; /* /local/templates/nation_2022/js/app.js?165969675715045*/
955; /* /local/templates/nation_2022/js/vanilla_frontpage.js?165969728316015*/
956; /* /local/templates/nation_2022/js/delay_load.js?16761206184112*/

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.