2014-07-07 13:10:32 -04:00
|
|
|
RootView = require 'views/kinds/RootView'
|
|
|
|
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
|
|
|
|
|
|
|
|
module.exports = class UnnamedView extends RootView
|
|
|
|
id: 'docs-components-view'
|
|
|
|
template: template
|
|
|
|
|
|
|
|
constructor: (options) ->
|
|
|
|
super(options)
|
|
|
|
@componentDocs = new ComponentDocsCollection()
|
|
|
|
@supermodel.loadCollection @componentDocs, 'components'
|
|
|
|
|
|
|
|
onLoaded: ->
|
|
|
|
console.log 'we have the components...', (c.get('name') for c in @componentDocs.models)
|
2014-07-09 16:01:53 -04:00
|
|
|
console.log 'we have the attributes...', (c.attributes for c in @componentDocs.models)
|
2014-07-16 20:19:09 -04:00
|
|
|
if (me.get('aceConfig')?.language?) is false
|
|
|
|
console.log 'default language javascript'
|
|
|
|
else
|
|
|
|
console.log 'language is =', me.get('aceConfig').language
|
|
|
|
|
|
|
|
#console.log 'test', @componentDocs.models[99].attributes.propertyDocumentation[1].description['python']
|
2014-07-07 13:10:32 -04:00
|
|
|
super()
|
|
|
|
|
|
|
|
getRenderData: ->
|
|
|
|
c = super()
|
|
|
|
c.components = @componentDocs.models
|
2014-07-14 14:18:17 -04:00
|
|
|
c.marked = marked
|
2014-07-16 20:19:09 -04:00
|
|
|
if (me.get('aceConfig')?.language?) is false
|
|
|
|
c.language = 'javascript'
|
|
|
|
else
|
2014-07-17 12:12:26 -04:00
|
|
|
c.language = me.get('aceConfig').language
|
2014-07-07 13:10:32 -04:00
|
|
|
c
|