1(() => { 2 'use strict'; 3 4 const article = document.querySelector('[data-lsrp-reading-content]'); 5 const bar = document.querySelector('[data-lsrp-progress]'); 6 7 if (!article || !bar) { 8 return; 9 } 10 11 let ticking = false; 12 13 const updateProgress = () => { 14 const rect = article.getBoundingClientRect(); 15 const articleTop = window.scrollY + rect.top; 16 const available = Math.max(1, article.offsetHeight - window.innerHeight); 17 const progress = Math.min(1, Math.max(0, (window.scrollY - articleTop) / available)); 18 19 bar.style.transform = `scaleX(${progress})`; 20 ticking = false; 21 }; 22 23 const requestUpdate = () => { 24 if (!ticking) { 25 window.requestAnimationFrame(updateProgress); 26 ticking = true; 27 } 28 }; 29 30 document.addEventListener('scroll', requestUpdate, { passive: true }); 31 window.addEventListener('resize', requestUpdate, { passive: true }); 32 window.addEventListener('load', requestUpdate, { once: true }); 33 requestUpdate(); 34 35 document.addEventListener('click', async (event) => { 36 const shareLink = event.target.closest('[data-lsrp-share]'); 37 if (shareLink) { 38 event.preventDefault(); 39 window.open( 40 shareLink.href, 41 'lsrp-share', 42 'width=720,height=560,resizable=yes,scrollbars=yes,noopener,noreferrer' 43 ); 44 return; 45 } 46 47 const copyButton = event.target.closest('[data-lsrp-copy]'); 48 if (!copyButton) { 49 return; 50 } 51 52 try { 53 await navigator.clipboard.writeText(copyButton.dataset.lsrpCopy); 54 copyButton.classList.add('is-copied'); 55 copyButton.setAttribute('aria-label', 'СÑÑлка ÑкопиÑована'); 56 copyButton.setAttribute('title', 'СкопиÑовано'); 57 window.setTimeout(() => { 58 copyButton.classList.remove('is-copied'); 59 copyButton.setAttribute('aria-label', 'СкопиÑоваÑÑ ÑÑÑлкÑ'); 60 copyButton.setAttribute('title', 'СкопиÑоваÑÑ ÑÑÑлкÑ'); 61 }, 1800); 62 } catch (error) { 63 window.prompt('СкопиÑÑйÑе ÑÑÑлкÑ:', copyButton.dataset.lsrpCopy); 64 } 65 }); 66})();
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.