You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Screenless Office - edit ${cfgfile}</title>
<style type="text/css" media="screen">
#editor {
height: 40em;
width: 80em;
}
#msg {
width: 40em;
background-color: pink;
height: 3em;
visibility: hidden;
opacity: 0;
transition: visibility 0s 2s, opacity 2s linear;
text-align: center;
}
</style>
</head>
<body>
<h3>The Screenless Office</h3>
<h4> edit config file <em>${cfgfile}</em></h4>
% if msg:
<div id="msg">${msg}</div>
% endif
<div><a href="/">← Main</a></div>
<div id="editor">${cfgdata}</div>
<form id="cfgform" action="/config/${bureau}" method="post">
<input type="hidden" value="${cfgdata}" name="cfgdata" id="cfgdata_field" />
<input type="submit" value="Save" name="operation" onclick="saveConfig()">
</form>
<script src="/static/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.session.setMode("ace/mode/${mode}");
function saveConfig(){
let cfgdata_field = document.getElementById("cfgdata_field");
cfgdata_field.value = editor.getValue();
if(confirm("Really overwrite ${cfgfile}?")){
document.forms[0].submit();
}
}
</script>
</body>
</html>