2014-07-25 16:06:04 -04:00
|
|
|
#RootView = require 'views/kinds/RootView'
|
|
|
|
CocoView = require 'views/kinds/CocoView'
|
2014-07-07 13:10:32 -04:00
|
|
|
template = require 'templates/docs/components'
|
|
|
|
CocoCollection = require 'collections/CocoCollection'
|
|
|
|
LevelComponent = require 'models/LevelComponent'
|
|
|
|
|
|
|
|
class ComponentDocsCollection extends CocoCollection
|
2014-07-20 19:23:01 -04:00
|
|
|
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
|
2014-07-07 13:10:32 -04:00
|
|
|
model: LevelComponent
|
|
|
|
|
2014-07-25 16:06:04 -04:00
|
|
|
module.exports = class ComponentDocumentationView extends CocoView
|
2014-07-07 13:10:32 -04:00
|
|
|
id: 'docs-components-view'
|
|
|
|
template: template
|
2014-07-25 16:06:04 -04:00
|
|
|
className: 'tab-pane'
|
2014-07-07 13:10:32 -04:00
|
|
|
|
|
|
|
constructor: (options) ->
|
|
|
|
super(options)
|
|
|
|
@componentDocs = new ComponentDocsCollection()
|
|
|
|
@supermodel.loadCollection @componentDocs, 'components'
|
2014-07-25 15:48:13 -04:00
|
|
|
|
2014-07-07 13:10:32 -04:00
|
|
|
getRenderData: ->
|
|
|
|
c = super()
|
|
|
|
c.components = @componentDocs.models
|
2014-07-14 14:18:17 -04:00
|
|
|
c.marked = marked
|
2014-08-11 14:04:38 -04:00
|
|
|
c.codeLanguage = me.get('aceConfig')?.language ? 'javascript'
|
|
|
|
c
|