Update templates/index.html
Browse files- templates/index.html +2 -4
templates/index.html
CHANGED
@@ -74,7 +74,6 @@
|
|
74 |
const codeInput = document.getElementById("code-input");
|
75 |
const outputDiv = document.getElementById("output");
|
76 |
|
77 |
-
// Show loading indicator
|
78 |
outputDiv.innerHTML += `\n> ${codeInput.value}<br>Running...`;
|
79 |
|
80 |
fetch("/execute", {
|
@@ -103,7 +102,7 @@
|
|
103 |
outputDiv.innerHTML += `<br>Error: ${error}`;
|
104 |
outputDiv.scrollTop = outputDiv.scrollHeight;
|
105 |
});
|
106 |
-
codeInput.value = "";
|
107 |
}
|
108 |
|
109 |
function cleanup() {
|
@@ -112,11 +111,10 @@
|
|
112 |
.then(data => {
|
113 |
const outputDiv = document.getElementById("output");
|
114 |
outputDiv.innerHTML += `\n${data.result}`;
|
115 |
-
outputDiv.scrollTop = outputDiv.scrollHeight;
|
116 |
});
|
117 |
}
|
118 |
|
119 |
-
// Cleanup temporary files when the user leaves the page
|
120 |
window.addEventListener("beforeunload", cleanup);
|
121 |
</script>
|
122 |
</body>
|
|
|
74 |
const codeInput = document.getElementById("code-input");
|
75 |
const outputDiv = document.getElementById("output");
|
76 |
|
|
|
77 |
outputDiv.innerHTML += `\n> ${codeInput.value}<br>Running...`;
|
78 |
|
79 |
fetch("/execute", {
|
|
|
102 |
outputDiv.innerHTML += `<br>Error: ${error}`;
|
103 |
outputDiv.scrollTop = outputDiv.scrollHeight;
|
104 |
});
|
105 |
+
codeInput.value = "";
|
106 |
}
|
107 |
|
108 |
function cleanup() {
|
|
|
111 |
.then(data => {
|
112 |
const outputDiv = document.getElementById("output");
|
113 |
outputDiv.innerHTML += `\n${data.result}`;
|
114 |
+
outputDiv.scrollTop = outputDiv.scrollHeight;
|
115 |
});
|
116 |
}
|
117 |
|
|
|
118 |
window.addEventListener("beforeunload", cleanup);
|
119 |
</script>
|
120 |
</body>
|