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

173 lines
5.1 KiB
Text
Raw Normal View History

h4
span.prop-name= doc.shortName
| -
- var skillType = (doc.type == 'function' && doc.owner == 'this' ? 'method' : doc.type)
code.prop-type(data-i18n='skill_docs.' + skillType)
// In case there's no translation in en.coffee because we missed one
= skillType
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
| )
if doc.translatedShortName
h5
span.translated-name= doc.translatedShortName
.description
p!= marked(doc.description || 'Still undocumented, sorry.')
if cooldowns && (cooldowns.cooldown || cooldowns.specificCooldown)
p
span
2015-09-03 08:10:06 -04:00
if cooldowns.type == 'spell'
span(data-i18n="skill_docs.spell") Spell
else
span(data-i18n="skill_docs.action") Action
2014-11-23 15:52:34 -05:00
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' && !_.contains(['HTML', 'CSS', 'WebJavaScript', 'jQuery'], doc.owner)) || 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
mixin argumentEntry(arg)
div
code= arg.name
span.spr :
code= arg.type
if arg.example
| (
span(data-i18n="skill_docs.ex") ex
span.spr :
code= arg.example
| )
if arg.description
div!= marked(arg.description)
if arg.default
div
em
span(data-i18n="skill_docs.default_value") Default value
span.spr :
code= arg.default
if doc.args && doc.args.length
- var hasOptionalArguments = _.any(doc.args, function(arg){ return arg.optional })
p.args
2014-11-23 15:52:34 -05:00
strong
if hasOptionalArguments
span(data-i18n="skill_docs.required_parameters") Required Parameters
else
span(data-i18n="skill_docs.parameters") Parameters
2014-11-23 15:52:34 -05:00
span.spr :
for arg in doc.args
unless arg.optional
+argumentEntry(arg)
if hasOptionalArguments
p.args
strong
span(data-i18n="skill_docs.optional_parameters") Optional Parameters
2014-11-23 15:52:34 -05:00
span.spr :
for arg in doc.args
if arg.optional
+argumentEntry(arg)
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.