Show files in replies on /f/.
This commit is contained in:
parent
df9e04f3ec
commit
910a71759e
@ -6,10 +6,10 @@ class Callbacks
|
|||||||
@keys.push name unless @[name]
|
@keys.push name unless @[name]
|
||||||
@[name] = cb
|
@[name] = cb
|
||||||
|
|
||||||
execute: (node) ->
|
execute: (node, keys=@keys) ->
|
||||||
for name in @keys
|
for name in keys
|
||||||
try
|
try
|
||||||
@[name].call node
|
@[name]?.call node
|
||||||
catch err
|
catch err
|
||||||
errors = [] unless errors
|
errors = [] unless errors
|
||||||
errors.push
|
errors.push
|
||||||
|
|||||||
@ -32,8 +32,7 @@ FappeTyme =
|
|||||||
cb: @catalogNode
|
cb: @catalogNode
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
return if @file
|
@nodes.root.classList.toggle 'noFile', !@file
|
||||||
$.addClass @nodes.root, "noFile"
|
|
||||||
|
|
||||||
catalogNode: ->
|
catalogNode: ->
|
||||||
{file} = @thread.OP
|
{file} = @thread.OP
|
||||||
|
|||||||
@ -81,6 +81,9 @@ ThreadUpdater =
|
|||||||
|
|
||||||
ThreadUpdater.setInterval()
|
ThreadUpdater.setInterval()
|
||||||
|
|
||||||
|
# Update immediately on /f/ to add files to replies.
|
||||||
|
ThreadUpdater.update() if @board.ID is 'f'
|
||||||
|
|
||||||
###
|
###
|
||||||
http://freesound.org/people/pierrecartoons1979/sounds/90112/
|
http://freesound.org/people/pierrecartoons1979/sounds/90112/
|
||||||
cc-by-nc-3.0
|
cc-by-nc-3.0
|
||||||
@ -270,6 +273,13 @@ ThreadUpdater =
|
|||||||
index.push ID
|
index.push ID
|
||||||
files.push ID if postObject.fsize
|
files.push ID if postObject.fsize
|
||||||
|
|
||||||
|
# Add files to replies on /f/.
|
||||||
|
if board.ID is 'f' and postObject.fsize and (post = thread.posts[ID]) and not post.file
|
||||||
|
node = Build.postFromObject postObject, board.ID
|
||||||
|
$.after post.nodes.info, $('.file', node)
|
||||||
|
post.parseFile()
|
||||||
|
Post.callbacks.execute post, ['Filter', 'File Info Formatting', 'Fappe Tyme', 'Sauce']
|
||||||
|
|
||||||
# Insert new posts, not older ones.
|
# Insert new posts, not older ones.
|
||||||
continue if ID <= lastPost
|
continue if ID <= lastPost
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user