mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Fixed some memory leaks. Fixed a couple minor bugs.
This commit is contained in:
parent
b8214e8b3c
commit
4b388f2775
11 changed files with 13 additions and 17 deletions
|
@ -813,4 +813,5 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
p.removeChild @healthBar if p = @healthBar?.parent
|
||||
@sprite?.off 'animationend', @playNextAction
|
||||
clearInterval @effectInterval if @effectInterval
|
||||
@dialogueSoundInstance?.removeAllEventListeners()
|
||||
super()
|
||||
|
|
|
@ -86,10 +86,10 @@ if campaign.loaded
|
|||
h1#campaign-status
|
||||
.campaign-status-background
|
||||
- var fullName = i18n(campaign.attributes, 'fullName')
|
||||
if me.get('preferredLanguage', true).split('-')[0] == 'en' || fullName != campaign.get('fullName')
|
||||
if (me.get('preferredLanguage', true) || 'en-US').split('-')[0] == 'en' || fullName != campaign.get('fullName')
|
||||
// We have a translation.
|
||||
span.spr= fullName
|
||||
| -
|
||||
span= fullName
|
||||
| :
|
||||
span.spl.spr= levelsCompleted
|
||||
| /
|
||||
span.spl= levelsTotal
|
||||
|
|
|
@ -39,7 +39,6 @@ module.exports = class SubscribeModal extends ModalView
|
|||
popoverContent += "<p>" + $.i18n.t('subscribe.parents_blurb2') + "</p>"
|
||||
popoverContent += "<p>" + $.i18n.t('subscribe.parents_blurb3') + "</p>"
|
||||
#popoverContent = popoverContent.replace /9[.,]99/g, '3.99' # Sale
|
||||
window.popoverContent = popoverContent
|
||||
@$el.find('#parents-info').popover(
|
||||
animation: true
|
||||
html: true
|
||||
|
|
|
@ -158,7 +158,6 @@ class ScriptNode extends TreemaObjectNode
|
|||
|
||||
tabToCurrentScript: ->
|
||||
@settings.view.scriptTreema?.keepFocus()
|
||||
window.v = @settings.view
|
||||
firstRow = @settings.view.scriptTreema?.$el.find('.treema-node:visible').data('instance')
|
||||
return unless firstRow?
|
||||
firstRow.select()
|
||||
|
|
|
@ -57,7 +57,6 @@ module.exports = class LevelThangEditView extends CocoView
|
|||
thangTypeName = thangType?.get('name') or 'None'
|
||||
input.val(thangTypeName)
|
||||
@$el.find('#thang-type-link span').text(thangTypeName)
|
||||
window.input = input
|
||||
@hideLoading()
|
||||
|
||||
navigateToAllThangs: ->
|
||||
|
|
|
@ -163,7 +163,6 @@ module.exports = class ThangTypeColorsTabView extends CocoView
|
|||
colors = {}
|
||||
@buttons.find('button').each (i, button) ->
|
||||
return unless $(button).hasClass('selected')
|
||||
window.button = button
|
||||
colors[$(button).val()] = true
|
||||
|
||||
shapes = []
|
||||
|
|
|
@ -46,7 +46,7 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
goalContainer = @$el.find('.level-loading-goals')
|
||||
goalList = goalContainer.find('ul')
|
||||
goalCount = 0
|
||||
for goalID, goal of @level.get('goals') when (not goal.team or goal.team is e.team) and not goal.hiddenGoal
|
||||
for goalID, goal of @level.get('goals') when (not goal.team or goal.team is (e.team or 'humans')) and not goal.hiddenGoal
|
||||
name = utils.i18n goal, 'name'
|
||||
goalList.append $('<li>' + name + '</li>')
|
||||
++goalCount
|
||||
|
|
|
@ -126,7 +126,9 @@ module.exports = class DocFormatter
|
|||
|
||||
replaceSpriteName: (s) ->
|
||||
# Prefer type, and excluded the quotes we'd get with @formatValue
|
||||
s.replace /#{spriteName}/g, @options.thang.type ? @options.thang.spriteName
|
||||
name = @options.thang.type ? @options.thang.spriteName
|
||||
name = 'hero' if /Hero Placeholder/.test @options.thang.id
|
||||
s.replace /#{spriteName}/g, name
|
||||
|
||||
formatValue: (v) ->
|
||||
return null if @doc.type is 'snippet'
|
||||
|
|
|
@ -439,7 +439,7 @@ module.exports = class SpellView extends CocoView
|
|||
attackEntry.content = attackEntry.content.replace '${1:enemy}', '"${1:Enemy Name}"'
|
||||
snippetEntries.push attackEntry
|
||||
|
||||
# window.zatannaInstance = @zatanna
|
||||
# window.zatannaInstance = @zatanna # For debugging. Make sure to not leave active when committing.
|
||||
# window.snippetEntries = snippetEntries
|
||||
lang = SpellView.editModes[e.language].substr 'ace/mode/'.length
|
||||
@zatanna.addSnippets snippetEntries, lang
|
||||
|
|
|
@ -52,8 +52,6 @@ module.exports = class LevelGuideView extends CocoView
|
|||
window.removeEventListener('message', @onMessageReceived, false)
|
||||
else
|
||||
window.detachEvent('onmessage', @onMessageReceived, false)
|
||||
if window.onYouTubeIframeAPIReady
|
||||
window.onYouTubeIframeAPIReady = null
|
||||
super()
|
||||
|
||||
getRenderData: ->
|
||||
|
|
|
@ -179,7 +179,6 @@ module.exports = class PlayHeroesModal extends ModalView
|
|||
stage = new createjs.SpriteStage(canvas[0])
|
||||
@stages[heroIndex] = stage
|
||||
stage.addChild layer.container
|
||||
window.stage = stage
|
||||
stage.update()
|
||||
unless preloading
|
||||
createjs.Ticker.addEventListener 'tick', stage
|
||||
|
|
Loading…
Reference in a new issue