forked from mkam423/chatApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.html
More file actions
61 lines (55 loc) · 1.77 KB
/
edit.html
File metadata and controls
61 lines (55 loc) · 1.77 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<style>
body{
padding-left: 50px;
padding-right: 50px;
}
textarea{
font-family: "Courier New", monospace;
font size: 14px;
}
.header{
text-align: center;
padding-top: 50px;
padding-bottom: 50px;
font-family: "Courier", monospace;
font-size: 48px;
font-weight: bold;
}
.subheader{
font-family: "Courier", monospace;
font-weight: bold;
}
</style>
</head>
<body>
<h1 class="header"> Editing {{.Title}}.txt </h1>
<div class="subheader row">
<div class="col"><h2><b>Code</b></h2></div>
<div class="col"><h2><b>Notes</b></h2></div>
</div>
<div class="row">
<textarea class="col" name="body" id=writer rows="20" autofocus>{{printf "%s" .Body}}</textarea>
<textarea class="col" rows="20" placeholder="Place for notes..."></textarea>
</div>
<script>
function update() {
var body = document.getElementById('writer').value
var path = "/save/" + {{.Title}}
postBody(path, body);
}
function postBody(path, body) {
var xhr = new XMLHttpRequest()
xhr.open("POST", path, true)
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
xhr.send(body)
}
//Startup commands
console.log("Hello in edit.html")
setInterval(update, 100)
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</body>
</html>