-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from tahabasri/release/3.0.0
Release/3.0.0
- Loading branch information
Showing
9 changed files
with
142 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import * as vscode from 'vscode'; | ||
import * as path from 'path'; | ||
import * as fs from 'fs'; | ||
import * as mustache from 'mustache'; | ||
|
||
export class NewRelease { | ||
private static readonly viewsFolder: string = 'views'; | ||
protected readonly _viewType: string = 'newRelease'; | ||
protected readonly _iconName: string = 'file'; | ||
protected readonly _panel: vscode.WebviewPanel; | ||
|
||
constructor( | ||
context: vscode.ExtensionContext, | ||
) { | ||
const title = 'Snippets - What\'s New'; | ||
const version = context.extension.packageJSON.version; | ||
this._panel = vscode.window.createWebviewPanel( | ||
this._viewType, | ||
title, | ||
{ | ||
viewColumn: vscode.ViewColumn.One, | ||
preserveFocus: true | ||
}, | ||
{ | ||
retainContextWhenHidden: true, | ||
enableCommandUris: true, | ||
localResourceRoots: [vscode.Uri.file(path.join(context.extensionPath, NewRelease.viewsFolder))] | ||
} | ||
); | ||
|
||
this._panel.iconPath = { | ||
light: vscode.Uri.file(path.join(__filename, '..', '..', 'resources', 'icons', 'light', `${this._iconName}.svg`)), | ||
dark: vscode.Uri.file(path.join(__filename, '..', '..', 'resources', 'icons', 'dark', `${this._iconName}.svg`)) | ||
}; | ||
|
||
const htmlTemplate = path.join(context.extensionPath, NewRelease.viewsFolder, `${this._viewType}.html`); | ||
this._panel.webview.html = mustache.render(fs.readFileSync(htmlTemplate).toString(), | ||
{ | ||
cspSource: this._panel.webview.cspSource, | ||
resetCssUri: this._panel.webview.asWebviewUri(vscode.Uri.file(path.join(context.extensionPath, NewRelease.viewsFolder, 'css', 'reset.css'))), | ||
cssUri: this._panel.webview.asWebviewUri(vscode.Uri.file(path.join(context.extensionPath, NewRelease.viewsFolder, 'css', 'vscode-custom.css'))), | ||
title: title, | ||
version: version | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="Content-Security-Policy" | ||
content="default-src 'none'; img-src {{cspSource}} https:; script-src {{cspSource}}; style-src {{cspSource}};"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{{title}}</title> | ||
<link rel="stylesheet" href="{{resetCssUri}}"> | ||
<link rel="stylesheet" href="{{cssUri}}"> | ||
</head> | ||
<body> | ||
<h1><img src="https://raw.githubusercontent.com/tahabasri/snippets/main/images/logo/logo.png" width="35px"><p class="changelog-header">{{title}} (version {{version}})</p></h1> | ||
<hr style="margin-top: 10px;"/> | ||
<div> | ||
<h2>🎉 Better Late Than Never !</h2> | ||
<h3>You can now drag and drop snippets and folders ✨</h3> | ||
<br/> | ||
<img src="https://raw.githubusercontent.com/tahabasri/snippets/main/images/features/056-drag-and-drop.gif" | ||
width="400px" alt="Drag and Drop Snippets"> | ||
</div> | ||
Check <a href="https://github.com/tahabasri/snippets/blob/main/CHANGELOG.md" target="_blank">CHANGELOG.md</a> for full release notes. | ||
<div> | ||
<h2>✅ Always Backup Your Snippets</h2> | ||
<h3>Don't forget to backup your data using the <b>Export Snippets</b> button before trying out the new release.</h3> | ||
<br/> | ||
<img src="https://raw.githubusercontent.com/tahabasri/snippets/main/images/release/backup-snippets.jpg" | ||
width="500px" alt="Backup Snippets"> | ||
</div> | ||
|
||
</body> | ||
</html> |