Simpler code for stubs.
This commit is contained in:
parent
785f5b39dc
commit
463947820f
@ -153,6 +153,12 @@ class Post
|
|||||||
$.rmClass node, 'desktop'
|
$.rmClass node, 'desktop'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
getNameBlock: ->
|
||||||
|
if Conf['Anonymize']
|
||||||
|
'Anonymous'
|
||||||
|
else
|
||||||
|
$('.nameBlock', @nodes.info).textContent.trim()
|
||||||
|
|
||||||
hide: (label, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) ->
|
hide: (label, makeStub=Conf['Stubs'], hideRecursively=Conf['Recursive Hiding']) ->
|
||||||
@labels.push label unless label in @labels
|
@labels.push label unless label in @labels
|
||||||
return if @isHidden
|
return if @isHidden
|
||||||
@ -174,11 +180,7 @@ class Post
|
|||||||
return
|
return
|
||||||
|
|
||||||
a = PostHiding.makeButton false
|
a = PostHiding.makeButton false
|
||||||
postInfo = if Conf['Anonymize']
|
$.add a, $.tn " #{@getNameBlock()}"
|
||||||
'Anonymous'
|
|
||||||
else
|
|
||||||
$('.nameBlock', @nodes.info).textContent.trim()
|
|
||||||
$.add a, $.tn " #{postInfo}"
|
|
||||||
@nodes.stub = $.el 'div',
|
@nodes.stub = $.el 'div',
|
||||||
className: 'stub'
|
className: 'stub'
|
||||||
$.add @nodes.stub, a
|
$.add @nodes.stub, a
|
||||||
|
|||||||
@ -73,18 +73,13 @@ class Thread
|
|||||||
root.hidden = true
|
root.hidden = true
|
||||||
return
|
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',
|
@stub = $.el 'div',
|
||||||
className: 'stub'
|
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']
|
$.add @stub, Menu.makeButton() if Conf['Menu']
|
||||||
$.prepend root, @stub
|
$.prepend root, @stub
|
||||||
show: ->
|
show: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user