1/** 2 * Global utility functions for the application 3 */ 4 5/** 6 * Scrolls to an element by ID with smooth behavior 7 * @param {string} elementId - The ID of the element to scroll to 8 */ 9window.scrollToElement = function(elementId) { 10 const element = document.getElementById(elementId); 11 if (element) { 12 element.scrollIntoView({ behavior: 'smooth', block: 'start' }); 13 } 14}; 15 16/** 17 * Opens a base64 image in a new tab 18 * @param {string} base64Data - The base64-encoded image data 19 * @param {string} filename - The name of the file 20 */ 21window.openImageInNewTab = function(base64Data) { 22 const newTab = window.open(); 23 if (newTab) { 24 newTab.document.write(` 25 <html> 26 <head> 27 <title>Chart Screenshot</title> 28 <style> 29 body { 30 margin: 0; 31 padding: 0; 32 display: flex; 33 justify-content: center; 34 align-items: center; 35 background-color: #1E1E1E; 36 min-height: 100vh; 37 } 38 img { 39 max-width: 100%; 40 max-height: 100vh; 41 } 42 </style> 43 </head> 44 <body> 45 <img src="data:image/png;base64,${base64Data}" alt="Chart Screenshot" /> 46 </body> 47 </html> 48 `); 49 newTab.document.close(); 50 } 51};
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.