PageSourceSearch

https://dom-baumana.ru/local/templates/pr/assets/js/app3.js?17598444292167

js dom-baumana.ru collected 2026-10-08 23:07:08 UTC 2,167 bytes, 54 lines download raw bytes

1// перенос предлогов
2function preventPrepositionWrapping() {
3    const prepositions = [
4        'в', 'и', 'к', 'с', 'у', 'о', 'а', 'но', 'за', 'над', 'под', 'по',
5        'перед', 'из', 'на', 'от', 'до', 'без', 'для', 'про', 'in', 'on',
6        'at', 'to', 'for', 'with', 'and', 'but', 'or', 'of', 'by', 'from'
7    ].sort((a, b) => b.length - a.length);
8
9    // Исправленное регулярное выражение
10    const regex = new RegExp(
11        `(^|\\s)(${prepositions.join('|')})\\s+(?=\\S)`,
12        'gimu'
13    );
14
15    function processText(text) {
16        return text.replace(regex, (match, space, preposition) => {
17            return `${space}${preposition}\u00A0`; // Правильные параметры
18        });
19    }
20
21    const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
22    while (walker.nextNode()) {
23        const node = walker.currentNode;
24        if (node.parentNode.tagName !== 'SCRIPT' && node.parentNode.tagName !== 'STYLE') {
25            node.textContent = processText(node.textContent);
26        }
27    }
28}
29
30// Запускаем с задержкой после полной загрузки и при изменениях
31window.addEventListener('DOMContentLoaded', () => setTimeout(preventPrepositionWrapping, 100));
32window.addEventListener('resize', () => setTimeout(preventPrepositionWrapping, 50));
33
34
35document.addEventListener('DOMContentLoaded', function() {
36    const addressText = document.querySelector('.header-address__text');
37    
38    if (addressText) {
39        addressText.addEventListener('click', function(e) {
40            e.preventDefault();
41            const targetBlock = document.getElementById('location');
42            
43            if (targetBlock) {
44                const targetPosition = targetBlock.getBoundingClientRect().top + window.pageYOffset - 90;
45                window.scrollTo({
46                    top: targetPosition,
47                    behavior: 'smooth'
48                });
49            }
50        });
51    } else {
52        console.log('Элемент .header-address__text не найден');
53    }
54});

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.