mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-26 12:50:31 -04: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: ->
|
transpileSession: ->
|
||||||
submittedCode = @session.get('code')
|
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 = {}
|
transpiledCode = {}
|
||||||
for thang, spells of submittedCode
|
for thang, spells of submittedCode
|
||||||
transpiledCode[thang] = {}
|
transpiledCode[thang] = {}
|
||||||
|
@ -80,7 +83,7 @@ module.exports = class LadderSubmissionView extends CocoView
|
||||||
#DRY this
|
#DRY this
|
||||||
aetherOptions =
|
aetherOptions =
|
||||||
problems: {}
|
problems: {}
|
||||||
language: "javascript"
|
language: language
|
||||||
functionName: spellID
|
functionName: spellID
|
||||||
functionParameters: []
|
functionParameters: []
|
||||||
yieldConditionally: spellID is "plan"
|
yieldConditionally: spellID is "plan"
|
||||||
|
|
|
@ -65,7 +65,7 @@ module.exports = class LadderView extends RootView
|
||||||
@insertSubView(@simulateTab = new SimulateTabView())
|
@insertSubView(@simulateTab = new SimulateTabView())
|
||||||
@refreshInterval = setInterval(@fetchSessionsAndRefreshViews.bind(@), 20 * 1000)
|
@refreshInterval = setInterval(@fetchSessionsAndRefreshViews.bind(@), 20 * 1000)
|
||||||
hash = document.location.hash[1..] if document.location.hash
|
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
|
@showPlayModal(hash) if @sessions.loaded
|
||||||
|
|
||||||
fetchSessionsAndRefreshViews: ->
|
fetchSessionsAndRefreshViews: ->
|
||||||
|
|
Loading…
Add table
Reference in a new issue