export function activate(context: wing.ExtensionContext) {
	console.log('activate');

	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));

	wing.window.webviews.forEach(webview => {
		webviewAdded(webview);
	});

	wing.window.onDidCreateWebView((webview) => {
		webviewAdded(webview);
	});

	wing.window.onDidDeleteWebView((webview) => {
		webviewRemoved(webview);
	});

	// wing.commands.registerCommand('extension.previewWebView', () => {
	// 	previewWebView(html);
	// });
	// hello
	wing.commands.registerCommand('extension.showNewTsClassPopup', () => {
		showWebViewPopup(html);
	});
}
function showFileName(context) {
	let editor = wing.window.activeTextEditor;
	if (!editor) {
		return;
	}
	let doc = editor.document;
	let fileName = doc.fileName;
	// wing.window.showInformationMessage(fileName);
	
	
	if (fileName.indexOf('.obj')>=0) {
		// wing.window.showInformationMessage('obj file');
		_fileName = fileName;
		
		let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));
		// showWebViewPopup(html);
		previewWebView(html);
	}
}
export function activate(context: wing.ExtensionContext) {
	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));

	wing.window.webviews.forEach(webview => {
		webviewAdded(webview);
	});

	wing.window.onDidCreateWebView((webview) => {
		webviewAdded(webview);
	});

	wing.window.onDidDeleteWebView((webview) => {
		webviewRemoved(webview);
	});

	wing.commands.registerCommand('extension.newUiStoryboard', () => {
		previewWebView(html);
	});
	wing.commands.registerCommand('extension.showWebViewPopup', () => {
		showWebViewPopup(html);
	});
}
export function activate(context: wing.ExtensionContext) {
	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));
	
	wing.window.webviews.forEach(webview => {
		webviewAdded(webview);
	});

	wing.window.onDidCreateWebView((webview) => {
		webviewAdded(webview);
	});

	wing.window.onDidDeleteWebView((webview) => {
		webviewRemoved(webview);
	});

	wing.commands.registerCommand('extension.previewWebView', () => {
		previewWebView(html);
	});
	wing.commands.registerCommand('extension.showWebViewPopup', () => {
		showWebViewPopup(html);
	});
	
	
	wing.window.onDidChangeActiveTextEditor((texteditor) => {
		// console.log('onDidChangeActiveTextEditor');
		// previewWebView(html);
		
		showFileName(context);
	});
	showFileName(context);
	
	// wing.workspace.onDidChangeTextDocument((event)=>{
	// 	wing.window.showInformationMessage('wing.workspace.onDidChangeTextDocument');
	// });
	
	
}
Example #5
0
function run(context: wing.ExtensionContext) {
	let html = path.join(context.extensionPath, 'index.html');
	wing.complexCommands.previewWebView(wing.Uri.file(html), 'WebViewTest');
}
export function activate(context: wing.ExtensionContext) {
	// console.log('activate');
	// wing.window.showInformationMessage('activate');
	
	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));

	wing.window.webviews.forEach(webview => {
		webviewAdded(webview);
	});

	wing.window.onDidCreateWebView((webview) => {
		webviewAdded(webview);
	});

	wing.window.onDidDeleteWebView((webview) => {
		webviewRemoved(webview);
	});

	wing.commands.registerCommand('extension.gtlab.wingPsMaster.show', () => {
		previewWebView(html);
	});
	// wing.commands.registerCommand('extension.showWebViewPopup', () => {
	// 	showWebViewPopup(html);
	// });
	
	
	
	// // workspace
	// wing.workspace.onDidChangeTextDocument((e: any) => {
	// 	wing.window.showInformationMessage('onDidChangeTextDocument');
	// });
	
	// wing.workspace.onDidOpenTextDocument((e: any) => {
	// 	wing.window.showInformationMessage('onDidOpenTextDocument');
	// });
	
	
	
	// // window
	// wing.window.onDidChangeTextEditorOptions((e:any) => {
	// 	wing.window.showInformationMessage('onDidChangeTextEditorOptions');
	// });
	
	// wing.window.onDidChangeTextEditorSelection((e:any)=>{
	// 	wing.window.showInformationMessage('onDidChangeTextEditorSelection');
	// });
	
	// wing.window.onDidChangeTextEditorViewColumn((e:any)=>{
	// 	wing.window.showInformationMessage('onDidChangeTextEditorViewColumn');
	// });
	
	
	
	
	// wing.window.onDidChangeActiveTextEditor((texteditor) => {
	// 	wing.window.showInformationMessage('onDidChangeActiveTextEditor');
	// 	// console.log('onDidChangeActiveTextEditor');
	// 	// previewWebView(html);
		
	// 	// showFileName(context);
	// });
	// // showFileName(context);
	
	// wing.window.showInformationMessage('setInterval');
	// setInterval( function () {
	// 	showFileName(context)
	// }, 2000);
}