Namespace views.gameLog
Game log and box score viewing for all seasons and teams.
Defined in: <js/views/gameLog.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
views.gameLog.boxScore(gid, cb)
Generate a box score.
|
<static> |
views.gameLog.gameLogList(abbrev, season, gid, prevMaxGid, cb)
Generate a game log list.
|
<static> |
views.gameLog.get(req)
Respond to GET requests for the game log.
|
<static> |
views.gameLog.update(abbrev, season, gid, updateEvent, cb)
Update the game log view, as necessary.
|
<static> |
views.gameLog.updateBoxScore(gid, cb)
Update the displayed box score, as necessary.
|
<static> |
views.gameLog.updateGameLogList(abbrev, season, gid, updateEvent, cb)
Update the game log list, as necessary.
|
Method Detail
<static>
views.gameLog.boxScore(gid, cb)
Generate a box score.
- Parameters:
- {number} gid
- Integer game ID for the box score (a negative number means no box score).
- {function(string)} cb
- Callback whose argument is a string of HTML containing either the box score or a placeholder.
<static>
views.gameLog.gameLogList(abbrev, season, gid, prevMaxGid, cb)
Generate a game log list.
- Parameters:
- {string} abbrev
- Abbrev of the team for the list of games.
- {number} season
- Season for the list of games.
- {number} gid
- Integer game ID for the box score (a negative number means no box score), which is used only for highlighting the relevant entry in the list.
- {number} prevMaxGid
- Integer game ID for the previous most recent entry in the list. Only games with larger IDs will be returned, so set to -1 to return all games.
- {function()} cb
- Callback.
<static>
views.gameLog.get(req)
Respond to GET requests for the game log.
- Parameters:
- {Object} req
- Davis.js request object.
<static>
views.gameLog.update(abbrev, season, gid, updateEvent, cb)
Update the game log view, as necessary.
If the game log view is not loaded yet, this will load it.
- Parameters:
- {string} abbrev
- Abbrev of the team for the list of games.
- {number} season
- Season for the list of games.
- {number} gid
- Integer game ID for the box score (a negative number means no box score).
- {string} updateEvent
- Information about what caused this update, e.g. "gameSim" or "newPhase". Empty on normal page loads (i.e. from clicking a link).
- {function()=} cb
- Optional callback.
<static>
views.gameLog.updateBoxScore(gid, cb)
Update the displayed box score, as necessary.
If the box score is already loaded, nothing is done.
- Parameters:
- {number} gid
- Integer game ID for the box score (a negative number means no box score).
- {function()} cb
- Callback.
<static>
views.gameLog.updateGameLogList(abbrev, season, gid, updateEvent, cb)
Update the game log list, as necessary.
If the game log list is already loaded, nothing is done. If the game log list is loaded and a new game has been played, update. If the game log list is not loaded, load it.
- Parameters:
- {string} abbrev
- Abbrev of the team for the list of games.
- {number} season
- Season for the list of games.
- {number} gid
- Integer game ID for the box score (a negative number means no box score), which is used only for highlighting the relevant entry in the list.
- {string} updateEvent
- Information about what caused this update, e.g. "gameSim" or "newPhase". Empty on normal page loads (i.e. from clicking a link).
- {function()} cb
- Callback.