Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy to clipboard when creating share link #147

Merged
merged 3 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.
Expand Down Expand Up @@ -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 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.

Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "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",
Expand Down
4 changes: 2 additions & 2 deletions src/web/actionsTreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const actions: ActionTreeNode[] = [
}
},
{
label: vscode.l10n.t("Create a share link"),
label: vscode.l10n.t("Create MakeCode Share Link"),
icon: new vscode.ThemeIcon("export"),
command: {
title: vscode.l10n.t("Create a share link"),
title: vscode.l10n.t("Create MakeCode Share Link"),
command: "makecode.shareProject"
}
},
Expand Down
7 changes: 6 additions & 1 deletion src/web/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,14 @@ 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)
output.append(vscode.l10n.t("Congratulations! Your project is shared at {0} and has been copied into your clipboard.", link));
}
}

Expand Down