Show files in replies on /f/.

This commit is contained in:
ccd0 2015-07-12 16:43:39 -07:00
parent df9e04f3ec
commit 910a71759e
3 changed files with 14 additions and 5 deletions

View File

@ -6,10 +6,10 @@ class Callbacks
@keys.push name unless @[name]
@[name] = cb
execute: (node) ->
for name in @keys
execute: (node, keys=@keys) ->
for name in keys
try
@[name].call node
@[name]?.call node
catch err
errors = [] unless errors
errors.push

View File

@ -32,8 +32,7 @@ FappeTyme =
cb: @catalogNode
node: ->
return if @file
$.addClass @nodes.root, "noFile"
@nodes.root.classList.toggle 'noFile', !@file
catalogNode: ->
{file} = @thread.OP

View File

@ -81,6 +81,9 @@ ThreadUpdater =
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/
cc-by-nc-3.0
@ -270,6 +273,13 @@ ThreadUpdater =
index.push ID
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.
continue if ID <= lastPost