uploading works! storing images separately and all

This commit is contained in:
2026-01-13 11:33:01 +13:00
parent 03d8c2ff74
commit ef72a95372
2 changed files with 52 additions and 18 deletions

View File

@@ -4,24 +4,30 @@ import "../styles/global.css"
<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'],
['image']
],
},
placeholder: 'Compose an epic...',
theme: 'snow', // or 'bubble'
});
document.querySelector("#render")?.addEventListener('click', () => {
const contents = JSON.stringify(quill.getContents())
document.querySelector("#upload")?.addEventListener('click', async () => {
const contents = quill.getContents()
const el = document.getElementById("result")
let entry: Entry = {
content: contents,
date: '2026-01-13T10:49:43Z',
location: null
}
el!.innerText = contents
await uploadEntry(entry)
})
@@ -44,8 +50,8 @@ import "../styles/global.css"
<p><br /></p>
</div>
<button id="render" class="mt-2">
render
<button id="upload" class="mt-2">
upload
</button>
<div id="result">