diff --git a/app/core/Tracker.coffee b/app/core/Tracker.coffee index 434e6d824..4294bc6ce 100644 --- a/app/core/Tracker.coffee +++ b/app/core/Tracker.coffee @@ -34,7 +34,7 @@ module.exports = class Tracker @explicitTraits ?= {} @explicitTraits[key] = value for key, value of traits - for userTrait in ['email', 'anonymous', 'dateCreated', 'name', 'testGroupNumber', 'gender', 'lastLevel', 'siteref'] + for userTrait in ['email', 'anonymous', 'dateCreated', 'name', 'testGroupNumber', 'gender', 'lastLevel', 'siteref', 'ageRange'] traits[userTrait] ?= me.get(userTrait) console.log 'Would identify', traits if debugAnalytics return unless @isProduction and not me.isAdmin() diff --git a/app/locale/pt-BR.coffee b/app/locale/pt-BR.coffee index e69bc0933..4a6aa374e 100644 --- a/app/locale/pt-BR.coffee +++ b/app/locale/pt-BR.coffee @@ -1,6 +1,6 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: "Portuguese (Brazil)", translation: home: - slogan: "Aprenda a programar enquanto se diverte com um jogo." + slogan: "Aprenda a programar enquanto se diverte jogando." no_ie: "CodeCombat não roda em versões mais antigas que o Internet Explorer 10. Desculpe!" # Warning that only shows up in IE8 and older no_mobile: "CodeCombat não foi projetado para dispositivos móveis e pode não funcionar!" # Warning that shows up on mobile devices play: "Jogar" # The big play button that opens up the campaign view. @@ -52,7 +52,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: spectate: "Assistir" # Ladder page players: "jogadores" # Hover over a level on /play hours_played: "Horas jogadas" # Hover over a level on /play - items: "Items" # Tooltip on item shop button from /play + items: "Itens" # Tooltip on item shop button from /play unlock: "Desbloquear" # For purchasing items and heroes confirm: "Confirmar" owned: "Possui" # For items you own @@ -67,7 +67,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: # poll: "Poll" # Tooltip on poll button from /play next: "Próximo" # Go from choose hero to choose inventory before playing a level change_hero: "Alterar Herói" # Go back from choose inventory to choose hero - choose_inventory: "Equipar Items" + choose_inventory: "Equipar Itens" buy_gems: "Comprar Gems" subscription_required: "Requer assinatura" older_campaigns: "Campanhas antigas" @@ -95,7 +95,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: share_progress_modal: blurb: "Você está fazendo um grande progresso! Diga a alguém o quão você aprendeu com o CodeCombat." - email_invalid: "Endereço de email invalido." + email_invalid: "Endereço de email inválido." form_blurb: "Informe o e-mail deles abaixo e mostraremos a eles!" form_label: "Endereço de Email" placeholder: "endereço de email" diff --git a/app/styles/play/modal/poll-modal.sass b/app/styles/play/modal/poll-modal.sass index fb7683500..da72c99be 100644 --- a/app/styles/play/modal/poll-modal.sass +++ b/app/styles/play/modal/poll-modal.sass @@ -50,7 +50,7 @@ width: 380px text-align: center color: rgb(254,188,68) - font-size: 32px + font-size: 28px text-shadow: black 2px 2px 0, black -2px -2px 0, black 2px -2px 0, black -2px 2px 0, black 2px 0px 0, black 0px -2px 0, black -2px 0px 0, black 0px 2px 0 //- Body diff --git a/app/templates/play/modal/poll-modal.jade b/app/templates/play/modal/poll-modal.jade index 2bdf16d9c..69b2bfbfd 100644 --- a/app/templates/play/modal/poll-modal.jade +++ b/app/templates/play/modal/poll-modal.jade @@ -1,8 +1,6 @@ extends /templates/core/modal-base block modal-header-content h1 - span(data-i18n="play.poll") Poll - span.spr : span= i18n(poll.attributes, "name") block modal-body-content diff --git a/app/views/contribute/DiplomatView.coffee b/app/views/contribute/DiplomatView.coffee index 9e0013402..1d38d9fe0 100644 --- a/app/views/contribute/DiplomatView.coffee +++ b/app/views/contribute/DiplomatView.coffee @@ -103,7 +103,7 @@ module.exports = class DiplomatView extends ContributeClassView fr: ['Xeonarno', 'Elfisen', 'Armaldio', 'MartinDelille', 'pstweb', 'veritable', 'jaybi', 'xavismeh', 'Anon', 'Feugy', 'dc55028', 'ChrisLightman', 'Oaugereau'] # français, French ja: ['g1itch', 'kengos', 'treby', 'Coderaulic'] # 日本語, Japanese ar: ['ahmed80dz', '5y'] # العربية, Arabic - 'pt-BR': ['Gutenberg Barros', 'Kieizroe', 'Matthew Burt', 'brunoporto', 'cassiocardoso', 'Bia41'] # português do Brasil, Portuguese (Brazil) + 'pt-BR': ['Gutenberg Barros', 'Kieizroe', 'Matthew Burt', 'brunoporto', 'cassiocardoso', 'Bia41', 'jklemm'] # português do Brasil, Portuguese (Brazil) 'pt-PT': ['Matthew Burt', 'ReiDuKuduro', 'Imperadeiro98', 'batista', 'ProgramadorLucas', 'gutierri'] # Português (Portugal), Portuguese (Portugal) pl: ['Anon', 'Kacper Ciepielewski', 'TigroTigro', 'kvasnyk'] # język polski, Polish it: ['flauta', 'AlessioPaternoster'] # italiano, Italian diff --git a/app/views/editor/level/modals/GenerateTerrainModal.coffee b/app/views/editor/level/modals/GenerateTerrainModal.coffee index 4159014cf..af0976f9e 100644 --- a/app/views/editor/level/modals/GenerateTerrainModal.coffee +++ b/app/views/editor/level/modals/GenerateTerrainModal.coffee @@ -99,6 +99,14 @@ clusters = { 'thangs': ['Oasis 1', 'Oasis 2', 'Oasis 3'] 'margin': 4 } + 'mountain_floor': { + 'thangs': ['Talus 1', 'Talus 2', 'Talus 3', 'Talus 4', 'Talus 5', 'Talus 6'] + 'margin': -1 + } + 'mountain_walls': { + 'thangs': ['Mountain 1','Mountain 3'] + 'margin': 6 + } } presets = { @@ -247,6 +255,25 @@ presets = { } } } + }, + 'mountain': { + 'terrainName': 'Mountain' + 'type': 'mountain' + 'floors': 'mountain_floor' + 'borders': 'mountain_walls' + 'borderNoise': 1 + 'borderSize': 1 + 'borderThickness': 1 + 'decorations': { + 'hero': { + 'num': [1, 1] + 'width': 2 + 'height': 2 + 'clusters': { + 'hero': [1, 1] + } + } + } } } diff --git a/app/views/play/level/tome/SpellView.coffee b/app/views/play/level/tome/SpellView.coffee index 680a39782..78dc7b008 100644 --- a/app/views/play/level/tome/SpellView.coffee +++ b/app/views/play/level/tome/SpellView.coffee @@ -265,6 +265,7 @@ module.exports = class SpellView extends CocoView if not lockDefaultCode or (_.isNumber(lockDefaultCode) and lockDefaultCode < me.level()) return return unless @spell.source is @spell.originalSource or force + return if @isIE() # Temporary workaround for #2512 console.info 'Locking down default code.' @@ -403,6 +404,8 @@ module.exports = class SpellView extends CocoView # tabTrigger: fallback for name field return unless @zatanna and @autocomplete snippetEntries = [] + haveFindNearestEnemy = false + haveFindNearest = false for group, props of e.propGroups for prop in props if _.isString prop # organizePalette @@ -426,9 +429,8 @@ module.exports = class SpellView extends CocoView meta: 'press enter' name: doc.name tabTrigger: doc.snippets[e.language].tab - if doc.name is 'findNearestEnemy' or doc.name is 'findNearest' - # Remember if we have findNearestEnemy so attack snippet can be updated - haveFindNearestEnemy = true + haveFindNearestEnemy ||= doc.name is 'findNearestEnemy' + haveFindNearest ||= doc.name is 'findNearest' if doc.name is 'attack' # Postpone this until we know if findNearestEnemy is available attackEntry = entry @@ -438,17 +440,37 @@ module.exports = class SpellView extends CocoView # TODO: Generalize this snippet replacement # TODO: Where should this logic live, and what format should it be in? if attackEntry? - unless haveFindNearestEnemy + unless haveFindNearestEnemy or haveFindNearest # No findNearestEnemy, so update attack snippet to string-based target attackEntry.content = attackEntry.content.replace '${1:enemy}', '"${1:Enemy Name}"' snippetEntries.push attackEntry + if haveFindNearest and not haveFindNearestEnemy + @translateFindNearest() + # 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 @editorLang = lang + translateFindNearest: -> + # If they have advanced glasses but are playing a level which assumes earlier glasses, we'll adjust the sample code to use the more advanced APIs instead. + oldSource = @getSource() + if @spell.language is 'clojure' + newSource = oldSource.replace /\(.findNearestEnemy this\)/g, "(.findNearest this (.findEnemies this))" + newSource = newSource.replace /\(.findNearestItem this\)/g, "(.findNearest this (.findItems this))" + else if @spell.language is 'io' + newSource = oldSource.replace /findNearestEnemy/g, "findNearest(findEnemies)" + newSource = newSource.replace /findNearestItem/g, "findNearest(findItems)" + else + newSource = oldSource.replace /(self:|self.|this.|@)findNearestEnemy\(\)/g, "$1findNearest($1findEnemies())" + newSource = newSource.replace /(self:|self.|this.|@)findNearestItem\(\)/g, "$1findNearest($1findItems())" + return if oldSource is newSource + @spell.originalSource = newSource + @updateACEText newSource + _.delay (=> @recompile?()), 1000 + onMultiplayerChanged: -> if @session.get('multiplayer') @createFirepad() @@ -800,6 +822,7 @@ module.exports = class SpellView extends CocoView preload: -> # Send this code over to the God for preloading, but don't change the cast state. + return if @spell.source.indexOf 'while' # If they're working with while-loops, it's more likely to be an incomplete infinite loop, so don't preload. oldSource = @spell.source oldSpellThangAethers = {} for thangID, spellThang of @spell.thangs diff --git a/headless_client/worker_world.coffee b/headless_client/worker_world.coffee index f32928f28..648ab0c8c 100644 --- a/headless_client/worker_world.coffee +++ b/headless_client/worker_world.coffee @@ -2,7 +2,7 @@ # This function needs to run inside an environment that has a 'self'. # This specific worker is targeted towards the node.js headless_client environment. -JASON = require 'jason' +JASON = require 'JASON' fs = require 'fs' GLOBAL.Aether = Aether = require 'aether' GLOBAL._ = _ = require 'lodash' diff --git a/server/routes/mail.coffee b/server/routes/mail.coffee index 5928fdc7d..59fa176e9 100644 --- a/server/routes/mail.coffee +++ b/server/routes/mail.coffee @@ -722,6 +722,7 @@ sendNextStepsEmail = (user, now, daysAgo) -> 'tealeaf-academy': isAdult and isFast 'talent-buddy': isAdult 'coding-campus': isAdult and Math.random() < 0.5 # TODO: geodetect UT and give priority + 'viking': isAdult and isFast #'mv-code-club': isKid # TODO: geodetect, get landing page URL nAdditionalOffers = 4 - _.filter(offers).length possibleAdditionalOffers = ['code-school', 'one-month', 'learnable', 'pluralsight']