comments working; with some stuff in the theme

pull/10/head
Stephen Searles 7 years ago
parent 432affea76
commit 28c081ed30
  1. 11
      comments/comments.go

@ -128,14 +128,7 @@ func (cs *Service) WriteHTML(post string, w io.Writer) (int64, error) {
<text>{{.Text}}</text>
</comment>
{{end}}{{end}}
<form onsubmit="javascript:submitComment(event)">
<script>
function submitComment(evt) {
var xhr = new XMLHttpRequest();
xhr.open('POST', document.location.pathname, true);
xhr.send(JSON.stringify({"text": evt.target.querySelector('textarea').value}));
}
</script>
<form onsubmit="submitComment(event)">
<p>
<div>
<label for="comment">post a comment:</label>
@ -144,7 +137,7 @@ func (cs *Service) WriteHTML(post string, w io.Writer) (int64, error) {
<textarea placeholder="comment..." name="comment"></textarea>
</div>
<div>
<button>post</button>
<button type="submit">post</button>
</div>
</p>
</form>`))

Loading…
Cancel
Save