{Post,Thread}::callbacks => {Post,Thread}.callbacks

This commit is contained in:
Mayhem 2013-10-02 11:38:15 +02:00
parent 1bd09b2270
commit 10e93091d7
37 changed files with 40 additions and 40 deletions

View File

@ -64,7 +64,7 @@ Filter =
delete @filters[key]
return unless Object.keys(@filters).length
Post::callbacks.push
Post.callbacks.push
name: 'Filter'
cb: @node

View File

@ -3,7 +3,7 @@ PostHiding =
return if g.VIEW is 'catalog' or !Conf['Reply Hiding'] and !Conf['Reply Hiding Link']
@db = new DataBoard 'hiddenPosts'
Post::callbacks.push
Post.callbacks.push
name: 'Reply Hiding'
cb: @node

View File

@ -3,7 +3,7 @@ Recursive =
init: ->
return if g.VIEW is 'catalog'
Post::callbacks.push
Post.callbacks.push
name: 'Recursive'
cb: @node

View File

@ -4,7 +4,7 @@ ThreadHiding =
@db = new DataBoard 'hiddenThreads'
@syncCatalog()
Thread::callbacks.push
Thread.callbacks.push
name: 'Thread Hiding'
cb: @node

View File

@ -206,7 +206,7 @@ Main =
callbackNodes: (klass, nodes) ->
# get the nodes' length only once
len = nodes.length
for callback in klass::callbacks
for callback in klass.callbacks
# c.profile callback.name
for i in [0...len] by 1
node = nodes[i]
@ -233,7 +233,7 @@ Main =
else
return
obj.callback.isAddon = true
Klass::callbacks.push obj.callback
Klass.callbacks.push obj.callback
handleErrors: (errors) ->
unless errors instanceof Array

View File

@ -1,5 +1,5 @@
class Post
callbacks: []
@callbacks = []
toString: -> @ID
constructor: (root, @thread, @board, that={}) ->

View File

@ -1,5 +1,5 @@
class Thread
callbacks: []
@callbacks = []
toString: -> @ID
constructor: (@ID, @board) ->

View File

@ -2,7 +2,7 @@ AutoGIF =
init: ->
return if g.VIEW is 'catalog' or !Conf['Auto-GIF'] or g.BOARD.ID in ['gif', 'wsg']
Post::callbacks.push
Post.callbacks.push
name: 'Auto-GIF'
cb: @node
node: ->

View File

@ -9,7 +9,7 @@ ImageExpand =
$.on @EAI, 'click', ImageExpand.cb.toggleAll
Header.addShortcut @EAI, 2
Post::callbacks.push
Post.callbacks.push
name: 'Image Expansion'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ ImageHover =
init: ->
return if g.VIEW is 'catalog' or !Conf['Image Hover']
Post::callbacks.push
Post.callbacks.push
name: 'Image Hover'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ RevealSpoilers =
init: ->
return if g.VIEW is 'catalog' or !Conf['Reveal Spoilers']
Post::callbacks.push
Post.callbacks.push
name: 'Reveal Spoilers'
cb: @node
node: ->

View File

@ -11,7 +11,7 @@ Sauce =
return unless links.length
@links = links
@link = $.el 'a', target: '_blank'
Post::callbacks.push
Post.callbacks.push
name: 'Sauce'
cb: @node
createSauceLink: (link) ->

View File

@ -39,7 +39,7 @@ Linkify =
)
///g
Post::callbacks.push
Post.callbacks.push
name: 'Linkify'
cb: @node

View File

@ -3,7 +3,7 @@ Menu =
return if g.VIEW is 'catalog' or !Conf['Menu']
@menu = new UI.Menu 'post'
Post::callbacks.push
Post.callbacks.push
name: 'Menu'
cb: @node

View File

@ -2,7 +2,7 @@ Anonymize =
init: ->
return if g.VIEW is 'catalog' or !Conf['Anonymize']
Post::callbacks.push
Post.callbacks.push
name: 'Anonymize'
cb: @node
node: ->

View File

@ -1,7 +1,7 @@
Dice =
init: ->
return if g.BOARD.ID isnt 'tg' or g.VIEW is 'catalog' or !Conf['Show Dice Roll']
Post::callbacks.push
Post.callbacks.push
name: 'Show Dice Roll'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ ExpandComment =
init: ->
return if g.VIEW isnt 'index' or !Conf['Comment Expansion']
Post::callbacks.push
Post.callbacks.push
name: 'Comment Expansion'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ ExpandThread =
init: ->
return if g.VIEW isnt 'index' or !Conf['Thread Expansion']
Thread::callbacks.push
Thread.callbacks.push
name: 'Thread Expansion'
cb: @node
node: ->

View File

@ -3,7 +3,7 @@ FileInfo =
return if g.VIEW is 'catalog' or !Conf['File Info Formatting']
@funk = @createFunc Conf['fileInfo']
Post::callbacks.push
Post.callbacks.push
name: 'File Info Formatting'
cb: @node
node: ->

View File

@ -10,7 +10,7 @@ Fourchan =
pre.innerHTML = prettyPrintOne(pre.innerHTML);
}, false);
"""
Post::callbacks.push
Post.callbacks.push
name: 'Parse /g/ code'
cb: @code
if board is 'sci'
@ -27,7 +27,7 @@ Fourchan =
}
}, false);
"""
Post::callbacks.push
Post.callbacks.push
name: 'Parse /sci/ math'
cb: @math
code: ->

View File

@ -3,7 +3,7 @@ IDColor =
return if g.VIEW is 'catalog' or !Conf['Color User IDs']
@ids = {}
Post::callbacks.push
Post.callbacks.push
name: 'Color User IDs'
cb: @node

View File

@ -9,7 +9,7 @@ RelativeDates =
# Start the timeout.
@flush()
Post::callbacks.push
Post.callbacks.push
name: 'Relative Post Dates'
cb: @node
node: ->

View File

@ -3,7 +3,7 @@ Time =
return if g.VIEW is 'catalog' or !Conf['Time Formatting']
@funk = @createFunc Conf['time']
Post::callbacks.push
Post.callbacks.push
name: 'Time Formatting'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ ThreadExcerpt =
init: ->
return if g.VIEW isnt 'thread' or !Conf['Thread Excerpt']
Thread::callbacks.push
Thread.callbacks.push
name: 'Thread Excerpt'
cb: @node
node: ->

View File

@ -9,7 +9,7 @@ ThreadStats =
@fileCountEl = $ '#file-count', @dialog
@pageCountEl = $ '#page-count', @dialog
Thread::callbacks.push
Thread.callbacks.push
name: 'Thread Stats'
cb: @node
node: ->

View File

@ -16,7 +16,7 @@ ThreadUpdater =
@status = $ '#update-status', @dialog
@isUpdating = Conf['Auto Update']
Thread::callbacks.push
Thread.callbacks.push
name: 'Thread Updater'
cb: @node

View File

@ -19,7 +19,7 @@ ThreadWatcher =
ThreadWatcher.fetchAllStatus()
@db.save()
Thread::callbacks.push
Thread.callbacks.push
name: 'Thread Watcher'
cb: @node
node: ->

View File

@ -8,7 +8,7 @@ Unread =
@posts = []
@postsQuotingYou = []
Thread::callbacks.push
Thread.callbacks.push
name: 'Unread'
cb: @node

View File

@ -9,7 +9,7 @@ QR =
$.on d, '4chanXInitFinished', @initReady
Post::callbacks.push
Post.callbacks.push
name: 'Quick Reply'
cb: @node

View File

@ -16,10 +16,10 @@ QuoteBacklink =
format = Conf['backlink'].replace /%id/g, "' + id + '"
@funk = Function 'id', "return '#{format}'"
@containers = {}
Post::callbacks.push
Post.callbacks.push
name: 'Quote Backlinking Part 1'
cb: @firstNode
Post::callbacks.push
Post.callbacks.push
name: 'Quote Backlinking Part 2'
cb: @secondNode
firstNode: ->

View File

@ -4,7 +4,7 @@ QuoteCT =
# \u00A0 is nbsp
@text = '\u00A0(Cross-thread)'
Post::callbacks.push
Post.callbacks.push
name: 'Mark Cross-thread Quotes'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ QuoteInline =
init: ->
return if g.VIEW is 'catalog' or !Conf['Quote Inlining']
Post::callbacks.push
Post.callbacks.push
name: 'Quote Inlining'
cb: @node
node: ->

View File

@ -4,7 +4,7 @@ QuoteOP =
# \u00A0 is nbsp
@text = '\u00A0(OP)'
Post::callbacks.push
Post.callbacks.push
name: 'Mark OP Quotes'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ QuotePreview =
init: ->
return if g.VIEW is 'catalog' or !Conf['Quote Previewing']
Post::callbacks.push
Post.callbacks.push
name: 'Quote Previewing'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ QuoteStrikeThrough =
init: ->
return if g.VIEW is 'catalog' or !Conf['Reply Hiding'] and !Conf['Reply Hiding Link'] and !Conf['Filter']
Post::callbacks.push
Post.callbacks.push
name: 'Strike-through Quotes'
cb: @node

View File

@ -4,7 +4,7 @@ QuoteYou =
# \u00A0 is nbsp
@text = '\u00A0(You)'
Post::callbacks.push
Post.callbacks.push
name: 'Mark Quotes of You'
cb: @node
node: ->

View File

@ -2,7 +2,7 @@ Quotify =
init: ->
return if g.VIEW is 'catalog' or !Conf['Resurrect Quotes']
Post::callbacks.push
Post.callbacks.push
name: 'Resurrect Quotes'
cb: @node
node: ->