|
14 | 14 |
|
15 | 15 | import * as vscode from 'vscode'; |
16 | 16 |
|
17 | | -export function getWebviewHtml(webview: vscode.Webview, extensionUri: vscode.Uri): string { |
18 | | - const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'webview', 'script.js')); |
19 | | - const styleUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'webview', 'style.css')); |
| 17 | +export function getWebviewHtml( |
| 18 | + webview: vscode.Webview, |
| 19 | + extensionUri: vscode.Uri |
| 20 | +): string { |
| 21 | + const scriptUri = webview.asWebviewUri( |
| 22 | + vscode.Uri.joinPath(extensionUri, 'webview', 'script.js') |
| 23 | + ); |
| 24 | + const styleUri = webview.asWebviewUri( |
| 25 | + vscode.Uri.joinPath(extensionUri, 'webview', 'style.css') |
| 26 | + ); |
| 27 | + |
| 28 | + const logoUri = webview.asWebviewUri( |
| 29 | + vscode.Uri.joinPath(extensionUri, 'assets', 'launchmap-logo.png') |
| 30 | + ); |
20 | 31 |
|
21 | 32 | return ` |
22 | | - <!DOCTYPE html> |
23 | | - <html> |
24 | | - <head> |
25 | | - <meta charset="UTF-8"> |
26 | | - <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' ${webview.cspSource}; style-src ${webview.cspSource};"> |
27 | | - <link href="${styleUri}" rel="stylesheet"> |
28 | | - </head> |
29 | | - <body> |
30 | | - <button id="export-btn">💾 Export JSON</button> |
31 | | - <div id="editor"> |
32 | | - </div> |
33 | | - <script src="${scriptUri}" type="module"></script> |
34 | | - </body> |
35 | | - </html> |
36 | | - `; |
| 33 | + <!DOCTYPE html> |
| 34 | + <html> |
| 35 | + <head> |
| 36 | + <meta charset="UTF-8"> |
| 37 | + <meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${webview.cspSource} https:; script-src 'unsafe-inline' 'unsafe-eval' ${webview.cspSource}; style-src ${webview.cspSource};"> |
| 38 | + <link href="${styleUri}" rel="stylesheet"> |
| 39 | + </head> |
| 40 | + <body> |
| 41 | + <button id="export-btn">💾 Export JSON</button> |
| 42 | + <div id="editor"></div> |
| 43 | + <div id="watermark"> |
| 44 | + <img src="${logoUri}" alt="Logo" /> |
| 45 | + <p>LaunchMap</p> |
| 46 | + </div> |
| 47 | + <script src="${scriptUri}" type="module"></script> |
| 48 | + </body> |
| 49 | + </html> |
| 50 | +`; |
37 | 51 | } |
0 commit comments