From 41ade2e2057eea3b36a5191a97fd6c52014348ec Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 26 Apr 2025 17:31:51 -0400 Subject: [PATCH] refactor/fix: api redoc --- CHANGELOG.md | 2 ++ Dockerfile | 6 +++++- public/api.php | 8 ++------ public/js/redoc-init.js | 6 ++++++ 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 public/js/redoc-init.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d4d26..0fa59c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ - **Controller**: Updated `FolderController::shareFolder()` (folderController) to include the gallery-view toggle script block intact, ensuring the “Switch to Gallery View” button works when sharing folders. - **UI (fileListView.js)**: Refactored `renderGalleryView` to remove all inline `onclick=` handlers; switched to using data-attributes and `addEventListener()` for preview, download, edit and rename buttons, fully CSP-compliant. - Moved logout button handler out of inline ` +
- \ No newline at end of file diff --git a/public/js/redoc-init.js b/public/js/redoc-init.js new file mode 100644 index 0000000..d39b92c --- /dev/null +++ b/public/js/redoc-init.js @@ -0,0 +1,6 @@ +// public/js/redoc-init.js +if (!customElements.get('redoc')) { + Redoc.init(window.location.origin + '/api.php?spec=1', + {}, + document.getElementById('redoc-container')); + } \ No newline at end of file