Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-11-30 18:03:36 -08:00
commit 68b3144b46
11 changed files with 161 additions and 111 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -28,7 +28,7 @@ module.exports = class Tracker
console.log "Would track analytics pageview: /#{name}" if debugAnalytics console.log "Would track analytics pageview: /#{name}" if debugAnalytics
return unless @isProduction and analytics? and not me.isAdmin() return unless @isProduction and analytics? and not me.isAdmin()
if includeIntegrations if includeIntegrations
options.integrations = {'All': false} options = integrations: {'All': false}
for integration in includeIntegrations for integration in includeIntegrations
options.integrations[integration] = true options.integrations[integration] = true
analytics.page null, "/#{name}", null, options analytics.page null, "/#{name}", null, options

View file

@ -86,8 +86,7 @@ module.exports = class MusicPlayer extends CocoClass
return if @inMenu return if @inMenu
@inMenu = true @inMenu = true
@previousMusic = @currentMusic @previousMusic = @currentMusic
terrain = (e.terrain ? 'Dungeon').toLowerCase() file = "/music/music-menu"
file = "/music/music-menu-#{terrain}"
Backbone.Mediator.publish 'music-player:play-music', file: file, play: true, delay: 1000 Backbone.Mediator.publish 'music-player:play-music', file: file, play: true, delay: 1000
onExitMenu: (e) -> onExitMenu: (e) ->

View file

@ -163,8 +163,8 @@ $itemSlotGridHeight: 51px
background-position: (-4 * $itemSlotInnerWidth) 0px background-position: (-4 * $itemSlotInnerWidth) 0px
&[data-slot="minion"] &[data-slot="minion"]
left: 10px + ($itemSlotGridWidth * 0) left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 0) top: 15px + ($itemSlotGridHeight * 1)
.placeholder .placeholder
background-position: (-1 * $itemSlotInnerWidth) 0px background-position: (-1 * $itemSlotInnerWidth) 0px
@ -172,15 +172,11 @@ $itemSlotGridHeight: 51px
left: 10px + ($itemSlotGridWidth * 0) left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 0) top: 15px + ($itemSlotGridHeight * 0)
.placeholder .placeholder
background-position: (-3 * $itemSlotInnerWidth) 0px background-position: (-2 * $itemSlotInnerWidth) 0px
// Only for wizards...
//&[data-slot="spellbook"] .placeholder
// background-position: (-2 * $itemSlotInnerWidth) 0px
&[data-slot="wrists"] &[data-slot="wrists"]
left: 10px + ($itemSlotGridWidth * 0) left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 0) top: 15px + ($itemSlotGridHeight * 2)
.placeholder .placeholder
background-position: (-5 * $itemSlotInnerWidth) 0px background-position: (-5 * $itemSlotInnerWidth) 0px
@ -198,7 +194,7 @@ $itemSlotGridHeight: 51px
&[data-slot="torso"] &[data-slot="torso"]
left: 10px + ($itemSlotGridWidth * 5) left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 2) top: 15px + ($itemSlotGridHeight * 3)
.placeholder .placeholder
background-position: (-8 * $itemSlotInnerWidth) 0px background-position: (-8 * $itemSlotInnerWidth) 0px
@ -228,7 +224,7 @@ $itemSlotGridHeight: 51px
&[data-slot="head"] &[data-slot="head"]
left: 10px + ($itemSlotGridWidth * 5) left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 1) top: 15px + ($itemSlotGridHeight * 2)
.placeholder .placeholder
background-position: (-13 * $itemSlotInnerWidth) 0px background-position: (-13 * $itemSlotInnerWidth) 0px
@ -240,19 +236,19 @@ $itemSlotGridHeight: 51px
&[data-slot="gloves"] &[data-slot="gloves"]
left: 10px + ($itemSlotGridWidth * 0) left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 2) top: 15px + ($itemSlotGridHeight * 3)
.placeholder .placeholder
background-position: (-15 * $itemSlotInnerWidth) 0px background-position: (-15 * $itemSlotInnerWidth) 0px
&[data-slot="left-hand"] &[data-slot="left-hand"]
left: 10px + ($itemSlotGridWidth * 5) left: 10px + ($itemSlotGridWidth * 5)
top: 15px + ($itemSlotGridHeight * 3) top: 15px + ($itemSlotGridHeight * 4)
.placeholder .placeholder
background-position: (-16 * $itemSlotInnerWidth) 0px background-position: (-16 * $itemSlotInnerWidth) 0px
&[data-slot="right-hand"] &[data-slot="right-hand"]
left: 10px + ($itemSlotGridWidth * 0) left: 10px + ($itemSlotGridWidth * 0)
top: 15px + ($itemSlotGridHeight * 3) top: 15px + ($itemSlotGridHeight * 4)
.placeholder .placeholder
background-position: (-17 * $itemSlotInnerWidth) 0px background-position: (-17 * $itemSlotInnerWidth) 0px
@ -272,6 +268,18 @@ $itemSlotGridHeight: 51px
border: 2px solid black border: 2px solid black
background-color: white background-color: white
&.Wizard #equipped .item-slot
&[data-slot="right-hand"] .placeholder
background-position: (-20 * $itemSlotInnerWidth) 0px
&[data-slot="left-hand"] .placeholder
background-position: (-3 * $itemSlotInnerWidth) 0px
&.Ranger #equipped .item-slot
&[data-slot="right-hand"] .placeholder
background-position: (-18 * $itemSlotInnerWidth) 0px
&[data-slot="left-hand"] .placeholder
background-position: (-19 * $itemSlotInnerWidth) 0px
//- dragging styling //- dragging styling

View file

@ -9,7 +9,6 @@
background-size: contain background-size: contain
#level-loading-view #level-loading-view
color: blue
width: 100% width: 100%
height: 100% height: 100%
position: absolute position: absolute
@ -21,61 +20,86 @@
.loading-details .loading-details
position: absolute position: absolute
top: 20px top: 86px
left: 50% left: 50%
$WIDTH: 1000px $WIDTH: 450px
width: $WIDTH width: $WIDTH
min-height: 60px height: 450px
margin-left: (-$WIDTH / 2) margin-left: (-$WIDTH / 2)
z-index: 100 z-index: 100
background-color: rgba(220, 255, 230, 0.6) background: transparent url(/images/level/code_editor_background.png) no-repeat
background-size: 100% 100%
color: darkslategray color: darkslategray
font-size: 15px font-size: 15px
border-radius: 30px padding: 80px 80px 40px 80px
padding: 10px
text-align: center text-align: center
// http://matthewlein.com/ceaser/ Bounce down a bit, then snap up. // http://matthewlein.com/ceaser/ Bounce down a bit, then snap up.
@include transition(top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600)) @include transition(top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600))
font-family: 'Open Sans Condensed'
.level-loading-goals
text-align: left
.goals-title
font-size: 32px
color: black
font-weight: bold
li
font-size: 20px
color: black
.progress-or-start-container
position: absolute
bottom: 95px
width: 261px
height: 80px
left: 80px
.load-progress .load-progress
position: absolute width: 100%
left: 2% height: 36px
top: 0px margin: 20px auto 0 auto
opacity: 0.6
width: 96%
height: 40px
margin: 10px auto 0
.progress .progress
height: 100% height: 100%
position: relative
background-color: transparent
.progress-bar .progress-bar
width: 1% width: 1%
height: 100% height: 100%
transition-duration: 0 transition-duration: 0
border-radius: 9px
background: transparent url(/images/level/loading_bar_fill.png) no-repeat
&.active .progress-bar &.active .progress-bar
transition-duration: 1.2s transition-duration: 1.2s
#tip-wrapper .rim
position: relative position: absolute
z-index: 2 left: 0
top: 10px top: 0
width: 100%
.level-loading-goals height: 100%
margin: 30px auto 10px background: transparent url(/images/level/loading_bar_rim.png) no-repeat
width: 400px background-size: 100% 100%
.panel-heading
font-size: 24px
.list-group-item
font-size: 20px
.start-level-button .start-level-button
display: none
width: 100%
margin: 0px auto
font-size: 40px font-size: 40px
font-variant: small-caps font-variant: small-caps
#tip-wrapper
position: absolute
z-index: 2
bottom: 40px
left: 25px
width: 401px
color: #666
.left-wing, .right-wing .left-wing, .right-wing
width: 100% width: 100%
height: 100% height: 100%

View file

@ -25,6 +25,7 @@
left: 0px left: 0px
height: 100% height: 100%
right: -10px right: -10px
border: 1px solid transparent
span.code-background span.code-background
border-width: 124px 76px 64px 40px border-width: 124px 76px 64px 40px
@ -131,23 +132,31 @@
@include animation(progress-bar-stripes 0.5s linear infinite) @include animation(progress-bar-stripes 0.5s linear infinite)
&:not(.user-code-problem) &:not(.user-code-problem)
.ace_gutter-cell.executing:not(.ace_error):not(.ace_warning):not(.ace_info):after .ace_gutter-cell.executing:not(.ace_error):not(.ace_warning):not(.ace_info)
margin-left: 1px
background-image: url(data:image/png;base64,iVBORw0K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jE3RDIzMTIwNjgxMThEQkI4NTlBMjQ1QTEwOTUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDI4MDExNzQwNzIwNjgxMThBNkRFOENDNTEzNTJCMUYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7SazaGAAAAiElEQVR42mL8//8/AzUBEwOVweA3kAWboI2jCyhgDwBx4ZH9ey5Qy4UOQHweaHg/EAtQ08sFUIMDqBmGCkC8HmgoCCtQM1ICoK5toGYsg8KzHmjo+UGbDj8AcSMwORkSnQ7xgA3QtPmApISNBTyAGrSBGl6eAMSGxBhGyIVkZT3G0fKQYgAQYACL+C2ZM6PC7AAAAABJRU5ErkJggg==)
background-position: 0px center
// Experimenting with a larger executing-line-pointer // .ace_gutter-cell.executing:not(.ace_error):not(.ace_warning):not(.ace_info):after
content: "\e072" //
position: relative // // Experimenting with a larger executing-line-pointer
top: -31px // content: "\e072"
left: -39px // position: relative
display: inline-block // left: -39px
font-family: 'Glyphicons Halflings' // font-family: 'Glyphicons Halflings'
font-style: normal // font-style: normal
font-weight: normal // font-weight: normal
line-height: 1 // color: white
color: white // text-shadow: 0 0 5px black, 0 0 5px black, 0 0 5px black
text-shadow: 0 0 5px black, 0 0 5px black, 0 0 5px black // -webkit-font-smoothing: antialiased
font-size: 39px // -moz-osx-font-smoothing: grayscale
-webkit-font-smoothing: antialiased //
-moz-osx-font-smoothing: grayscale // // Chrome likes these, but Firefox does not
// // TODO: Figure out how to make the executing gutter arrow big, and compatible
// display: inline-block
// top: -31px
// line-height: 1
// font-size: 39px
.ace_gutter-cell.executed:not(.ace_error):not(.ace_warning):not(.ace_info) .ace_gutter-cell.executed:not(.ace_error):not(.ace_warning):not(.ace_info)
margin-left: 1px margin-left: 1px

View file

@ -4,9 +4,19 @@
.loading-details.loading-container .loading-details.loading-container
.level-loading-goals.secret
.goals-title(data-i18n="play_level.goals") Goals
ul.list-unstyled
.errors
.progress-or-start-container
button.start-level-button.btn.btn-lg.btn-success.header-fontneedsclick(data-i18n="play_level.loading_start") Start Level
.load-progress .load-progress
.progress .progress
.progress-bar.progress-bar-success .progress-bar.progress-bar-success
.rim
#tip-wrapper #tip-wrapper
strong.tip(data-i18n='play_level.tip_toggle_play') Toggle play/paused with Ctrl+P. strong.tip(data-i18n='play_level.tip_toggle_play') Toggle play/paused with Ctrl+P.
@ -41,11 +51,3 @@
strong.tip.rare strong.tip.rare
span(data-i18n='play_level.tip_harry') Yer a Wizard, span(data-i18n='play_level.tip_harry') Yer a Wizard,
span= me.get('name', true) span= me.get('name', true)
.errors
.panel.panel-default.level-loading-goals.secret
.panel-heading.header-font(data-i18n="play_level.goals") Goals
ul.list-group
button.start-level-button.btn.btn-lg.btn-success.header-font.secret.needsclick(data-i18n="play_level.loading_start") Start Level

View file

@ -63,7 +63,7 @@ module.exports = class WorldMapView extends RootView
@getLevelPlayCounts() @getLevelPlayCounts()
$(window).on 'resize', @onWindowResize $(window).on 'resize', @onWindowResize
@playAmbientSound() @playAmbientSound()
@probablyCachedMusic = storage.load("loaded-menu-music-#{@terrain}") @probablyCachedMusic = storage.load("loaded-menu-music")
musicDelay = if @probablyCachedMusic then 1000 else 10000 musicDelay = if @probablyCachedMusic then 1000 else 10000
@playMusicTimeout = _.delay (=> @playMusic() unless @destroyed), musicDelay @playMusicTimeout = _.delay (=> @playMusic() unless @destroyed), musicDelay
@hadEverChosenHero = me.get('heroConfig')?.thangType @hadEverChosenHero = me.get('heroConfig')?.thangType
@ -280,9 +280,9 @@ module.exports = class WorldMapView extends RootView
playMusic: -> playMusic: ->
@musicPlayer = new MusicPlayer() @musicPlayer = new MusicPlayer()
musicFile = {dungeon: '/music/music-menu-dungeon', forest: '/music/music-menu-grass'}[@terrain] musicFile = '/music/music-menu'
Backbone.Mediator.publish 'music-player:play-music', play: true, file: musicFile Backbone.Mediator.publish 'music-player:play-music', play: true, file: musicFile
storage.save("loaded-menu-music-#{@terrain}", true) unless @probablyCachedMusic storage.save("loaded-menu-music", true) unless @probablyCachedMusic
preloadTopHeroes: -> preloadTopHeroes: ->
for heroID in ['captain', 'knight'] for heroID in ['captain', 'knight']

View file

@ -44,7 +44,7 @@ module.exports = class LevelLoadingView extends CocoView
goalCount = 0 goalCount = 0
for goalID, goal of @level.get('goals') when (not goal.team or goal.team is e.team) and not goal.hiddenGoal for goalID, goal of @level.get('goals') when (not goal.team or goal.team is e.team) and not goal.hiddenGoal
name = utils.i18n goal, 'name' name = utils.i18n goal, 'name'
goalList.append $('<li class="list-group-item">' + name + '</li>') goalList.append $('<li>' + name + '</li>')
++goalCount ++goalCount
if goalCount if goalCount
goalContainer.removeClass('secret') goalContainer.removeClass('secret')
@ -68,8 +68,8 @@ module.exports = class LevelLoadingView extends CocoView
@unveil() @unveil()
else else
Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'level_loaded', volume: 0.75 # old: loading_ready Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'level_loaded', volume: 0.75 # old: loading_ready
@$el.find('.progress').addClass 'active progress-striped' @$el.find('.progress').hide()
@$el.find('.start-level-button').removeClass 'secret' @$el.find('.start-level-button').show()
startUnveiling: (e) -> startUnveiling: (e) ->
@playSound 'menu-button-click' @playSound 'menu-button-click'

View file

@ -31,6 +31,15 @@ exports.config =
overrides: overrides:
production: production:
sourceMaps: 'absoluteUrl' sourceMaps: 'absoluteUrl'
onCompile: (files) ->
# For some reason, production brunch produces two entries, the first of which is wrong:
# //# sourceMappingURL=public/javascripts/app.js.map
# //# sourceMappingURL=/javascripts/app.js.map
# So we remove the ones that have public in them.
exec = require('child_process').exec
for file in files
exec "perl -pi -e 's/\\/\\/# sourceMappingURL=public.*//g' #{file.path}"
exec c
files: files:
javascripts: javascripts:
@ -172,7 +181,6 @@ exports.config =
defn = if path in needHeaders then commonjsHeader else '' defn = if path in needHeaders then commonjsHeader else ''
return defn return defn
#- Find all .coffee and .jade files in /app #- Find all .coffee and .jade files in /app
dirStack = ['./app'] dirStack = ['./app']