editor technically works
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
function pushFile() {
|
||||
const title = document.getElementById("title").innerHTML ? document.getElementById("title").innerHTML : ""
|
||||
const body = easyMDE.value() ? easyMDE.value() : ""
|
||||
const id = easyMDE.meta.id ? easyMDE.meta.id : ""
|
||||
const id = window.location.pathname.includes("/ui/files/") ? window.location.pathname.split("/ui/files/")[1] : ""
|
||||
headers = {}
|
||||
if (title)
|
||||
headers["Title"] = title
|
||||
@@ -52,8 +52,6 @@
|
||||
alert(`failed to push file ${id}: ${status}: ${body}`)
|
||||
throw `failed to push file ${id}: ${status}: ${body}`
|
||||
}
|
||||
drawTree()
|
||||
//drawFile(id)
|
||||
document.getElementById("saveFeedback").innerHTML = "success!"
|
||||
if (saveFeedbackInterval) {
|
||||
clearTimeout(saveFeedbackInterval)
|
||||
|
||||
@@ -76,4 +76,23 @@
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function http(method, remote, callback, body, headers) {
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (xmlhttp.readyState == XMLHttpRequest.DONE) {
|
||||
callback(xmlhttp.responseText, xmlhttp.status, (key) => xmlhttp.getResponseHeader(key))
|
||||
}
|
||||
};
|
||||
xmlhttp.open(method, remote, true);
|
||||
if (typeof body == "undefined") {
|
||||
body = null
|
||||
}
|
||||
if (headers) {
|
||||
for (var key in headers)
|
||||
xmlhttp.setRequestHeader(key, headers[key])
|
||||
}
|
||||
xmlhttp.send(body);
|
||||
}
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user