feat: Enhance WebDAV file management and UI

- Add functionality to create new collections via API
- Implement copy and move operations between collections
- Improve image rendering in markdown preview with relative path resolution
- Add support for previewing binary files (images, PDFs)
- Refactor modal styling to use flat buttons and improve accessibility
This commit is contained in:
Mahmoud-Emad
2025-10-26 17:29:45 +03:00
parent 0ed6bcf1f2
commit f319f29d4c
20 changed files with 1679 additions and 113 deletions

View File

@@ -49,11 +49,11 @@ class ModalManager {
// Update button styling based on danger level
if (isDangerous) {
this.confirmButton.className = 'btn btn-danger';
this.confirmButton.textContent = 'Delete';
this.confirmButton.className = 'btn-flat btn-flat-danger';
this.confirmButton.innerHTML = '<i class="bi bi-trash"></i> Delete';
} else {
this.confirmButton.className = 'btn btn-primary';
this.confirmButton.textContent = 'OK';
this.confirmButton.className = 'btn-flat btn-flat-primary';
this.confirmButton.innerHTML = '<i class="bi bi-check-circle"></i> OK';
}
// Set up event handlers
@@ -74,6 +74,8 @@ class ModalManager {
// Focus confirm button after modal is shown
this.modalElement.addEventListener('shown.bs.modal', () => {
// Ensure aria-hidden is removed (Bootstrap should do this, but be explicit)
this.modalElement.removeAttribute('aria-hidden');
this.confirmButton.focus();
}, { once: true });
});
@@ -103,8 +105,8 @@ class ModalManager {
this.inputElement.value = defaultValue;
// Reset button to primary style for prompts
this.confirmButton.className = 'btn btn-primary';
this.confirmButton.textContent = 'OK';
this.confirmButton.className = 'btn-flat btn-flat-primary';
this.confirmButton.innerHTML = '<i class="bi bi-check-circle"></i> OK';
// Set up event handlers
this.confirmButton.onclick = (e) => {
@@ -132,6 +134,8 @@ class ModalManager {
// Focus and select input after modal is shown
this.modalElement.addEventListener('shown.bs.modal', () => {
// Ensure aria-hidden is removed (Bootstrap should do this, but be explicit)
this.modalElement.removeAttribute('aria-hidden');
this.inputElement.focus();
this.inputElement.select();
}, { once: true });
@@ -161,6 +165,11 @@ class ModalManager {
this.currentResolver = null;
this.isShowing = false;
this.modal.hide();
// Restore aria-hidden after modal is hidden
this.modalElement.addEventListener('hidden.bs.modal', () => {
this.modalElement.setAttribute('aria-hidden', 'true');
}, { once: true });
}
}