aboutsummaryrefslogtreecommitdiff
path: root/editor/example.html
diff options
context:
space:
mode:
Diffstat (limited to 'editor/example.html')
-rw-r--r--editor/example.html33
1 files changed, 12 insertions, 21 deletions
diff --git a/editor/example.html b/editor/example.html
index 1c22f3f..c4eef27 100644
--- a/editor/example.html
+++ b/editor/example.html
@@ -13,25 +13,10 @@
</script>
<script src="editor.js"></script>
<script>
- function main() {
- let opts = {
- id: "editor",
- is_editable: true,
- OpenFile: doOpenFile,
- }
-
- wuiEditor = new WuiEditor(opts)
-
- wuiEditor.OpenFile("/test.aww")
- }
-
- function doOpenFile(path) {
- let res = {
- code: 200,
- data: {
- name: "Test",
- path: path,
- content: `mkdir -p \${HOME}/aur/stackdriver-collectd
+ let nodeFile = {
+ name: "Test",
+ path: "/test",
+ content: `mkdir -p \${HOME}/aur/stackdriver-collectd
git -C \${HOME}/aur/stackdriver-collectd clone \\
ssh://aur@aur.archlinux.org/stackdriver-collectd.git .
@@ -62,9 +47,15 @@ sudo systemctl status stackdriver-collectd
sudo systemctl restart telegraf
sudo systemctl status telegraf
`,
- },
+ }
+
+ function main() {
+ let opts = {
+ id: "editor",
+ is_editable: true,
}
- return res
+ wuiEditor = new WuiEditor(opts)
+ wuiEditor.Open(nodeFile)
}
</script>
</body>