Commit fed940d1 by murtaugh

removed console log, better delete confirm

1 parent 12fd3332
......@@ -66,32 +66,6 @@ td.filecontrols.active {
-->
</div>
<script>
/*
function getjson (url, callback) {
var request = new XMLHttpRequest();
request.open('GET', url, true);
if (callback === undefined) {
callback = function (err, response) {
if (err) {
console.log("getjson.error");
} else {
console.log("getjson", response);
}
};
}
request.onload = function() {
if (request.status >= 200 && request.status < 400) {
callback(null, JSON.parse(request.responseText));
} else {
callback("server error");
}
};
request.onerror = function() {
callback("connection error");
};
request.send();
}
*/
function post (url, data, callback) {
var request = new XMLHttpRequest();
request.open('POST', url, true);
......@@ -130,17 +104,6 @@ touch.addEventListener("click", function () {
window.location.reload();
}
});
/*
getjson("/__makeserver__/cgi-bin/touch.cgi?path=" + encodeURIComponent(path),function (err, data) {
console.log("data", data);
if (data.result === 0) {
console.log("refreshing page")
window.location.reload();
} else {
alert("that didn't work (" + data.result + ")");
}
});
*/
}
}, false);
......@@ -148,7 +111,7 @@ var fc = document.getElementById("filecontrols");
Array.prototype.slice.call(document.querySelectorAll("a.filecontrols")).forEach(function (x) {
x.addEventListener("click", function (e) {
e.preventDefault();
console.log("click");
// console.log("click");
x.parentNode.appendChild(fc);
fc.style.display = "block";
x.parentNode.classList.add("active");
......@@ -183,7 +146,7 @@ fc.querySelector("#deletefile").addEventListener("click", function () {
td2 = td.parentNode.querySelector("td.filename");
td2a = td2.querySelector("a");
originalPath = td2a.textContent;
if (confirm("are you sure?")) {
if (confirm("Delete \"" + originalPath + "\"\nAre you sure?")) {
post(originalPath, {"delete": "1"}, function (err, response) {
if (err) {
alert("ERROR: " + err);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!