mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-16 00:19:50 -05:00
Add support for CSS docs
This commit is contained in:
parent
5d0b9c875a
commit
b04e968da5
3 changed files with 6 additions and 5 deletions
|
@ -95,7 +95,7 @@ if !selectedMethod
|
|||
else if language == 'io'
|
||||
span= (doc.ownerName == 'this' ? '' : doc.ownerName + ' ') + docName + '(' + argumentExamples.join(', ') + ')'
|
||||
|
||||
if (doc.type != 'function' && doc.type != 'snippet' && doc.owner != 'HTML') || doc.name == 'now'
|
||||
if (doc.type != 'function' && doc.type != 'snippet' && doc.owner != 'HTML' && doc.owner != 'CSS') || doc.name == 'now'
|
||||
p.value
|
||||
strong
|
||||
span(data-i18n="skill_docs.current_value") Current Value
|
||||
|
|
|
@ -49,7 +49,7 @@ module.exports = class DocFormatter
|
|||
@doc.type = 'snippet'
|
||||
@doc.owner = 'snippets'
|
||||
@doc.shortName = @doc.shorterName = @doc.title = @doc.name
|
||||
else if @doc.owner is 'HTML'
|
||||
else if @doc.owner in ['HTML', 'CSS']
|
||||
@doc.shortName = @doc.shorterName = @doc.title = @doc.name
|
||||
else
|
||||
@doc.owner ?= 'this'
|
||||
|
|
|
@ -157,6 +157,7 @@ module.exports = class SpellPaletteView extends CocoView
|
|||
LoDash: 'programmableLoDashProperties'
|
||||
Vector: 'programmableVectorProperties'
|
||||
HTML: 'programmableHTMLProperties'
|
||||
CSS: 'programmableCSSProperties'
|
||||
snippets: 'programmableSnippets'
|
||||
else
|
||||
propStorage =
|
||||
|
@ -196,7 +197,7 @@ module.exports = class SpellPaletteView extends CocoView
|
|||
return 'more' if entry.doc.owner is 'this' and entry.doc.name in (propGroups.more ? [])
|
||||
entry.doc.owner
|
||||
@entries = _.sortBy @entries, (entry) ->
|
||||
order = ['this', 'more', 'Math', 'Vector', 'String', 'Object', 'Array', 'Function', 'HTML', 'snippets']
|
||||
order = ['this', 'more', 'Math', 'Vector', 'String', 'Object', 'Array', 'Function', 'HTML', 'CSS', 'snippets']
|
||||
index = order.indexOf groupForEntry entry
|
||||
index = String.fromCharCode if index is -1 then order.length else index
|
||||
index += entry.doc.name
|
||||
|
@ -247,7 +248,7 @@ module.exports = class SpellPaletteView extends CocoView
|
|||
console.log @thang.id, "couldn't find item ThangType for", slot, thangTypeName
|
||||
|
||||
# Get any Math-, Vector-, etc.-owned properties into their own tabs
|
||||
for owner, storage of propStorage when not (owner in ['this', 'more', 'snippets', 'HTML'])
|
||||
for owner, storage of propStorage when not (owner in ['this', 'more', 'snippets', 'HTML', 'CSS'])
|
||||
continue unless @thang[storage]?.length
|
||||
@tabs ?= {}
|
||||
@tabs[owner] = []
|
||||
|
@ -261,7 +262,7 @@ module.exports = class SpellPaletteView extends CocoView
|
|||
|
||||
# Assign any unassigned properties to the hero itself.
|
||||
for owner, storage of propStorage
|
||||
continue unless owner in ['this', 'more', 'snippets', 'HTML']
|
||||
continue unless owner in ['this', 'more', 'snippets', 'HTML', 'CSS']
|
||||
for prop in _.reject(@thang[storage] ? [], (prop) -> itemsByProp[prop] or prop[0] is '_') # no private properties
|
||||
continue if prop is 'say' and @options.level.get 'hidesSay' # Hide for Dungeon Campaign
|
||||
continue if prop is 'moveXY' and @options.level.get('slug') is 'slalom' # Hide for Slalom
|
||||
|
|
Loading…
Reference in a new issue