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