1/** 2 * NewPress â the ONLY JS file of the theme. Vanilla, no jQuery, 3 * no bootstrap.bundle: the bundle was needed solely for the 4 * navbar collapse, which is 10 lines of vanilla below. 5 * Loaded with `defer`, so DOM is ready on execution. 6 */ 7 8// ââ Navbar collapse (replaces Bootstrap Collapse plugin) âââââââââ 9const navToggle = document.getElementById('navToggle'); 10const navMain = document.getElementById('navbarMain'); 11 12if (navToggle && navMain) { 13 navToggle.addEventListener('click', () => { 14 const open = navMain.classList.toggle('show'); 15 navToggle.setAttribute('aria-expanded', open ? 'true' : 'false'); 16 }); 17} 18 19// ââ Search overlay âââââââââââââââââââââââââââââââââââââââââââââââ 20const searchOverlay = document.getElementById('searchOverlay'); 21const searchOpen = document.getElementById('searchOpen'); 22const searchClose = document.getElementById('searchClose'); 23 24if (searchOverlay && searchOpen && searchClose) { 25 searchOpen.addEventListener('click', () => { 26 searchOverlay.style.display = 'block'; 27 const input = searchOverlay.querySelector('input[type="search"]'); 28 if (input) input.focus(); 29 }); 30 searchClose.addEventListener('click', () => { 31 searchOverlay.style.display = 'none'; 32 }); 33 document.addEventListener('keydown', (e) => { 34 if (e.key === 'Escape') searchOverlay.style.display = 'none'; 35 }); 36}
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.