mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Merge branch 'master' into production
This commit is contained in:
commit
383f215b36
252 changed files with 858 additions and 719 deletions
app
assets
collections
core
CocoClass.coffeeModuleLoader.coffeeNameLoader.coffeeRouter.coffeeSystemNameLoader.coffeeTracker.coffeeapplication.coffeeauth.coffeecontact.coffeedeltas.coffeeerrors.coffeeforms.coffeeinitialize.coffee
services
social-handlers
storage.coffeetreema-ext.coffeeutils.coffeelib
Angel.coffeeAsyncCloner.coffeeAudioPlayer.coffeeBus.coffeeGod.coffeeLevelBus.coffeeLevelLoader.coffeeLevelOptions.coffeeLevelSetupManager.coffee
scripts
simulator
sprites
surface
Camera.coffeeCoordinateGrid.coffeeCountdownScreen.coffeeDimmer.coffeeFlagLank.coffeeLabel.coffeeLank.coffeeLankBoss.coffeeLayerAdapter.coffeeMark.coffeeMusicPlayer.coffeePlaybackOverScreen.coffeePointChooser.coffeeRegionChooser.coffeeSurface.coffeeTrailMaster.coffeeWaitingScreen.coffeeWizardLank.coffee
world
locale
models
Achievement.coffeeCocoModel.coffeeEarnedAchievement.coffeeLevelSystem.coffeeThangType.coffeeUser.coffee
schemas
styles
templates
views
|
@ -1,7 +1,7 @@
|
|||
// Helper for running tests through Karma.
|
||||
// Hooks into the test view logic for running tests.
|
||||
|
||||
require('initialize');
|
||||
require('core/initialize');
|
||||
console.debug = function() {}; // Karma conf doesn't seem to work? Debug messages are still emitted when they shouldn't be.
|
||||
TestView = require('views/TestView');
|
||||
TestView.runTests();
|
|
@ -28,23 +28,46 @@
|
|||
<link rel="shortcut icon" href="/images/favicon.ico">
|
||||
<link rel="stylesheet" href="/stylesheets/app.css">
|
||||
|
||||
<script src="/lib/ace/ace.js"></script>
|
||||
<script src="/lib/ace/ace.js" defer></script>
|
||||
<!--[if IE 9]><script src="/javascripts/box2d.js"></script><![endif]-->
|
||||
<script src="/javascripts/vendor.js"></script>
|
||||
<script src="/javascripts/aether.js"></script>
|
||||
<script src="/javascripts/app.js"></script> <!-- it's all Backbone! -->
|
||||
<script>$(function() { FastClick.attach(document.body); });</script>
|
||||
<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! -->
|
||||
<script>
|
||||
window.userObject = "userObjectTag";
|
||||
onLoad = function() {
|
||||
FastClick.attach(document.body);
|
||||
window.userObject = "userObjectTag";
|
||||
require('core/initialize');
|
||||
}
|
||||
</script>
|
||||
<script>require('initialize');</script>
|
||||
|
||||
</head>
|
||||
<body class="nano clearfix">
|
||||
<body class="nano clearfix" onload="onLoad();">
|
||||
<div id="fb-root"></div>
|
||||
|
||||
<div id="page-container" class="nano-content"></div>
|
||||
<div id="page-container" class="nano-content">
|
||||
</div>
|
||||
|
||||
<div id="modal-wrapper" class="modal-content"></div>
|
||||
|
||||
<div class="modal fade" id="module-loading-list">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">LOADING</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<ul class="list-group"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="panel panel-primary" id="module-loading-list">-->
|
||||
<!--<div class="panel-heading">-->
|
||||
<!--<div class="panel-title">LOADING</div>-->
|
||||
<!--</div>-->
|
||||
<!--<ul class="list-group"></ul>-->
|
||||
<!--</div>-->
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
CocoCollection = require 'collections/CocoCollection'
|
||||
Achievement = require 'models/Achievement'
|
||||
|
||||
class NewAchievementCollection extends CocoCollection
|
||||
model: Achievement
|
||||
|
||||
initialize: (me = require('lib/auth').me) ->
|
||||
@url = "/db/user/#{me.id}/achievements?notified=false"
|
||||
|
||||
module.exports = NewAchievementCollection
|
|
@ -1,5 +1,5 @@
|
|||
# Template for classes with common functions, like hooking into the Mediator.
|
||||
utils = require './utils'
|
||||
utils = require './../core/utils'
|
||||
classCount = 0
|
||||
makeScopeName = -> "class-scope-#{classCount++}"
|
||||
doNothing = ->
|
107
app/core/ModuleLoader.coffee
Normal file
107
app/core/ModuleLoader.coffee
Normal file
|
@ -0,0 +1,107 @@
|
|||
CocoClass = require 'core/CocoClass'
|
||||
locale = require 'locale/locale'
|
||||
|
||||
LOG = false
|
||||
|
||||
|
||||
module.exports = ModuleLoader = class ModuleLoader extends CocoClass
|
||||
|
||||
@WADS = [
|
||||
'lib/world'
|
||||
'lib/surface'
|
||||
'views/play'
|
||||
'views/game-menu'
|
||||
'views/editor'
|
||||
]
|
||||
|
||||
constructor: ->
|
||||
super()
|
||||
@loaded = {}
|
||||
@queue = new createjs.LoadQueue()
|
||||
@queue.on('fileload', @onFileLoad, @)
|
||||
|
||||
load: (path, first=true) ->
|
||||
if first
|
||||
$('#module-loading-list ul').empty()
|
||||
@recentPaths = []
|
||||
@recentLoadedBytes = 0
|
||||
|
||||
originalPath = path
|
||||
wad = _.find ModuleLoader.WADS, (wad) -> _.string.startsWith(path, wad)
|
||||
path = wad if wad
|
||||
return false if @loaded[path]
|
||||
$('#module-loading-list').modal('show') if first
|
||||
@loaded[path] = true
|
||||
@recentPaths.push(path)
|
||||
li = $("<li class='list-group-item loading' data-path='#{path}'>#{path}</li>")
|
||||
.prepend($("<span class='glyphicon glyphicon-minus'></span>"))
|
||||
.prepend($("<span class='glyphicon glyphicon-ok'></span>"))
|
||||
ul = $('#module-loading-list ul')
|
||||
ul.append(li).scrollTop(ul[0].scrollHeight)
|
||||
console.debug 'Loading js file:', "/javascripts/app/#{path}.js" if LOG
|
||||
@queue.loadFile({
|
||||
id: path
|
||||
src: "/javascripts/app/#{path}.js"
|
||||
type: createjs.LoadQueue.JAVASCRIPT
|
||||
})
|
||||
return true
|
||||
|
||||
loadLanguage: (langCode) ->
|
||||
loading = @load("locale/#{langCode}")
|
||||
firstBit = langCode[...2]
|
||||
return loading if firstBit is langCode
|
||||
return loading unless locale[firstBit]?
|
||||
return @load("locale/#{firstBit}", false) or loading
|
||||
|
||||
onFileLoad: (e) =>
|
||||
$("#module-loading-list li[data-path='#{e.item.id}']").removeClass('loading').addClass('success')
|
||||
have = window.require.list()
|
||||
console.group('Dependencies', e.item.id) if LOG
|
||||
@recentLoadedBytes += e.rawResult.length
|
||||
dependencies = @parseDependencies(e.rawResult)
|
||||
console.groupEnd() if LOG
|
||||
missing = _.difference dependencies, have
|
||||
@load(module, false) for module in missing
|
||||
locale.update() if _.string.startsWith(e.item.id, 'locale')
|
||||
$(e.result).remove()
|
||||
if @queue.progress is 1
|
||||
$('#module-loading-list').modal('hide')
|
||||
@recentPaths.sort()
|
||||
console.log @recentPaths.join('\n')
|
||||
console.log 'loaded', @recentPaths.length, 'files,', parseInt(@recentLoadedBytes/1024), 'KB'
|
||||
@trigger 'load-complete'
|
||||
|
||||
parseDependencies: (raw) ->
|
||||
bits = raw.match(/(require\(\'([^)]+)\')|(register\(\".+\")/g) or []
|
||||
rootFolder = null
|
||||
dependencies = []
|
||||
for bit in bits
|
||||
if _.string.startsWith(bit, 'register')
|
||||
root = bit.slice(10, bit.length-1) # remove 'register("' and final double quote
|
||||
console.groupEnd() if rootFolder if LOG
|
||||
rootFolder = (root.match('.+/')[0] or '')[...-1]
|
||||
console.group('register', rootFolder, "(#{bit})") if LOG
|
||||
else
|
||||
dep = bit.slice(9, bit.length-1) # remove "require('" and final single quote
|
||||
dep = dep[1...] if dep[0] is '/'
|
||||
dep = @expand(rootFolder, dep)
|
||||
continue if dep is 'memwatch'
|
||||
continue if _.string.startsWith(dep, 'ace/')
|
||||
dependencies.push(dep)
|
||||
console.log dep if LOG
|
||||
console.groupEnd() if LOG
|
||||
return dependencies
|
||||
|
||||
expand: (root, name) ->
|
||||
results = []
|
||||
if /^\.\.?(\/|$)/.test(name)
|
||||
parts = [root, name].join('/').split('/')
|
||||
else
|
||||
parts = name.split('/')
|
||||
for part in parts
|
||||
if part is '..'
|
||||
results.pop()
|
||||
else if (part isnt '.' and part isnt '')
|
||||
results.push(part)
|
||||
return results.join('/')
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
namesCache = {}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
gplusClientID = '800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com'
|
||||
# TODO: Move to GPlusHandler
|
||||
|
||||
NotFoundView = require('views/NotFoundView')
|
||||
NotFoundView = require('views/core/NotFoundView')
|
||||
|
||||
go = (path) -> -> @routeDirectly path, arguments
|
||||
|
||||
|
@ -105,8 +105,12 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
window.location.href = window.location.href
|
||||
|
||||
routeDirectly: (path, args) ->
|
||||
path = "views/#{path}"
|
||||
path = "views/#{path}" if not _.str.startsWith(path, 'views/')
|
||||
ViewClass = @tryToLoadModule path
|
||||
if not ViewClass and application.moduleLoader.load(path)
|
||||
@listenToOnce application.moduleLoader, 'load-complete', ->
|
||||
@routeDirectly(path, args)
|
||||
return
|
||||
return @openView @notFoundView() if not ViewClass
|
||||
view = new ViewClass({}, args...) # options, then any path fragment args
|
||||
view.render()
|
||||
|
@ -148,15 +152,9 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
|
||||
initializeSocialMediaServices: ->
|
||||
return if application.testing or application.demoing
|
||||
services = [
|
||||
'./lib/services/facebook'
|
||||
'./lib/services/google'
|
||||
'./lib/services/twitter'
|
||||
]
|
||||
|
||||
for service in services
|
||||
service = require service
|
||||
service()
|
||||
require('core/services/facebook')()
|
||||
require('core/services/google')()
|
||||
require('core/services/twitter')()
|
||||
|
||||
renderLoginButtons: =>
|
||||
@initializeSocialMediaServices()
|
|
@ -1,4 +1,4 @@
|
|||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
debugAnalytics = false
|
||||
|
||||
|
@ -25,18 +25,29 @@ module.exports = class Tracker
|
|||
console.log 'Going to track visit for', "/#{url}" if debugAnalytics
|
||||
analytics.pageview "/#{url}"
|
||||
|
||||
trackEvent: (event, properties, includeProviders=null) =>
|
||||
console.log 'Would track analytics event:', event, properties if debugAnalytics
|
||||
trackEvent: (action, properties, includeProviders=null) =>
|
||||
# 'action' is a string
|
||||
# Google Analytics properties format: {category: 'Account', label: 'Premium', value: 50 }
|
||||
# https://segment.com/docs/integrations/google-analytics/#track
|
||||
# https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#Anatomy
|
||||
# Mixpanel properties format: whatever you want unlike GA
|
||||
# https://segment.com/docs/integrations/mixpanel/
|
||||
console.log 'Would track analytics event:', action, properties if debugAnalytics
|
||||
return unless me and @isProduction and analytics? and not me.isAdmin()
|
||||
console.log 'Going to track analytics event:', event, properties if debugAnalytics
|
||||
console.log 'Going to track analytics event:', action, properties if debugAnalytics
|
||||
properties = properties or {}
|
||||
context = {}
|
||||
|
||||
# TODO: Restrict providers, if given includeProviders
|
||||
# TODO: This method may not work anymore, because it is not referenced in the segment.io docs
|
||||
# TODO: Can double check in Mixpanel
|
||||
# TODO: https://segment.com/docs/api/tracking/track/
|
||||
if includeProviders
|
||||
context.providers = {'All': false}
|
||||
for provider in includeProviders
|
||||
context.providers[provider] = true
|
||||
event.label = properties.label if properties.label
|
||||
analytics?.track event, properties, context
|
||||
|
||||
analytics?.track action, properties, context
|
||||
|
||||
trackTiming: (duration, category, variable, label, samplePercentage=5) ->
|
||||
# https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingTiming
|
|
@ -1,10 +1,10 @@
|
|||
FacebookHandler = require 'lib/FacebookHandler'
|
||||
GPlusHandler = require 'lib/GPlusHandler'
|
||||
GitHubHandler = require 'lib/GitHubHandler'
|
||||
locale = require 'locale/locale' # TODO: don't require all of these? Might be slow. (Haven't checked.)
|
||||
{me} = require 'lib/auth'
|
||||
Tracker = require 'lib/Tracker'
|
||||
CocoView = require 'views/kinds/CocoView'
|
||||
FacebookHandler = require 'core/social-handlers/FacebookHandler'
|
||||
GPlusHandler = require 'core/social-handlers/GPlusHandler'
|
||||
GitHubHandler = require 'core/social-handlers/GitHubHandler'
|
||||
ModuleLoader = require 'core/ModuleLoader'
|
||||
locale = require 'locale/locale'
|
||||
{me} = require 'core/auth'
|
||||
Tracker = require 'core/Tracker'
|
||||
|
||||
marked.setOptions {gfm: true, sanitize: true, smartLists: true, breaks: false}
|
||||
|
||||
|
@ -35,7 +35,7 @@ preload = (arrayOfImages) ->
|
|||
$('<img/>')[0].src = @
|
||||
|
||||
Application = initialize: ->
|
||||
Router = require('Router')
|
||||
Router = require('core/Router')
|
||||
@isProduction = -> document.location.href.search('codecombat.com') isnt -1
|
||||
@isIPadApp = webkit?.messageHandlers? and navigator.userAgent?.indexOf('iPad') isnt -1
|
||||
$('body').addClass 'ipad' if @isIPadApp
|
||||
|
@ -43,6 +43,8 @@ Application = initialize: ->
|
|||
@facebookHandler = new FacebookHandler()
|
||||
@gplusHandler = new GPlusHandler()
|
||||
@githubHandler = new GitHubHandler()
|
||||
@moduleLoader = new ModuleLoader()
|
||||
@moduleLoader.loadLanguage(me.get('preferredLanguage', true))
|
||||
$(document).bind 'keydown', preventBackspace
|
||||
preload(COMMON_FILES)
|
||||
$.i18n.init {
|
|
@ -1,6 +1,6 @@
|
|||
{backboneFailure, genericFailure, parseServerError} = require 'lib/errors'
|
||||
{backboneFailure, genericFailure, parseServerError} = require 'core/errors'
|
||||
User = require 'models/User'
|
||||
storage = require 'lib/storage'
|
||||
storage = require 'core/storage'
|
||||
BEEN_HERE_BEFORE_KEY = 'beenHereBefore'
|
||||
|
||||
init = ->
|
|
@ -1,4 +1,4 @@
|
|||
SystemNameLoader = require './SystemNameLoader'
|
||||
SystemNameLoader = require './../core/SystemNameLoader'
|
||||
###
|
||||
Good-to-knows:
|
||||
dataPath: an array of keys that walks you up a JSON object that's being patched
|
|
@ -1,5 +1,5 @@
|
|||
errorModalTemplate = require 'templates/modal/error'
|
||||
{applyErrorsToForm} = require 'lib/forms'
|
||||
{applyErrorsToForm} = require 'core/forms'
|
||||
|
||||
module.exports.parseServerError = (text) ->
|
||||
try
|
|
@ -1,24 +1,24 @@
|
|||
Backbone.Mediator.setValidationEnabled false
|
||||
app = require 'application'
|
||||
app = require 'core/application'
|
||||
|
||||
channelSchemas =
|
||||
'auth': require './schemas/subscriptions/auth'
|
||||
'bus': require './schemas/subscriptions/bus'
|
||||
'editor': require './schemas/subscriptions/editor'
|
||||
'errors': require './schemas/subscriptions/errors'
|
||||
'ipad': require './schemas/subscriptions/ipad'
|
||||
'misc': require './schemas/subscriptions/misc'
|
||||
'multiplayer': require './schemas/subscriptions/multiplayer'
|
||||
'play': require './schemas/subscriptions/play'
|
||||
'surface': require './schemas/subscriptions/surface'
|
||||
'tome': require './schemas/subscriptions/tome'
|
||||
'god': require './schemas/subscriptions/god'
|
||||
'scripts': require './schemas/subscriptions/scripts'
|
||||
'world': require './schemas/subscriptions/world'
|
||||
'auth': require 'schemas/subscriptions/auth'
|
||||
'bus': require 'schemas/subscriptions/bus'
|
||||
'editor': require 'schemas/subscriptions/editor'
|
||||
'errors': require 'schemas/subscriptions/errors'
|
||||
'ipad': require 'schemas/subscriptions/ipad'
|
||||
'misc': require 'schemas/subscriptions/misc'
|
||||
'multiplayer': require 'schemas/subscriptions/multiplayer'
|
||||
'play': require 'schemas/subscriptions/play'
|
||||
'surface': require 'schemas/subscriptions/surface'
|
||||
'tome': require 'schemas/subscriptions/tome'
|
||||
'god': require 'schemas/subscriptions/god'
|
||||
'scripts': require 'schemas/subscriptions/scripts'
|
||||
'world': require 'schemas/subscriptions/world'
|
||||
|
||||
definitionSchemas =
|
||||
'bus': require './schemas/definitions/bus'
|
||||
'misc': require './schemas/definitions/misc'
|
||||
'bus': require 'schemas/definitions/bus'
|
||||
'misc': require 'schemas/definitions/misc'
|
||||
|
||||
init = ->
|
||||
setupConsoleLogging()
|
||||
|
@ -33,7 +33,7 @@ init = ->
|
|||
Backbone.history.start({ pushState: true })
|
||||
handleNormalUrls()
|
||||
setUpMoment() # Set up i18n for moment
|
||||
treemaExt = require 'treema-ext'
|
||||
treemaExt = require 'core/treema-ext'
|
||||
treemaExt.setup()
|
||||
|
||||
handleNormalUrls = ->
|
||||
|
@ -70,20 +70,13 @@ setUpBackboneMediator = ->
|
|||
webkit.messageHandlers.backboneEventHandler?.postMessage channel: arguments[0], event: serializeForIOS(arguments[1] ? {})
|
||||
|
||||
setUpMoment = ->
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
moment.lang me.get('preferredLanguage', true), {}
|
||||
me.on 'change:preferredLanguage', (me) ->
|
||||
moment.lang me.get('preferredLanguage', true), {}
|
||||
|
||||
initializeUtilityServices = ->
|
||||
services = [
|
||||
#'./lib/services/filepicker' # Not until needed
|
||||
'./lib/services/segmentio'
|
||||
]
|
||||
|
||||
for service in services
|
||||
service = require service
|
||||
service()
|
||||
require('core/services/segmentio')()
|
||||
|
||||
setupConsoleLogging = ->
|
||||
unless console.debug
|
|
@ -1,7 +1,7 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
{me} = require 'lib/auth'
|
||||
{backboneFailure} = require 'lib/errors'
|
||||
storage = require 'lib/storage'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
{me} = require 'core/auth'
|
||||
{backboneFailure} = require 'core/errors'
|
||||
storage = require 'core/storage'
|
||||
|
||||
# facebook user object props to
|
||||
userPropsToSave =
|
|
@ -1,7 +1,7 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
{me} = require 'lib/auth'
|
||||
{backboneFailure} = require 'lib/errors'
|
||||
storage = require 'lib/storage'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
{me} = require 'core/auth'
|
||||
{backboneFailure} = require 'core/errors'
|
||||
storage = require 'core/storage'
|
||||
GPLUS_TOKEN_KEY = 'gplusToken'
|
||||
|
||||
# gplus user object props to
|
|
@ -1,6 +1,6 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
{me} = require 'lib/auth'
|
||||
storage = require 'lib/storage'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
{me} = require 'core/auth'
|
||||
storage = require 'core/storage'
|
||||
|
||||
module.exports = class GitHubHandler extends CocoClass
|
||||
scopes: 'user:email'
|
|
@ -1,10 +1,10 @@
|
|||
CocoModel = require 'models/CocoModel'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
{me} = require('lib/auth')
|
||||
{me} = require('core/auth')
|
||||
locale = require 'locale/locale'
|
||||
|
||||
initializeFilePicker = ->
|
||||
require('lib/services/filepicker')() unless window.application.isIPadApp
|
||||
require('core/services/filepicker')() unless window.application.isIPadApp
|
||||
|
||||
class DateTimeTreema extends TreemaNode.nodeMap.string
|
||||
valueClass: 'treema-date-time'
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{now} = require 'lib/world/world_utils'
|
||||
World = require 'lib/world/world'
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
GoalManager = require 'lib/world/GoalManager'
|
||||
|
||||
module.exports = class Angel extends CocoClass
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
#CocoClass = require 'lib/CocoClass'
|
||||
#
|
||||
#module.exports = class AsyncCloner extends CocoClass
|
||||
# constructor: (@source, @depth=2) ->
|
||||
# # passing in a depth of 0 will just _.clone the first layer, and will result in 1 indexList
|
||||
# super()
|
||||
# @indexLists = []
|
||||
# @initClone()
|
||||
#
|
||||
# initClone: () ->
|
||||
# @target = AsyncCloner.cloneToDepth(@source, @depth)
|
||||
# @indexLists = [_.keys(@target)] if _.isObject @target
|
||||
#
|
||||
# @cloneToDepth: (value, depth) ->
|
||||
# value = _.clone(value)
|
||||
# return value unless depth and _.isObject value
|
||||
# value[key] = @cloneToDepth(value[key], depth-1) for key in _.keys value
|
||||
# value
|
||||
#
|
||||
# clone: ->
|
||||
# while @indexLists.length
|
||||
# #console.log 'Clone loop:', JSON.stringify @indexLists
|
||||
# @moveIndexForward() # fills or empties the index so @indexLists.length === @depth + 1
|
||||
# break if @done()
|
||||
# @cloneOne()
|
||||
# @moveIndexForwardOne()
|
||||
# break if @done() or @timeToSleep()
|
||||
#
|
||||
# moveIndexForward: ->
|
||||
# while @indexLists.length
|
||||
# nextValue = @getNextValue()
|
||||
# if _.isObject(nextValue)
|
||||
# if @indexLists.length <= @depth
|
||||
# # push a new list if it's a collection
|
||||
# @indexLists.push _.keys(nextValue)
|
||||
# continue
|
||||
# else
|
||||
# break # we done, the next value needs to be deep cloned
|
||||
# #console.log 'Skipping:', @getNextPath()
|
||||
# @moveIndexForwardOne() # move past this value otherwise
|
||||
# #console.log '\tMoved index forward', JSON.stringify @indexLists
|
||||
#
|
||||
# getNextValue: ->
|
||||
# value = @target
|
||||
# value = value[indexList[0]] for indexList in @indexLists
|
||||
# value
|
||||
#
|
||||
# getNextParent: ->
|
||||
# parent = @target
|
||||
# parent = parent[indexList[0]] for indexList in @indexLists[...-1]
|
||||
# parent
|
||||
#
|
||||
# getNextPath: ->
|
||||
# (indexList[0] for indexList in @indexLists when indexList.length).join '.'
|
||||
#
|
||||
# moveIndexForwardOne: ->
|
||||
# @indexLists[@indexLists.length-1].shift() # move the index forward one
|
||||
# # if we reached the end of an index list, trim down through all finished lists
|
||||
# while @indexLists.length and not @indexLists[@indexLists.length-1].length
|
||||
# @indexLists.pop()
|
||||
# @indexLists[@indexLists.length-1].shift() if @indexLists.length
|
||||
#
|
||||
# cloneOne: ->
|
||||
# if @indexLists.length isnt @depth + 1
|
||||
# throw new Error('Cloner is in an invalid state!')
|
||||
# parent = @getNextParent()
|
||||
# key = @indexLists[@indexLists.length-1][0]
|
||||
# parent[key] = _.cloneDeep parent[key]
|
||||
# #console.log 'Deep Cloned:', @getNextPath()
|
||||
#
|
||||
# done: -> not @indexLists.length
|
||||
#
|
||||
# timeToSleep: -> false
|
||||
|
||||
|
||||
###
|
||||
Overall, the loop is:
|
||||
Fill indexes if we need to to the depth we've cloned
|
||||
Clone that one, popping it off the list.
|
||||
If the last list is now empty, pop that list and every subsequent list if needed.
|
||||
Check for doneness, or timeout.
|
||||
###
|
|
@ -1,6 +1,6 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
cache = {}
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
# Top 20 obscene words (plus 'fiddlesticks') will trigger swearing Simlish with *beeps*.
|
||||
# Didn't like leaving so much profanity lying around in the source, so rot13'd.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
CHAT_SIZE_LIMIT = 500 # no more than 500 messages
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{now} = require 'lib/world/world_utils'
|
||||
World = require 'lib/world/world'
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
Angel = require 'lib/Angel'
|
||||
|
||||
module.exports = class God extends CocoClass
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Bus = require './Bus'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
LevelSession = require 'models/LevelSession'
|
||||
utils = require 'lib/utils'
|
||||
utils = require 'core/utils'
|
||||
|
||||
module.exports = class LevelBus extends Bus
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ LevelSession = require 'models/LevelSession'
|
|||
ThangType = require 'models/ThangType'
|
||||
ThangNamesCollection = require 'collections/ThangNamesCollection'
|
||||
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
app = require 'application'
|
||||
app = require 'core/application'
|
||||
World = require 'lib/world/world'
|
||||
|
||||
# This is an initial stab at unifying loading and setup into a single place which can
|
||||
|
|
|
@ -71,7 +71,7 @@ module.exports = LevelOptions =
|
|||
hidesCodeToolbar: true
|
||||
hidesRealTimePlayback: true
|
||||
requiredGear: {feet: 'simple-boots', 'right-hand': 'simple-sword', waist: 'leather-belt'}
|
||||
restrictedGear: {feet: 'leather-boots'}
|
||||
restrictedGear: {feet: 'leather-boots', 'programming-book': 'programmaticon-i'}
|
||||
requiredCode: ['Brak']
|
||||
'favorable-odds':
|
||||
disableSpaces: true
|
||||
|
@ -82,7 +82,7 @@ module.exports = LevelOptions =
|
|||
hidesCodeToolbar: true
|
||||
hidesRealTimePlayback: true
|
||||
requiredGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||
restrictedGear: {feet: 'leather-boots'}
|
||||
restrictedGear: {feet: 'leather-boots', 'programming-book': 'programmaticon-i'}
|
||||
'the-raised-sword':
|
||||
disableSpaces: true
|
||||
hidesPlayButton: true
|
||||
|
@ -92,7 +92,7 @@ module.exports = LevelOptions =
|
|||
hidesCodeToolbar: true
|
||||
hidesRealTimePlayback: true
|
||||
requiredGear: {feet: 'simple-boots', 'right-hand': 'simple-sword', torso: 'tarnished-bronze-breastplate'}
|
||||
restrictedGear: {feet: 'leather-boots'}
|
||||
restrictedGear: {feet: 'leather-boots', 'programming-book': 'programmaticon-i'}
|
||||
'the-first-kithmaze':
|
||||
hidesRunShortcut: true
|
||||
hidesHUD: true
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
PlayHeroesModal = require 'views/play/modal/PlayHeroesModal'
|
||||
InventoryModal = require 'views/game-menu/InventoryModal'
|
||||
LevelSession = require 'models/LevelSession'
|
||||
|
@ -78,14 +78,14 @@ module.exports = class LevelSetupManager extends CocoClass
|
|||
@inventoryModal.didReappear()
|
||||
@inventoryModal.onShown()
|
||||
@inventoryModal.setHero(e.hero)
|
||||
window.tracker?.trackEvent 'Play Level Modal', Action: 'Choose Inventory', ['Google Analytics']
|
||||
window.tracker?.trackEvent 'Choose Inventory', category: 'Play Level', ['Google Analytics']
|
||||
|
||||
onChooseHeroClicked: ->
|
||||
@options.parent.openModalView(@heroesModal)
|
||||
@heroesModal.render()
|
||||
@heroesModal.didReappear()
|
||||
@inventoryModal.endHighlight()
|
||||
window.tracker?.trackEvent 'Play Level Modal', Action: 'Choose Hero', ['Google Analytics']
|
||||
window.tracker?.trackEvent 'Change Hero', category: 'Play Level', ['Google Analytics']
|
||||
|
||||
onInventoryModalPlayClicked: ->
|
||||
@navigatingToPlay = true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoView = require 'views/kinds/CocoView'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
CocoView = require 'views/core/CocoView'
|
||||
{scriptMatchesEventPrereqs} = require './../world/script_event_prereqs'
|
||||
|
||||
allScriptModules = []
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class ScriptModule extends CocoClass
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ ScriptModule = require './ScriptModule'
|
|||
currentMusic = null
|
||||
standingBy = null
|
||||
|
||||
{me} = require('lib/auth')
|
||||
{me} = require('core/auth')
|
||||
|
||||
module.exports = class SoundScriptModule extends ScriptModule
|
||||
@neededFor: (noteGroup) ->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
ScriptModule = require './ScriptModule'
|
||||
{me} = require 'lib/auth'
|
||||
utils = require 'lib/utils'
|
||||
{me} = require 'core/auth'
|
||||
utils = require 'core/utils'
|
||||
|
||||
module.exports = class SpritesScriptModule extends ScriptModule
|
||||
@neededFor: (noteGroup) ->
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SuperModel = require 'models/SuperModel'
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
LevelLoader = require 'lib/LevelLoader'
|
||||
GoalManager = require 'lib/world/GoalManager'
|
||||
God = require 'lib/God'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{hexToHSL, hslToHex} = require 'lib/utils'
|
||||
{hexToHSL, hslToHex} = require 'core/utils'
|
||||
|
||||
module.exports = class SpriteBuilder
|
||||
constructor: (@thangType, @options) ->
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
# If I were the kind of math major who remembered his math, this would all be done with matrix transforms.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class CoordinateGrid extends CocoClass
|
||||
subscriptions:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class CountdownScreen extends CocoClass
|
||||
subscriptions:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class Dimmer extends CocoClass
|
||||
subscriptions:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
IndieLank = require 'lib/surface/IndieLank'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
module.exports = class FlagLank extends IndieLank
|
||||
subscriptions:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class Label extends CocoClass
|
||||
@STYLE_DIALOGUE = 'dialogue' # A speech bubble from a script
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
{createProgressBar} = require './sprite_utils'
|
||||
Camera = require './Camera'
|
||||
Mark = require './Mark'
|
||||
Label = require './Label'
|
||||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
# We'll get rid of this once level's teams actually have colors
|
||||
healthColors =
|
||||
|
@ -60,7 +60,7 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
constructor: (@thangType, options) ->
|
||||
super()
|
||||
spriteName = @thangType.get('name')
|
||||
@isMissile = /(Missile|Arrow|Spear)/.test(spriteName) and not /Tower/.test(spriteName)
|
||||
@isMissile = /(Missile|Arrow|Spear)/.test(spriteName) and not /(Tower|Charge)/.test(spriteName)
|
||||
@options = _.extend($.extend(true, {}, @options), options)
|
||||
@setThang @options.thang
|
||||
if @thang?
|
||||
|
@ -326,7 +326,10 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
|
||||
newScaleFactorX = @thang?.scaleFactorX ? @thang?.scaleFactor ? 1
|
||||
newScaleFactorY = @thang?.scaleFactorY ? @thang?.scaleFactor ? 1
|
||||
if @thang and (newScaleFactorX isnt @targetScaleFactorX or newScaleFactorY isnt @targetScaleFactorY)
|
||||
if @thang?.spriteName is 'Beam'
|
||||
@scaleFactorX = newScaleFactorX
|
||||
@scaleFactorY = newScaleFactorY
|
||||
else if @thang and (newScaleFactorX isnt @targetScaleFactorX or newScaleFactorY isnt @targetScaleFactorY)
|
||||
@targetScaleFactorX = newScaleFactorX
|
||||
@targetScaleFactorY = newScaleFactorY
|
||||
createjs.Tween.removeTweens(@)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
{me} = require 'lib/auth'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
{me} = require 'core/auth'
|
||||
LayerAdapter = require './LayerAdapter'
|
||||
IndieLank = require 'lib/surface/IndieLank'
|
||||
WizardLank = require 'lib/surface/WizardLank'
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
###
|
||||
|
||||
SpriteBuilder = require 'lib/sprites/SpriteBuilder'
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
SegmentedSprite = require './SegmentedSprite'
|
||||
SingularSprite = require './SingularSprite'
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
Camera = require './Camera'
|
||||
ThangType = require 'models/ThangType'
|
||||
markThangTypes = {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
CROSSFADE_LENGTH = 1500
|
||||
MUSIC_VOLUME = 0.6
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class PlaybackOverScreen extends CocoClass
|
||||
subscriptions:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class PointChooser extends CocoClass
|
||||
constructor: (@options) ->
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
Camera = require './Camera'
|
||||
|
||||
module.exports = class RegionChooser extends CocoClass
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
TrailMaster = require './TrailMaster'
|
||||
Dropper = require './Dropper'
|
||||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
Camera = require './Camera'
|
||||
CameraBorder = require './CameraBorder'
|
||||
Layer = require('./LayerAdapter')
|
||||
|
|
|
@ -8,7 +8,7 @@ FUTURE_PATH_INTERVAL_DIVISOR = 4
|
|||
PAST_PATH_INTERVAL_DIVISOR = 2
|
||||
|
||||
Camera = require './Camera'
|
||||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
|
||||
module.exports = class TrailMaster extends CocoClass
|
||||
world: null
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
RealTimeCollection = require 'collections/RealTimeCollection'
|
||||
|
||||
module.exports = class WaitingScreen extends CocoClass
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
IndieLank = require 'lib/surface/IndieLank'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
module.exports = class WizardLank extends IndieLank
|
||||
# Wizard targets are constantly changing, so a simple tween doesn't work.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CocoClass = require 'lib/CocoClass'
|
||||
utils = require 'lib/utils'
|
||||
CocoClass = require 'core/CocoClass'
|
||||
utils = require 'core/utils'
|
||||
|
||||
module.exports = class GoalManager extends CocoClass
|
||||
# The Goal Manager is created both on the main thread and
|
||||
|
|
|
@ -4,54 +4,62 @@
|
|||
# http://en.wikipedia.org/wiki/Languages_used_on_the_Internet
|
||||
|
||||
module.exports =
|
||||
en: require './en' # English - English
|
||||
'en-US': require './en-US' # English (US), English (US)
|
||||
'en-GB': require './en-GB' # English (UK), English (UK)
|
||||
'en-AU': require './en-AU' # English (AU), English (AU)
|
||||
ru: require './ru' # русский язык, Russian
|
||||
'de-DE': require './de-DE' # Deutsch (Deutschland), German (Germany)
|
||||
'de-AT': require './de-AT' # Deutsch (Österreich), German (Austria)
|
||||
'de-CH': require './de-CH' # Deutsch (Schweiz), German (Switzerland)
|
||||
'es-419': require './es-419' # español (América Latina), Spanish (Latin America)
|
||||
'es-ES': require './es-ES' # español (ES), Spanish (Spain)
|
||||
'zh-HANS': require './zh-HANS' # 简体中文, Chinese (Simplified)
|
||||
'zh-HANT': require './zh-HANT' # 繁体中文, Chinese (Traditional)
|
||||
'zh-WUU-HANS': require './zh-WUU-HANS' # 吴语, Wuu (Simplified)
|
||||
'zh-WUU-HANT': require './zh-WUU-HANT' # 吳語, Wuu (Traditional)
|
||||
fr: require './fr' # français, French
|
||||
ja: require './ja' # 日本語, Japanese
|
||||
ar: require './ar' # العربية, Arabic
|
||||
'pt-BR': require './pt-BR' # português do Brasil, Portuguese (Brazil)
|
||||
'pt-PT': require './pt-PT' # Português (Portugal), Portuguese (Portugal)
|
||||
pl: require './pl' # język polski, Polish
|
||||
it: require './it' # italiano, Italian
|
||||
tr: require './tr' # Türkçe, Turkish
|
||||
'nl-BE': require './nl-BE' # Nederlands (België), Dutch (Belgium)
|
||||
'nl-NL': require './nl-NL' # Nederlands (Nederland), Dutch (Netherlands)
|
||||
fa: require './fa' # فارسی, Persian
|
||||
cs: require './cs' # čeština, Czech
|
||||
sv: require './sv' # Svenska, Swedish
|
||||
id: require './id' # Bahasa Indonesia, Indonesian
|
||||
el: require './el' # ελληνικά, Greek
|
||||
ro: require './ro' # limba română, Romanian
|
||||
vi: require './vi' # Tiếng Việt, Vietnamese
|
||||
hu: require './hu' # magyar, Hungarian
|
||||
th: require './th' # ไทย, Thai
|
||||
da: require './da' # dansk, Danish
|
||||
ko: require './ko' # 한국어, Korean
|
||||
sk: require './sk' # slovenčina, Slovak
|
||||
sl: require './sl' # slovenščina, Slovene
|
||||
fi: require './fi' # suomi, Finnish
|
||||
bg: require './bg' # български език, Bulgarian
|
||||
no: require './no' # Norsk, Norwegian
|
||||
nn: require './nn' # Norwegian (Nynorsk), Norwegian Nynorsk
|
||||
nb: require './nb' # Norsk Bokmål, Norwegian (Bokmål)
|
||||
he: require './he' # עברית, Hebrew
|
||||
lt: require './lt' # lietuvių kalba, Lithuanian
|
||||
sr: require './sr' # српски, Serbian
|
||||
uk: require './uk' # українська мова, Ukrainian
|
||||
hi: require './hi' # मानक हिन्दी, Hindi
|
||||
ur: require './ur' # اُردُو, Urdu
|
||||
ms: require './ms' # Bahasa Melayu, Bahasa Malaysia
|
||||
ca: require './ca' # Català, Catalan
|
||||
gl: require './gl' # Galego, Galician
|
||||
update: ->
|
||||
localesLoaded = (s for s in window.require.list() when _.string.startsWith(s, 'locale/'))
|
||||
for path in localesLoaded
|
||||
continue if path is 'locale/locale'
|
||||
code = path.replace('locale/', '')
|
||||
@[code] = require(path)
|
||||
|
||||
|
||||
'en': { nativeDescription: 'English', englishDescription: 'English' }
|
||||
'en-US': { nativeDescription: 'English (US)', englishDescription: 'English (US)' }
|
||||
'en-GB': { nativeDescription: 'English (UK)', englishDescription: 'English (UK)' }
|
||||
'en-AU': { nativeDescription: 'English (AU)', englishDescription: 'English (AU)' }
|
||||
'ru': { nativeDescription: 'русский', englishDescription: 'Russian' }
|
||||
'de-DE': { nativeDescription: 'Deutsch (Deutschland)', englishDescription: 'German (Germany)' }
|
||||
'de-AT': { nativeDescription: 'Deutsch (Österreich)', englishDescription: 'German (Austria)' }
|
||||
'de-CH': { nativeDescription: 'Deutsch (Schweiz)', englishDescription: 'German (Switzerland)' }
|
||||
'es-419': { nativeDescription: 'español (América Latina)', englishDescription: 'Spanish (Latin America)' }
|
||||
'es-ES': { nativeDescription: 'español (ES)', englishDescription: 'Spanish (Spain)' }
|
||||
'zh-HANS': { nativeDescription: '简体中文', englishDescription: 'Chinese (Simplified)' }
|
||||
'zh-HANT': { nativeDescription: '繁体中文', englishDescription: 'Chinese (Traditional)' }
|
||||
'zh-WUU-HANS': { nativeDescription: '吴语', englishDescription: 'Wuu (Simplified)' }
|
||||
'zh-WUU-HANT': { nativeDescription: '吳語', englishDescription: 'Wuu (Traditional)' }
|
||||
'fr': { nativeDescription: 'français', englishDescription: 'French' }
|
||||
'ja': { nativeDescription: '日本語', englishDescription: 'Japanese' }
|
||||
'ar': { nativeDescription: 'العربية', englishDescription: 'Arabic' }
|
||||
'pt-BR': { nativeDescription: 'português do Brasil', englishDescription: 'Portuguese (Brazil)' }
|
||||
'pt-PT': { nativeDescription: 'Português (Portugal)', englishDescription: 'Portuguese (Portugal)' }
|
||||
'pl': { nativeDescription: 'język polski', englishDescription: 'Polish' }
|
||||
'it': { nativeDescription: 'Italiano', englishDescription: 'Italian' }
|
||||
'tr': { nativeDescription: 'Türkçe', englishDescription: 'Turkish' }
|
||||
'nl-BE': { nativeDescription: 'Nederlands (België)', englishDescription: 'Dutch (Belgium)' }
|
||||
'nl-NL': { nativeDescription: 'Nederlands (Nederland)', englishDescription: 'Dutch (Netherlands)' }
|
||||
'fa': { nativeDescription: 'فارسی', englishDescription: 'Persian' }
|
||||
'cs': { nativeDescription: 'čeština', englishDescription: 'Czech' }
|
||||
'sv': { nativeDescription: 'Svenska', englishDescription: 'Swedish' }
|
||||
'id': { nativeDescription: 'Bahasa Indonesia', englishDescription: 'Indonesian' }
|
||||
'el': { nativeDescription: 'Ελληνικά', englishDescription: 'Greek' }
|
||||
'ro': { nativeDescription: 'limba română', englishDescription: 'Romanian' }
|
||||
'vi': { nativeDescription: 'Tiếng Việt', englishDescription: 'Vietnamese' }
|
||||
'hu': { nativeDescription: 'magyar', englishDescription: 'Hungarian' }
|
||||
'th': { nativeDescription: 'ไทย', englishDescription: 'Thai' }
|
||||
'da': { nativeDescription: 'dansk', englishDescription: 'Danish' }
|
||||
'ko': { nativeDescription: '한국어', englishDescription: 'Korean' }
|
||||
'sk': { nativeDescription: 'slovenčina', englishDescription: 'Slovak' }
|
||||
'sl': { nativeDescription: 'slovenščina', englishDescription: 'Slovene' }
|
||||
'fi': { nativeDescription: 'suomi', englishDescription: 'Finnish' }
|
||||
'bg': { nativeDescription: 'български език', englishDescription: 'Bulgarian' }
|
||||
'no': { nativeDescription: 'Norsk', englishDescription: 'Norwegian' }
|
||||
'nn': { nativeDescription: 'Norwegian Nynorsk', englishDescription: 'Norwegian' }
|
||||
'nb': { nativeDescription: 'Norsk Bokmål', englishDescription: 'Norwegian (Bokmål)' }
|
||||
'he': { nativeDescription: 'עברית', englishDescription: 'Hebrew' }
|
||||
'lt': { nativeDescription: 'lietuvių kalba', englishDescription: 'Lithuanian' }
|
||||
'sr': { nativeDescription: 'српски', englishDescription: 'Serbian' }
|
||||
'uk': { nativeDescription: 'українська мова', englishDescription: 'Ukrainian' }
|
||||
'hi': { nativeDescription: 'मानक हिन्दी', englishDescription: 'Hindi' }
|
||||
'ur': { nativeDescription: 'اُردُو', englishDescription: 'Urdu' }
|
||||
'ms': { nativeDescription: 'Bahasa Melayu', englishDescription: 'Bahasa Malaysia' }
|
||||
'ca': { nativeDescription: 'Català', englishDescription: 'Catalan' }
|
||||
'gl': { nativeDescription: 'Galego', englishDescription: 'Galician' }
|
|
@ -1,5 +1,5 @@
|
|||
CocoModel = require './CocoModel'
|
||||
utils = require '../lib/utils'
|
||||
utils = require '../core/utils'
|
||||
|
||||
module.exports = class Achievement extends CocoModel
|
||||
@className: 'Achievement'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
storage = require 'lib/storage'
|
||||
deltasLib = require 'lib/deltas'
|
||||
storage = require 'core/storage'
|
||||
deltasLib = require 'core/deltas'
|
||||
|
||||
class CocoModel extends Backbone.Model
|
||||
idAttribute: '_id'
|
||||
|
@ -333,7 +333,15 @@ class CocoModel extends Backbone.Model
|
|||
return if _.isString @url then @url else @url()
|
||||
|
||||
@pollAchievements: ->
|
||||
NewAchievementCollection = require '../collections/NewAchievementCollection' # Nasty mutual inclusion if put on top
|
||||
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
Achievement = require 'models/Achievement'
|
||||
|
||||
class NewAchievementCollection extends CocoCollection
|
||||
model: Achievement
|
||||
initialize: (me = require('core/auth').me) ->
|
||||
@url = "/db/user/#{me.id}/achievements?notified=false"
|
||||
|
||||
achievements = new NewAchievementCollection
|
||||
achievements.fetch
|
||||
success: (collection) ->
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CocoModel = require './CocoModel'
|
||||
utils = require '../lib/utils'
|
||||
utils = require '../core/utils'
|
||||
|
||||
module.exports = class EarnedAchievement extends CocoModel
|
||||
@className: 'EarnedAchievement'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CocoModel = require './CocoModel'
|
||||
SystemNameLoader = require 'lib/SystemNameLoader'
|
||||
SystemNameLoader = require 'core/SystemNameLoader'
|
||||
|
||||
module.exports = class LevelSystem extends CocoModel
|
||||
@className: 'LevelSystem'
|
||||
|
|
|
@ -2,7 +2,7 @@ CocoModel = require './CocoModel'
|
|||
SpriteBuilder = require 'lib/sprites/SpriteBuilder'
|
||||
LevelComponent = require './LevelComponent'
|
||||
|
||||
utils = require 'lib/utils'
|
||||
utils = require 'core/utils'
|
||||
|
||||
buildQueue = []
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GRAVATAR_URL = 'https://www.gravatar.com/'
|
||||
cache = {}
|
||||
CocoModel = require './CocoModel'
|
||||
util = require 'lib/utils'
|
||||
util = require 'core/utils'
|
||||
ThangType = require './ThangType'
|
||||
|
||||
module.exports = class User extends CocoModel
|
||||
|
@ -124,4 +124,6 @@ module.exports = class User extends CocoModel
|
|||
application.tracker.identify gemPromptGroup: @gemPromptGroup unless me.isAdmin()
|
||||
@gemPromptGroup
|
||||
|
||||
tiersByLevel = [-1, 0, 0.05, 0.14, 0.18, 0.32, 0.41, 0.5, 0.64, 0.82, 0.91, 1.04, 1.22, 1.35, 1.48, 1.65, 1.78, 1.96, 2.1, 2.24, 2.38, 2.55, 2.69, 2.86, 3.03, 3.16, 3.29, 3.42, 3.58, 3.74, 3.89, 4.04, 4.19, 4.32, 4.47, 4.64, 4.79, 4.96]
|
||||
tiersByLevel = [-1, 0, 0.05, 0.14, 0.18, 0.32, 0.41, 0.5, 0.64, 0.82, 0.91, 1.04, 1.22, 1.35, 1.48, 1.65, 1.78, 1.96, 2.1, 2.24, 2.38, 2.55, 2.69, 2.86, 3.03, 3.16, 3.29, 3.42, 3.58, 3.74, 3.89, 4.04, 4.19, 4.32, 4.47, 4.64, 4.79, 4.96,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 15
|
||||
]
|
||||
|
|
|
@ -132,9 +132,11 @@ _.extend ThangTypeSchema.properties,
|
|||
raster: {type: 'string', format: 'image-file', title: 'Raster Image'}
|
||||
rasterIcon: { type: 'string', format: 'image-file', title: 'Raster Image Icon' }
|
||||
containerIcon: { type: 'string' }
|
||||
featureImage: { type: 'string', format: 'image-file', title: 'Feature Image' }
|
||||
featureImageHair: { type: 'string', format: 'image-file', title: 'Feature Image Hair' }
|
||||
featureImageThumb: { type: 'string', format: 'image-file', title: 'Feature Image Thumb' }
|
||||
featureImages: c.object { title: 'Hero Doll Images' },
|
||||
body: { type: 'string', format: 'image-file', title: 'Body' }
|
||||
head: { type: 'string', format: 'image-file', title: 'Head' }
|
||||
hair: { type: 'string', format: 'image-file', title: 'Hair' }
|
||||
thumb: { type: 'string', format: 'image-file', title: 'Thumb' }
|
||||
dollImages: c.object { title: 'Paper Doll Images' },
|
||||
male: { type: 'string', format: 'image-file', title: ' Male' }
|
||||
female: { type: 'string', format: 'image-file', title: ' Female' }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
c = require 'schemas/schemas'
|
||||
|
||||
module.exports =
|
||||
# app/lib/errors
|
||||
# app/core/errors
|
||||
'errors:server-error': c.object {required: ['response']},
|
||||
response: {type: 'object'}
|
||||
|
|
|
@ -292,3 +292,27 @@ html.no-borderimage
|
|||
|
||||
body > iframe[src^="https://apis.google.com"]
|
||||
display: none
|
||||
|
||||
#module-loading-list
|
||||
.modal-content
|
||||
background: white
|
||||
border-shadow: 2px 2px 10px black
|
||||
|
||||
ul
|
||||
max-height: 500px
|
||||
overflow: scroll
|
||||
|
||||
li
|
||||
padding: 2px 15px
|
||||
font-size: 10px
|
||||
.glyphicon
|
||||
margin-right: 10px
|
||||
|
||||
&.loading
|
||||
.glyphicon-ok
|
||||
display: none
|
||||
|
||||
&.success
|
||||
font-weight: bold
|
||||
.glyphicon-minus
|
||||
display: none
|
|
@ -1,6 +1,4 @@
|
|||
#editor-achievement-edit-view
|
||||
height: 100%
|
||||
|
||||
.treema-root
|
||||
margin: 28px 0px 20px
|
||||
|
||||
|
|
|
@ -480,10 +480,7 @@ $itemSlotGridHeight: 51px
|
|||
|
||||
//- Paper doll positioning
|
||||
|
||||
#hero-image
|
||||
//@include filter(contrast(0%) brightness(0%))
|
||||
//opacity: 0.4
|
||||
//width: 225px
|
||||
#hero-image, #hero-image-head, #hero-image-hair, #hero-image-thumb
|
||||
display: block
|
||||
position: absolute
|
||||
z-index: 12
|
||||
|
@ -496,111 +493,71 @@ $itemSlotGridHeight: 51px
|
|||
left: 80px
|
||||
bottom: 31px
|
||||
|
||||
#hero-image-head
|
||||
z-index: 16
|
||||
#hero-image-hair
|
||||
position: absolute
|
||||
z-index: 16
|
||||
|
||||
&.female
|
||||
left: 103px
|
||||
bottom: 218px
|
||||
|
||||
&.male
|
||||
left: 124px
|
||||
bottom: 228px
|
||||
|
||||
z-index: 17
|
||||
#hero-image-thumb
|
||||
position: absolute
|
||||
z-index: 16
|
||||
|
||||
&.female
|
||||
left: 81px
|
||||
bottom: 150px
|
||||
@include rotate(-15deg)
|
||||
left: 66px
|
||||
bottom: 54px
|
||||
|
||||
&.male
|
||||
left: 68px
|
||||
bottom: 121px
|
||||
@include rotate(-15deg)
|
||||
left: 53px
|
||||
bottom: 54px
|
||||
|
||||
.doll-image
|
||||
position: absolute
|
||||
z-index: 15
|
||||
|
||||
&.male
|
||||
left: 65px
|
||||
bottom: 31px
|
||||
|
||||
&.female
|
||||
left: 80px
|
||||
bottom: 31px
|
||||
|
||||
&.feet
|
||||
z-index: 13
|
||||
|
||||
&.female
|
||||
left: 101px
|
||||
bottom: 37px
|
||||
|
||||
&.male
|
||||
left: 98px
|
||||
bottom: 37px
|
||||
|
||||
&.right-hand
|
||||
@include rotate(-15deg)
|
||||
&.female
|
||||
left: 48px
|
||||
bottom: 132px
|
||||
@include rotate(-15deg)
|
||||
|
||||
left: 66px
|
||||
bottom: 54px
|
||||
|
||||
&.male
|
||||
left: 40px
|
||||
bottom: 111px
|
||||
left: 55px
|
||||
bottom: 63px
|
||||
@include rotate(-15deg)
|
||||
|
||||
&.left-hand
|
||||
z-index: 17
|
||||
&.female
|
||||
left: 193px
|
||||
bottom: 72px
|
||||
|
||||
&.male
|
||||
left: 193px
|
||||
bottom: 72px
|
||||
|
||||
&.torso
|
||||
z-index: 14
|
||||
|
||||
&.female
|
||||
left: 72px
|
||||
bottom: 105px
|
||||
|
||||
&.male
|
||||
left: 55px
|
||||
bottom: 69px
|
||||
|
||||
&.gloves
|
||||
z-index: 15
|
||||
|
||||
&.female
|
||||
left: 78px
|
||||
bottom: 133px
|
||||
|
||||
&.female-thumb
|
||||
z-index: 16
|
||||
left: 81px
|
||||
bottom: 150px
|
||||
@include rotate(-15deg)
|
||||
left: 66px
|
||||
bottom: 54px
|
||||
|
||||
&.male
|
||||
left: 65px
|
||||
bottom: 109px
|
||||
|
||||
&.male-thumb
|
||||
z-index: 16
|
||||
left: 68px
|
||||
bottom: 121px
|
||||
@include rotate(-15deg)
|
||||
left: 53px
|
||||
bottom: 54px
|
||||
|
||||
&.head
|
||||
z-index: 16
|
||||
|
||||
&.female
|
||||
left: 72px
|
||||
bottom: 105px
|
||||
|
||||
&.male
|
||||
left: 119px
|
||||
bottom: 180px
|
||||
|
||||
|
||||
z-index: 17
|
||||
|
|
|
@ -57,7 +57,7 @@ block footer
|
|||
#footer-links
|
||||
a(href='/contribute', tabindex=-1, data-i18n="nav.contribute") Contribute
|
||||
a(href='/legal', tabindex=-1, data-i18n="nav.legal") Legal
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Contact
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Contact
|
||||
a(href='/teachers', data-i18n="nav.teachers") Teachers
|
||||
a(href="/play-old", data-i18n="play.older_campaigns") Older Campaigns
|
||||
if me.isAdmin()
|
||||
|
|
|
@ -31,7 +31,7 @@ block content
|
|||
|
||||
h4(data-i18n="contribute.how_to_join") How to Join
|
||||
p
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="contribute.contact_us_url")
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="contribute.contact_us_url")
|
||||
| Contact us
|
||||
span ,
|
||||
span(data-i18n="contribute.ambassador_join_desc")
|
||||
|
|
|
@ -48,7 +48,7 @@ block content
|
|||
span(data-i18n="contribute.join_desc_2")
|
||||
| to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email.
|
||||
| Want to chat about what to do or how to get more deeply involved?
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="contribute.join_url_email")
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="contribute.join_url_email")
|
||||
| Email us
|
||||
span(data-i18n="contribute.join_desc_3")
|
||||
| , or find us in our
|
||||
|
|
|
@ -37,7 +37,7 @@ block content
|
|||
|
||||
h4(data-i18n="contribute.how_to_join") How To Join
|
||||
p
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="contribute.contact_us_url")
|
||||
a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="contribute.contact_us_url")
|
||||
| Contact us
|
||||
span ,
|
||||
span(data-i18n="contribute.scribe_join_description")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends /templates/kinds/table
|
||||
extends /templates/common/table
|
||||
|
||||
block tableHeader
|
||||
tr
|
||||
|
|
|
@ -1 +1 @@
|
|||
extends /templates/kinds/table
|
||||
extends /templates/common/table
|
||||
|
|
|
@ -110,7 +110,7 @@ block header
|
|||
li
|
||||
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
||||
li
|
||||
a(data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Email
|
||||
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
|
||||
|
||||
block outer_content
|
||||
.outer-content
|
||||
|
|
|
@ -1 +1 @@
|
|||
extends /templates/kinds/table
|
||||
extends /templates/common/table
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends /templates/kinds/table
|
||||
extends /templates/common/table
|
||||
|
||||
block tableResultsHeader
|
||||
tr
|
||||
|
|
|
@ -71,7 +71,7 @@ block header
|
|||
li
|
||||
a(href='http://discourse.codecombat.com/category/artisan', data-i18n="nav.forum", target="_blank") Forum
|
||||
li
|
||||
a(data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Email
|
||||
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
|
||||
|
||||
block outer_content
|
||||
.outer-content
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
span.glyphicon.glyphicon-remove
|
||||
|
||||
#equipped
|
||||
if selectedHero && selectedHero.get('featureImage')
|
||||
img(src="/file/"+selectedHero.get('featureImage'), draggable="false")#hero-image
|
||||
if selectedHero.get('featureImageHair')
|
||||
img(src="/file/"+selectedHero.get('featureImageHair'), draggable="false")#hero-image-hair
|
||||
if selectedHero.get('featureImageThumb')
|
||||
img(src="/file/"+selectedHero.get('featureImageThumb'), draggable="false")#hero-image-thumb
|
||||
if selectedHero && selectedHero.get('featureImages')
|
||||
- var featureImages = selectedHero.get('featureImages');
|
||||
img(src="/file/"+featureImages.body, draggable="false")#hero-image
|
||||
img(src="/file/"+featureImages.head, draggable="false")#hero-image-head
|
||||
img(src="/file/"+featureImages.hair, draggable="false")#hero-image-hair
|
||||
img(src="/file/"+featureImages.thumb, draggable="false")#hero-image-thumb
|
||||
|
||||
for slot in ['head', 'eyes', 'neck', 'torso', 'gloves', 'wrists', 'left-hand', 'right-hand', 'waist', 'feet', 'left-ring', 'right-ring', 'minion', 'flag', 'pet', 'programming-book', 'misc-0', 'misc-1']
|
||||
.item-slot(data-slot=slot)
|
||||
|
|
|
@ -47,7 +47,7 @@ block header
|
|||
li
|
||||
a(href='http://discourse.codecombat.com/category/diplomat', data-i18n="nav.forum", target="_blank") Forum
|
||||
li
|
||||
a(data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Email
|
||||
a(data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Email
|
||||
|
||||
block outer_content
|
||||
.outer-content
|
||||
|
|
|
@ -36,4 +36,4 @@
|
|||
|
||||
#play-footer
|
||||
p(class='footer-link-text')
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Contact
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Contact
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
.footer
|
||||
.content
|
||||
p(class='footer-link-text')
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="modal/ContactModal", data-i18n="nav.contact") Contact
|
||||
a(title='Send CodeCombat a message', tabindex=-1, data-toggle="coco-modal", data-target="core/ContactModal", data-i18n="nav.contact") Contact
|
|
@ -1,4 +1,4 @@
|
|||
extends /templates/kinds/user
|
||||
extends /templates/common/user
|
||||
|
||||
block append content
|
||||
if user
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/about'
|
||||
|
||||
module.exports = class AboutView extends RootView
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/cla'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
|
||||
module.exports = class CLAView extends RootView
|
||||
id: 'cla-view'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/community'
|
||||
|
||||
module.exports = class CommunityView extends RootView
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
ModalView = require 'views/kinds/ModalView'
|
||||
RootView = require 'views/core/RootView'
|
||||
ModalView = require 'views/core/ModalView'
|
||||
template = require 'templates/demo'
|
||||
requireUtils = require 'lib/requireUtils'
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/employers'
|
||||
User = require 'models/User'
|
||||
{me} = require 'lib/auth'
|
||||
{me} = require 'core/auth'
|
||||
CocoCollection = require 'collections/CocoCollection'
|
||||
EmployerSignupModal = require 'views/modal/EmployerSignupModal'
|
||||
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/home'
|
||||
WizardLank = require 'lib/surface/WizardLank'
|
||||
ThangType = require 'models/ThangType'
|
||||
Simulator = require 'lib/simulator/Simulator'
|
||||
|
||||
{me} = require '/lib/auth'
|
||||
|
||||
module.exports = class HomeView extends RootView
|
||||
id: 'home-view'
|
||||
|
@ -15,7 +10,7 @@ module.exports = class HomeView extends RootView
|
|||
|
||||
constructor: ->
|
||||
super()
|
||||
window.tracker?.trackEvent 'Homepage', Action: 'Loaded'
|
||||
window.tracker?.trackEvent 'Homepage Loaded', category: 'Homepage', ['Google Analytics']
|
||||
if not me.get('hourOfCode') and @getQueryVariable 'hour_of_code'
|
||||
@setUpHourOfCode()
|
||||
elapsed = (new Date() - new Date(me.get('dateCreated')))
|
||||
|
@ -41,16 +36,12 @@ module.exports = class HomeView extends RootView
|
|||
@playSound 'menu-button-click'
|
||||
e.preventDefault()
|
||||
e.stopImmediatePropagation()
|
||||
window.tracker?.trackEvent 'Homepage', Action: 'Play'
|
||||
window.tracker?.trackEvent 'Click Play', category: 'Homepage'
|
||||
window.open '/play', '_blank'
|
||||
|
||||
afterInsert: ->
|
||||
super(arguments...)
|
||||
@$el.addClass 'hour-of-code' if @explainsHourOfCode
|
||||
if me.isAdmin() and me.get('slug') is 'nick'
|
||||
LevelSetupManager = require 'lib/LevelSetupManager'
|
||||
setupManager = new LevelSetupManager levelID: 'dungeons-of-kithgard', hadEverChosenHero: true, parent: @
|
||||
setupManager.open()
|
||||
|
||||
setUpHourOfCode: ->
|
||||
elapsed = (new Date() - new Date(me.get('dateCreated')))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
RootView = require 'views/kinds/RootView'
|
||||
RootView = require 'views/core/RootView'
|
||||
template = require 'templates/legal'
|
||||
|
||||
module.exports = class LegalView extends RootView
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue