First commit

This commit is contained in:
2026-01-14 23:24:24 +01:00
commit c9f15b87b3
214 changed files with 9851 additions and 0 deletions

42
hugo/content/notes.html Normal file
View File

@@ -0,0 +1,42 @@
---
title: "Notes"
type: "notes"
---
<main x-data="{
store: null,
notes: '',
needCreate: false,
loaded: false,
async getNotes() {
const notes = await this.store.getNotes();
this.loaded = true;
if (notes === false) {
this.needCreate = true;
return;
}
this.notes = notes;
},
async saveNotes() {
if (!this.loaded)
return;
if (this.needCreate) {
const result = await this.store.createNotes(this.notes);
if (result)
this.needCreate = false;
}
else {
await this.store.updateNotes(this.notes);
}
},
async init() {
this.store = Alpine.store('alphabreed');
this.store.backUrl = '/notes/';
const tokenOK = await this.store.checkToken();
if (!tokenOK)
return;
await this.getNotes();
}
}" @keydown.window.prevent.stop.ctrl.s="saveNotes">
<textarea autocomplete="off" spellcheck="false" autofocus placeholder="Write notes here..." x-model="notes" @input="$store.alphabreed.pending = true" @input.debounce.500ms="saveNotes"></textarea>
<div id="pending" :class="{'show': $store.alphabreed.pending}"></div>
</main>