codecombat/app/templates/play/level/tome/spell_palette_entry_popover.jade

145 lines
4.2 KiB
Text
Raw Normal View History

h4
span.prop-name= doc.shortName
| -
code.prop-type= doc.type == 'function' && doc.owner == 'this' ? 'method' : doc.type
if doc.type != 'function'
2014-11-23 15:52:34 -05:00
| (
2014-07-15 22:25:53 -04:00
if writable
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.writable") writable
2014-07-15 22:25:53 -04:00
else
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.read_only") read-only
| )
.description
p!= marked(doc.description || 'Still undocumented, sorry.')
if cooldowns && (cooldowns.cooldown || cooldowns.specificCooldown)
p
span
2014-11-23 15:52:34 -05:00
| #{cooldowns.type == 'spell' ? 'Spell' : 'Action'}
span.spl(data-i18n="skill_docs.action_name") name
span.spr :
code "#{cooldowns.name}"
| .
span.spl
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.action_cooldown") Takes
span.spr :
code= cooldowns.cooldown
| s.
if cooldowns.specificCooldown
span.spl
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.action_specific_cooldown") Cooldown
span.spr :
code= cooldowns.specificCooldown
| s.
if cooldowns.damage
span.spl
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.action_damage") Damage
span.spr :
code= cooldowns.damage
| .
if cooldowns.range
span.spl
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.action_range") Range
span.spr :
code= cooldowns.range
| m.
if cooldowns.radius
span.spl
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.action_radius") Radius
span.spr :
code= cooldowns.radius
| m.
if cooldowns.duration
span.spl
2014-11-23 15:52:34 -05:00
span(data-i18n="skill_docs.action_duration") Duration
span.spr :
code= cooldowns.duration
| s.
2014-07-15 22:25:53 -04:00
if !selectedMethod
if doc.example
p.example
2014-11-23 15:52:34 -05:00
strong
span(data-i18n="skill_docs.example") Example
| :
.docs-ace-container
.docs-ace= doc.example
2014-07-15 22:25:53 -04:00
else if doc.type == 'function' && argumentExamples.length
p.example
2014-11-23 15:52:34 -05:00
strong
span(data-i18n="skill_docs.example") Example
| :
2014-07-15 22:25:53 -04:00
div
.docs-ace-container
.docs-ace
if language == 'javascript'
span= doc.owner + '.' + docName + '(' + argumentExamples.join(', ') + ');'
else if language == 'coffeescript'
span= doc.ownerName + (doc.ownerName == '@' ? '' : '.') + docName + ' ' + argumentExamples.join(', ')
else if language == 'python'
span= doc.ownerName + '.' + docName + '(' + argumentExamples.join(', ') + ')'
else if language == 'clojure'
span= '(.' + docName + ' ' + doc.ownerName + ' ' + argumentExamples.join(', ') + ')'
else if language == 'lua'
span= doc.ownerName + ':' + docName + '(' + argumentExamples.join(', ') + ')'
else if language == 'io'
span= (doc.ownerName == 'this' ? '' : doc.ownerName + ' ') + docName + '(' + argumentExamples.join(', ') + ')'
if (doc.type != 'function' && doc.type != 'snippet') || doc.name == 'now'
p.value
2014-11-23 15:52:34 -05:00
strong
span(data-i18n="skill_docs.current_value") Current Value
span.spr :
2014-02-13 14:18:20 -05:00
pre
code.current-value(data-prop=doc.name)= value
if doc.args && doc.args.length
p.args
2014-11-23 15:52:34 -05:00
strong
span(data-i18n="skill_docs.parameters") Parameters
span.spr :
for arg in doc.args
div
code= arg.name
2014-11-23 15:52:34 -05:00
span.spr :
code= arg.type
if arg.example
2014-11-23 15:52:34 -05:00
| (
span(data-i18n="skill_docs.ex") ex
span.spr :
code= arg.example
| )
if arg.description
div!= marked(arg.description)
if arg.default
div
2014-11-23 15:52:34 -05:00
em
span(data-i18n="skill_docs.default_value") Default value
span.spr :
code= arg.default
2014-11-23 15:52:34 -05:00
if doc.returns
p.returns
2014-11-23 15:52:34 -05:00
strong
span(data-i18n="skill_docs.returns") Returns
span.spr :
div
code= doc.returns.type
if doc.returns.example
2014-11-23 15:52:34 -05:00
| (
span(data-i18n="skill_docs.ex") ex
span.spr :
code= doc.returns.example
| )
if doc.returns.description
div!= marked(doc.returns.description)
2014-07-15 22:25:53 -04:00
if item
p
2014-11-23 15:52:34 -05:00
em
span.spr(data-i18n="skill_docs.granted_by") Granted by
| #{item.get('name')}.
2014-07-15 22:25:53 -04:00
if selectedMethod
p
em Write the body of this method below.