Added editing posts

This commit is contained in:
tdgmcode 2023-03-18 23:02:25 -04:00
parent e323c22ba9
commit eec1873e28
7 changed files with 119 additions and 28 deletions

View file

@ -18,6 +18,8 @@
let currentState = 'editor';
let edit = $page.url.searchParams.get('edit') || '';
function setState(editor) {
currentState = editor;
}
@ -50,6 +52,7 @@
method='POST'
on:submit|preventDefault={async e => form = JSON.parse(await handleSubmit(e)) }
>
<textarea name='edit' style='display: none;' value={edit}></textarea>
<textarea name='content' style='display: none;' value={formContent}></textarea>
<input formaction="?/create" type='submit' value='Post' bind:this={formBody} style='display: none;'>
{#if currentState == 'editor'}
@ -88,7 +91,7 @@
<b>@user</b> mentions a user
</p>
<p>
<b>#post</b> replies to a post by ID
<b>#post</b> tags a post as a reply or subtopic
</p>
<p>
<b>%post</b> links to a chatroom