diff --git a/gulp/res/css/style.css b/gulp/res/css/style.css index 9413d721..d539c8a7 100644 --- a/gulp/res/css/style.css +++ b/gulp/res/css/style.css @@ -204,6 +204,9 @@ pre { content: "Settings"; } .expand-omitted { + background-color: var(--post-color); + border: 1px solid var(--font-color); + border-radius: 2px; vertical-align: bottom; margin-right: 5px; } diff --git a/gulp/res/img/minus.png b/gulp/res/img/minus.png index 95d1eb24..3732f92e 100644 Binary files a/gulp/res/img/minus.png and b/gulp/res/img/minus.png differ diff --git a/gulp/res/img/plus.png b/gulp/res/img/plus.png index c7bceeae..21097c73 100644 Binary files a/gulp/res/img/plus.png and b/gulp/res/img/plus.png differ diff --git a/gulp/res/js/live.js b/gulp/res/js/live.js index b9c4c8b1..dcd59cee 100644 --- a/gulp/res/js/live.js +++ b/gulp/res/js/live.js @@ -113,7 +113,7 @@ window.addEventListener('settingsReady', function(event) { //after domcontentloa quotedPostData.appendChild(newRepliesDiv); replies = newRepliesDiv; } - if (new RegExp(`>>${postData.postId}(\s|$)`).test(replies.innerText)) { + if (new RegExp(`>>${postData.postId}(\\s|$)`).test(replies.innerText)) { //reply link already exists (probably from a late catch up) continue; } diff --git a/gulp/res/js/omitted.js b/gulp/res/js/omitted.js index bf188d29..392eb799 100644 --- a/gulp/res/js/omitted.js +++ b/gulp/res/js/omitted.js @@ -5,7 +5,8 @@ window.addEventListener('DOMContentLoaded', () => { const hideOmitted = (e) => { e.target.nextSibling.style.display = 'unset'; const thread = e.target.closest('.thread'); - let replies = Array.from(thread.querySelectorAll('.post-container:not(.op)')); + const posts = Array.from(thread.querySelectorAll('.post-container')); + let replies = posts.slice(1); if (e.target.dataset.shown > 0) { replies = replies.slice(0, -parseInt(e.target.dataset.shown)); } @@ -52,7 +53,7 @@ window.addEventListener('DOMContentLoaded', () => { if (json) { setLocalStorage(`hovercache-${jsonPath}`, JSON.stringify(json)); hoverCacheList.value = Object.keys(localStorage).filter(k => k.startsWith('hovercache')); - replies = json.replies; + replies = [...json.replies]; } else { return localStorage.removeItem(`hovercache-${jsonPath}`); //thread deleted } @@ -60,10 +61,16 @@ window.addEventListener('DOMContentLoaded', () => { if (!replies) { return; } + const opReplies = parentPost.querySelector('.replies'); + if (opReplies && opReplies.innerText.includes('+')) { + const earlierLink = opReplies.lastElementChild; + earlierLink.previousSibling.remove(); + earlierLink.remove(); + } + replies = replies.reverse(); e.target.nextSibling.style.display = 'none'; e.target.src = '/file/minus.png'; e.target.dataset.open = true; - replies = replies.reverse(); if (firstPreviewReply) { replies = replies.filter(r => r.postId < firstPreviewReply.dataset.postId); } diff --git a/views/mixins/post.pug b/views/mixins/post.pug index 51936e7b..618ee72e 100644 --- a/views/mixins/post.pug +++ b/views/mixins/post.pug @@ -158,7 +158,7 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false, overboar | Message too long. #[a.viewfulltext(href=`${postURL}#${post.postId}`) View the full text] if post.omittedposts || post.omittedfiles div.cb.mt-5.ml-5 - img.jsonly.dummy-link.expand-omitted(height='18' width='18' data-shown=post.replies.length data-board=post.board data-thread=post.postId src='/file/plus.png') + img.jsonly.dummy-link.expand-omitted(height='12' width='12' data-shown=post.replies.length data-board=post.board data-thread=post.postId src='/file/plus.png') - const ompo = post.omittedposts; - const omfi = post.omittedfiles; span @@ -174,6 +174,7 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false, overboar if post.previewbacklinks.length < post.backlinks.length - const ombls = post.backlinks.length-post.previewbacklinks.length; | + #[a(href=`${postURL}#${post.postId}`) #{ombls} earlier] + | else if post.backlinks && post.backlinks.length > 0 div.replies.mt-5.ml-5 Replies: each backlink in post.backlinks