1// INPUT FIELD FILE 2const InputFile = () => { 3 const fileButtons = document.querySelectorAll(".js-input-file-button"); 4 5 fileButtons.forEach((fileButton) => { 6 const parentDiv = fileButton.parentElement; 7 const fileBrowserInput = parentDiv.firstElementChild; 8 const fileBrowserName = fileButton.querySelector(".js-input-file-name"); 9 10 fileButton.addEventListener("click", () => { 11 fileBrowserInput.click(); 12 }); 13 14 fileBrowserInput.addEventListener("change", () => { 15 const selectedFileNames = Array.from(fileBrowserInput.files).map( 16 (file) => file.name 17 ); 18 19 if (selectedFileNames.length === 1) { 20 fileBrowserName.innerText = selectedFileNames[0]; 21 } else if (selectedFileNames.length > 1) { 22 fileBrowserName.innerText = selectedFileNames.join(", "); 23 } 24 }); 25 }); 26}; 27 28const load_InputFile = window.addEventListener("DOMContentLoaded", InputFile); 29 30// export your function at the bottom as follows 31export { load_InputFile };
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.