new features and refactor

This commit is contained in:
Ryan
2025-03-07 03:22:20 -05:00
committed by GitHub
parent 6a41280667
commit 960b27b414
14 changed files with 1338 additions and 1225 deletions

48
main.js Normal file
View File

@@ -0,0 +1,48 @@
// main.js
import { sendRequest } from './networkUtils.js';
import {
toggleVisibility,
toggleAllCheckboxes,
updateFileActionButtons
} from './domUtils.js';
import {
loadFileList,
initFileActions,
editFile,
saveFile,
displayFilePreview,
renameFile
} from './fileManager.js';
import {
deleteFolder,
loadCopyMoveFolderList,
loadFolderList
} from './folderManager.js';
import { initUpload } from './upload.js';
import { initAuth } from './auth.js';
// Expose functions for inline handlers.
window.sendRequest = sendRequest;
window.toggleVisibility = toggleVisibility;
window.toggleAllCheckboxes = toggleAllCheckboxes;
window.editFile = editFile;
window.saveFile = saveFile;
window.renameFile = renameFile;
// Global variable for the current folder.
window.currentFolder = "root";
// DOMContentLoaded initialization.
document.addEventListener("DOMContentLoaded", function () {
window.currentFolder = window.currentFolder || "root";
loadFileList(window.currentFolder);
loadCopyMoveFolderList();
initFileActions();
initUpload();
loadFolderList();
updateFileActionButtons();
// Initialize authentication and user management.
initAuth();
});