From 2b450b66fee4906e746f6e04a6d07a72ff2faf64 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 12:26:17 +0300 Subject: Insert images straight from the Markdown editor A shared editor partial adds an "Insert image" file picker plus paste and drag-and-drop on the textarea; a few lines of inline JS upload the file to the existing images endpoint (which now answers JSON when asked) and put the Markdown at the caret. Without JS the same file rides along with the form and is appended to the text on save, so nothing depends on scripting. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/static/dashboard.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/web/static/dashboard.css') diff --git a/internal/web/static/dashboard.css b/internal/web/static/dashboard.css index e0aee73..c3d1420 100644 --- a/internal/web/static/dashboard.css +++ b/internal/web/static/dashboard.css @@ -107,11 +107,17 @@ tr.disabled td { color: #8f887c; } ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 0.3em 0; border-bottom: 1px solid #ddd6c7; } ul.plain li:last-child { border-bottom: 0; } -details.help { margin: 0.8em 4px 1.6em 0; border: 2px dashed #1d1a17; padding: 0.5em 1em; background: #fbf8f0; } +details.help { margin: 0.8em 0 0; border: 2px dashed #1d1a17; padding: 0.5em 1em; background: #fbf8f0; } details.help summary { cursor: pointer; font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.06em; } details.help[open] summary { margin-bottom: 0.5em; } .cheat td { border: 0; padding: 0.2em 1em 0.2em 0; background: none; } +.editor-tools { margin: 0.5em 0 0; font-size: 0.9em; } +.editor-tools .upload { display: inline-block; margin: 0 0.8em 0 0; padding: 0.25em 0.7em; border: 2px solid #1d1a17; background: #fffdf8; cursor: pointer; font-size: 0.8em; } +.editor-tools .upload:hover { background: #ebe5d6; } +.editor-tools .upload input { display: inline-block; width: auto; max-width: 14em; margin: 0 0 0 0.4em; padding: 0; border: 0; background: none; font-size: 0.9em; } +.editor-tools .upload-status { font-family: "IBM Plex Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.85em; margin-right: 0.6em; } + /* ---- images -------------------------------------------------------------- */ .gallery { overflow: hidden; } .thumb { float: left; width: 200px; margin: 0 1.2em 1.6em 0; padding: 0.6em; text-align: center; } -- cgit v1.2.3