mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-01 16:33:38 -04:00
Fixed A/B test to fire with default English language.
This commit is contained in:
parent
6f437d11b1
commit
7651eaf6cc
5 changed files with 8 additions and 7 deletions
app
lib
models
styles/play
views/core
|
@ -111,9 +111,6 @@ class AudioPlayer extends CocoClass
|
||||||
@soundsToPlayWhenLoaded[name] = audioOptions.volume
|
@soundsToPlayWhenLoaded[name] = audioOptions.volume
|
||||||
audioOptions = @applyPanning audioOptions, pos if @camera and not @camera.destroyed and pos
|
audioOptions = @applyPanning audioOptions, pos if @camera and not @camera.destroyed and pos
|
||||||
instance = createjs.Sound.play name, audioOptions
|
instance = createjs.Sound.play name, audioOptions
|
||||||
# For some reason, individual sound volume control doesn't work any more.
|
|
||||||
# I tried updating to SoundJS NEXT on 2014-09-10, but couldn't get any sounds to play with that one.
|
|
||||||
#console.log 'got instance with volume', instance.volume, instance._volume, instance.gainNode?.gain.value
|
|
||||||
instance
|
instance
|
||||||
|
|
||||||
hasLoadedSound: (filename, name) ->
|
hasLoadedSound: (filename, name) ->
|
||||||
|
|
|
@ -27,7 +27,7 @@ module.exports = class MusicPlayer extends CocoClass
|
||||||
onPlayMusic: (e) ->
|
onPlayMusic: (e) ->
|
||||||
return if application.isIPadApp # Hard to measure, but just guessing this will save memory.
|
return if application.isIPadApp # Hard to measure, but just guessing this will save memory.
|
||||||
src = e.file
|
src = e.file
|
||||||
src = "/file#{e.file}#{AudioPlayer.ext}"
|
src = "/file#{src}#{AudioPlayer.ext}"
|
||||||
if (not e.file) or src is @currentMusic?.src
|
if (not e.file) or src is @currentMusic?.src
|
||||||
if e.play then @restartCurrentMusic() else @fadeOutCurrentMusic()
|
if e.play then @restartCurrentMusic() else @fadeOutCurrentMusic()
|
||||||
return
|
return
|
||||||
|
|
|
@ -144,7 +144,7 @@ module.exports = class User extends CocoModel
|
||||||
@subscribeCopyGroup = switch group
|
@subscribeCopyGroup = switch group
|
||||||
when 0, 1, 2 then 'original'
|
when 0, 1, 2 then 'original'
|
||||||
when 3, 4, 5 then 'new'
|
when 3, 4, 5 then 'new'
|
||||||
if /^en/.test(@get('preferredLanguage')) and not me.isAdmin()
|
if (not @get('preferredLanguage') or /^en/.test(@get('preferredLanguage'))) and not me.isAdmin()
|
||||||
application.tracker.identify subscribeCopyGroup: @subscribeCopyGroup
|
application.tracker.identify subscribeCopyGroup: @subscribeCopyGroup
|
||||||
else
|
else
|
||||||
@subscribeCopyGroup = 'original'
|
@subscribeCopyGroup = 'original'
|
||||||
|
|
|
@ -96,6 +96,7 @@ $gameControlMargin: 30px
|
||||||
.map-background
|
.map-background
|
||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
|
@include user-select(none)
|
||||||
|
|
||||||
.level, .level-shadow
|
.level, .level-shadow
|
||||||
position: absolute
|
position: absolute
|
||||||
|
|
|
@ -161,7 +161,7 @@ module.exports = class CocoView extends Backbone.View
|
||||||
else
|
else
|
||||||
@warnConnectionError()
|
@warnConnectionError()
|
||||||
return _.delay (=> r.load()), 3000
|
return _.delay (=> r.load()), 3000
|
||||||
|
|
||||||
@$el.find('.loading-container .errors').append(loadingErrorTemplate({
|
@$el.find('.loading-container .errors').append(loadingErrorTemplate({
|
||||||
status: r.jqxhr?.status
|
status: r.jqxhr?.status
|
||||||
name: r.name
|
name: r.name
|
||||||
|
@ -173,7 +173,7 @@ module.exports = class CocoView extends Backbone.View
|
||||||
warnConnectionError: ->
|
warnConnectionError: ->
|
||||||
msg = $.i18n.t 'loading_error.connection_failure', defaultValue: 'Connection failed.'
|
msg = $.i18n.t 'loading_error.connection_failure', defaultValue: 'Connection failed.'
|
||||||
noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
|
noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
|
||||||
|
|
||||||
onRetryResource: (e) ->
|
onRetryResource: (e) ->
|
||||||
res = @supermodel.getResource($(e.target).data('resource-index'))
|
res = @supermodel.getResource($(e.target).data('resource-index'))
|
||||||
# different views may respond to this call, and not all have the resource to reload
|
# different views may respond to this call, and not all have the resource to reload
|
||||||
|
@ -425,6 +425,9 @@ module.exports = class CocoView extends Backbone.View
|
||||||
isIPadBrowser: ->
|
isIPadBrowser: ->
|
||||||
navigator?.userAgent?.indexOf('iPad') isnt -1
|
navigator?.userAgent?.indexOf('iPad') isnt -1
|
||||||
|
|
||||||
|
isFirefox: ->
|
||||||
|
navigator.userAgent.toLowerCase().indexOf('firefox') isnt -1
|
||||||
|
|
||||||
initSlider: ($el, startValue, changeCallback) ->
|
initSlider: ($el, startValue, changeCallback) ->
|
||||||
slider = $el.slider({animate: 'fast'})
|
slider = $el.slider({animate: 'fast'})
|
||||||
slider.slider('value', startValue)
|
slider.slider('value', startValue)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue