mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Transpile code properly.
This commit is contained in:
parent
d058b16283
commit
248cec1e6e
2 changed files with 5 additions and 2 deletions
|
@ -72,6 +72,9 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
|
||||
transpileSession: ->
|
||||
submittedCode = @session.get('code')
|
||||
language = @session.get('codeLanguage') or 'javascript'
|
||||
@session.set('submittedCodeLanguage', language)
|
||||
@session.save() # TODO: maybe actually use a callback to make sure this works?
|
||||
transpiledCode = {}
|
||||
for thang, spells of submittedCode
|
||||
transpiledCode[thang] = {}
|
||||
|
@ -80,7 +83,7 @@ module.exports = class LadderSubmissionView extends CocoView
|
|||
#DRY this
|
||||
aetherOptions =
|
||||
problems: {}
|
||||
language: "javascript"
|
||||
language: language
|
||||
functionName: spellID
|
||||
functionParameters: []
|
||||
yieldConditionally: spellID is "plan"
|
||||
|
|
|
@ -65,7 +65,7 @@ module.exports = class LadderView extends RootView
|
|||
@insertSubView(@simulateTab = new SimulateTabView())
|
||||
@refreshInterval = setInterval(@fetchSessionsAndRefreshViews.bind(@), 20 * 1000)
|
||||
hash = document.location.hash[1..] if document.location.hash
|
||||
if hash and not (hash in ['my-matches', 'simulate', 'ladder'])
|
||||
if hash and not (hash in ['my-matches', 'simulate', 'ladder', 'prizes', 'rules'])
|
||||
@showPlayModal(hash) if @sessions.loaded
|
||||
|
||||
fetchSessionsAndRefreshViews: ->
|
||||
|
|
Loading…
Reference in a new issue