Update code related to hidden threads.
This commit is contained in:
parent
0ea3c733a4
commit
498dfda2ef
@ -243,10 +243,8 @@ Build =
|
||||
Build.spoilerRange[board] = data.custom_spoiler
|
||||
|
||||
if (OP = board.posts[data.no]) and root = OP.nodes.root.parentNode
|
||||
for node in $$ '.thread > :not(.stub):not(.opContainer)', root
|
||||
$.rm node
|
||||
if OP.thread.stub and stub = OP.thread.stub.firstElementChild.lastChild
|
||||
stub.textContent = stub.textContent.replace /\d+ rep\w+/, "#{data.replies} repl#{if data.replies is 1 then 'y' else 'ies'}"
|
||||
$.rmAll root
|
||||
$.add root, OP.nodes.root
|
||||
else
|
||||
root = $.el 'div',
|
||||
className: 'thread'
|
||||
|
||||
@ -18,7 +18,7 @@ Config =
|
||||
'Anonymize': [false, 'Make everyone Anonymous.']
|
||||
'Filter': [true, 'Self-moderation placebo.']
|
||||
'Post Hiding': [true, 'Add buttons to hide threads and replies.']
|
||||
'Stubs': [true, 'Show stubs of hidden threads and replies.']
|
||||
'Stubs': [true, 'Show stubs of hidden posts.']
|
||||
'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.']
|
||||
'Images':
|
||||
'Auto-GIF': [false, 'Animate GIF thumbnails (disabled on /gif/, /wsg/).']
|
||||
|
||||
@ -232,6 +232,6 @@ Get =
|
||||
thread = g.threads["#{boardID}.#{threadID}"] or
|
||||
new Thread threadID, board
|
||||
post = new Post Build.post(o, true), thread, board, {isArchived: true}
|
||||
$('.page-num', post.nodes.info).hidden = true unless post.isReply
|
||||
$('.page-num', post.nodes.info)?.hidden = true
|
||||
Main.callbackNodes Post, [post]
|
||||
Get.insert post, root, context
|
||||
|
||||
@ -43,7 +43,7 @@ ImageExpand =
|
||||
for post in [post].concat post.clones
|
||||
{file} = post
|
||||
continue unless file and file.isImage and doc.contains post.nodes.root
|
||||
if ImageExpand.on and
|
||||
if ImageExpand.on and !post.isHidden and
|
||||
(!Conf['Expand spoilers'] and file.isSpoiler or
|
||||
Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0)
|
||||
continue
|
||||
@ -76,7 +76,7 @@ ImageExpand =
|
||||
expand: (post, src) ->
|
||||
# Do not expand images of hidden/filtered replies, or already expanded pictures.
|
||||
{thumb} = post.file
|
||||
return if post.isHidden or post.file.isExpanded or $.hasClass thumb, 'expanding'
|
||||
return if post.file.isExpanded or $.hasClass thumb, 'expanding'
|
||||
$.addClass thumb, 'expanding'
|
||||
if post.file.fullImage
|
||||
# Expand already-loaded/ing picture.
|
||||
|
||||
@ -38,8 +38,6 @@ Nav =
|
||||
|
||||
getThread: ->
|
||||
for threadRoot in $$ '.thread'
|
||||
thread = Get.threadFromRoot threadRoot
|
||||
continue if thread.isHidden and !thread.stub
|
||||
if Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height # not scrolled past
|
||||
return threadRoot
|
||||
return $ '.board'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user