0:00 / 0:00
Implementing Binder Document Duplication.
I have implemented the requested Binder Duplicate Feature in the Writer's Studio application. This includes UI enhancements, backend logic for recursive duplication, and frontend event handling.
Changes Made:
Frontend UI (anti/public/index.html):
Added a new Duplicate button ('d') in the sidebar header actions, positioned between the "New Text" button and the "Toggle Inspector" button.
Backend API (anti/server.js):
Implemented a new POST /api/documents/duplicate endpoint.
Added recursive duplication logic that handles single documents, multiple selections, and entire folders.
The duplication process preserves all document settings (status, synopsis, notes, metadata, etc.) and maintains the original hierarchical structure for folders.
Fresh created_at and updated_at timestamps are generated for the new copies.
Frontend API Service (anti/public/js/api_v2.js):
Added the duplicateDocuments(ids) method to handle communication with the new backend endpoint.
Frontend Controller (anti/public/js/writer_v2.js):
Implemented a click event listener for the new duplicate button.
It automatically detects the current selection (or the active document) and triggers the duplication.
Refreshes the binder tree immediately after duplication to show the new items.
How to use:
Single Document: Click on a document in the binder to select it, then click the 'd' button.
Multiple Documents: Use Cmd/Ctrl+Click to select multiple items, then click 'd'.
Folders: Select a folder and click 'd' to duplicate the folder and all its contents (nested documents and sub-folders) recursively.
The new items will appear in the same parent folder as the original(s) with the same names and settings.
Comments & Ratings
#
Loading comments...