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

Add Button to Download Public Gist #941

Merged
merged 2 commits into from
Jul 2, 2019
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
25 changes: 25 additions & 0 deletions src/service/webview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,31 @@ export class WebviewService {
await state.commons.GetSettings()
);
break;
case "downloadPublicGist":
const [extConfig, customConfig] = await Promise.all([
state.commons.GetSettings(),
state.commons.GetCustomSettings()
]);
const publicGist = await vscode.window.showInputBox({
placeHolder: localize("common.placeholder.enterGistId"),
ignoreFocusOut: true
});
if (!publicGist) {
break;
}
await state.commons.SetCustomSettings({
...customConfig,
downloadPublicGist: true
});
await state.commons.SaveSettings({
...extConfig,
gist: publicGist
});
vscode.window.showInformationMessage(
localize("cmd.otherOptions.warning.tokenNotRequire")
);
vscode.commands.executeCommand("extension.downloadSettings");
break;
}
});
landingPanel.webview.html = content;
Expand Down
8 changes: 8 additions & 0 deletions ui/landing-page/landing-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ <h3 class="mx-auto mt-2 text-white-50a text-left">
</div>
</div>
</div>
<div class="text-left my-2">
<a
href="#"
onclick="sendCommand('downloadPublicGist')"
title="Download Public Gist"
>Download Public Gist</a
>
</div>
</div>
<div>
<h3 class="mx-auto mb-3 text-white-50a text-left">
Expand Down