From f4228e36107eeff9b12697a3742dbb0c474effab Mon Sep 17 00:00:00 2001 From: MasonBone Date: Tue, 9 Nov 2021 12:38:01 -0600 Subject: [PATCH] added initial webpage --- package.json | 9 +++++++++ src/commands.ts | 15 +++++++++++++++ src/extension.ts | 1 + 3 files changed, 25 insertions(+) diff --git a/package.json b/package.json index e6c5da7..2c42823 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,10 @@ { "command": "mind-reader.selectTheme", "title": "Select Theme" + }, + { + "command": "mind-reader.openWebview", + "title": "Mind Reader Webview" } ], "keybindings": [ @@ -120,6 +124,11 @@ "command": "mind-reader.selectTheme", "group": "mind-reader", "when": "activeEditor" + }, + { + "command": "mind-reader.openWebview", + "group": "mind-reader", + "when": "activeEditor" } ] }, diff --git a/src/commands.ts b/src/commands.ts index 537df19..ddf56bd 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -48,6 +48,11 @@ const commands: Command[] = [ name: 'mind-reader.resetEditorScale', callback: resetEditorScale, }, + + { + name: 'mind-reader.openWebview', + callback: openWebview, + } ]; // COMMAND CALLBACK IMPLEMENTATIONS @@ -76,4 +81,14 @@ function resetEditorScale(): void { vscode.commands.executeCommand('workbench.action.zoomReset'); } +function openWebview(): void { + //vscode.commands.executeCommand('workbench.action.zoomOut'); + vscode.window.createWebviewPanel( + 'catCoding', // Identifies the type of the webview. Used internally + 'Cat Coding', // Title of the panel displayed to the user + vscode.ViewColumn.One, // Editor column to show the new webview panel in. + {} + ); // Webview options. More on these later. +} + export default commands; diff --git a/src/extension.ts b/src/extension.ts index 5767437..4db5afd 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -18,6 +18,7 @@ export function activate(context: vscode.ExtensionContext) { command.callback ); context.subscriptions.push(disposable); + console.log(command.name); }); }