From 248cec1e6ea55503da4d3832053ee35b926b5d55 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 20 May 2014 08:23:25 -0700 Subject: [PATCH] Transpile code properly. --- app/views/play/common/ladder_submission_view.coffee | 5 ++++- app/views/play/ladder/ladder_view.coffee | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/play/common/ladder_submission_view.coffee b/app/views/play/common/ladder_submission_view.coffee index 9a0052647..ccb3571a3 100644 --- a/app/views/play/common/ladder_submission_view.coffee +++ b/app/views/play/common/ladder_submission_view.coffee @@ -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" diff --git a/app/views/play/ladder/ladder_view.coffee b/app/views/play/ladder/ladder_view.coffee index 9d40389b6..884c72d63 100644 --- a/app/views/play/ladder/ladder_view.coffee +++ b/app/views/play/ladder/ladder_view.coffee @@ -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: ->