first reasonable version

This commit is contained in:
Barak Michener 2015-02-07 17:49:41 -05:00
parent 429ba99406
commit de8ddbb0a6
5 changed files with 809 additions and 19 deletions

View file

@ -3,24 +3,33 @@ package main
var pageTemplate = `
<html>
<head>
<title>LiveMarkdown</title>
<title>LiveMarkdown {{.}}</title>
<link rel="stylesheet" type="text/css" href="/github.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
var ws = new WebSocket("ws://" + location.host + "/ws" + "{{.}}")
ws.onopen = function() {
$("body").Text("wooot")
$("#content").html("wooot")
}
ws.onmessage = function(evt) {
$("body").Text(evt)
var data = JSON.parse(evt.data)
$("#content").html(data.Markdown)
}
ws.onclose = function() {
}
</script>
<style>
body {
padding: 10px 20px;
}
</style>
</head>
<body>
<div id="content" class="markdown-body">
</div>
</body>
</html>
`