Add nascent version of the mod detail page

* Create a nascent version of the mod detail page
* Make the slug mandatory for Mod instead of name, and load the name
  from the data file
* Make the Feedback view universal on all pages
* Refactor the use of mod pack to have a single global object at the
  router level which is shared between pages. Further, make this one
  object load itself immediately and have it automatically load any
  activated mod version
* Refactor the use of Storage related to mod pack versions into the
  router as well.
* Add trace logging back in for events, but allow individual classes
  to suppress it (as opposed to actually supressing the events)
* Fix a bug in ModVersion.eachItem where it would suggest so-called
  items which are merely registered slugs without associated items
This commit is contained in:
Andrew Miner
2015-01-20 10:55:38 -08:00
parent d33723b3c2
commit 164c0d4892
25 changed files with 151 additions and 26 deletions
+7
View File
@@ -13,6 +13,7 @@ All rights reserved.
module.exports = class BaseModel extends Backbone.Model
constructor: (attributes={}, options={})->
options.logEvents ?= true
super attributes, options
makeGetter = (name)-> return -> @get name
@@ -21,6 +22,7 @@ module.exports = class BaseModel extends Backbone.Model
continue if name is 'id'
Object.defineProperty this, name, get:makeGetter(name), set:makeSetter(name)
@logEvents = options.logEvents or false
@state = ModelState.unloaded
@on 'request', => @state = ModelState.loading
@@ -77,6 +79,11 @@ module.exports = class BaseModel extends Backbone.Model
sync: (method, model)->
throw new Error "#{@constructor.name}.#{@cid} is not permitted to #{method}"
trigger: (name, model, args...)->
if @logEvents
logger.trace "#{@constructor.name}.#{@cid} triggered event #{name} with args: #{args}"
super
# Object Overrides #############################################################################
toString: ->