adding stuff from theme on the prod website
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<script>
|
||||
window.onload = function () {
|
||||
refreshComments();
|
||||
};
|
||||
|
||||
function refreshComments() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "./comments");
|
||||
xhr.onload = function () {
|
||||
document.querySelector("#comments").innerHTML = xhr.responseText;
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
window.submitComment = function (evt) {
|
||||
evt.preventDefault();
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', './comments', true);
|
||||
xhr.send(JSON.stringify({"text": evt.target.querySelector('textarea').value}));
|
||||
xhr.onload = function () {
|
||||
refreshComments();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id="comments"></div>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<p
|
||||
{{ if eq (.Get "align") "left" }}class="leftimg"{{else if (.Get "align") "right"}}class="rightimg"{{end -}}
|
||||
><a href="/media/{{ .Get "filename"}}" target="_blank"><img src="/media/
|
||||
{{- with .Get "width"}}{{.}}{{else}}100{{end}}x{{with .Get "height"}}{{.}}{{else}}{{end}}/{{ .Get "filename" -}}"
|
||||
{{ with .Get "caption" }}title="{{.}}"{{end}}
|
||||
{{ with .Get "caption" }}alt="{{.}}"{{end}}
|
||||
/></a>
|
||||
</p>
|
||||
Reference in New Issue
Block a user