diff --git a/src/views/ManageFormsView.ts b/src/views/ManageFormsView.ts index bcb0af70..68e29828 100644 --- a/src/views/ManageFormsView.ts +++ b/src/views/ManageFormsView.ts @@ -1,5 +1,5 @@ import ModalFormPlugin from "../main"; -import { ItemView, Setting, WorkspaceLeaf } from "obsidian"; +import { ItemView, Notice, Setting, WorkspaceLeaf } from "obsidian"; export const MANAGE_FORMS_VIEW = "modal-form-manage-forms-view"; @@ -78,6 +78,13 @@ export class ManageFormsView extends ItemView { this.plugin.duplicateForm(form); }) }) + .addButton(button => { + button.setIcon('clipboard-copy') + button.onClick(() => { + navigator.clipboard.writeText(JSON.stringify(form, null, 2)); + new Notice("Form has been copied to the clipboard"); + }); + }) ; }) }