aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/index.html
diff options
context:
space:
mode:
authorkj_sh6042026-05-31 11:29:58 -0400
committerkj_sh6042026-05-31 11:29:58 -0400
commit2b2e511a15414f6c28f15990b75442424f9cc3b9 (patch)
tree99a6cc4ad40dd2309bb4a0b2c875e1719dbfe449 /src/templates/index.html
parent4626e9f40c4678622ef53cc0d9d3fa89768c08f0 (diff)
refactor: initial hardening tweaks
store images in localStorage
Diffstat (limited to 'src/templates/index.html')
-rw-r--r--src/templates/index.html27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/templates/index.html b/src/templates/index.html
index 194a2af..3af58ad 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -7,17 +7,6 @@
<title>likha-pdf</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/kj-sh604/noir.css@latest/out/noir.min.css" />
- <script src="https://unpkg.com/htmx.org@1.9.12"></script>
- <style>
- .htmx-indicator {
- display: none;
- }
-
- .htmx-request .htmx-indicator,
- .htmx-request.htmx-indicator {
- display: inline;
- }
- </style>
</head>
<body>
@@ -25,7 +14,7 @@
<h1>likha-pdf</h1>
<p>simple markdown to pdf export.</p>
- <form id="convert-form" hx-post="/convert" hx-target="#result" hx-swap="innerHTML" hx-indicator="#loading">
+ <form id="convert-form" action="/convert" method="post">
<label for="markdown">
<h3>textarea</h3>
</label>
@@ -34,19 +23,11 @@
<section id="image-upload-section">
<label for="image"><small>image file</small></label>
- <input id="image" name="image" type="file" accept="image/*" />
- <button id="upload-button" type="button" hx-post="/upload-image" hx-target="#upload-result" hx-swap="innerHTML"
- hx-encoding="multipart/form-data" hx-include="#image" hx-indicator="#uploading">upload image</button>
- <small id="uploading" class="htmx-indicator">uploading…</small>
+ <input id="image" type="file" accept="image/*" />
+ <button id="upload-button" type="button">insert image</button>
<div id="upload-result" aria-live="polite"></div>
</section>
- <section id="md-file-section">
- <h3>or upload a markdown file</h3>
- <label for="md-file"><small><em>(overrides textarea)</em></small></label>
- <input id="md-file" type="file" accept=".md,.markdown,text/markdown,text/plain" />
- </section>
-
<section>
<h3>pdf options</h3>
@@ -133,7 +114,7 @@
</section>
<button id="convert-button" type="submit">generate pdf</button>
- <small id="loading" class="htmx-indicator">converting…</small>
+ <small id="loading" hidden>converting...</small>
</form>
<section id="result" aria-live="polite"></section>