Files
Oxicloud/static/js/app/state.js
T

67 lines
1.8 KiB
JavaScript
Raw Normal View History

/**
* OxiCloud - App state container
* Centralized mutable state for app and cached DOM references.
*/
2026-04-30 02:02:27 +02:00
/** @import {FolderInfo} from '../core/types.js' */
export const app = {
currentView: 'grid',
2026-04-30 02:02:27 +02:00
/** @type {string | null} */
currentPath: '',
currentFolder: null,
2026-04-30 02:02:27 +02:00
/** @type {FolderInfo | null} */
currentFolderInfo: null,
2026-04-30 02:02:27 +02:00
/** @type {Object | null} */
contextMenuTargetFolder: null,
2026-04-30 02:02:27 +02:00
/** @type {Object | null} */
contextMenuTargetFile: null,
selectedTargetFolderId: '',
moveDialogMode: 'file',
2026-04-30 02:02:27 +02:00
/** @type {String | null} */
currentSection: null, // will be defined on first call
isSearchMode: false,
shareDialogItem: null,
shareDialogItemType: null,
notificationShareUrl: null,
userHomeFolderId: null,
userHomeFolderName: null,
2026-04-30 02:02:27 +02:00
/** @type {Object[]} */
breadcrumbPath: [], // Array of {id, name} tracking folder navigation hierarchy
2026-04-30 02:02:27 +02:00
/** @type {String | null} */
viewFile: null // current file in inline view
};
2026-04-30 02:02:27 +02:00
export const appElements = {
/** @type {HTMLElement | null} */
uploadBtn: null,
/** @type {HTMLElement | null} */
dropzone: null,
/** @type {HTMLInputElement | null} */
fileInput: null,
/** @type {HTMLElement | null} */
filesList: null,
/** @type {HTMLElement | null} */
newFolderBtn: null,
/** @type {HTMLElement | null} */
gridViewBtn: null,
/** @type {HTMLElement | null} */
listViewBtn: null,
/** @type {HTMLElement | null} */
breadcrumb: null,
/** @type {HTMLElement | null} */
pageTitle: null,
/** @type {HTMLElement | null} */
actionsBar: null,
/** @type {NodeListOf<HTMLElement> | null} */
navItems: null,
/** @type {HTMLInputElement | null} */
searchInput: null
};