Compare commits

..

3 Commits

Author SHA1 Message Date
f29ca3aa5a Add makefile 2026-04-10 11:03:23 +02:00
2724e05e90 Add Save shortcut 2026-04-10 11:03:17 +02:00
a7e22d1aa7 Update Agents.md 2026-04-10 10:03:10 +02:00
4 changed files with 26 additions and 1 deletions

View File

@@ -45,6 +45,20 @@ Do not add endpoints beyond these without a concrete stated need.
- Readable on small screens without zooming
- Fast on a low-power ARM CPU — no heavy rendering, no large payloads
## Frontend Conventions
**JS file scoping:** each feature gets its own file. Global app behaviour goes in
`global-shortcuts.js`. Feature-specific logic gets its own file (e.g. `editor.js`).
Do not inline JS in the template or consolidate unrelated features into one file.
**Keyboard shortcuts:** `ALT+SHIFT` is the established modifier for all application
shortcuts — it avoids collisions with browser and OS bindings. Do not use other
modifiers for new shortcuts.
**Editor toolbar:** buttons use `data-action` (maps to a JS action function) and
`data-key` (the `ALT+SHIFT+KEY` shortcut letter). Adding a `data-key` to a button
automatically registers its shortcut — no extra wiring needed.
## Auth
- Basic auth is sufficient — this is a personal tool on a private VPN
- Do not over-engineer access control

8
Makefile Normal file
View File

@@ -0,0 +1,8 @@
NAS := thebe
.PHONY: deploy
deploy:
GOOS=linux GOARCH=arm GOARM=7 go build -o datascape-arm .
scp datascape-arm $(NAS):~/.local/bin/datascape
ssh $(NAS) /share/homes/luxick/.local/bin/datascape-start.sh
rm datascape-arm

View File

@@ -26,7 +26,10 @@
textarea.focus();
}
var form = textarea.closest('form');
var actions = {
save: function () { form.submit(); },
bold: function () { wrap('**', '**', 'bold text'); },
italic: function () { wrap('*', '*', 'italic text'); },
h1: function () { linePrefix('# '); },

View File

@@ -39,7 +39,7 @@
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
<div class="form-actions">
<a class="btn-cancel" href="{{.PostURL}}">CANCEL</a>
<button class="btn-save" type="submit">SAVE</button>
<button class="btn-save" type="submit" data-action="save" data-key="S" title="Save (S)">SAVE</button>
</div>
</form>
<script src="/_/editor.js"></script>