aboutsummaryrefslogtreecommitdiff
path: root/editor/example.html
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-08-27 08:40:25 +0700
committerShulhan <ms@kilabit.info>2021-08-27 23:47:17 +0700
commit58cfb51717241721b8e66bdbf4ea4bb9a41b5ca1 (patch)
treebe8d487163024cccd7daf32980f1a3da5cacfa6e /editor/example.html
parent6857ce06167038eb5980a9b2bfc2af2c6c0a87ae (diff)
downloadpakakeh.ts-58cfb51717241721b8e66bdbf4ea4bb9a41b5ca1.tar.xz
editor: add handler to save the content
When user press CTRL+S on the editor, it will trigger the OnSave handler. While at it, * auto scroll when pressing arrow up or down * auto scroll to bottom when pressing Enter at the end of file * fix tab key not inserting tab characters
Diffstat (limited to 'editor/example.html')
-rw-r--r--editor/example.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/example.html b/editor/example.html
index 344bd1b..7321386 100644
--- a/editor/example.html
+++ b/editor/example.html
@@ -9,6 +9,7 @@
<script>
var exports = {}
+ let wuiEditor = null
</script>
<script src="editor.js"></script>
<script>
@@ -19,9 +20,9 @@
OpenFile: doOpenFile,
}
- let editor = new Editor(opts)
+ wuiEditor = new Editor(opts)
- editor.OpenFile("/test.aww")
+ wuiEditor.OpenFile("/test.aww")
}
function doOpenFile(path) {