1(function(window, document) { 2 function removeExistingOverlay() { 3 const existingOverlay = document.querySelector('.overlay'); 4 if (existingOverlay) { 5 existingOverlay.parentNode.removeChild(existingOverlay); 6 document.body.classList.remove('overlayed'); 7 } 8 } 9 10 function open(content) { 11 removeExistingOverlay(); 12 document.body.classList.add('overlayed'); 13 14 const overlay = document.createElement('div'); 15 overlay.className = 'overlay'; 16 overlay.innerHTML = `${content}<span class="close-btn"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 329.3 329" width="32" height="32"><path fill="white" d="M195 165 323 37a21 21 0 1 0-30-31L165 135 36 6A21 21 0 1 0 6 37l128 128L6 293a21 21 0 1 0 30 30l129-128 128 128a21 21 0 0 0 30 0c8-8 8-22 0-30zm0 0"/></svg></span>`; 17 document.body.appendChild(overlay); 18 19 function close() { 20 if (overlay.parentNode) { 21 overlay.parentNode.removeChild(overlay); 22 document.body.classList.remove('overlayed'); 23 } 24 } 25 26 overlay.addEventListener('click', function(event) { 27 if (event.target === overlay) { 28 close(); 29 } 30 }); 31 32 overlay.querySelector('.close-btn').addEventListener('click', function(event) { 33 event.stopPropagation(); 34 close(); 35 }); 36 37 document.addEventListener('keydown', function onEsc(e) { 38 if (e.key === "Escape") { 39 close(); 40 document.removeEventListener('keydown', onEsc); 41 } 42 }); 43 44 return overlay; 45 } 46 47 window.Overlay = { open }; 48})(window, document);
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.