adding uploads to org authoring server
All checks were successful
Build Org Website / build (push) Successful in 54s
All checks were successful
Build Org Website / build (push) Successful in 54s
This commit is contained in:
@@ -819,7 +819,7 @@ APP_HTML = r"""<!doctype html>
|
||||
<button type="button" data-md="quote">Quote</button>
|
||||
<button type="button" data-md="link">Link</button>
|
||||
<button type="button" id="pageLinkBtn">Link to page</button>
|
||||
<button type="button" id="attachBtn">Insert attachment</button>
|
||||
<button type="button" id="attachBtn">Insert image</button>
|
||||
<input id="attachInput" type="file" accept="image/*" />
|
||||
</div>
|
||||
<div id="pageLinkPicker" class="link-picker" hidden>
|
||||
@@ -1147,7 +1147,7 @@ APP_HTML = r"""<!doctype html>
|
||||
editor.date.closest("label").hidden = isLima;
|
||||
editor.comments.closest("label").hidden = isLima;
|
||||
editor.section.closest("label").hidden = editor.pageType.value !== "post";
|
||||
attachBtn.hidden = isOrg;
|
||||
attachBtn.hidden = false;
|
||||
previewWrap.hidden = !isLima;
|
||||
contentLayout.classList.toggle("previewing", isLima);
|
||||
pageLinkPicker.hidden = true;
|
||||
@@ -1313,7 +1313,7 @@ APP_HTML = r"""<!doctype html>
|
||||
async function uploadAttachment() {
|
||||
const file = attachInput.files[0];
|
||||
if (!file) return;
|
||||
saveMessage.textContent = "Uploading attachment.";
|
||||
saveMessage.textContent = "Uploading image.";
|
||||
const body = new FormData();
|
||||
body.append("attachment", file);
|
||||
body.append("pagePath", currentEditorPath() || "index.org");
|
||||
@@ -1322,7 +1322,7 @@ APP_HTML = r"""<!doctype html>
|
||||
const data = await res.json();
|
||||
if (!res.ok) throw new Error(data.error || "Upload failed");
|
||||
replaceSelection(`\n${data.insertText || data.markdown}\n`);
|
||||
saveMessage.textContent = "Attachment inserted.";
|
||||
saveMessage.textContent = "Image inserted.";
|
||||
} catch (err) {
|
||||
saveMessage.textContent = err.message;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user