mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-25 12:20:32 -04:00
Merge remote-tracking branch 'upstream/master' into eventcheck-regexp
This commit is contained in:
commit
30d8eb8256
7 changed files with 16 additions and 12 deletions
app
collections
lib/world
views
editor
play/level/tome
server/models
7
app/collections/ComponentsCollection.coffee
Normal file
7
app/collections/ComponentsCollection.coffee
Normal file
|
@ -0,0 +1,7 @@
|
|||
LevelComponent = require 'models/LevelComponent'
|
||||
CocoCollection = require 'models/CocoCollection'
|
||||
|
||||
module.exports = class ComponentsCollection extends CocoCollection
|
||||
url: '/db/level_component/search'
|
||||
model: LevelComponent
|
||||
|
|
@ -221,7 +221,7 @@ module.exports = class World
|
|||
channel = 'world:' + channel
|
||||
for script in @scripts
|
||||
continue if script.channel isnt channel
|
||||
scriptNote = new WorldScriptNote script, event, world
|
||||
scriptNote = new WorldScriptNote script, event
|
||||
continue if scriptNote.invalid
|
||||
@scriptNotes.push scriptNote
|
||||
return unless @goalManager
|
||||
|
|
|
@ -2,8 +2,8 @@ VersionsView = require 'views/kinds/VersionsView'
|
|||
|
||||
module.exports = class SuperVersionsView extends VersionsView
|
||||
id: "editor-component-versions-view"
|
||||
url: "/db/component/"
|
||||
url: "/db/level.component/"
|
||||
page: "component"
|
||||
|
||||
constructor: (options, @ID) ->
|
||||
super options, ID, require 'models/Component'
|
||||
super options, ID, require 'models/LevelComponent'
|
|
@ -3,13 +3,9 @@ template = require 'templates/editor/components/main'
|
|||
|
||||
Level = require 'models/Level'
|
||||
LevelComponent = require 'models/LevelComponent'
|
||||
CocoCollection = require 'models/CocoCollection'
|
||||
ComponentsCollection = require 'collections/ComponentsCollection'
|
||||
ComponentConfigView = require './config'
|
||||
|
||||
class ComponentsSearchCollection extends CocoCollection
|
||||
url: '/db/level_component/search'
|
||||
model: LevelComponent
|
||||
|
||||
module.exports = class ThangComponentEditView extends CocoView
|
||||
id: "thang-components-edit-view"
|
||||
template: template
|
||||
|
@ -25,7 +21,7 @@ module.exports = class ThangComponentEditView extends CocoView
|
|||
for model in [Level, LevelComponent]
|
||||
(new model()).on 'schema-loaded', @render unless model.schema?.loaded
|
||||
if not @componentCollection
|
||||
@componentCollection = @supermodel.getCollection new ComponentsSearchCollection()
|
||||
@componentCollection = @supermodel.getCollection new ComponentsCollection()
|
||||
unless @componentCollection.loaded
|
||||
@componentCollection.once 'sync', @onComponentsSync
|
||||
@componentCollection.fetch()
|
||||
|
|
|
@ -26,7 +26,7 @@ module.exports = class SpellToolbarView extends View
|
|||
return unless total = @callState?.statementsExecuted
|
||||
@statementIndex = Math.min(total - 1, Math.max(0, statementIndex))
|
||||
@statementRatio = @statementIndex / (total - 1)
|
||||
@statementTime = @callState.statements[@statementIndex].userInfo.time
|
||||
@statementTime = @callState.statements[@statementIndex]?.userInfo.time ? 0
|
||||
@$el.find('.bar').css('width', 100 * @statementRatio + '%')
|
||||
Backbone.Mediator.publish 'tome:spell-statement-index-updated', statementIndex: @statementIndex, ace: @ace
|
||||
@$el.find('.step-backward').prop('disabled', @statementIndex is 0)
|
||||
|
@ -83,7 +83,7 @@ module.exports = class SpellToolbarView extends View
|
|||
setCallState: (callState, statementIndex, @callIndex, @metrics) ->
|
||||
return if callState is @callState and statementIndex is @statementIndex
|
||||
return unless @callState = callState
|
||||
if not @maintainIndexHover and not @maintainIndexScrub and statementIndex? and callState.statements[statementIndex].userInfo.time isnt @statementTime
|
||||
if not @maintainIndexHover and not @maintainIndexScrub and statementIndex? and callState.statements[statementIndex]?.userInfo.time isnt @statementTime
|
||||
@setStatementIndex statementIndex
|
||||
else
|
||||
@setStatementRatio @statementRatio
|
||||
|
|
|
@ -370,7 +370,7 @@ module.exports = class SpellView extends View
|
|||
#console.log thangID, "got new castAether with raw", aether.raw, "problems", aether.problems
|
||||
spellThang.castAether = aether
|
||||
spellThang.aether = @spell.createAether e.world.getThangByID(thangID)
|
||||
#console.log thangID, @spell.spellKey, "ran", aether.metrics.callsExecuted, "times over", aether.metrics.statementsExecuted, "statements, with max recursion depth", aether.metrics.maxDepth, "and full flow/metrics", aether.metrics, aether.flow
|
||||
console.log thangID, @spell.spellKey, "ran", aether.metrics.callsExecuted, "times over", aether.metrics.statementsExecuted, "statements, with max recursion depth", aether.metrics.maxDepth, "and full flow/metrics", aether.metrics, aether.flow
|
||||
@spell.transpile()
|
||||
@updateAether false, false
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ UserSchema.statics.updateMailChimp = (doc, callback) ->
|
|||
params.email = if existingProps then {leid:existingProps.leid} else {email:doc.get('email')}
|
||||
params.merge_vars = { groupings: [ {id: MAILCHIMP_GROUP_ID, groups: newGroups} ] }
|
||||
params.update_existing = true
|
||||
params.double_optin = false
|
||||
|
||||
onSuccess = (data) ->
|
||||
doc.set('mailChimp', data)
|
||||
|
|
Loading…
Add table
Reference in a new issue