1'use strict'; 2 3// ---- Install Panel ---- 4function openInstallPanel() { 5 var panel = document.getElementById('install_panel'); 6 if (panel) panel.classList.remove('lostfocus'); 7} 8 9function closeInstallPanel() { 10 var panel = document.getElementById('install_panel'); 11 if (panel) panel.classList.add('lostfocus'); 12} 13 14document.addEventListener('DOMContentLoaded', function () { 15 var panel = document.getElementById('install_panel'); 16 if (!panel) return; 17 18 // Close on backdrop click 19 panel.addEventListener('click', function (e) { 20 if (e.target === panel) closeInstallPanel(); 21 }); 22 23 // Close button 24 var closeBtn = document.getElementById('installPanelClose'); 25 if (closeBtn) closeBtn.addEventListener('click', closeInstallPanel); 26 27 // All .install_action triggers 28 document.querySelectorAll('.install_action').forEach(function (el) { 29 el.addEventListener('click', function (e) { 30 e.preventDefault(); 31 openInstallPanel(); 32 }); 33 }); 34 35 // Escape key 36 document.addEventListener('keydown', function (e) { 37 if (e.key === 'Escape') closeInstallPanel(); 38 }); 39}); 40 41 42// ---- Read progress indicator ---- 43(function () { 44 const indicator = document.getElementById('readIndicator'); 45 if (!indicator) return; 46 window.addEventListener('scroll', function () { 47 const scrollTop = window.scrollY; 48 const docHeight = document.documentElement.scrollHeight - window.innerHeight; 49 indicator.style.width = (docHeight > 0 ? (scrollTop / docHeight) * 100 : 0) + '%'; 50 }, { passive: true }); 51})(); 52 53// ---- Navbar shadow on scroll ---- 54(function () { 55 const nav = document.getElementById('mainNav'); 56 if (!nav) return; 57 window.addEventListener('scroll', function () { 58 nav.classList.toggle('scrolled', window.scrollY > 10); 59 }, { passive: true }); 60})(); 61 62// ---- Smooth scroll for anchor links ---- 63document.querySelectorAll('a[href^="#"]').forEach(function (el) { 64 el.addEventListener('click', function (e) { 65 var href = this.getAttribute('href'); 66 if (!href || href === '#') return; 67 var target = document.querySelector(href); 68 if (!target) return; 69 e.preventDefault(); 70 window.scrollTo({ top: target.offsetTop - 70, behavior: 'smooth' }); 71 }); 72});
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.