mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-12 00:31:21 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
a4fcbadc76
4 changed files with 37 additions and 16 deletions
|
@ -295,10 +295,27 @@ class ModelResource extends Resource
|
|||
@model = modelOrCollection
|
||||
@fetchOptions = fetchOptions
|
||||
@jqxhr = @model.jqxhr
|
||||
@loadsAttempted = 0
|
||||
|
||||
load: ->
|
||||
timeToWait = 5000
|
||||
tryLoad = =>
|
||||
return if this.isLoaded
|
||||
if @loadsAttempted > 4
|
||||
@markFailed()
|
||||
return @
|
||||
@markLoading()
|
||||
if @loadsAttempted > 0
|
||||
console.log "Didn't load model in #{timeToWait}ms (attempt ##{@loadsAttempted}), trying again: ", this
|
||||
@fetchModel()
|
||||
@listenTo @model, 'error', (levelComponent, request) ->
|
||||
if request.status isnt 504
|
||||
clearTimeout(@timeoutID)
|
||||
clearTimeout(@timeoutID) if @timeoutID
|
||||
@timeoutID = setTimeout(tryLoad, timeToWait)
|
||||
@loadsAttempted += 1
|
||||
timeToWait *= 1.5
|
||||
tryLoad()
|
||||
@
|
||||
|
||||
fetchModel: ->
|
||||
|
|
|
@ -217,6 +217,7 @@ module.exports = class PlayLevelView extends RootView
|
|||
# TODO: Update terminology to always be opponentSession or otherSession
|
||||
# TODO: E.g. if it's always opponent right now, then variable names should be opponentSession until we have coop play
|
||||
@otherSession = @levelLoader.opponentSession
|
||||
unless @level.isType('game-dev')
|
||||
@worldLoadFakeResources = [] # first element (0) is 1%, last (99) is 100%
|
||||
for percent in [1 .. 100]
|
||||
@worldLoadFakeResources.push @supermodel.addSomethingResource 1
|
||||
|
@ -570,7 +571,7 @@ module.exports = class PlayLevelView extends RootView
|
|||
ModalClass = CourseVictoryModal if @isCourseMode() or me.isSessionless()
|
||||
if @level.isType('course-ladder')
|
||||
ModalClass = CourseVictoryModal
|
||||
options.courseInstanceID = @getQueryVariable 'league'
|
||||
options.courseInstanceID = @getQueryVariable 'course-instance' or @getQueryVariable 'league'
|
||||
ModalClass = PicoCTFVictoryModal if window.serverConfig.picoCTF
|
||||
victoryModal = new ModalClass(options)
|
||||
@openModalView(victoryModal)
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = class CourseVictoryModal extends ModalView
|
|||
|
||||
initialize: (options) ->
|
||||
@courseID = options.courseID
|
||||
@courseInstanceID = options.courseInstanceID
|
||||
@courseInstanceID = options.courseInstanceID or @getQueryVariable 'course-instance' or @getQueryVariable 'league'
|
||||
@views = []
|
||||
|
||||
@session = options.session
|
||||
|
|
|
@ -64,10 +64,8 @@ var courses =
|
|||
slug: "game-dev-1",
|
||||
campaignID: ObjectId("5789236960deed1f00ec2ab8"),
|
||||
description: "Learn to create your owns games which you can share with your friends.",
|
||||
duration: NumberInt(5),
|
||||
duration: NumberInt(1),
|
||||
free: false,
|
||||
//screenshot: "/images/pages/courses/105_info.png",
|
||||
adminOnly: true, // Until we finish transitioning to releasePhase
|
||||
releasePhase: 'beta'
|
||||
},
|
||||
{
|
||||
|
@ -75,10 +73,8 @@ var courses =
|
|||
slug: "web-dev-1",
|
||||
campaignID: ObjectId("578913f2c8871ac2326fa3e4"),
|
||||
description: "Learn the basics of web development in this introductory HTML & CSS course.",
|
||||
duration: NumberInt(5),
|
||||
duration: NumberInt(1),
|
||||
free: false,
|
||||
//screenshot: "/images/pages/courses/105_info.png",
|
||||
adminOnly: true, // Until we finish transitioning to releasePhase
|
||||
releasePhase: 'beta'
|
||||
},
|
||||
{
|
||||
|
@ -86,10 +82,17 @@ var courses =
|
|||
slug: "web-dev-2",
|
||||
campaignID: ObjectId("57891570c8871ac2326fa3f8"),
|
||||
description: "Learn more advanced web development, including scripting to make interactive webpages.",
|
||||
duration: NumberInt(5),
|
||||
duration: NumberInt(2),
|
||||
free: false,
|
||||
releasePhase: 'beta'
|
||||
},
|
||||
{
|
||||
name: "JS Primer",
|
||||
slug: "js-primer",
|
||||
campaignID: ObjectId("579a5f37843ad12000e6d4c7"),
|
||||
description: "Learn JavaScript after you already know another programming language like Python.",
|
||||
duration: NumberInt(1),
|
||||
free: false,
|
||||
//screenshot: "/images/pages/courses/105_info.png",
|
||||
adminOnly: true, // Until we finish transitioning to releasePhase
|
||||
releasePhase: 'beta'
|
||||
}
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue