1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-03 23:56:22 -07:00

Add post dropdowns to loaded posts

This commit is contained in:
Eggbertx 2022-08-04 16:35:45 -07:00
parent d0a889b369
commit 697e9f9e0e
3 changed files with 7 additions and 8 deletions

View file

@ -137,8 +137,9 @@ function createPostElement(post, boardDir, elementClass = "inlinepostprev") {
" ", " ",
$("<a/>") $("<a/>")
.prop({ .prop({
class: "backlink-click",
href: `javascript:quote(${post.no})` href: `javascript:quote(${post.no})`
}).text(post.no), }).text(post.no), "<br/>",
); );
let $postInfo = $post.find("label.post-info"); let $postInfo = $post.find("label.post-info");
let postName = (post.name == "" && post.trip == "")?"Anonymous":post.name; let postName = (post.name == "" && post.trip == "")?"Anonymous":post.name;
@ -193,11 +194,11 @@ function createPostElement(post, boardDir, elementClass = "inlinepostprev") {
); );
} }
$post.append( $post.append(
"<br/>",
$("<div/>").prop({ $("<div/>").prop({
class: "post-text" class: "post-text"
}).html(post.com) }).html(post.com)
) )
addPostDropdown($post);
return $post; return $post;
} }
@ -413,7 +414,7 @@ export function addPostDropdown($post) {
if($post.find("select.post-actions").length > 0) if($post.find("select.post-actions").length > 0)
return $post; return $post;
let $postInfo = $post.find("label.post-info"); let $postInfo = $post.find("label.post-info");
let isOP = $postInfo.parents("div.reply-container").length == 0; let isOP = $post.prop("class").split(" ").indexOf("op-post") > -1; // $postInfo.parents("div.reply-container").length == 0;
let hasUpload = $postInfo.siblings("div.file-info").length > 0; let hasUpload = $postInfo.siblings("div.file-info").length > 0;
let postID = $postInfo.parent().attr("id"); let postID = $postInfo.parent().attr("id");
let threadPost = isOP?"thread":"post"; let threadPost = isOP?"thread":"post";
@ -545,8 +546,6 @@ $(() => {
if(pageThread.op < 1) return; // not in a thread if(pageThread.op < 1) return; // not in a thread
threadWatcherInterval = setInterval(() => { threadWatcherInterval = setInterval(() => {
updateThreadJSON().then(updateThreadHTML).catch(e => { updateThreadJSON().then(updateThreadHTML);
console.error(`Error updating current thread: ${e}`);
});
}, getNumberStorageVal("watcherseconds", 10) * 1000); }, getNumberStorageVal("watcherseconds", 10) * 1000);
}) })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long