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
|
Build.spoilerRange[board] = data.custom_spoiler
|
||||||
|
|
||||||
if (OP = board.posts[data.no]) and root = OP.nodes.root.parentNode
|
if (OP = board.posts[data.no]) and root = OP.nodes.root.parentNode
|
||||||
for node in $$ '.thread > :not(.stub):not(.opContainer)', root
|
$.rmAll root
|
||||||
$.rm node
|
$.add root, OP.nodes.root
|
||||||
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'}"
|
|
||||||
else
|
else
|
||||||
root = $.el 'div',
|
root = $.el 'div',
|
||||||
className: 'thread'
|
className: 'thread'
|
||||||
|
|||||||
@ -18,7 +18,7 @@ Config =
|
|||||||
'Anonymize': [false, 'Make everyone Anonymous.']
|
'Anonymize': [false, 'Make everyone Anonymous.']
|
||||||
'Filter': [true, 'Self-moderation placebo.']
|
'Filter': [true, 'Self-moderation placebo.']
|
||||||
'Post Hiding': [true, 'Add buttons to hide threads and replies.']
|
'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.']
|
'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.']
|
||||||
'Images':
|
'Images':
|
||||||
'Auto-GIF': [false, 'Animate GIF thumbnails (disabled on /gif/, /wsg/).']
|
'Auto-GIF': [false, 'Animate GIF thumbnails (disabled on /gif/, /wsg/).']
|
||||||
|
|||||||
@ -232,6 +232,6 @@ Get =
|
|||||||
thread = g.threads["#{boardID}.#{threadID}"] or
|
thread = g.threads["#{boardID}.#{threadID}"] or
|
||||||
new Thread threadID, board
|
new Thread threadID, board
|
||||||
post = new Post Build.post(o, true), thread, board, {isArchived: true}
|
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]
|
Main.callbackNodes Post, [post]
|
||||||
Get.insert post, root, context
|
Get.insert post, root, context
|
||||||
|
|||||||
@ -43,7 +43,7 @@ ImageExpand =
|
|||||||
for post in [post].concat post.clones
|
for post in [post].concat post.clones
|
||||||
{file} = post
|
{file} = post
|
||||||
continue unless file and file.isImage and doc.contains post.nodes.root
|
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 spoilers'] and file.isSpoiler or
|
||||||
Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0)
|
Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0)
|
||||||
continue
|
continue
|
||||||
@ -76,7 +76,7 @@ ImageExpand =
|
|||||||
expand: (post, src) ->
|
expand: (post, src) ->
|
||||||
# Do not expand images of hidden/filtered replies, or already expanded pictures.
|
# Do not expand images of hidden/filtered replies, or already expanded pictures.
|
||||||
{thumb} = post.file
|
{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'
|
$.addClass thumb, 'expanding'
|
||||||
if post.file.fullImage
|
if post.file.fullImage
|
||||||
# Expand already-loaded/ing picture.
|
# Expand already-loaded/ing picture.
|
||||||
|
|||||||
@ -38,8 +38,6 @@ Nav =
|
|||||||
|
|
||||||
getThread: ->
|
getThread: ->
|
||||||
for threadRoot in $$ '.thread'
|
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
|
if Header.getTopOf(threadRoot) >= -threadRoot.getBoundingClientRect().height # not scrolled past
|
||||||
return threadRoot
|
return threadRoot
|
||||||
return $ '.board'
|
return $ '.board'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user