Manual server file uploads implemented
This commit is contained in:
parent
c8308664d3
commit
70b5285e16
10 changed files with 329 additions and 26 deletions
|
|
@ -267,11 +267,11 @@ export class N2PageNodeUI extends CustomHTMLElement {
|
|||
const file = item.getAsFile()
|
||||
if (!file)
|
||||
throw new Error("Couldn't convert image to file object.")
|
||||
const uuid = uuidv7()
|
||||
await globalThis.nodeStore.files.add({ data: { UUID: uuid, file: file } })
|
||||
|
||||
const fileMetadata = await globalThis.nodeStore.storeFile(file)
|
||||
|
||||
const [start, end] = [this.elNodeContent.selectionStart, this.elNodeContent.selectionEnd]
|
||||
this.elNodeContent.setRangeText(``, start, end, 'select');
|
||||
this.elNodeContent.setRangeText(``, start, end, 'select');
|
||||
|
||||
// Editing the textarea programatically doesn't generate the events it usually gets when edited interactively.
|
||||
this.node.setContent(this.elNodeContent.value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue