Add some convenience properties.
This commit is contained in:
parent
a650efe9ab
commit
64d1e5b21d
@ -2,6 +2,8 @@ class Board
|
||||
toString: -> @ID
|
||||
|
||||
constructor: (@ID) ->
|
||||
@boardID = @ID
|
||||
@siteID = g.SITE.ID
|
||||
@threads = new SimpleDict()
|
||||
@posts = new SimpleDict()
|
||||
@config = BoardConfig.boards?[@ID] or {}
|
||||
|
||||
@ -8,6 +8,7 @@ class Post
|
||||
|
||||
$.extend @, flags
|
||||
@ID = +root.id.match(/\d*$/)[0]
|
||||
@postID = @ID
|
||||
@threadID = @thread.ID
|
||||
@boardID = @board.ID
|
||||
@siteID = g.SITE.ID
|
||||
|
||||
@ -2,6 +2,9 @@ class Thread
|
||||
toString: -> @ID
|
||||
|
||||
constructor: (@ID, @board) ->
|
||||
@threadID = @ID
|
||||
@boardID = @board.ID
|
||||
@siteID = g.SITE.ID
|
||||
@fullID = "#{@board}.#{@ID}"
|
||||
@posts = new SimpleDict()
|
||||
@isDead = false
|
||||
|
||||
@ -37,5 +37,5 @@ Site =
|
||||
software = properties.software
|
||||
continue unless software and SW[software]
|
||||
g.sites[ID] = site = Object.create SW[software]
|
||||
$.extend site, {ID, properties, software}
|
||||
$.extend site, {ID, siteID: ID, properties, software}
|
||||
g.SITE = g.sites[hostname]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user