From 84b03d2c2ba1ba77e58528482959bb06f85eeeaa Mon Sep 17 00:00:00 2001 From: fyears Date: Wed, 5 Jan 2022 00:58:59 +0800 Subject: [PATCH] add button to copy url --- src/settings.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/settings.ts b/src/settings.ts index 75088da..27671c3 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -170,6 +170,21 @@ export class OnedriveAuthModal 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,