From f0dd3bb5ef0d521f799a30580e8b4138cf5215fb Mon Sep 17 00:00:00 2001 From: fyears Date: Wed, 5 Jan 2022 09:30:07 +0800 Subject: [PATCH] add button to copy url of dropbox --- src/settings.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/settings.ts b/src/settings.ts index 27671c3..d6ad5c3 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -120,6 +120,21 @@ class DropboxAuthModal extends Modal { contentEl.createEl("p", { text: "Finally you should be redirected to Obsidian.", }); + + const div2 = contentEl.createDiv(); + div2.createEl( + "button", + { + text: "Click to copy the auth url", + }, + (el) => { + el.onclick = async () => { + await navigator.clipboard.writeText(authUrl); + new Notice("the auth url copied to clipboard!"); + }; + } + ); + contentEl.createEl("p").createEl("a", { href: authUrl, text: authUrl,