Merge branch 'master' into production

This commit is contained in:
Matt Lott 2016-08-03 11:12:12 -07:00
commit 652a2b1b87
10 changed files with 49 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -327,6 +327,7 @@ module.exports.capitalLanguages = capitalLanguages =
'python': 'Python' 'python': 'Python'
'java': 'Java' 'java': 'Java'
'lua': 'Lua' 'lua': 'Lua'
'html': 'HTML'
module.exports.createLevelNumberMap = (levels) -> module.exports.createLevelNumberMap = (levels) ->
levelNumberMap = {} levelNumberMap = {}

View file

@ -436,6 +436,9 @@
done: "Done" done: "Done"
next_level: "Next Level" next_level: "Next Level"
next_game: "Next game" next_game: "Next game"
language: "Language"
languages: "Languages"
programming_language: "Programming language"
show_menu: "Show game menu" show_menu: "Show game menu"
home: "Home" # Not used any more, will be removed soon. home: "Home" # Not used any more, will be removed soon.
level: "Level" # Like "Level: Dungeons of Kithgard" level: "Level" # Like "Level: Dungeons of Kithgard"

View file

@ -128,9 +128,9 @@
.img-thumbnail .img-thumbnail
border-radius: 50% border-radius: 50%
padding: 0 padding: 0
background-color: $burgandy // background-color: $burgandy
border: 5px solid $gold // border: 5px solid $gold
// #community // #community
// margin-top: 100px // margin-top: 100px

View file

@ -28,7 +28,7 @@
border: 1px solid transparent border: 1px solid transparent
span.code-background span.code-background
border-width: 124px 76px 64px 40px border-width: 115px 76px 64px 40px
border-image: url(/images/level/code_editor_background_border.png) 124 76 64 40 fill stretch border-image: url(/images/level/code_editor_background_border.png) 124 76 64 40 fill stretch
img.code-background img.code-background
@ -38,8 +38,24 @@
.save-status .save-status
display: none display: none
position: absolute position: absolute
top: 1% top: 10px
right: 4% left: 20px
z-index: 4
.programming-language-container
position: absolute
top: 10px
right: 26px
z-index: 4
font-family: "Open Sans Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif
font-size: 14px
padding: 0px 10px
.programming-language-label
color: #6E654B
font-weight: bold
text-transform: uppercase
.programming-language
color: darkred
.firepad .firepad
// When Firepad is active, it wraps .ace_editor in .firepad. // When Firepad is active, it wraps .ace_editor in .firepad.
@ -56,6 +72,7 @@
.ace_editor .ace_editor
// When Firepad isn't active, .ace_editor needs the width/height set itself. // When Firepad isn't active, .ace_editor needs the width/height set itself.
@include editor-height(0px) @include editor-height(0px)
margin-top: 10px
width: 94% width: 94%
position: relative position: relative
background-color: transparent background-color: transparent

View file

@ -1,6 +1,21 @@
img(src="/images/level/code_editor_background.png").code-background img(src="/images/level/code_editor_background.png").code-background
span.code-background span.code-background
.ace
div.ace .save-status(data-i18n="play_level.code_saved")
.programming-language-container
.save-status(data-i18n="play_level.code_saved") Code Saved if view.spell.level.isType('web-dev')
- var campaign = view.spell.level.get('campaign') || '';
if campaign.indexOf('web-dev-1') >= 0
span.programming-language-label(data-i18n='play_level.language')
span.programming-language-label.spr :
span.programming-language HTML
else
span.programming-language-label(data-i18n='play_level.languages')
span.programming-language-label.spr :
span.programming-language.spr HTML
span.programming-language-label.spr /
span.programming-language JavaScript
else
span.programming-language-label(data-i18n='play_level.programming_language')
span.programming-language-label.spr :
span.programming-language= view.spell.displayCodeLanguage

View file

@ -67,6 +67,7 @@ module.exports = class Spell
setLanguage: (@language) -> setLanguage: (@language) ->
@language = 'html' if @level.isType('web-dev') @language = 'html' if @level.isType('web-dev')
@displayCodeLanguage = utils.capitalLanguages[@language]
#console.log 'setting language to', @language, 'so using original source', @languages[language] ? @languages.javascript #console.log 'setting language to', @language, 'so using original source', @languages[language] ? @languages.javascript
@originalSource = @languages[@language] ? @languages.javascript @originalSource = @languages[@language] ? @languages.javascript
@originalSource = @addPicoCTFProblem() if window.serverConfig.picoCTF @originalSource = @addPicoCTFProblem() if window.serverConfig.picoCTF

View file

@ -39,7 +39,6 @@ module.exports = class SpellTopBarView extends CocoView
afterRender: -> afterRender: ->
super() super()
@$el.addClass 'spell-tab'
@attachTransitionEventListener() @attachTransitionEventListener()
onDisableControls: (e) -> @toggleControls e, false onDisableControls: (e) -> @toggleControls e, false

View file

@ -629,7 +629,7 @@ module.exports = class SpellView extends CocoView
# 2 lines buffer is nice # 2 lines buffer is nice
@ace.setOptions minLines: lines, maxLines: lines @ace.setOptions minLines: lines, maxLines: lines
# Move spell palette up, slightly overlapping us. # Move spell palette up, slightly overlapping us.
newTop = 175 + lineHeight * lines newTop = 185 + lineHeight * lines
spellPaletteView.css('top', newTop) spellPaletteView.css('top', newTop)
# Expand it to bottom of tome if too short. # Expand it to bottom of tome if too short.
newHeight = Math.max @spellPaletteHeight, tomeHeight - newTop + 10 newHeight = Math.max @spellPaletteHeight, tomeHeight - newTop + 10
@ -942,7 +942,7 @@ module.exports = class SpellView extends CocoView
@spellHasChanged = true @spellHasChanged = true
onSessionWillSave: (e) -> onSessionWillSave: (e) ->
return unless @spellHasChanged return unless @spellHasChanged and me.isAdmin()
setTimeout(=> setTimeout(=>
unless @destroyed or @spellHasChanged unless @destroyed or @spellHasChanged
@$el.find('.save-status').finish().show().fadeOut(2000) @$el.find('.save-status').finish().show().fadeOut(2000)