4chan-x/src/classes/CatalogThreadNative.coffee
2019-08-03 00:23:08 -07:00

13 lines
433 B
CoffeeScript

class CatalogThreadNative
toString: -> @ID
constructor: (root) ->
@nodes =
root: root
thumb: $(g.SITE.selectors.catalog.thumb, root)
@siteID = g.SITE.ID
@boardID = @nodes.thumb.parentNode.pathname.split(/\/+/)[1]
@board = g.boards[@boardID] or new Board(@boardID)
@ID = @threadID = +(root.dataset.id or root.id).match(/\d*$/)[0]
@thread = @board.threads.get(@ID) or new Thread(@ID, @board)