-
Notifications
You must be signed in to change notification settings - Fork 3
/
ace.ftl
27 lines (24 loc) · 930 Bytes
/
ace.ftl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<style type="text/css" media="screen">
#editor {
width: 100%;
height: 500px;
}
</style>
<div id="editor">${fm.getFileContentsAsString()}</div>
<script src="/static/js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/chrome");
/**
* TODO: Make proper lang detection with manual override on the page itself. (dropdown?) See http://ajaxorg.github.io/ace-builds/kitchen-sink.html
* editor.getSession().setMode("ace/mode/html");
*/
editor.getSession().setTabSize(4);
editor.getSession().setUseSoftTabs(true);
editor.setShowPrintMargin(false);
</script>
<#if !readonly>
<button type="button" class="btn btn-primary btn-block" onclick="call('filemanager', '${fm.server.name}', '${fm.stripServer(fm.file)}', 'set', editor.getValue());">Save</button>
<#else>
<p>File is readonly.</p>
</#if>