remove "+x earlier", bugfixes and expanding omitted appearance tweaks

indiachan-spamvector v0.6.1
Thomas Lynch 2 years ago
parent f3daa8e352
commit e92e27bd40
  1. 3
      gulp/res/css/style.css
  2. BIN
      gulp/res/img/minus.png
  3. BIN
      gulp/res/img/plus.png
  4. 2
      gulp/res/js/live.js
  5. 13
      gulp/res/js/omitted.js
  6. 3
      views/mixins/post.pug

@ -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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 554 B

@ -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;
}

@ -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);
}

@ -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

Loading…
Cancel
Save