31 lines
609 B
Plaintext
31 lines
609 B
Plaintext
|
|
<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> |