Merge pull request #1323 from codecombat/master

Master into production
This commit is contained in:
Michael Schmatz 2014-07-14 11:15:31 -07:00
commit aaf9bf1253
12 changed files with 98 additions and 82 deletions

View file

@ -30,6 +30,7 @@ module.exports = class ThangState
if type is 'Vector' if type is 'Vector'
@props.push value?.copy() # could try storing [x, y, z] or {x, y, z} here instead if this is expensive @props.push value?.copy() # could try storing [x, y, z] or {x, y, z} here instead if this is expensive
else if type is 'object' or type is 'array' else if type is 'object' or type is 'array'
console.log 'storing', prop, 'as', value if prop is 'myTiles'
@props.push clone(value, true) @props.push clone(value, true)
else else
@props.push value @props.push value
@ -144,7 +145,7 @@ module.exports = class ThangState
# We make sure the array keys won't collide with any string keys by using some unprintable characters. # We make sure the array keys won't collide with any string keys by using some unprintable characters.
stringPieces = ['\x1D'] # Group Separator stringPieces = ['\x1D'] # Group Separator
for element in value for element in value
if element and element.isThang if element and element.id # Was checking element.isThang, but we can't store non-strings anyway
element = element.id element = element.id
stringPieces.push element, '\x1E' # Record Separator(s) stringPieces.push element, '\x1E' # Record Separator(s)
value = stringPieces.join('') value = stringPieces.join('')

View file

@ -173,8 +173,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
email_announcements: "Bejelentések" email_announcements: "Bejelentések"
email_announcements_description: "Szeretnél levelet kapni a legújabb fejlesztéseinkről?" email_announcements_description: "Szeretnél levelet kapni a legújabb fejlesztéseinkről?"
email_notifications: "Értesítések" email_notifications: "Értesítések"
# email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity." email_notifications_summary: "CodeCombat tevékenységedre vonatkozó személyre szóló, automatikus értesítések beállításai."
email_any_notes: "Bármely értesítés" email_any_notes: "Bármely megjegyzés"
email_any_notes_description: "Minden tevékenységgel kapcsolatos e-mail értesítés letiltása." email_any_notes_description: "Minden tevékenységgel kapcsolatos e-mail értesítés letiltása."
email_recruit_notes: "Álláslehetőségek" email_recruit_notes: "Álláslehetőségek"
email_recruit_notes_description: "Ha igazán jól játszol lehet, hogy felveszzük veled a kapcsolatot és megbeszéljük, hogy szerezzünk-e neked egy (jobb) állást." email_recruit_notes_description: "Ha igazán jól játszol lehet, hogy felveszzük veled a kapcsolatot és megbeszéljük, hogy szerezzünk-e neked egy (jobb) állást."

View file

@ -1 +0,0 @@
@import "bootstrap/bootstrap";

View file

@ -13,13 +13,14 @@
$childMargin: 2px $childMargin: 2px
$childSize: $height - 2 * $childMargin $childSize: $height - 2 * $childMargin
height: $height height: $height
width: 80% width: 90%
width: -webkit-calc(100% - 100px) width: -webkit-calc(100% - 50px)
width: calc(100% - 100px) width: calc(100% - 50px)
padding: 0px 8px padding: 0px 8px
border-width: 3px border-width: 3px
border-image: url(/images/level/code_editor_tab_background.png) 4 fill repeat border-image: url(/images/level/code_editor_tab_background.png) 4 fill repeat
text-align: center white-space: nowrap
position: relative
&.read-only &.read-only
background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%,rgba(0,0,0,0.2) 100%), url(/images/level/code_editor_tab_background.png) background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%,rgba(0,0,0,0.2) 100%), url(/images/level/code_editor_tab_background.png)
@ -34,6 +35,11 @@
.spell-list-button, .thang-avatar-wrapper .spell-list-button, .thang-avatar-wrapper
float: left float: left
.spell-tool-buttons
position: absolute
right: 0px
top: 0px
.reload-code .reload-code
float: right float: right
display: none display: none
@ -66,6 +72,7 @@
code code
margin-top: 7px margin-top: 7px
font-size: 1vw
.spell-list-entry-view:not(.spell-tab) .spell-list-entry-view:not(.spell-tab)
cursor: pointer cursor: pointer

View file

@ -36,22 +36,22 @@ block content
ul ul
li We write about our progress and current projects on our li We write about our progress and current projects on our
a(href="http://blog.codecombat.com", data-i18n="nav.blog") a.spl(href="http://blog.codecombat.com", data-i18n="nav.blog")
| . | .
li Participate in our active user community by checking out our li Participate in our active user community by checking out our
a(href="http://discourse.codecombat.com", data-i18n="nav.forum") a.spl(href="http://discourse.codecombat.com", data-i18n="nav.forum")
| . | .
li For regular news about learning to code, games, and education, check out our li For regular news about learning to code, games, and education, check out our
a(href="https://www.facebook.com/codecombat", data-i18n="community.facebook") a.spl(href="https://www.facebook.com/codecombat", data-i18n="community.facebook")
| . | .
li For realtime status or to have a quick chat, follow us on li For realtime status or to have a quick chat, follow us on
a(href="https://twitter.com/CodeCombat", data-i18n="community.twitter") a.spl(href="https://twitter.com/CodeCombat", data-i18n="community.twitter")
| . | .
li Don't like Facebook? We're on li Don't like Facebook? We're on
a(href="https://plus.google.com/115285980638641924488/posts", data-i18n="community.gplus") a.spl(href="https://plus.google.com/115285980638641924488/posts", data-i18n="community.gplus")
| . | .
li You can also find us in our li You can also find us in our
a(href="http://www.hipchat.com/g3plnOKqa", data-i18n="editor.hipchat_url") a.spl(href="http://www.hipchat.com/g3plnOKqa", data-i18n="editor.hipchat_url")
.community_columns .community_columns
@ -81,5 +81,5 @@ block content
| : support our community of educators and coders. | : support our community of educators and coders.
| Check out the | Check out the
a(href="/contribute", data-i18n="nav.contribute") a.spl(href="/contribute", data-i18n="nav.contribute")
| page to find out more about the roles and how you can get started. | page to find out more about the roles and how you can get started.

View file

@ -49,7 +49,7 @@ block header
if level.get('type') === 'ladder' if level.get('type') === 'ladder'
li.dropdown li.dropdown
a(data-toggle='dropdown') a(data-toggle='dropdown').play-with-team-parent
span.glyphicon-play.glyphicon span.glyphicon-play.glyphicon
ul.dropdown-menu ul.dropdown-menu
li.dropdown-header Play As Which Team? li.dropdown-header Play As Which Team?

View file

@ -4,15 +4,15 @@
code #{methodSignature} code #{methodSignature}
.btn.btn-small.fullscreen-code(title="Expand code editor") .spell-tool-buttons
i.icon-fullscreen .btn.btn-small.fullscreen-code(title="Expand code editor")
i.icon-resize-small i.icon-fullscreen
i.icon-resize-small
.btn.btn-small.reload-code(title="Reload original code for " + spell.name) .btn.btn-small.reload-code(title="Reload original code for " + spell.name)
i.icon-repeat i.icon-repeat
.btn.btn-small.beautify-code(title="Ctrl+Shift+B: Beautify code for " + spell.name) .btn.btn-small.beautify-code(title="Ctrl+Shift+B: Beautify code for " + spell.name)
i.icon-magnet i.icon-magnet
.clearfix
.clearfix

View file

@ -26,6 +26,7 @@ module.exports = class EditorLevelView extends View
events: events:
'click #play-button': 'onPlayLevel' 'click #play-button': 'onPlayLevel'
'click .play-with-team-button': 'onPlayLevel' 'click .play-with-team-button': 'onPlayLevel'
'click .play-with-team-parent': 'onPlayLevelTeamSelect'
'click #commit-level-start-button': 'startCommittingLevel' 'click #commit-level-start-button': 'startCommittingLevel'
'click #fork-level-start-button': 'startForkingLevel' 'click #fork-level-start-button': 'startForkingLevel'
'click #level-history-button': 'showVersionHistory' 'click #level-history-button': 'showVersionHistory'
@ -77,6 +78,12 @@ module.exports = class EditorLevelView extends View
@listenTo @patchesView, 'accepted-patch', -> location.reload() @listenTo @patchesView, 'accepted-patch', -> location.reload()
@$el.find('#level-watch-button').find('> span').toggleClass('secret') if @level.watching() @$el.find('#level-watch-button').find('> span').toggleClass('secret') if @level.watching()
onPlayLevelTeamSelect: (e) ->
if @childWindow and not @childWindow.closed
# We already have a child window open, so we don't need to ask for a team; we'll use its existing team.
e.stopImmediatePropagation()
@onPlayLevel e
onPlayLevel: (e) -> onPlayLevel: (e) ->
team = $(e.target).data('team') team = $(e.target).data('team')
sendLevel = => sendLevel = =>

View file

@ -66,6 +66,7 @@ sizes = {
'borderSize': { 'borderSize': {
'x':4 'x':4
'y':4 'y':4
'thickness':2
} }
} }
@ -114,36 +115,38 @@ module.exports = class TerrainRandomizeModal extends ModalView
randomizeBorder: (preset, presetSize) -> randomizeBorder: (preset, presetSize) ->
for i in _.range(0-sizes.floorSize.x/2+sizes.borderSize.x, presetSize.x-sizes.floorSize.x/2, sizes.borderSize.x) for i in _.range(0-sizes.floorSize.x/2+sizes.borderSize.x, presetSize.x-sizes.floorSize.x/2, sizes.borderSize.x)
@thangs.push { for j in _.range(sizes.borderSize.thickness)
'id': @getRandomThang(preset.borders) @thangs.push {
'pos': { 'id': @getRandomThang(preset.borders)
'x': i 'pos': {
'y': 0-sizes.floorSize.x/2 'x': i + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
'y': 0 - sizes.floorSize.x/2 + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
}
} }
} @thangs.push {
@thangs.push { 'id': @getRandomThang(preset.borders)
'id': @getRandomThang(preset.borders) 'pos': {
'pos': { 'x': i + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
'x': i 'y': presetSize.y - sizes.borderSize.y + _.random(-sizes.borderSize.x/2, sizes.borderSize.x/2)
'y': presetSize.y - sizes.borderSize.y }
} }
}
for i in _.range(0-sizes.floorSize.y/2, presetSize.y-sizes.borderSize.y, sizes.borderSize.y) for i in _.range(0-sizes.floorSize.y/2, presetSize.y-sizes.borderSize.y, sizes.borderSize.y)
@thangs.push { for j in _.range(3)
'id': @getRandomThang(preset.borders) @thangs.push {
'pos': { 'id': @getRandomThang(preset.borders)
'x': 0-sizes.floorSize.x/2+sizes.borderSize.x 'pos': {
'y': i 'x': 0-sizes.floorSize.x/2+sizes.borderSize.x + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
'y': i + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
}
} }
} @thangs.push {
@thangs.push { 'id': @getRandomThang(preset.borders)
'id': @getRandomThang(preset.borders) 'pos': {
'pos': { 'x': presetSize.x - sizes.borderSize.x - sizes.floorSize.x/2 + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
'x': presetSize.x - sizes.borderSize.x - sizes.floorSize.x/2 'y': i + _.random(-sizes.borderSize.y/2, sizes.borderSize.y/2)
'y': i }
} }
}
randomizeDecorations: (preset, presetSize)-> randomizeDecorations: (preset, presetSize)->
for name, decoration of preset.decorations for name, decoration of preset.decorations

View file

@ -368,7 +368,7 @@ module.exports = class SpellView extends View
# Now that that's figured out, perform the update. # Now that that's figured out, perform the update.
# The web worker Aether won't track state, so don't have to worry about updating it # The web worker Aether won't track state, so don't have to worry about updating it
finishUpdatingAether = (aether) => finishUpdatingAether = (aether) =>
@displayAether aether @displayAether aether, codeIsAsCast
@lastUpdatedAetherSpellThang = @spellThang @lastUpdatedAetherSpellThang = @spellThang
@guessWhetherFinished aether if fromCodeChange @guessWhetherFinished aether if fromCodeChange
@ -396,10 +396,9 @@ module.exports = class SpellView extends View
@aceSession.setAnnotations [] @aceSession.setAnnotations []
@highlightCurrentLine {} # This'll remove all highlights @highlightCurrentLine {} # This'll remove all highlights
displayAether: (aether) -> displayAether: (aether, isCast=false) ->
@displayedAether = aether @displayedAether = aether
isCast = not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'} isCast = isCast or not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'}
isCast = isCast or @spell.language isnt 'javascript' # Since we don't have linting for other languages
problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran. problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran.
@problems = [] @problems = []
annotations = [] annotations = []

View file

@ -64,7 +64,7 @@ exports.config =
'stylesheets/app.css': /^(app|vendor|bower_components)/ 'stylesheets/app.css': /^(app|vendor|bower_components)/
order: order:
before: [ before: [
'app/styles/bootstrap.scss' 'app/styles/bootstrap/*'
'vendor/styles/nanoscroller.scss' 'vendor/styles/nanoscroller.scss'
] ]
templates: templates:

View file

@ -84,7 +84,7 @@
"nodemon": "0.7.5", "nodemon": "0.7.5",
"marked": "0.2.x", "marked": "0.2.x",
"telepath-brunch": "https://github.com/nwinter/telepath-brunch/tarball/master", "telepath-brunch": "https://github.com/nwinter/telepath-brunch/tarball/master",
"bower": "~1.2.8", "bower": "~1.3.8",
"bless-brunch": "~1.6.1", "bless-brunch": "~1.6.1",
"karma-script-launcher": "~0.1.0", "karma-script-launcher": "~0.1.0",
"karma-chrome-launcher": "~0.1.2", "karma-chrome-launcher": "~0.1.2",