Tidy up code, fix a visual bug
This commit is contained in:
parent
9186eb551b
commit
cea14f3142
1 changed files with 13 additions and 2 deletions
|
@ -126,15 +126,26 @@
|
|||
ret += `<a href="/post/${postid}">[Nevermind]</a>`
|
||||
ret +=
|
||||
`</div></div><post><div class="content"><form method="post"><label>` +
|
||||
`<h3><input type="username" name="name" ${fake ? `value="${post.comments[post.comments.length - 1].author.replaceAll("\"", """)}"` : 'value="Anonymous"'} required>: <input type="text" name="title" placeholder="Title" ${fake ? `value="${post.comments[post.comments.length - 1].title.replaceAll("\"", """)}"` : ''} required></h3>` +
|
||||
`<textarea name="content" placeholder="So basically, ..." required>${fake ? post.comments[post.comments.length - 1].content.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">") : ''}</textarea><br/><br/><button type="submit" name="fake" value="no">Submit</button> <button type="submit" name="fake" value="yes">Preview</button>` +
|
||||
`<h3>` +
|
||||
`<input type="username" name="name" ${fake ? `value="${post.comments[post.comments.length - 1].author.replaceAll("&", "&").replaceAll("\"", """)}"` : 'value="Anonymous"'} required>: ` +
|
||||
`<input type="text" name="title" placeholder="Title" ${fake ? `value="${post.comments[post.comments.length - 1].title.replaceAll("&", "&").replaceAll("\"", """)}"` : ''} required>` +
|
||||
`</h3>` +
|
||||
`<textarea name="content" placeholder="So basically, ..." required>` +
|
||||
(fake ? post.comments[post.comments.length - 1].content.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">") : '') +
|
||||
`</textarea><br/><br/>` +
|
||||
`<button type="submit" name="fake" value="no">Submit</button> ` +
|
||||
`<button type="submit" name="fake" value="yes">Preview</button>` +
|
||||
`</label></form></div></post><div>`
|
||||
}
|
||||
else if (!fake)
|
||||
ret += `<a href="/comment/${postid}/${id}">[Reply]</a> </div>`
|
||||
else
|
||||
ret += '</div>'
|
||||
}
|
||||
else if (!fake)
|
||||
ret += `<a href="/post/${id}">[Open]</a></div>`
|
||||
else
|
||||
ret += '</div>'
|
||||
ret += '</div>'
|
||||
for(let i = post.comments.length - 1; i >= 0; i--) {
|
||||
const pid = id
|
||||
|
|
Loading…
Add table
Reference in a new issue