dynamically list maps avaialble

This commit is contained in:
John Hess 2025-02-18 15:14:36 -06:00
parent 3246b44a86
commit cc69d322ca
8 changed files with 70 additions and 52 deletions

View file

@ -120,8 +120,7 @@ function extractDirectoryListing(doc) {
return { files, folders };
}
window.onload = function () {
// Example usage
function renderDirectory() {
const { files, folders } = extractDirectoryListing(window.document);
const listDiv = document.querySelector('div.list');
@ -201,4 +200,10 @@ window.onload = function () {
// do the insertion
listDiv.parentNode.insertBefore(fileListing, listDiv);
}
window.onload = function () {
if (window.location.pathname.includes(usbRoot)) {
renderDirectory();
}
}