codecombat/app/views/docs/ComponentDocumentationView.coffee
Darredevil b77b796cef Merge branch 'codecombat-master'
Conflicts:
	app/views/docs/ComponentDocumentationView.coffee
	app/views/editor/level/LevelEditView.coffee
2014-07-25 22:48:13 +03:00

38 lines
No EOL
1.3 KiB
CoffeeScript

RootView = require 'views/kinds/RootView'
template = require 'templates/docs/components'
CocoCollection = require 'collections/CocoCollection'
LevelComponent = require 'models/LevelComponent'
class ComponentDocsCollection extends CocoCollection
url: '/db/level.component?project=name,description,dependencies,propertyDocumentation,code'
model: LevelComponent
module.exports = class ComponentDocumentationView 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)
console.log 'we have the attributes...', (c.attributes for c in @componentDocs.models)
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']
super()
getRenderData: ->
c = super()
c.components = @componentDocs.models
c.marked = marked
if (me.get('aceConfig')?.language?) is false
c.language = 'javascript'
else
c.language = me.get('aceConfig').language
c