From 558159f8ccf524ecd941ccbe3abca6d5d0d062be Mon Sep 17 00:00:00 2001 From: Joey Wunderlich Date: Fri, 17 Mar 2023 13:02:43 -0700 Subject: [PATCH 1/3] copy to clipboard when generating share link --- README.md | 4 ++-- package.nls.json | 2 +- src/web/actionsTreeView.ts | 4 ++-- src/web/extension.ts | 5 +++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4f9aab0..f935386 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Some other files you might see in your project include: Some of the important fields include: -* **name** - The name of the project. When you create a share link, this name is what people will see. Try to make it descriptive! +* **name** - The name of the project. When you create a MakeCode Project share link, this name is what people will see. Try to make it descriptive! * **description** - A description of your project. * **dependencies** - This field contains all of the extensions used by your project. To add/remove an extension, see the sections below. By default, all arcade projects depend on the `device` extension; make sure not to remove it if you want your project to work with MakeCode Arcade! * **files** - This is a list of the files in your project. All `.ts`, `.jres`, `.g.ts`, `.g.jres`, and `.md` files should be listed here. @@ -183,7 +183,7 @@ If your hardware is failing to show up as a USB drive when you plug it in, try t ## Sharing your project -To create a share link for your project, click the "Create a share link" command in the MakeCode Asset Explorer. This will cause the output pane to open with a link that you can copy/paste. +To create a MakeCode Project share link for your project, click the "Copy MakeCode Project Link" command in the MakeCode Asset Explorer. This will cause the output pane to open with a link that you can copy/paste. To change the name of your shared project, see the `pxt.json` section above. diff --git a/package.nls.json b/package.nls.json index 0c14c09..c7f3c26 100644 --- a/package.nls.json +++ b/package.nls.json @@ -7,7 +7,7 @@ "makecode.install.title": "Install project dependencies", "makecode.clean.title": "Clean built folders", "makecode.importUrl.title": "Import project from URL", - "makecode.shareProject.title": "Create a share link", + "makecode.shareProject.title": "Copy MakeCode Project Link", "makecode.addDependency.title": "Add extension to project", "makecode.removeDependency.title": "Remove extension from project", "makecode.createImage.title": "Create a new image asset", diff --git a/src/web/actionsTreeView.ts b/src/web/actionsTreeView.ts index 88387f3..c2f2e57 100644 --- a/src/web/actionsTreeView.ts +++ b/src/web/actionsTreeView.ts @@ -32,10 +32,10 @@ const actions: ActionTreeNode[] = [ } }, { - label: vscode.l10n.t("Create a share link"), + label: vscode.l10n.t("Copy MakeCode Project Link"), icon: new vscode.ThemeIcon("export"), command: { - title: vscode.l10n.t("Create a share link"), + title: vscode.l10n.t("Copy MakeCode Project Link"), command: "makecode.shareProject" } }, diff --git a/src/web/extension.ts b/src/web/extension.ts index 9df9daa..4aa1904 100644 --- a/src/web/extension.ts +++ b/src/web/extension.ts @@ -527,6 +527,11 @@ async function shareCommandAsync() { const link = await shareProjectAsync(workspace); if (link) { + try { + await vscode.env.clipboard.writeText(link); + } catch (e) { + tickEvent("clipboard.failed"); + } const output = vscode.window.createOutputChannel("MakeCode"); output.show(); output.append(vscode.l10n.t("Congratulations! Your project is shared at ") + link) From f8657b0ed4c83160213846eebd16e6e7d2e63264 Mon Sep 17 00:00:00 2001 From: Joey Wunderlich Date: Fri, 17 Mar 2023 13:26:06 -0700 Subject: [PATCH 2/3] note that it's in your keyboard already --- src/web/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/extension.ts b/src/web/extension.ts index 4aa1904..abaf031 100644 --- a/src/web/extension.ts +++ b/src/web/extension.ts @@ -534,7 +534,7 @@ async function shareCommandAsync() { } const output = vscode.window.createOutputChannel("MakeCode"); output.show(); - output.append(vscode.l10n.t("Congratulations! Your project is shared at ") + link) + output.append(vscode.l10n.t("Congratulations! Your project is shared at {0} and has been copied into your clipboard.", link)); } } From ad2ae67a7d85270246326337667007ba7d2e1081 Mon Sep 17 00:00:00 2001 From: Joey Wunderlich Date: Fri, 17 Mar 2023 13:29:11 -0700 Subject: [PATCH 3/3] Copy MakeCode Project Link -> Create MakeCode Share Link --- README.md | 4 ++-- package.nls.json | 2 +- src/web/actionsTreeView.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f935386..4609750 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Some other files you might see in your project include: Some of the important fields include: -* **name** - The name of the project. When you create a MakeCode Project share link, this name is what people will see. Try to make it descriptive! +* **name** - The name of the project. When you create a MakeCode share link, this name is what people will see. Try to make it descriptive! * **description** - A description of your project. * **dependencies** - This field contains all of the extensions used by your project. To add/remove an extension, see the sections below. By default, all arcade projects depend on the `device` extension; make sure not to remove it if you want your project to work with MakeCode Arcade! * **files** - This is a list of the files in your project. All `.ts`, `.jres`, `.g.ts`, `.g.jres`, and `.md` files should be listed here. @@ -183,7 +183,7 @@ If your hardware is failing to show up as a USB drive when you plug it in, try t ## Sharing your project -To create a MakeCode Project share link for your project, click the "Copy MakeCode Project Link" command in the MakeCode Asset Explorer. This will cause the output pane to open with a link that you can copy/paste. +To create a MakeCode share link for your project, click the "Create MakeCode Share Link" command in the MakeCode Asset Explorer. This will cause the output pane to open with a link that you can copy/paste. To change the name of your shared project, see the `pxt.json` section above. diff --git a/package.nls.json b/package.nls.json index c7f3c26..1536c2b 100644 --- a/package.nls.json +++ b/package.nls.json @@ -7,7 +7,7 @@ "makecode.install.title": "Install project dependencies", "makecode.clean.title": "Clean built folders", "makecode.importUrl.title": "Import project from URL", - "makecode.shareProject.title": "Copy MakeCode Project Link", + "makecode.shareProject.title": "Create MakeCode Share Link", "makecode.addDependency.title": "Add extension to project", "makecode.removeDependency.title": "Remove extension from project", "makecode.createImage.title": "Create a new image asset", diff --git a/src/web/actionsTreeView.ts b/src/web/actionsTreeView.ts index c2f2e57..b273bbd 100644 --- a/src/web/actionsTreeView.ts +++ b/src/web/actionsTreeView.ts @@ -32,10 +32,10 @@ const actions: ActionTreeNode[] = [ } }, { - label: vscode.l10n.t("Copy MakeCode Project Link"), + label: vscode.l10n.t("Create MakeCode Share Link"), icon: new vscode.ThemeIcon("export"), command: { - title: vscode.l10n.t("Copy MakeCode Project Link"), + title: vscode.l10n.t("Create MakeCode Share Link"), command: "makecode.shareProject" } },