mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Server now thinks it's production whenever it's not localhost:3000, rather than whenever it is codecombat.com.
This commit is contained in:
parent
7de6fcf5fd
commit
bb80db9cd5
3 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ console.debug ?= console.log # Needed for IE10 and earlier
|
|||
|
||||
Application = initialize: ->
|
||||
Router = require('core/Router')
|
||||
@isProduction = -> document.location.href.search('codecombat.com') isnt -1
|
||||
@isProduction = -> document.location.href.search('https?://localhost:3000') is -1
|
||||
@isIPadApp = webkit?.messageHandlers? and navigator.userAgent?.indexOf('iPad') isnt -1
|
||||
$('body').addClass 'ipad' if @isIPadApp
|
||||
@tracker = new Tracker()
|
||||
|
|
|
@ -29,7 +29,7 @@ module.exports = class LevelBus extends Bus
|
|||
constructor: ->
|
||||
super(arguments...)
|
||||
@changedSessionProperties = {}
|
||||
if document.location.href.search('codecombat.com') isnt -1
|
||||
if application.isProduction()
|
||||
@saveSession = _.debounce(@reallySaveSession, 4000, {maxWait: 10000}) # Save slower on production.
|
||||
else
|
||||
@saveSession = _.debounce(@reallySaveSession, 1000, {maxWait: 5000}) # Save quickly in development.
|
||||
|
|
|
@ -121,7 +121,7 @@ module.exports = class CocoView extends Backbone.View
|
|||
|
||||
getRenderData: (context) ->
|
||||
context ?= {}
|
||||
context.isProduction = document.location.href.search(/codecombat.com/) isnt -1
|
||||
context.isProduction = application.isProduction()
|
||||
context.me = me
|
||||
context.pathname = document.location.pathname # like '/play/level'
|
||||
context.fbRef = context.pathname.replace(/[^a-zA-Z0-9+/=\-.:_]/g, '').slice(0, 40) or 'home'
|
||||
|
|
Loading…
Reference in a new issue