From 3baea9683c063ae4116a335db4d6f1bf9fa66251 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 4 Jan 2016 16:41:24 -0800 Subject: [PATCH] Additional java support. --- app/core/utils.coffee | 1 + app/styles/play/modal/play-heroes-modal.sass | 2 ++ app/views/play/level/PlayLevelView.coffee | 1 + app/views/play/level/tome/SpellPaletteView.coffee | 2 +- app/views/play/modal/PlayHeroesModal.coffee | 4 +++- app/views/play/modal/PollModal.coffee | 1 + config.coffee | 1 + 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/core/utils.coffee b/app/core/utils.coffee index df8411596..6566bbb89 100644 --- a/app/core/utils.coffee +++ b/app/core/utils.coffee @@ -264,6 +264,7 @@ module.exports.aceEditModes = aceEditModes = 'clojure': 'ace/mode/clojure' 'lua': 'ace/mode/lua' 'io': 'ace/mode/text' + 'java': 'ace/mode/java' module.exports.initializeACE = (el, codeLanguage) -> contents = $(el).text().trim() diff --git a/app/styles/play/modal/play-heroes-modal.sass b/app/styles/play/modal/play-heroes-modal.sass index 5aed4d59a..45911e24c 100644 --- a/app/styles/play/modal/play-heroes-modal.sass +++ b/app/styles/play/modal/play-heroes-modal.sass @@ -396,6 +396,8 @@ $heroCanvasHeight: 275px background-image: url(/images/common/code_languages/clojure_small.png) &[data-value="lua"] background-image: url(/images/common/code_languages/lua_small.png) + &[data-value="java"] + background-image: url(/images/common/code_languages/java_small.png) &[data-value="io"] background-image: url(/images/common/code_languages/io_small.png) diff --git a/app/views/play/level/PlayLevelView.coffee b/app/views/play/level/PlayLevelView.coffee index a956ff533..aa581c10f 100644 --- a/app/views/play/level/PlayLevelView.coffee +++ b/app/views/play/level/PlayLevelView.coffee @@ -407,6 +407,7 @@ module.exports = class PlayLevelView extends RootView require 'vendor/aether-java' require 'vendor/aether-clojure' require 'vendor/aether-io' + require 'vendor/aether-java' @simulateNextGame() simulateNextGame: -> diff --git a/app/views/play/level/tome/SpellPaletteView.coffee b/app/views/play/level/tome/SpellPaletteView.coffee index 8a36e97d2..2171d4a4f 100644 --- a/app/views/play/level/tome/SpellPaletteView.coffee +++ b/app/views/play/level/tome/SpellPaletteView.coffee @@ -44,7 +44,7 @@ module.exports = class SpellPaletteView extends CocoView c.defaultGroupSlug = @defaultGroupSlug c.showsHelp = @showsHelp c.tabs = @tabs # For hero-based, non-this-owned tabs like Vector, Math, etc. - c.thisName = {coffeescript: '@', lua: 'self', python: 'self'}[@options.language] or 'this' + c.thisName = {coffeescript: '@', lua: 'self', python: 'self', java: 'hero'}[@options.language] or 'this' c._ = _ c diff --git a/app/views/play/modal/PlayHeroesModal.coffee b/app/views/play/modal/PlayHeroesModal.coffee index 2c4c0c601..c4ea0e19a 100644 --- a/app/views/play/modal/PlayHeroesModal.coffee +++ b/app/views/play/modal/PlayHeroesModal.coffee @@ -113,10 +113,12 @@ module.exports = class PlayHeroesModal extends ModalView {id: 'coffeescript', name: "CoffeeScript (#{$.i18n.t('choose_hero.experimental')})"} {id: 'clojure', name: "Clojure (#{$.i18n.t('choose_hero.experimental')})"} {id: 'lua', name: 'Lua'} - {id: 'java', name: 'Java'} #{id: 'io', name: "Io (#{$.i18n.t('choose_hero.experimental')})"} ] + if me.isAdmin() or not application.isProduction() + @codeLanguageList.push {id: 'java', name: "Java (#{$.i18n.t('choose_hero.experimental')})"} + onHeroChanged: (e) -> direction = e.direction # 'left' or 'right' heroItem = $(e.relatedTarget) diff --git a/app/views/play/modal/PollModal.coffee b/app/views/play/modal/PollModal.coffee index c2baef8f5..4a9af778b 100644 --- a/app/views/play/modal/PollModal.coffee +++ b/app/views/play/modal/PollModal.coffee @@ -132,3 +132,4 @@ commentStarts = clojure: '; ' lua: '-- ' io: '// ' + java: '// ' diff --git a/config.coffee b/config.coffee index cb1c3e557..8edc4f604 100644 --- a/config.coffee +++ b/config.coffee @@ -114,6 +114,7 @@ exports.config = 'javascripts/app/vendor/aether-io.js': 'bower_components/aether/build/io.js' 'javascripts/app/vendor/aether-javascript.js': 'bower_components/aether/build/javascript.js' 'javascripts/app/vendor/aether-lua.js': 'bower_components/aether/build/lua.js' + 'javascripts/app/vendor/aether-java.js': 'bower_components/aether/build/java.js' 'javascripts/app/vendor/aether-python.js': 'bower_components/aether/build/python.js' 'javascripts/app/vendor/aether-java.js': 'bower_components/aether/build/java.js'