summaryrefslogtreecommitdiffstats
path: root/templates/note.html.template
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-09-20 21:12:47 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-09-20 21:12:47 -0700
commit1905b90698b8171880b812bec1fcafaf0e35dc6a (patch)
treed676478bde0005179244c6baf06bdfb0b847c0c1 /templates/note.html.template
parent34a2a69a28457f5b58c357cb19f091330cca6110 (diff)
downloadroseh.moe-1905b90698b8171880b812bec1fcafaf0e35dc6a.tar.zst
Ditch HTMX
Diffstat (limited to 'templates/note.html.template')
-rw-r--r--templates/note.html.template30
1 files changed, 10 insertions, 20 deletions
diff --git a/templates/note.html.template b/templates/note.html.template
index eac0e02..0a88fd6 100644
--- a/templates/note.html.template
+++ b/templates/note.html.template
@@ -1,31 +1,21 @@
{{define "head"}}
-<script src="/static/htmx.min.js"></script>
-<title>Notepad</title>
+ <script src="/static/note.js"></script>
+ <title>Notepad</title>
-<meta name="viewport" content="interactive-widget=resizes-content"> <!-- https://stackoverflow.com/q/76026292 -->
+ <meta name="viewport" content="interactive-widget=resizes-content"> <!-- https://stackoverflow.com/q/76026292 -->
{{end}}
-<form method="post">
+<form id="form" method="post">
<div class="save-indicator-container">
- {{block "saveIndicator" ""}}
- <span id="save-indicator">{{.}}</span>
- {{end}}
+ <div id="save-indicator-wrapper">
+ {{block "saveIndicator" ""}}
+ <span id="save-indicator">{{.}}</span>
+ {{end}}
+ </div>
<noscript><input type="submit" value="Save"></noscript>
</div>
<div class="content-container">
- <textarea
- name="content"
- hx-post="/notepad/autosave"
- hx-on:input="
- const indicator = htmx.find('#save-indicator');
- htmx.addClass(indicator, 'htmx-indicator');
- indicator.innerHTML = 'Saving...';
- "
- hx-trigger="input delay:1s"
- hx-indicator="#save-indicator"
- hx-target="#save-indicator"
- hx-swap="outerHTML"
- autofocus>
+ <textarea id="content" name="content" oninput="autosave()" autofocus>
{{- .Content -}}
</textarea>
</div>