added static folder
switch to fancy css
This commit is contained in:
19
md2html/static/hot-reload.js
Normal file
19
md2html/static/hot-reload.js
Normal file
@@ -0,0 +1,19 @@
|
||||
function req(first) {
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onload = function() {
|
||||
if (xmlhttp.status == 200) {
|
||||
document.querySelector("article.markdown-body").innerHTML = xmlhttp.responseText;
|
||||
} else if(xmlhttp.status == 304) {
|
||||
} else {
|
||||
console.log(xmlhttp.status, xmlhttp.statusText);
|
||||
}
|
||||
req(false);
|
||||
};
|
||||
xmlhttp.onerror = function() {
|
||||
console.log(xmlhttp.status, xmlhttp.statusText);
|
||||
setTimeout(req, 1000, false);
|
||||
};
|
||||
xmlhttp.open("GET", first ? "/markdown" : "/reload", true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
req(true);
|
Reference in New Issue
Block a user