mirror of
				https://github.com/We-Dont-Byte/Mind_Reader.git
				synced 2025-02-04 10:38:42 +00:00 
			
		
		
		
	Masonbone (#13)
* added initial webpage * Added webpage * Update package.json * Update package.json * Updating stuff * Update src/commands.ts Co-authored-by: Jake Grossman <jake.r.grossman@gmail.com> * updated extension.ts * Added Key binding pages * Read html from file Co-authored-by: Jake Grossman <jake.r.grossman@gmail.com>
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
import * as vscode from 'vscode';
 | 
			
		||||
import * as pl from './pylex';
 | 
			
		||||
import * as fs from 'fs';
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @type {Object} Command // Command to register with the VS Code Extension API
 | 
			
		||||
@@ -50,6 +51,20 @@ const commands: Command[] = [
 | 
			
		||||
    callback: resetEditorScale,
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  {
 | 
			
		||||
    name: 'mind-reader.openWebview',
 | 
			
		||||
    callback: openWebview,
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  {
 | 
			
		||||
    name: 'mind-reader.openKeyBindWin',
 | 
			
		||||
    callback: () => openKeyBindWin('Windows')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    name: 'mind-reader.openKeyBindMac',
 | 
			
		||||
    callback: () => openKeyBindWin('Mac'),
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  //Navigation Keys......
 | 
			
		||||
  {
 | 
			
		||||
    name: 'mind-reader.showAllSymbols',
 | 
			
		||||
@@ -150,6 +165,38 @@ function resetEditorScale(): void {
 | 
			
		||||
  vscode.commands.executeCommand('workbench.action.zoomReset');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function openWebview(): void {
 | 
			
		||||
  //vscode.commands.executeCommand('workbench.action.zoomOut');
 | 
			
		||||
  const panel = vscode.window.createWebviewPanel(
 | 
			
		||||
    'mindReader', // Identifies the type of the webview. Used internally
 | 
			
		||||
    'Mind Reader', // 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.
 | 
			
		||||
 | 
			
		||||
  panel.webview.html = getWebviewContent('media/html/main.html');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getWebviewContent(filepath: string) {
 | 
			
		||||
  return fs.readFileSync(filepath, {encoding: 'utf-8'});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function openKeyBindWin(os: 'Mac' | 'Windows'): void {
 | 
			
		||||
  //vscode.commands.executeCommand('workbench.action.zoomOut');
 | 
			
		||||
  const panel = vscode.window.createWebviewPanel(
 | 
			
		||||
    'mindReader', // Identifies the type of the webview. Used internally
 | 
			
		||||
    'MR Key Bindings', // 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.
 | 
			
		||||
 | 
			
		||||
  if (os === 'Windows') {
 | 
			
		||||
    panel.webview.html = getWebviewContent('media/html/winkeys.html');
 | 
			
		||||
  } else if (os === 'Mac') {
 | 
			
		||||
    panel.webview.html = getWebviewContent('media/html/mackeys.html');
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getIndent(): void {
 | 
			
		||||
  let editor = vscode.window.activeTextEditor;
 | 
			
		||||
  if(editor)
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ import * as vscode from 'vscode';
 | 
			
		||||
import * as pl from './pylex';
 | 
			
		||||
import commands from './commands';
 | 
			
		||||
 | 
			
		||||
import AccessNodeProvider from './accessNodeProvider'
 | 
			
		||||
import AccessNodeProvider from './accessNodeProvider';
 | 
			
		||||
 | 
			
		||||
let parser: pl.Parser = new pl.Parser();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user