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.