Additional java support.

This commit is contained in:
Rob 2016-01-04 16:41:24 -08:00
parent 41a532cb50
commit 3baea9683c
7 changed files with 10 additions and 2 deletions

View file

@ -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()

View file

@ -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)

View file

@ -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: ->

View file

@ -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

View file

@ -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)

View file

@ -132,3 +132,4 @@ commentStarts =
clojure: '; '
lua: '-- '
io: '// '
java: '// '

View file

@ -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'