Simpler code for stubs.
This commit is contained in:
parent
785f5b39dc
commit
463947820f
@ -153,6 +153,12 @@ class Post
|
||||
$.rmClass node, 'desktop'
|
||||
return
|
||||
|
||||
getNameBlock: ->
|
||||
if Conf['Anonymize']
|
||||
'Anonymous'
|
||||
else
|
||||
$('.nameBlock', @nodes.info).textContent.trim()
|
||||
|
||||
hide: (label, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) ->
|
||||
@labels.push label unless label in @labels
|
||||
return if @isHidden
|
||||
@ -174,11 +180,7 @@ class Post
|
||||
return
|
||||
|
||||
a = PostHiding.makeButton false
|
||||
postInfo = if Conf['Anonymize']
|
||||
'Anonymous'
|
||||
else
|
||||
$('.nameBlock', @nodes.info).textContent.trim()
|
||||
$.add a, $.tn " #{postInfo}"
|
||||
$.add a, $.tn " #{@getNameBlock()}"
|
||||
@nodes.stub = $.el 'div',
|
||||
className: 'stub'
|
||||
$.add @nodes.stub, a
|
||||
|
||||
@ -73,18 +73,13 @@ class Thread
|
||||
root.hidden = true
|
||||
return
|
||||
|
||||
numReplies = $$('.thread > .replyContainer', root).length # Don't count clones.
|
||||
numReplies += +summary.textContent.match /\d+/ if summary = $ '.summary', root
|
||||
opInfo = if Conf['Anonymize']
|
||||
'Anonymous'
|
||||
else
|
||||
$('.nameBlock', @OP.nodes.info).textContent.trim()
|
||||
|
||||
a = PostHiding.makeButton false
|
||||
$.add a, $.tn " #{opInfo} (#{numReplies} repl#{if numReplies is 1 then 'y' else 'ies'})"
|
||||
@stub = $.el 'div',
|
||||
className: 'stub'
|
||||
$.add @stub, a
|
||||
{replies} = Index.liveThreadData[Index.liveThreadIDs.indexOf @ID]
|
||||
$.add @stub, [
|
||||
PostHiding.makeButton false
|
||||
$.tn " #{@OP.getNameBlock()} (#{replies} repl#{if replies is 1 then 'y' else 'ies'})"
|
||||
]
|
||||
$.add @stub, Menu.makeButton() if Conf['Menu']
|
||||
$.prepend root, @stub
|
||||
show: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user