-
Notifications
You must be signed in to change notification settings - Fork 7
/
edit.html
47 lines (43 loc) · 1.05 KB
/
edit.html
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!doctype html>
<html>
<head>
<title>Vis/Printer</title>
<meta http-equiv="content-type" content="text/html; charset=utf8">
<script src="VisPrinter.js"></script>
<link rel="stylesheet" type="text/css" href="base.css">
</head>
<body>
<style>
#editor{
position: absolute;
top: 30px;
bottom: 10px;
left: 10px;
right: 10px;
}
</style>
<form method=POST enctype=multipart/form-data>
<input type=text id=name onchange="setName(this.value)">
<button>save</button>
<textarea id=editor>
</textarea>
</form>
<script>
var file=document.location.search.substring(1);
var onLoad=function(response){
var name =document.getElementById('name');
var editor=document.getElementById('editor');
editor.value=response;
editor.name=file;
name.value=file;
editor.parentNode.action=document.location;
}
VisPrinter.httpGet(file,onLoad);
function setName(name){
var editor=document.getElementById('editor');
editor.name=name;
editor.parentNode.action=document.location.pathname+'?'+name;
}
</script>
</body>
</html>