|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
| 6 | +import 'vs/css!./share'; |
6 | 7 | import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
7 | 8 | import { Codicon } from 'vs/base/common/codicons';
|
| 9 | +import { MarkdownString } from 'vs/base/common/htmlContent'; |
8 | 10 | import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
9 | 11 | import { localize } from 'vs/nls';
|
10 | 12 | import { Action2, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
|
@@ -78,19 +80,23 @@ class ShareWorkbenchContribution {
|
78 | 80 |
|
79 | 81 | const uri = await shareService.provideShare({ resourceUri }, new CancellationTokenSource().token);
|
80 | 82 | if (uri) {
|
81 |
| - await clipboardService.writeText(uri.toString()); |
82 |
| - const result = await dialogService.input( |
| 83 | + const uriText = uri.toString(); |
| 84 | + await clipboardService.writeText(uriText); |
| 85 | + dialogService.prompt( |
83 | 86 | {
|
84 | 87 | type: Severity.Info,
|
85 |
| - inputs: [{ type: 'text', value: uri.toString() }], |
86 | 88 | message: localize('shareSuccess', 'Copied link to clipboard!'),
|
87 |
| - custom: { icon: Codicon.check }, |
88 |
| - primaryButton: localize('open link', 'Open Link') |
| 89 | + custom: { |
| 90 | + icon: Codicon.check, |
| 91 | + markdownDetails: [{ |
| 92 | + markdown: new MarkdownString(`<div aria-label='${uriText}'>${uriText}</div>`, { supportHtml: true }), |
| 93 | + classes: ['share-dialog-input'] |
| 94 | + }] |
| 95 | + }, |
| 96 | + cancelButton: localize('close', 'Close'), |
| 97 | + buttons: [{ label: localize('open link', 'Open Link'), run: () => { urlService.open(uri, { openExternal: true }); } }] |
89 | 98 | }
|
90 | 99 | );
|
91 |
| - if (result.confirmed) { |
92 |
| - urlService.open(uri, { openExternal: true }); |
93 |
| - } |
94 | 100 | }
|
95 | 101 | }
|
96 | 102 | });
|
|
0 commit comments