configui/templates/components/editor.tmpl

20 lines
585 B
Cheetah

{{define "components/editor"}}
{{template "components/toolbar" .}}
<container class="container is-max-desktop">
<div id="editor">{{.File.Content}}</div>
</container>
<script>
function setEditor(){
var beautify = ace.require("ace/ext/beautify");
window.beautify = beautify
var editor = ace.edit("editor");
window.editor = editor
editor.setTheme("ace/theme/monokai");
editor.session.setMode("ace/mode/{{.Editor.Lang}}");
editor.session.setUseWrapMode(false);
editor.session.setNewLineMode('{{.Editor.Platform}}')
editor.setReadOnly({{.File.RO}});
}
</script>
{{end}}