Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Add button to download public gist

* Download after getting public gist
  • Loading branch information
auxves authored and shanalikhan committed Jul 2, 2019
1 parent c8523b9 commit 632b6ae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
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

0 comments on commit 632b6ae

Please sign in to comment.