refactor editor file

This commit is contained in:
2026-01-15 15:09:01 +13:00
parent fc7cd5a60a
commit dad55dab39
4 changed files with 125 additions and 56 deletions

View File

@@ -0,0 +1,31 @@
<div id="editor" />
<script>
import Quill from "quill";
import { uploadEntry } from '../utils/quill'
import type { Entry } from "../utils/quill";
const quill = new Quill('#editor', {
modules: {
toolbar: [
['bold', 'italic', 'underline'],
['image']
],
},
placeholder: 'Compose an epic...',
theme: 'snow', // or 'bubble'
});
document.querySelector("#upload")?.addEventListener('click', async () => {
const contents = quill.getContents()
let entry: Entry = {
content: contents,
date: '2026-01-13T10:49:43Z',
location: null
}
await uploadEntry(entry)
})
</script>