mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-24 21:13:35 -04:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
5a8d1b0a2b
3 changed files with 13 additions and 7 deletions
app
|
@ -17,7 +17,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
|
||||
# editor views tend to have the same general structure
|
||||
'editor/:model(/:slug_or_id)(/:subview)': 'editorModelView'
|
||||
|
||||
|
||||
# Experimenting with direct links
|
||||
# 'play/ladder/:levelID/team/:team': go('play/ladder/team_view')
|
||||
|
||||
|
@ -31,7 +31,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
home: -> @openRoute('home')
|
||||
general: (name) ->
|
||||
@openRoute(name)
|
||||
|
||||
|
||||
editorModelView: (modelName, slugOrId, subview) ->
|
||||
modulePrefix = "views/editor/#{modelName}/"
|
||||
suffix = subview or (if slugOrId then 'edit' else 'home')
|
||||
|
@ -92,7 +92,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
view = @getView(route)
|
||||
@cache[route] = view if view?.cache
|
||||
return view
|
||||
|
||||
|
||||
routeDirectly: (path, args) ->
|
||||
path = "views/#{path}"
|
||||
ViewClass = @tryToLoadModule path
|
||||
|
@ -154,7 +154,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
|
||||
onNavigate: (e) ->
|
||||
manualView = e.view or e.viewClass
|
||||
@navigate e.route, {trigger:not manualView}
|
||||
@navigate e.route, {trigger: not manualView}
|
||||
return unless manualView
|
||||
if e.viewClass
|
||||
args = e.viewArgs or []
|
||||
|
|
|
@ -44,6 +44,6 @@ block content
|
|||
span(data-i18n="ladder.simulation_explanation") By simulating games you can get your game ranked faster!
|
||||
p
|
||||
button(data-i18n="ladder.simulate_games").btn.btn-warning.btn-lg.highlight#simulate-button Simulate Games!
|
||||
if me.isAdmin()
|
||||
if false && me.isAdmin()
|
||||
p
|
||||
button(data-i18n="ladder.simulate_all").btn.btn-danger.btn-lg.highlight#simulate-all-button RESET AND SIMULATE GAMES
|
||||
|
|
|
@ -66,7 +66,6 @@ module.exports = class SpectateLevelView extends View
|
|||
'ctrl+s': 'onCtrlS'
|
||||
|
||||
constructor: (options, @levelID) ->
|
||||
@originalOptions = _.cloneDeep(options)
|
||||
console.profile?() if PROFILE_ME
|
||||
super options
|
||||
$(window).on('resize', @onWindowResize)
|
||||
|
@ -446,7 +445,14 @@ module.exports = class SpectateLevelView extends View
|
|||
Backbone.Mediator.publish 'router:navigate', {
|
||||
route: url,
|
||||
viewClass: SpectateLevelView,
|
||||
viewArgs: [{spectateSessions:{sessionOne: @sessionOne, sessionTwo: @sessionTwo}}, @levelID ]}
|
||||
viewArgs: [
|
||||
{
|
||||
spectateSessions: {sessionOne: @sessionOne, sessionTwo: @sessionTwo}
|
||||
supermodel: @supermodel
|
||||
}
|
||||
@levelID ]
|
||||
}
|
||||
history?.pushState? {}, "", url # Backbone won't update the URL if just query parameters change
|
||||
|
||||
fetchRandomSessionPair: (cb) ->
|
||||
console.log "Fetching random session pair!"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue