mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Merge branch 'master' into production
This commit is contained in:
commit
23f8f461d7
5 changed files with 15 additions and 8 deletions
app
assets
lib
models
views/play/level/tome
|
@ -28,11 +28,20 @@
|
|||
<link rel="shortcut icon" href="/images/favicon.ico">
|
||||
<link rel="stylesheet" href="/stylesheets/app.css">
|
||||
|
||||
<!-- IE9 doesn't support defer attribute: https://github.com/h5bp/lazyweb-requests/issues/42 -->
|
||||
<!--[if IE 9]>
|
||||
<script src="/lib/ace/ace.js"></script>
|
||||
<script src="/javascripts/box2d.js"></script>
|
||||
<script src="/javascripts/vendor.js"></script>
|
||||
<script src="/javascripts/aether.js"></script>
|
||||
<script src="/javascripts/app.js"></script>
|
||||
<![endif]-->
|
||||
<![if (gt IE 9)|(!IE)]>
|
||||
<script src="/lib/ace/ace.js" defer></script>
|
||||
<!--[if IE 9]><script src="/javascripts/box2d.js"></script><![endif]-->
|
||||
<script src="/javascripts/vendor.js" defer></script>
|
||||
<script src="/javascripts/aether.js" defer></script>
|
||||
<script src="/javascripts/app.js" defer></script> <!-- it's all Backbone! -->
|
||||
<![endif]>
|
||||
<script>
|
||||
|
||||
// Placeholder for iPad, which inspects the user object at the bottom of an injected page.
|
||||
|
|
|
@ -30,9 +30,9 @@ module.exports = class LevelBus extends Bus
|
|||
super(arguments...)
|
||||
@changedSessionProperties = {}
|
||||
if document.location.href.search('codecombat.com') isnt -1
|
||||
@saveSession = _.debounce(@reallySaveSession, 10000, {maxWait: 30000}) # Save us during HoC
|
||||
@saveSession = _.debounce(@reallySaveSession, 4000, {maxWait: 10000}) # Save slower on production.
|
||||
else
|
||||
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Not this fast during HoC
|
||||
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Save quickly in development.
|
||||
@playerIsIdle = false
|
||||
|
||||
init: ->
|
||||
|
|
|
@ -19,10 +19,10 @@ class CocoModel extends Backbone.Model
|
|||
@on 'error', @onError, @
|
||||
@on 'add', @onLoaded, @
|
||||
@saveBackup = _.debounce(@saveBackup, 500)
|
||||
@usesVersions = @schema().properties.version?
|
||||
@usesVersions = @schema()?.properties?.version?
|
||||
|
||||
backupKey: ->
|
||||
if @usesVersions then @id else @id + ':' + @attributes.__v # TODO: doesn't work because __v doesn't actually increment?
|
||||
if @usesVersions then @id else @id + ':' + @attributes.__v # TODO: doesn't work because __v doesn't actually increment. #2061
|
||||
|
||||
setProjection: (project) ->
|
||||
return if project is @project
|
||||
|
|
|
@ -59,6 +59,7 @@ module.exports = class LevelSession extends CocoModel
|
|||
state.difficulty = (state.difficulty ? 0) + 1
|
||||
delete state.lastUnsuccessfulSubmissionTime
|
||||
@set 'state', state
|
||||
@save()
|
||||
|
||||
timeUntilResubmit: ->
|
||||
state = @get('state') ? {}
|
||||
|
|
|
@ -733,9 +733,6 @@ module.exports = class SpellView extends CocoView
|
|||
hashValue = aether.raw + aetherProblem.message
|
||||
return if hashValue of @savedProblems
|
||||
@savedProblems[hashValue] = true
|
||||
if Math.random() > 0.01
|
||||
# Let's only save a tiny fraction of these during HoC to reduce writes.
|
||||
return
|
||||
|
||||
# Save new problem
|
||||
@userCodeProblem = new UserCodeProblem()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue