configui/templates/components/editor.tmpl

20 lines
603 B
Cheetah
Raw Normal View History

2021-10-19 09:28:38 +00:00
{{define "components/editor"}}
{{template "components/toolbar" .}}
2021-10-21 08:04:57 +00:00
<!-- <container class="container is-max-desktop"> -->
<div id="editor">{{.File.Content}}</div>
2021-10-21 08:04:57 +00:00
<!-- </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>
2021-10-19 09:28:38 +00:00
{{end}}