uploading works! storing images separately and all
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user