summaryrefslogtreecommitdiffstats
path: root/static/note.js
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-11-20 22:12:49 -0800
committerRose Hogenson <rosehogenson@posteo.net>2025-11-20 22:12:49 -0800
commit32ef4e7be5a7d826fbdf9789e5af3968ffb219ac (patch)
tree7c4f30305255aac14dc15bacad2ab060821147d1 /static/note.js
parentc7e501977eaeb8744a4aa54c60335d338217dc7b (diff)
downloadroseh.moe-32ef4e7be5a7d826fbdf9789e5af3968ffb219ac.tar.zst
Clean up the static files
Diffstat (limited to 'static/note.js')
-rw-r--r--static/note.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/static/note.js b/static/note.js
deleted file mode 100644
index 27d3eef..0000000
--- a/static/note.js
+++ /dev/null
@@ -1,39 +0,0 @@
-let running = false;
-let pending = false;
-
-async function save() {
- if (running) {
- pending = true;
- return;
- }
- running = true;
-
- try {
- const indicator = document.getElementById("save-indicator");
- indicator.innerHTML = "Saving...";
- indicator.classList.remove("hidden");
-
- let responseHTML;
- do {
- pending = false;
- const response = await fetch("/notepad/autosave", {
- method: "POST",
- body: new FormData(document.getElementById("form")),
- });
- responseHTML = await response.text();
- } while (pending);
- // Who needs HTMX?
- document.getElementById("save-indicator-wrapper").innerHTML = responseHTML;
- } finally {
- running = false;
- }
-}
-
-let autosaveTimer;
-
-function autosave(key) {
- document.getElementById("save-indicator").classList.add("hidden");
-
- clearTimeout(autosaveTimer);
- autosaveTimer = setTimeout(() => save(key), 1000);
-}