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'
'java': 'Java'
'lua': 'Lua'
'html': 'HTML'
module.exports.createLevelNumberMap = (levels) ->
levelNumberMap = {}

View file

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

View file

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

View file

@ -28,7 +28,7 @@
border: 1px solid transparent
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
img.code-background
@ -38,8 +38,24 @@
.save-status
display: none
position: absolute
top: 1%
right: 4%
top: 10px
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
// When Firepad is active, it wraps .ace_editor in .firepad.
@ -56,6 +72,7 @@
.ace_editor
// When Firepad isn't active, .ace_editor needs the width/height set itself.
@include editor-height(0px)
margin-top: 10px
width: 94%
position: relative
background-color: transparent

View file

@ -1,6 +1,21 @@
img(src="/images/level/code_editor_background.png").code-background
span.code-background
div.ace
.save-status(data-i18n="play_level.code_saved") Code Saved
.ace
.save-status(data-i18n="play_level.code_saved")
.programming-language-container
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) ->
@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
@originalSource = @languages[@language] ? @languages.javascript
@originalSource = @addPicoCTFProblem() if window.serverConfig.picoCTF

View file

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

View file

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