mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 08:38:09 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
45ae15efad
8 changed files with 31 additions and 11 deletions
|
@ -162,7 +162,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
||||||
service = require service
|
service = require service
|
||||||
service()
|
service()
|
||||||
|
|
||||||
renderLoginButtons: ->
|
renderLoginButtons: =>
|
||||||
@initializeSocialMediaServices()
|
@initializeSocialMediaServices()
|
||||||
$('.share-buttons, .partner-badges').addClass('fade-in').delay(10000).removeClass('fade-in', 5000)
|
$('.share-buttons, .partner-badges').addClass('fade-in').delay(10000).removeClass('fade-in', 5000)
|
||||||
setTimeout(FB.XFBML.parse, 10) if FB?.XFBML?.parse # Handles FB login and Like
|
setTimeout(FB.XFBML.parse, 10) if FB?.XFBML?.parse # Handles FB login and Like
|
||||||
|
|
|
@ -8,6 +8,8 @@ module.exports =
|
||||||
|
|
||||||
'auth:logging-in-with-facebook': c.object {}
|
'auth:logging-in-with-facebook': c.object {}
|
||||||
|
|
||||||
|
'auth:logging-out': c.object {}
|
||||||
|
|
||||||
'auth:logged-in-with-facebook': c.object {title: 'Facebook logged in', description: 'Published when you successfully logged in with Facebook', required: ['response']},
|
'auth:logged-in-with-facebook': c.object {title: 'Facebook logged in', description: 'Published when you successfully logged in with Facebook', required: ['response']},
|
||||||
response:
|
response:
|
||||||
type: 'object'
|
type: 'object'
|
||||||
|
|
|
@ -169,5 +169,6 @@ $heroCanvasHeight: 265px
|
||||||
background-image: url(/images/common/code_languages/io_small.png)
|
background-image: url(/images/common/code_languages/io_small.png)
|
||||||
|
|
||||||
body.ipad #choose-hero-view
|
body.ipad #choose-hero-view
|
||||||
|
// iPad is Python-only for now, and has its own reset button.
|
||||||
.form
|
.form
|
||||||
display: none
|
display: none
|
||||||
|
|
|
@ -245,7 +245,7 @@ $gameControlMargin: 30px
|
||||||
|
|
||||||
.old-levels
|
.old-levels
|
||||||
position: absolute
|
position: absolute
|
||||||
bottom: 1%
|
bottom: 5%
|
||||||
left: 1%
|
left: 1%
|
||||||
z-index: 3
|
z-index: 3
|
||||||
|
|
||||||
|
@ -261,9 +261,7 @@ $gameControlMargin: 30px
|
||||||
.user-status
|
.user-status
|
||||||
position: absolute
|
position: absolute
|
||||||
bottom: 1%
|
bottom: 1%
|
||||||
left: 50%
|
left: 1%
|
||||||
width: 400px
|
|
||||||
margin-left: -200px
|
|
||||||
text-align: center
|
text-align: center
|
||||||
font-size: 24px
|
font-size: 24px
|
||||||
color: white
|
color: white
|
||||||
|
@ -302,10 +300,10 @@ body:not(.ipad) #world-map-view
|
||||||
.level-info-container
|
.level-info-container
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
|
|
||||||
.old-levels
|
|
||||||
display: none
|
|
||||||
|
|
||||||
body.ipad #world-map-view
|
body.ipad #world-map-view
|
||||||
// iPad only supports up to Kithgard Gates for now.
|
// iPad only supports up to Kithgard Gates for now.
|
||||||
.campaign-switch
|
.campaign-switch
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
|
.old-levels
|
||||||
|
display: none
|
||||||
|
|
|
@ -56,8 +56,9 @@ block modal-body-content
|
||||||
else
|
else
|
||||||
input.btn.btn-info.btn-large#login-button(value=translate("login.log_in"), type="submit")
|
input.btn.btn-info.btn-large#login-button(value=translate("login.log_in"), type="submit")
|
||||||
.btn.btn-default.btn-large#switch-to-signup-button(data-i18n="login.sign_up") Create Account
|
.btn.btn-default.btn-large#switch-to-signup-button(data-i18n="login.sign_up") Create Account
|
||||||
if mode === 'signup'
|
else if mode === 'signup'
|
||||||
input.btn.btn-info.btn-large#signup-button(value=translate("signup.sign_up"), type="submit")
|
input.btn.btn-info.btn-large#signup-button(value=translate("signup.sign_up"), type="submit")
|
||||||
|
.btn.btn-default.btn-large#switch-to-login-button(data-i18n="login.log_in")
|
||||||
|
|
||||||
|
|
||||||
block modal-body-wait-content
|
block modal-body-wait-content
|
||||||
|
|
|
@ -43,6 +43,7 @@ module.exports = class RootView extends CocoView
|
||||||
success: (achievement) => @showNewAchievement(achievement, earnedAchievement)
|
success: (achievement) => @showNewAchievement(achievement, earnedAchievement)
|
||||||
|
|
||||||
logoutAccount: ->
|
logoutAccount: ->
|
||||||
|
Backbone.Mediator.publish("auth:logging-out")
|
||||||
window.tracker?.trackEvent 'Homepage', Action: 'Log Out' if @id is 'home-view'
|
window.tracker?.trackEvent 'Homepage', Action: 'Log Out' if @id is 'home-view'
|
||||||
logoutUser($('#login-email').val())
|
logoutUser($('#login-email').val())
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,12 @@ application = require 'application'
|
||||||
module.exports = class AuthModal extends ModalView
|
module.exports = class AuthModal extends ModalView
|
||||||
id: 'auth-modal'
|
id: 'auth-modal'
|
||||||
template: template
|
template: template
|
||||||
mode: 'login' # or 'signup'
|
mode: 'signup' # or 'login'
|
||||||
|
|
||||||
events:
|
events:
|
||||||
# login buttons
|
# login buttons
|
||||||
'click #switch-to-signup-button': 'onSignupInstead'
|
'click #switch-to-signup-button': 'onSignupInstead'
|
||||||
|
'click #switch-to-login-button': 'onLoginInstead'
|
||||||
'click #confirm-age': 'checkAge'
|
'click #confirm-age': 'checkAge'
|
||||||
'click #github-login-button': 'onGitHubLoginClicked'
|
'click #github-login-button': 'onGitHubLoginClicked'
|
||||||
'submit': 'onSubmitForm' # handles both submit buttons
|
'submit': 'onSubmitForm' # handles both submit buttons
|
||||||
|
@ -51,6 +52,12 @@ module.exports = class AuthModal extends ModalView
|
||||||
@render()
|
@render()
|
||||||
_.delay application.router.renderLoginButtons, 500
|
_.delay application.router.renderLoginButtons, 500
|
||||||
|
|
||||||
|
onLoginInstead: (e) ->
|
||||||
|
@mode = 'login'
|
||||||
|
@previousFormInputs = forms.formToObject @$el
|
||||||
|
@render()
|
||||||
|
_.delay application.router.renderLoginButtons, 500
|
||||||
|
|
||||||
onSubmitForm: (e) ->
|
onSubmitForm: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if @mode is 'login' then @loginAccount() else @createAccount()
|
if @mode is 'login' then @loginAccount() else @createAccount()
|
||||||
|
|
|
@ -7,6 +7,7 @@ PlayLevelModal = require 'views/play/modal/PlayLevelModal'
|
||||||
ThangType = require 'models/ThangType'
|
ThangType = require 'models/ThangType'
|
||||||
MusicPlayer = require 'lib/surface/MusicPlayer'
|
MusicPlayer = require 'lib/surface/MusicPlayer'
|
||||||
storage = require 'lib/storage'
|
storage = require 'lib/storage'
|
||||||
|
AuthModal = require 'views/modal/AuthModal'
|
||||||
|
|
||||||
class LevelSessionsCollection extends CocoCollection
|
class LevelSessionsCollection extends CocoCollection
|
||||||
url: ''
|
url: ''
|
||||||
|
@ -106,6 +107,15 @@ module.exports = class WorldMapView extends RootView
|
||||||
@updateVolume()
|
@updateVolume()
|
||||||
@highlightElement '.level.next', delay: 500, duration: 60000, rotation: 0, sides: ['top'] unless window.currentModal
|
@highlightElement '.level.next', delay: 500, duration: 60000, rotation: 0, sides: ['top'] unless window.currentModal
|
||||||
|
|
||||||
|
afterInsert: ->
|
||||||
|
super()
|
||||||
|
return unless @getQueryVariable 'signup'
|
||||||
|
return if me.get('email')
|
||||||
|
@endHighlight()
|
||||||
|
authModal = new AuthModal supermodel: @supermodel
|
||||||
|
authModal.mode = 'signup'
|
||||||
|
@openModalView authModal
|
||||||
|
|
||||||
onSessionsLoaded: (e) ->
|
onSessionsLoaded: (e) ->
|
||||||
for session in @sessions.models
|
for session in @sessions.models
|
||||||
@levelStatusMap[session.get('levelID')] = if session.get('state')?.complete then 'complete' else 'started'
|
@levelStatusMap[session.get('levelID')] = if session.get('state')?.complete then 'complete' else 'started'
|
||||||
|
|
Loading…
Reference in a new issue