Merge branch 'master' into production

This commit is contained in:
Nick Winter 2015-01-04 09:20:23 -08:00
commit 375f895a59
21 changed files with 63 additions and 67 deletions

View file

@ -107,7 +107,7 @@ module.exports = class CocoRouter extends Backbone.Router
window.location.href = window.location.href window.location.href = window.location.href
routeDirectly: (path, args) -> routeDirectly: (path, args) ->
path = "views/#{path}" if not _.str.startsWith(path, 'views/') path = "views/#{path}" if not _.string.startsWith(path, 'views/')
ViewClass = @tryToLoadModule path ViewClass = @tryToLoadModule path
if not ViewClass and application.moduleLoader.load(path) if not ViewClass and application.moduleLoader.load(path)
@listenToOnce application.moduleLoader, 'load-complete', -> @listenToOnce application.moduleLoader, 'load-complete', ->

View file

@ -118,7 +118,7 @@ module.exports.getConflicts = (headDeltas, pendingDeltas) ->
offset += 1 offset += 1
# these stop being substrings of each other? Then conflict DNE # these stop being substrings of each other? Then conflict DNE
if not (nextPath.startsWith path) then break if not (_.string.startsWith nextPath, path) then break
# check if these two are from the same group, but we still need to check for more beyond # check if these two are from the same group, but we still need to check for more beyond
unless headPathMap[path] or headPathMap[nextPath] then continue unless headPathMap[path] or headPathMap[nextPath] then continue

View file

@ -25,8 +25,8 @@ init = ->
watchForErrors() watchForErrors()
setUpIOSLogging() setUpIOSLogging()
path = document.location.pathname path = document.location.pathname
app.testing = path.startsWith '/test' app.testing = _.string.startsWith path, '/test'
app.demoing = path.startsWith '/demo' app.demoing = _.string.startsWith path, '/demo'
initializeUtilityServices() unless app.testing or app.demoing initializeUtilityServices() unless app.testing or app.demoing
setUpBackboneMediator() setUpBackboneMediator()
app.initialize() app.initialize()

View file

@ -197,7 +197,7 @@ module.exports = Lank = class Lank extends CocoClass
showAreaOfEffects: -> showAreaOfEffects: ->
return unless @thang?.currentEvents return unless @thang?.currentEvents
for event in @thang.currentEvents for event in @thang.currentEvents
continue unless event.startsWith 'aoe-' continue unless _.string.startsWith event, 'aoe-'
continue if @handledDisplayEvents[event] continue if @handledDisplayEvents[event]
@handledDisplayEvents[event] = true @handledDisplayEvents[event] = true
args = JSON.parse(event[4...]) args = JSON.parse(event[4...])
@ -240,7 +240,7 @@ module.exports = Lank = class Lank extends CocoClass
showTextEvents: -> showTextEvents: ->
return unless @thang?.currentEvents return unless @thang?.currentEvents
for event in @thang.currentEvents for event in @thang.currentEvents
continue unless event.startsWith 'text-' continue unless _.string.startsWith event, 'text-'
continue if @handledDisplayEvents[event] continue if @handledDisplayEvents[event]
@handledDisplayEvents[event] = true @handledDisplayEvents[event] = true
options = JSON.parse(event[5...]) options = JSON.parse(event[5...])

View file

@ -199,7 +199,7 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
@upsertActionToRender(lank.thangType) @upsertActionToRender(lank.thangType)
else else
for action in _.values(lank.thangType.getActions()) for action in _.values(lank.thangType.getActions())
continue unless _.any @defaultActions, (prefix) -> action.name.startsWith(prefix) continue unless _.any @defaultActions, (prefix) -> _.string.startsWith(action.name, prefix)
@upsertActionToRender(lank.thangType, action.name, lank.options.colorConfig) @upsertActionToRender(lank.thangType, action.name, lank.options.colorConfig)
upsertActionToRender: (thangType, actionName, colorConfig) -> upsertActionToRender: (thangType, actionName, colorConfig) ->

View file

@ -38,7 +38,7 @@ module.exports = class SegmentedSprite extends createjs.SpriteContainer
@actionNotSupported = false @actionNotSupported = false
action = @thangType.getActions()[actionName] action = @thangType.getActions()[actionName]
randomStart = actionName.startsWith('move') randomStart = _.string.startsWith(actionName, 'move')
# because the resulting segmented image is set to the size of the movie clip, you can use # because the resulting segmented image is set to the size of the movie clip, you can use
# the raw registration data without scaling it. # the raw registration data without scaling it.

View file

@ -20,7 +20,7 @@ module.exports = class SingularSprite extends createjs.Sprite
@actionNotSupported = false @actionNotSupported = false
action = @thangType.getActions()[actionName] action = @thangType.getActions()[actionName]
randomStart = actionName.startsWith('move') randomStart = _.string.startsWith(actionName, 'move')
reg = action.positions?.registration or @thangType.get('positions')?.registration or {x:0, y:0} reg = action.positions?.registration or @thangType.get('positions')?.registration or {x:0, y:0}
if action.animation if action.animation

View file

@ -819,12 +819,12 @@ module.exports = nativeDescription: "Español (América Latina)", englishDescrip
account: account:
recently_played: "Recientemente jugado" recently_played: "Recientemente jugado"
no_recent_games: "No juegos jugados duramente las últimas dos semanas." no_recent_games: "No juegos jugados duramente las últimas dos semanas."
# payments: "Payments" payments: "Pagos"
# purchased: "Purchased" purchased: "Comprado"
subscription: "Suscripción" subscription: "Suscripción"
service_apple: "Apple" service_apple: "Apple"
service_web: "Web" service_web: "Web"
# paid_on: "Paid On" paid_on: "Pagado en"
service: "Servicio" service: "Servicio"
price: "Precio" price: "Precio"
gems: "Gemas" gems: "Gemas"
@ -917,15 +917,15 @@ module.exports = nativeDescription: "Español (América Latina)", englishDescrip
multiplayer_hint_label: "Consejo:" multiplayer_hint_label: "Consejo:"
multiplayer_hint: " Cliquea el enlace para seleccionar todo, luego presiona ⌘-C o Ctrl-C para copiar el enlace." multiplayer_hint: " Cliquea el enlace para seleccionar todo, luego presiona ⌘-C o Ctrl-C para copiar el enlace."
multiplayer_coming_soon: "¡Más características de multijugador por venir!" multiplayer_coming_soon: "¡Más características de multijugador por venir!"
# multiplayer_sign_in_leaderboard: "Sign in or create an account and get your solution on the leaderboard." multiplayer_sign_in_leaderboard: "Entra o crea una cuenta y mira tu solución en la clafisicación."
legal: legal:
page_title: "Legal" page_title: "Legal"
opensource_intro: "CodeCombat is completamente open source." opensource_intro: "CodeCombat es completamente open source."
opensource_description_prefix: "Echa un vistazo " opensource_description_prefix: "Echa un vistazo "
github_url: "nuestro GitHub" github_url: "nuestro GitHub"
opensource_description_center: "y ayudanos si quieres! CodeCombat esta construido por docenas de proyectos open source, y los amamos. Mira " opensource_description_center: "y ayudanos si quieres! CodeCombat esta construido por docenas de proyectos open source, y los amamos. Mira "
archmage_wiki_url: "nuestra wiki de Archimago wiki" archmage_wiki_url: "nuestra wiki de Archimago"
opensource_description_suffix: "Para la lista de softwares que hacen al juego posible." opensource_description_suffix: "Para la lista de softwares que hacen al juego posible."
practices_title: "Mejores prácticas respetuosas" practices_title: "Mejores prácticas respetuosas"
# practices_description: "These are our promises to you, the player, in slightly less legalese." # practices_description: "These are our promises to you, the player, in slightly less legalese."
@ -938,7 +938,7 @@ module.exports = nativeDescription: "Español (América Latina)", englishDescrip
email_settings_url: "tus opciones de mail" email_settings_url: "tus opciones de mail"
email_description_suffix: "o mediante links en los mails que mandamos, tu puedas cambiar tus preferencias y fácilmente desuscribirte en cualquier momento." email_description_suffix: "o mediante links en los mails que mandamos, tu puedas cambiar tus preferencias y fácilmente desuscribirte en cualquier momento."
cost_title: "Costo" cost_title: "Costo"
# cost_description: "CodeCombat is free to play for all of its core levels, with a $9.99 USD/mo subscription for access to extra level branches and 3500 bonus gems per month. You can cancel with a click, and we offer a 100% money-back guarantee." cost_description: "CodeCombat es gratuito para todos sus niveles principales, con una suscripción de $9.99 USD/mes con acceso a niveles adicionales y un bonus de 3500 gemas cada mes. Puedes cancelar con un click y ofrecemos una garantía del 100%."
# copyrights_title: "Copyrights and Licenses" # copyrights_title: "Copyrights and Licenses"
# contributor_title: "Contributor License Agreement" # contributor_title: "Contributor License Agreement"
# contributor_description_prefix: "All contributions, both on the site and on our GitHub repository, are subject to our" # contributor_description_prefix: "All contributions, both on the site and on our GitHub repository, are subject to our"

View file

@ -7,12 +7,12 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
# try_it: "Try It" # Alternate wording for Play button # try_it: "Try It" # Alternate wording for Play button
old_browser: "Uh oh, jouw browser is te oud om CodeCombat te kunnen spelen, Sorry!" # Warning that shows up on really old Firefox/Chrome/Safari old_browser: "Uh oh, jouw browser is te oud om CodeCombat te kunnen spelen, Sorry!" # Warning that shows up on really old Firefox/Chrome/Safari
old_browser_suffix: "Je kan toch proberen, maar het zal waarschijnlijk niet werken!" old_browser_suffix: "Je kan toch proberen, maar het zal waarschijnlijk niet werken!"
# ipad_browser: "Bad news: CodeCombat doesn't run on iPad in the browser. Good news: our native iPad app is awaiting Apple approval." ipad_browser: "Slecht nieuws: CodeCombat draait niet in je browser op iPad. Goed nieuws: onze iPad-app wordt op het moment beoordeeld door Apple."
campaign: "Campagne" campaign: "Campagne"
for_beginners: "Voor Beginners" for_beginners: "Voor Beginners"
multiplayer: "Multiplayer" # Not currently shown on home page multiplayer: "Multiplayer" # Not currently shown on home page
for_developers: "Voor ontwikkelaars" # Not currently shown on home page. for_developers: "Voor ontwikkelaars" # Not currently shown on home page.
# or_ipad: "Or download for iPad" or_ipad: "Of download voor iPad"
nav: nav:
play: "Levels" # The top nav bar entry where players choose which levels to play play: "Levels" # The top nav bar entry where players choose which levels to play
@ -21,7 +21,7 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
blog: "Blog" blog: "Blog"
forum: "Forum" forum: "Forum"
account: "Lidmaatschap" account: "Lidmaatschap"
# profile: "Profile" profile: "Profiel"
# stats: "Stats" # stats: "Stats"
# code: "Code" # code: "Code"
admin: "Administrator" # Only shows up when you are an admin admin: "Administrator" # Only shows up when you are an admin
@ -51,32 +51,32 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
play: play:
play_as: "Speel als " # Ladder page play_as: "Speel als " # Ladder page
spectate: "Toeschouwen" # Ladder page spectate: "Toeschouwen" # Ladder page
# players: "players" # Hover over a level on /play players: "Spelers" # Hover over a level on /play
# hours_played: "hours played" # Hover over a level on /play # hours_played: "hours played" # Hover over a level on /play
# items: "Items" # Tooltip on item shop button from /play # items: "Items" # Tooltip on item shop button from /play
# unlock: "Unlock" # For purchasing items and heroes unlock: "Ontgrendel" # For purchasing items and heroes
# confirm: "Confirm" confirm: "Bevestigen"
# owned: "Owned" # For items you own # owned: "Owned" # For items you own
# locked: "Locked" locked: "Vergrendeld"
# purchasable: "Purchasable" # For a hero you unlocked but haven't purchased # purchasable: "Purchasable" # For a hero you unlocked but haven't purchased
# available: "Available" # available: "Available"
# skills_granted: "Skills Granted" # Property documentation details # skills_granted: "Skills Granted" # Property documentation details
# heroes: "Heroes" # Tooltip on hero shop button from /play # heroes: "Heroes" # Tooltip on hero shop button from /play
# achievements: "Achievements" # Tooltip on achievement list button from /play # achievements: "Achievements" # Tooltip on achievement list button from /play
# account: "Account" # Tooltip on account button from /play # account: "Account" # Tooltip on account button from /play
# settings: "Settings" # Tooltip on settings button from /play settings: "Instellingen" # Tooltip on settings button from /play
# next: "Next" # Go from choose hero to choose inventory before playing a level # next: "Next" # Go from choose hero to choose inventory before playing a level
# change_hero: "Change Hero" # Go back from choose inventory to choose hero # change_hero: "Change Hero" # Go back from choose inventory to choose hero
# choose_inventory: "Equip Items" # choose_inventory: "Equip Items"
# buy_gems: "Buy Gems" buy_gems: "Edelstenen kopen"
# campaign_desert: "Desert Campaign" # campaign_desert: "Desert Campaign"
# campaign_forest: "Forest Campaign" # campaign_forest: "Forest Campaign"
# campaign_dungeon: "Dungeon Campaign" # campaign_dungeon: "Dungeon Campaign"
# subscription_required: "Subscription Required" # subscription_required: "Subscription Required"
# free: "Free" free: "Gratis"
# subscribed: "Subscribed" subscribed: "Geabbonneerd"
# older_campaigns: "Older Campaigns" # older_campaigns: "Older Campaigns"
# anonymous: "Anonymous Player" anonymous: "Anonieme Speler"
level_difficulty: "Moeilijkheidsgraad: " level_difficulty: "Moeilijkheidsgraad: "
campaign_beginner: "Beginnercampagne" campaign_beginner: "Beginnercampagne"
# awaiting_levels_adventurer_prefix: "We release five levels per week." # awaiting_levels_adventurer_prefix: "We release five levels per week."
@ -102,14 +102,14 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
log_in: "Inloggen" log_in: "Inloggen"
logging_in: "Bezig met inloggen" logging_in: "Bezig met inloggen"
log_out: "Uitloggen" log_out: "Uitloggen"
# forgot_password: "Forgot your password?" forgot_password: "Wachtwoord vergeten?"
# authenticate_gplus: "Authenticate G+" authenticate_gplus: "G+ verifiëren"
# load_profile: "Load G+ Profile" load_profile: "G+ profiel laden"
# load_email: "Load G+ Email" load_email: "G+ e-mail laden"
# finishing: "Finishing" # finishing: "Finishing"
# sign_in_with_facebook: "Sign in with Facebook" sign_in_with_facebook: "Inloggen met Facebook"
# sign_in_with_gplus: "Sign in with G+" sign_in_with_gplus: "Inloggen met G+"
# signup_switch: "Want to create an account?" signup_switch: "Wil je een account maken?"
signup: signup:
email_announcements: "Ontvang aankondigingen via email" email_announcements: "Ontvang aankondigingen via email"
@ -118,12 +118,12 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
log_in: "inloggen met wachtwoord" log_in: "inloggen met wachtwoord"
social_signup: "Of je kunt je registreren met Facebook of G+:" social_signup: "Of je kunt je registreren met Facebook of G+:"
# required: "You need to log in before you can go that way." # required: "You need to log in before you can go that way."
# login_switch: "Already have an account?" login_switch: "Heb je al een account?"
recover: recover:
recover_account_title: "Herstel Account" recover_account_title: "Herstel Account"
send_password: "Verzend nieuw wachtwoord" send_password: "Verzend nieuw wachtwoord"
# recovery_sent: "Recovery email sent." recovery_sent: "Herstel e-mail verzonden."
# items: # items:
# primary: "Primary" # primary: "Primary"

View file

@ -291,7 +291,7 @@ module.exports = class ThangType extends CocoModel
uploadGenericPortrait: (callback, src) -> uploadGenericPortrait: (callback, src) ->
src ?= @getPortraitSource() src ?= @getPortraitSource()
return callback?() unless src and src.startsWith 'data:' return callback?() unless src and _.string.startsWith src, 'data:'
src = src.replace('data:image/png;base64,', '').replace(/\ /g, '+') src = src.replace('data:image/png;base64,', '').replace(/\ /g, '+')
body = body =
filename: 'portrait.png' filename: 'portrait.png'

View file

@ -5,7 +5,7 @@
position: absolute position: absolute
left: 10px left: 10px
right: 10px right: 10px
padding: 0 4px 10px 40px padding: 0 4px 10px 3%
background-color: transparent background-color: transparent
background-size: 100% 100% background-size: 100% 100%
z-index: 2 z-index: 2
@ -37,7 +37,7 @@
margin-bottom: 3px margin-bottom: 3px
ul.nav.nav-pills ul.nav.nav-pills
margin-top: 15px margin-top: 3%
h4 h4
margin-top: 2px margin-top: 2px
@ -63,7 +63,7 @@
vertical-align: top vertical-align: top
#spell-palette-help-button #spell-palette-help-button
margin: 30px 0px 4px margin: 3% 0px 4px
&.hero .properties &.hero .properties
@include flexbox() @include flexbox()
@ -101,8 +101,3 @@
#spell-palette-view #spell-palette-view
// Make sure we have enough room for at least two columns // Make sure we have enough room for at least two columns
padding-left: 12px padding-left: 12px
@media only screen and (max-width: 1555px)
#spell-palette-view #spell-palette-help-button
// Save vertical space when we don't have three columns (#2005).
margin-top: 16px

View file

@ -22,15 +22,15 @@ nav.navbar.navbar-default(role='navigation')
span.glyphicon-chevron-down.glyphicon span.glyphicon-chevron-down.glyphicon
ul.dropdown-menu ul.dropdown-menu
li.dropdown-header Actions li.dropdown-header(data-i18n="common.actions") Actions
li li
a#component-watch-button a#component-watch-button
span.watch span.watch
span.glyphicon.glyphicon-eye-open span.glyphicon.glyphicon-eye-open
span.spl Watch span.spl(data-i18n="common.watch") Watch
span.unwatch.secret span.unwatch.secret
span.glyphicon.glyphicon-eye-close span.glyphicon.glyphicon-eye-close
span.spl Unwatch span.spl(data-i18n="common.unwatch") Unwatch
if !me.get('anonymous') if !me.get('anonymous')
li#create-new-component-button li#create-new-component-button
a(data-i18n="editor.level_component_b_new") Create New Component a(data-i18n="editor.level_component_b_new") Create New Component
@ -38,7 +38,7 @@ nav.navbar.navbar-default(role='navigation')
a(data-i18n="editor.pop_i18n")#pop-component-i18n-button Populate i18n a(data-i18n="editor.pop_i18n")#pop-component-i18n-button Populate i18n
li.divider li.divider
li.dropdown-header Info li.dropdown-header(data-i18n="common.info") Info
li#component-history-button li#component-history-button
a(data-i18n="general.version_history") Version History a(data-i18n="general.version_history") Version History
@ -51,4 +51,4 @@ nav.navbar.navbar-default(role='navigation')
.tab-pane#component-settings .tab-pane#component-settings
#edit-component-treema #edit-component-treema
.tab-pane#component-patches .tab-pane#component-patches
.patches-view .patches-view

View file

@ -2,11 +2,11 @@ nav.navbar.navbar-default(role='navigation')
ul.nav.navbar-nav.nav-tabs ul.nav.navbar-nav.nav-tabs
li.active li.active
a(href="#system-code" data-toggle="tab")#system-code-tab Code a(href="#system-code" data-toggle="tab" data-i18n="general.code")#system-code-tab Code
li li
a(href="#system-config-schema" data-toggle="tab")#system-config-schema-tab Config Schema a(href="#system-config-schema" data-toggle="tab" data-i18n="editor.level_component_config_schema")#system-config-schema-tab Config Schema
li li
a(href="#system-settings" data-toggle="tab")#system-settings-tab Settings a(href="#system-settings" data-toggle="tab" data-i18n="editor.level_component_settings")#system-settings-tab Settings
li li
a(href="#system-patches" data-toggle="tab" data-i18n="resources.patches")#system-patches-tab Patches a(href="#system-patches" data-toggle="tab" data-i18n="resources.patches")#system-patches-tab Patches
@ -19,20 +19,20 @@ nav.navbar.navbar-default(role='navigation')
a(data-toggle='dropdown') a(data-toggle='dropdown')
span.glyphicon-chevron-down.glyphicon span.glyphicon-chevron-down.glyphicon
ul.dropdown-menu ul.dropdown-menu
li.dropdown-header Actions li.dropdown-header(data-i18n="common.actions") Actions
li li
a#system-watch-button a#system-watch-button
span.watch span.watch
span.glyphicon.glyphicon-eye-open span.glyphicon.glyphicon-eye-open
span.spl Watch span.spl(data-i18n="common.watch") Watch
span.unwatch.secret span.unwatch.secret
span.glyphicon.glyphicon-eye-close span.glyphicon.glyphicon-eye-close
span.spl Unwatch span.spl(data-i18n="common.unwatch") Unwatch
if me.isAdmin() if me.isAdmin()
li#create-new-system li#create-new-system
a(data-i18n="editor.level_system_btn_new") Create New System a(data-i18n="editor.level_system_btn_new") Create New System
li.divider li.divider
li.dropdown-header Info li.dropdown-header(data-i18n="common.info") Info
li#system-history-button li#system-history-button
a(data-i18n="general.version_history") Version History a(data-i18n="general.version_history") Version History
@ -47,4 +47,4 @@ nav.navbar.navbar-default(role='navigation')
.tab-pane#system-settings .tab-pane#system-settings
#edit-system-treema #edit-system-treema
.tab-pane#system-patches .tab-pane#system-patches
.patches-view .patches-view

View file

@ -68,7 +68,7 @@ module.exports = DemoView = class DemoView extends RootView
@demoFiles = @getAllDemoFiles() @demoFiles = @getAllDemoFiles()
if @subPath if @subPath
prefix = DEMO_REQUIRE_PREFIX + @subPath prefix = DEMO_REQUIRE_PREFIX + @subPath
@demoFiles = (f for f in @demoFiles when f.startsWith prefix) @demoFiles = (f for f in @demoFiles when _.string.startsWith f, prefix)
runDemo: -> runDemo: ->
# TODO: Maybe have an option to run all demos in this folder at the same time? # TODO: Maybe have an option to run all demos in this folder at the same time?

View file

@ -27,7 +27,7 @@ module.exports = class HomeView extends RootView
c.isOldBrowser = true if $.browser.safari && majorVersion < 6 # 6 might have problems with Aether, or maybe just old minors of 6: https://errorception.com/projects/51a79585ee207206390002a2/errors/547a202e1ead63ba4e4ac9fd c.isOldBrowser = true if $.browser.safari && majorVersion < 6 # 6 might have problems with Aether, or maybe just old minors of 6: https://errorception.com/projects/51a79585ee207206390002a2/errors/547a202e1ead63ba4e4ac9fd
else else
console.warn 'no more jquery browser version...' console.warn 'no more jquery browser version...'
c.isEnglish = (me.get('preferredLanguage') or 'en').startsWith 'en' c.isEnglish = _.string.startsWith (me.get('preferredLanguage') or 'en'), 'en'
c.languageName = me.get('preferredLanguage') c.languageName = me.get('preferredLanguage')
c.explainsHourOfCode = @explainsHourOfCode c.explainsHourOfCode = @explainsHourOfCode
c.isMobile = @isMobile() c.isMobile = @isMobile()

View file

@ -42,7 +42,7 @@ module.exports = TestView = class TestView extends RootView
@specFiles = TestView.getAllSpecFiles() @specFiles = TestView.getAllSpecFiles()
if @subPath if @subPath
prefix = TEST_REQUIRE_PREFIX + @subPath prefix = TEST_REQUIRE_PREFIX + @subPath
@specFiles = (f for f in @specFiles when f.startsWith prefix) @specFiles = (f for f in @specFiles when _.string.startsWith f, prefix)
@runTests: (specFiles) -> @runTests: (specFiles) ->
specFiles ?= @getAllSpecFiles() specFiles ?= @getAllSpecFiles()

View file

@ -544,7 +544,7 @@ module.exports = class ThangTypeEditView extends RootView
return @stopShowingSelectedNode() if not selected return @stopShowingSelectedNode() if not selected
path = selected.getPath() path = selected.getPath()
parts = path.split('/') parts = path.split('/')
return @stopShowingSelectedNode() unless parts.length >= 4 and path.startsWith '/raw/' return @stopShowingSelectedNode() unless parts.length >= 4 and _.string.startsWith path, '/raw/'
key = parts[3] key = parts[3]
type = parts[2] type = parts[2]
vectorParser = new SpriteBuilder(@thangType) vectorParser = new SpriteBuilder(@thangType)

View file

@ -72,10 +72,10 @@ module.exports = class I18NHomeView extends RootView
updateCoverage: -> updateCoverage: ->
selectedBase = @selectedLanguage[..2] selectedBase = @selectedLanguage[..2]
relatedLanguages = (l for l in languages when l.startsWith(selectedBase) and l isnt @selectedLanguage) relatedLanguages = (l for l in languages when _.string.startsWith(l, selectedBase) and l isnt @selectedLanguage)
for model in @aggregateModels.models for model in @aggregateModels.models
@updateCoverageForModel(model, relatedLanguages) @updateCoverageForModel(model, relatedLanguages)
model.generallyCovered = true if @selectedLanguage.startsWith 'en' model.generallyCovered = true if _.string.startsWith @selectedLanguage, 'en'
@aggregateModels.sort() @aggregateModels.sort()
updateCoverageForModel: (model, relatedLanguages) -> updateCoverageForModel: (model, relatedLanguages) ->

View file

@ -98,7 +98,7 @@ module.exports = class LadderView extends RootView
onClickedLink: (e) -> onClickedLink: (e) ->
link = $(e.target).closest('a').attr('href') link = $(e.target).closest('a').attr('href')
if link?.startsWith('/play/level') and me.get('anonymous') if link? and _.string.startsWith(link, '/play/level') and me.get('anonymous')
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
@showApologeticSignupModal() @showApologeticSignupModal()

View file

@ -112,6 +112,7 @@ module.exports = class TomeView extends CocoView
for thang in programmableThangs for thang in programmableThangs
continue if @thangSpells[thang.id]? continue if @thangSpells[thang.id]?
@thangSpells[thang.id] = [] @thangSpells[thang.id] = []
thang.programmableMethods ?= plan: {name: 'plan', source: '// Should fill in some default source.', permissions: {readwrite: ['humans']}}
for methodName, method of thang.programmableMethods for methodName, method of thang.programmableMethods
pathComponents = [thang.id, methodName] pathComponents = [thang.id, methodName]
if method.cloneOf if method.cloneOf

View file

@ -529,7 +529,7 @@ getJasmineRequireObj().AjaxRequestTracker = function() {
var requests = jasmine.Ajax.requests.all().slice(); var requests = jasmine.Ajax.requests.all().slice();
for(var j in requests) { for(var j in requests) {
var request = requests[j]; var request = requests[j];
if(request.url.startsWith(url)) { if(_.string.startsWith(request.url, url)) {
request.respondWith({status: 200, responseText: JSON.stringify(responseBody)}); request.respondWith({status: 200, responseText: JSON.stringify(responseBody)});
responded = true; responded = true;
break; break;