aboutsummaryrefslogtreecommitdiffstats
path: root/templates/wiki/page_edit.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/wiki/page_edit.html')
-rw-r--r--templates/wiki/page_edit.html20
1 files changed, 19 insertions, 1 deletions
diff --git a/templates/wiki/page_edit.html b/templates/wiki/page_edit.html
index b59a8912..a2d709e2 100644
--- a/templates/wiki/page_edit.html
+++ b/templates/wiki/page_edit.html
@@ -99,5 +99,23 @@
document.getElementById("title").oninput = function() {
document.getElementById("preview-title").textContent = document.getElementById("title").value;
}
+
+ function refreshLock(){
+ console.log("Refreshing lock")
+ let xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (this.readyState === 4 && this.status === 204) {
+ console.log("Lock refreshed")
+ } else if(this.readyState === 4 && this.status !== 204) {
+ console.log("Could not refresh lock")
+ }
+ };
+
+ xhttp.open("PATCH", document.location.pathname, true);
+ xhttp.send();
+ }
+
+ // Lock refreshing
+ setInterval(refreshLock, (60 * 4) * 1000)
</script>
-{% endblock %} \ No newline at end of file
+{% endblock %}