summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/wamr-ide/VSCode-Extension/resource/webview/js/newproj.js
diff options
context:
space:
mode:
Diffstat (limited to 'fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/wamr-ide/VSCode-Extension/resource/webview/js/newproj.js')
-rw-r--r--fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/wamr-ide/VSCode-Extension/resource/webview/js/newproj.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/wamr-ide/VSCode-Extension/resource/webview/js/newproj.js b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/wamr-ide/VSCode-Extension/resource/webview/js/newproj.js
new file mode 100644
index 000000000..30e169788
--- /dev/null
+++ b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/test-tools/wamr-ide/VSCode-Extension/resource/webview/js/newproj.js
@@ -0,0 +1,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;
+ }
+ });
+}