Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
raptazure committed Feb 13, 2020
1 parent 65adda7 commit ae243b0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@

### 0.1.0

Initial release.
- Initial release.

### 0.1.2

- Content of the status bar cannot be overwritten now.
- Auto close: Ask multiple questions. We will close previous panels for you.

**Enjoy!**

6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
### 0.1.0: 05 Feb 2020
- Initial release
- Status bar and input box support
- Choices: `Ask a Question` and `Draw a Card`
- Choices: `Ask a Question` and `Draw a Card`

### 0.1.2: 13 Feb 2020
- Content of the status bar cannot be overwritten now.
- Auto close: Ask multiple questions. We will close previous panels for you.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "daily-tarot",
"displayName": "Daily Tarot",
"description": "Get your daily tarot reading - Prisma Visions",
"version": "0.1.1",
"version": "0.1.2",
"publisher": "raptazure",
"icon": "images/icon.jpg",
"engines": {
Expand Down
4 changes: 3 additions & 1 deletion src/dailyTarot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { tarotDict } from './tarotDict'
let statusBar: vscode.StatusBarItem | undefined;

export function dailyTarot(context: vscode.ExtensionContext) {
DrawCards.show(context);
if (statusBar === undefined) {
DrawCards.show(context);
}

const index = String(DrawCards.selector);
vscode.window.showInformationMessage(`${tarotDict[index]}`);
Expand Down
19 changes: 9 additions & 10 deletions src/drawCards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@ export class DrawCards {
vscode.window.activeTextEditor.viewColumn : undefined;

if (this.panel) {
this.panel.reveal(columnToShowIn);
} else {
this.panel = vscode.window.createWebviewPanel('dailyTarot', 'Daily Tarot', vscode.ViewColumn.Two, {});

DrawCards.selector = -1 + Math.floor(Math.random() * 79);
this.panel.dispose();
}

if (this.panel !== undefined) {
const filePath: vscode.Uri = vscode.Uri.file(path.join(context.extensionPath, 'src', 'pages', `${DrawCards.selector}.html`));
this.panel.webview.html = fs.readFileSync(filePath.fsPath, 'utf8');
}
this.panel = vscode.window.createWebviewPanel('dailyTarot', 'Daily Tarot', vscode.ViewColumn.Two, {});
DrawCards.selector = -1 + Math.floor(Math.random() * 79);

this.panel.onDidDispose(() => this.panel = undefined);
if (this.panel !== undefined) {
const filePath: vscode.Uri = vscode.Uri.file(path.join(context.extensionPath, 'src', 'pages', `${DrawCards.selector}.html`));
this.panel.webview.html = fs.readFileSync(filePath.fsPath, 'utf8');
}

this.panel.onDidDispose(() => this.panel = undefined);
}
}

0 comments on commit ae243b0

Please sign in to comment.