blob: 30e1697885ca37b1ad18426874a83b1360e85274 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*
* Copyright (C) 2019 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*/
const vscode = acquireVsCodeApi();
document.getElementById('btn_submit').onclick = () => {
submitFunc();
};
function submitFunc() {
let projectName = document.getElementById('ipt_projName').value;
let template = document.getElementById('select_dropdown').value;
vscode.postMessage({
command: 'create_new_project',
projectName: projectName,
template: template,
});
/* get msg from ext */
window.addEventListener('message', event => {
const message = event.data;
switch (message.command) {
/* send command to open the project */
case 'proj_creation_finish':
vscode.postMessage({
command: 'open_project',
projectName: message.prjName,
});
break;
default:
break;
}
});
}
|