From 28b8f6106eadf5c94d79509df7a311b9dfe529c2 Mon Sep 17 00:00:00 2001 From: Choom Date: Sun, 18 Dec 2022 05:29:23 -0300 Subject: Fix autorefresh --- cgi/templates/board.html | 3 +- cgi/templates/board.jp.html | 3 +- static/css/ib.css | 8 +++- static/js/autorefresh.js | 110 ++++++++++++++++++-------------------------- 4 files changed, 55 insertions(+), 69 deletions(-) diff --git a/cgi/templates/board.html b/cgi/templates/board.html index ab867d4..778fb31 100644 --- a/cgi/templates/board.html +++ b/cgi/templates/board.html @@ -256,7 +256,8 @@ -
+ +

+ +

"; + } } else { + var s_msg = ''; if (post.file) { if (post.image_width != 0) { s_img = @@ -199,7 +174,6 @@ function updateThread(posts, total_replies, serverTime) { post.message + ""; } else { - s_img = ""; s_msg = "
" + post.message + "
"; } if (post.IS_DELETED == 0) { @@ -234,8 +208,14 @@ function updateThread(posts, total_replies, serverTime) { } } - thread_div.insertBefore(div, last_elem); - thread_div.setAttribute("data-length", num); + if (serviceType == 2) { + repliesDiv.appendChild(div); + } else { + threadDiv.appendChild(div); + } + + threadDiv.setAttribute("data-length", num); + if (serviceType == 2) document .getElementsByTagName("h3")[0] -- cgit v1.2.1-18-gbd029