Compare commits
3 Commits
57e2ce23fe
...
f29ca3aa5a
| Author | SHA1 | Date | |
|---|---|---|---|
| f29ca3aa5a | |||
| 2724e05e90 | |||
| a7e22d1aa7 |
14
AGENTS.md
14
AGENTS.md
@@ -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
8
Makefile
Normal 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
|
||||
@@ -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('# '); },
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user