mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-29 02:25:37 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
375f895a59
21 changed files with 63 additions and 67 deletions
|
@ -107,7 +107,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
|||
window.location.href = window.location.href
|
||||
|
||||
routeDirectly: (path, args) ->
|
||||
path = "views/#{path}" if not _.str.startsWith(path, 'views/')
|
||||
path = "views/#{path}" if not _.string.startsWith(path, 'views/')
|
||||
ViewClass = @tryToLoadModule path
|
||||
if not ViewClass and application.moduleLoader.load(path)
|
||||
@listenToOnce application.moduleLoader, 'load-complete', ->
|
||||
|
|
|
@ -118,7 +118,7 @@ module.exports.getConflicts = (headDeltas, pendingDeltas) ->
|
|||
offset += 1
|
||||
|
||||
# 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
|
||||
unless headPathMap[path] or headPathMap[nextPath] then continue
|
||||
|
|
|
@ -25,8 +25,8 @@ init = ->
|
|||
watchForErrors()
|
||||
setUpIOSLogging()
|
||||
path = document.location.pathname
|
||||
app.testing = path.startsWith '/test'
|
||||
app.demoing = path.startsWith '/demo'
|
||||
app.testing = _.string.startsWith path, '/test'
|
||||
app.demoing = _.string.startsWith path, '/demo'
|
||||
initializeUtilityServices() unless app.testing or app.demoing
|
||||
setUpBackboneMediator()
|
||||
app.initialize()
|
||||
|
|
|
@ -197,7 +197,7 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
showAreaOfEffects: ->
|
||||
return unless @thang?.currentEvents
|
||||
for event in @thang.currentEvents
|
||||
continue unless event.startsWith 'aoe-'
|
||||
continue unless _.string.startsWith event, 'aoe-'
|
||||
continue if @handledDisplayEvents[event]
|
||||
@handledDisplayEvents[event] = true
|
||||
args = JSON.parse(event[4...])
|
||||
|
@ -240,7 +240,7 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
showTextEvents: ->
|
||||
return unless @thang?.currentEvents
|
||||
for event in @thang.currentEvents
|
||||
continue unless event.startsWith 'text-'
|
||||
continue unless _.string.startsWith event, 'text-'
|
||||
continue if @handledDisplayEvents[event]
|
||||
@handledDisplayEvents[event] = true
|
||||
options = JSON.parse(event[5...])
|
||||
|
|
|
@ -199,7 +199,7 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
|||
@upsertActionToRender(lank.thangType)
|
||||
else
|
||||
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: (thangType, actionName, colorConfig) ->
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = class SegmentedSprite extends createjs.SpriteContainer
|
|||
@actionNotSupported = false
|
||||
|
||||
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
|
||||
# the raw registration data without scaling it.
|
||||
|
|
|
@ -20,7 +20,7 @@ module.exports = class SingularSprite extends createjs.Sprite
|
|||
@actionNotSupported = false
|
||||
|
||||
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}
|
||||
|
||||
if action.animation
|
||||
|
|
|
@ -819,12 +819,12 @@ module.exports = nativeDescription: "Español (América Latina)", englishDescrip
|
|||
account:
|
||||
recently_played: "Recientemente jugado"
|
||||
no_recent_games: "No juegos jugados duramente las últimas dos semanas."
|
||||
# payments: "Payments"
|
||||
# purchased: "Purchased"
|
||||
payments: "Pagos"
|
||||
purchased: "Comprado"
|
||||
subscription: "Suscripción"
|
||||
service_apple: "Apple"
|
||||
service_web: "Web"
|
||||
# paid_on: "Paid On"
|
||||
paid_on: "Pagado en"
|
||||
service: "Servicio"
|
||||
price: "Precio"
|
||||
gems: "Gemas"
|
||||
|
@ -917,15 +917,15 @@ module.exports = nativeDescription: "Español (América Latina)", englishDescrip
|
|||
multiplayer_hint_label: "Consejo:"
|
||||
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_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:
|
||||
page_title: "Legal"
|
||||
opensource_intro: "CodeCombat is completamente open source."
|
||||
opensource_intro: "CodeCombat es completamente open source."
|
||||
opensource_description_prefix: "Echa un vistazo "
|
||||
github_url: "nuestro GitHub"
|
||||
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."
|
||||
practices_title: "Mejores prácticas respetuosas"
|
||||
# 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_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_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"
|
||||
# contributor_title: "Contributor License Agreement"
|
||||
# contributor_description_prefix: "All contributions, both on the site and on our GitHub repository, are subject to our"
|
||||
|
|
|
@ -7,12 +7,12 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
|
|||
# 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_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"
|
||||
for_beginners: "Voor Beginners"
|
||||
multiplayer: "Multiplayer" # 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:
|
||||
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"
|
||||
forum: "Forum"
|
||||
account: "Lidmaatschap"
|
||||
# profile: "Profile"
|
||||
profile: "Profiel"
|
||||
# stats: "Stats"
|
||||
# code: "Code"
|
||||
admin: "Administrator" # Only shows up when you are an admin
|
||||
|
@ -51,32 +51,32 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
|
|||
play:
|
||||
play_as: "Speel als " # 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
|
||||
# items: "Items" # Tooltip on item shop button from /play
|
||||
# unlock: "Unlock" # For purchasing items and heroes
|
||||
# confirm: "Confirm"
|
||||
unlock: "Ontgrendel" # For purchasing items and heroes
|
||||
confirm: "Bevestigen"
|
||||
# owned: "Owned" # For items you own
|
||||
# locked: "Locked"
|
||||
locked: "Vergrendeld"
|
||||
# purchasable: "Purchasable" # For a hero you unlocked but haven't purchased
|
||||
# available: "Available"
|
||||
# skills_granted: "Skills Granted" # Property documentation details
|
||||
# heroes: "Heroes" # Tooltip on hero shop button from /play
|
||||
# achievements: "Achievements" # Tooltip on achievement list 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
|
||||
# change_hero: "Change Hero" # Go back from choose inventory to choose hero
|
||||
# choose_inventory: "Equip Items"
|
||||
# buy_gems: "Buy Gems"
|
||||
buy_gems: "Edelstenen kopen"
|
||||
# campaign_desert: "Desert Campaign"
|
||||
# campaign_forest: "Forest Campaign"
|
||||
# campaign_dungeon: "Dungeon Campaign"
|
||||
# subscription_required: "Subscription Required"
|
||||
# free: "Free"
|
||||
# subscribed: "Subscribed"
|
||||
free: "Gratis"
|
||||
subscribed: "Geabbonneerd"
|
||||
# older_campaigns: "Older Campaigns"
|
||||
# anonymous: "Anonymous Player"
|
||||
anonymous: "Anonieme Speler"
|
||||
level_difficulty: "Moeilijkheidsgraad: "
|
||||
campaign_beginner: "Beginnercampagne"
|
||||
# awaiting_levels_adventurer_prefix: "We release five levels per week."
|
||||
|
@ -102,14 +102,14 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
|
|||
log_in: "Inloggen"
|
||||
logging_in: "Bezig met inloggen"
|
||||
log_out: "Uitloggen"
|
||||
# forgot_password: "Forgot your password?"
|
||||
# authenticate_gplus: "Authenticate G+"
|
||||
# load_profile: "Load G+ Profile"
|
||||
# load_email: "Load G+ Email"
|
||||
forgot_password: "Wachtwoord vergeten?"
|
||||
authenticate_gplus: "G+ verifiëren"
|
||||
load_profile: "G+ profiel laden"
|
||||
load_email: "G+ e-mail laden"
|
||||
# finishing: "Finishing"
|
||||
# sign_in_with_facebook: "Sign in with Facebook"
|
||||
# sign_in_with_gplus: "Sign in with G+"
|
||||
# signup_switch: "Want to create an account?"
|
||||
sign_in_with_facebook: "Inloggen met Facebook"
|
||||
sign_in_with_gplus: "Inloggen met G+"
|
||||
signup_switch: "Wil je een account maken?"
|
||||
|
||||
signup:
|
||||
email_announcements: "Ontvang aankondigingen via email"
|
||||
|
@ -118,12 +118,12 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
|
|||
log_in: "inloggen met wachtwoord"
|
||||
social_signup: "Of je kunt je registreren met Facebook of G+:"
|
||||
# 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_account_title: "Herstel Account"
|
||||
send_password: "Verzend nieuw wachtwoord"
|
||||
# recovery_sent: "Recovery email sent."
|
||||
recovery_sent: "Herstel e-mail verzonden."
|
||||
|
||||
# items:
|
||||
# primary: "Primary"
|
||||
|
|
|
@ -291,7 +291,7 @@ module.exports = class ThangType extends CocoModel
|
|||
|
||||
uploadGenericPortrait: (callback, src) ->
|
||||
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, '+')
|
||||
body =
|
||||
filename: 'portrait.png'
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
position: absolute
|
||||
left: 10px
|
||||
right: 10px
|
||||
padding: 0 4px 10px 40px
|
||||
padding: 0 4px 10px 3%
|
||||
background-color: transparent
|
||||
background-size: 100% 100%
|
||||
z-index: 2
|
||||
|
@ -37,7 +37,7 @@
|
|||
margin-bottom: 3px
|
||||
|
||||
ul.nav.nav-pills
|
||||
margin-top: 15px
|
||||
margin-top: 3%
|
||||
|
||||
h4
|
||||
margin-top: 2px
|
||||
|
@ -63,7 +63,7 @@
|
|||
vertical-align: top
|
||||
|
||||
#spell-palette-help-button
|
||||
margin: 30px 0px 4px
|
||||
margin: 3% 0px 4px
|
||||
|
||||
&.hero .properties
|
||||
@include flexbox()
|
||||
|
@ -101,8 +101,3 @@
|
|||
#spell-palette-view
|
||||
// Make sure we have enough room for at least two columns
|
||||
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
|
||||
|
|
|
@ -22,15 +22,15 @@ nav.navbar.navbar-default(role='navigation')
|
|||
span.glyphicon-chevron-down.glyphicon
|
||||
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Actions
|
||||
li.dropdown-header(data-i18n="common.actions") Actions
|
||||
li
|
||||
a#component-watch-button
|
||||
span.watch
|
||||
span.glyphicon.glyphicon-eye-open
|
||||
span.spl Watch
|
||||
span.spl(data-i18n="common.watch") Watch
|
||||
span.unwatch.secret
|
||||
span.glyphicon.glyphicon-eye-close
|
||||
span.spl Unwatch
|
||||
span.spl(data-i18n="common.unwatch") Unwatch
|
||||
if !me.get('anonymous')
|
||||
li#create-new-component-button
|
||||
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
|
||||
|
||||
li.divider
|
||||
li.dropdown-header Info
|
||||
li.dropdown-header(data-i18n="common.info") Info
|
||||
|
||||
li#component-history-button
|
||||
a(data-i18n="general.version_history") Version History
|
||||
|
|
|
@ -2,11 +2,11 @@ nav.navbar.navbar-default(role='navigation')
|
|||
|
||||
ul.nav.navbar-nav.nav-tabs
|
||||
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
|
||||
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
|
||||
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
|
||||
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')
|
||||
span.glyphicon-chevron-down.glyphicon
|
||||
ul.dropdown-menu
|
||||
li.dropdown-header Actions
|
||||
li.dropdown-header(data-i18n="common.actions") Actions
|
||||
li
|
||||
a#system-watch-button
|
||||
span.watch
|
||||
span.glyphicon.glyphicon-eye-open
|
||||
span.spl Watch
|
||||
span.spl(data-i18n="common.watch") Watch
|
||||
span.unwatch.secret
|
||||
span.glyphicon.glyphicon-eye-close
|
||||
span.spl Unwatch
|
||||
span.spl(data-i18n="common.unwatch") Unwatch
|
||||
if me.isAdmin()
|
||||
li#create-new-system
|
||||
a(data-i18n="editor.level_system_btn_new") Create New System
|
||||
li.divider
|
||||
li.dropdown-header Info
|
||||
li.dropdown-header(data-i18n="common.info") Info
|
||||
li#system-history-button
|
||||
a(data-i18n="general.version_history") Version History
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ module.exports = DemoView = class DemoView extends RootView
|
|||
@demoFiles = @getAllDemoFiles()
|
||||
if @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: ->
|
||||
# TODO: Maybe have an option to run all demos in this folder at the same time?
|
||||
|
|
|
@ -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
|
||||
else
|
||||
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.explainsHourOfCode = @explainsHourOfCode
|
||||
c.isMobile = @isMobile()
|
||||
|
|
|
@ -42,7 +42,7 @@ module.exports = TestView = class TestView extends RootView
|
|||
@specFiles = TestView.getAllSpecFiles()
|
||||
if @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) ->
|
||||
specFiles ?= @getAllSpecFiles()
|
||||
|
|
|
@ -544,7 +544,7 @@ module.exports = class ThangTypeEditView extends RootView
|
|||
return @stopShowingSelectedNode() if not selected
|
||||
path = selected.getPath()
|
||||
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]
|
||||
type = parts[2]
|
||||
vectorParser = new SpriteBuilder(@thangType)
|
||||
|
|
|
@ -72,10 +72,10 @@ module.exports = class I18NHomeView extends RootView
|
|||
|
||||
updateCoverage: ->
|
||||
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
|
||||
@updateCoverageForModel(model, relatedLanguages)
|
||||
model.generallyCovered = true if @selectedLanguage.startsWith 'en'
|
||||
model.generallyCovered = true if _.string.startsWith @selectedLanguage, 'en'
|
||||
@aggregateModels.sort()
|
||||
|
||||
updateCoverageForModel: (model, relatedLanguages) ->
|
||||
|
|
|
@ -98,7 +98,7 @@ module.exports = class LadderView extends RootView
|
|||
|
||||
onClickedLink: (e) ->
|
||||
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.preventDefault()
|
||||
@showApologeticSignupModal()
|
||||
|
|
|
@ -112,6 +112,7 @@ module.exports = class TomeView extends CocoView
|
|||
for thang in programmableThangs
|
||||
continue if @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
|
||||
pathComponents = [thang.id, methodName]
|
||||
if method.cloneOf
|
||||
|
|
2
vendor/scripts/jasmine-mock-ajax.js
vendored
2
vendor/scripts/jasmine-mock-ajax.js
vendored
|
@ -529,7 +529,7 @@ getJasmineRequireObj().AjaxRequestTracker = function() {
|
|||
var requests = jasmine.Ajax.requests.all().slice();
|
||||
for(var j in requests) {
|
||||
var request = requests[j];
|
||||
if(request.url.startsWith(url)) {
|
||||
if(_.string.startsWith(request.url, url)) {
|
||||
request.respondWith({status: 200, responseText: JSON.stringify(responseBody)});
|
||||
responded = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue