From 8d9c7cf0be68aa5e0821c889e6bd0413b726afa8 Mon Sep 17 00:00:00 2001 From: Imperadeiro98 Date: Sat, 29 Nov 2014 21:22:06 +0000 Subject: [PATCH 1/3] Update pt-PT.coffee --- app/locale/pt-PT.coffee | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/locale/pt-PT.coffee b/app/locale/pt-PT.coffee index 9676538ec..f217151d4 100644 --- a/app/locale/pt-PT.coffee +++ b/app/locale/pt-PT.coffee @@ -56,7 +56,7 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: confirm: "Confirmar" owned: "Obtido" # For items you own locked: "Bloqueado" -# purchasable: "Purchasable" # For a hero you unlocked but haven't purchased + purchasable: "Adquirível" # For a hero you unlocked but haven't purchased available: "Disponível" skills_granted: "Habilidades Garantidas" # Property documentation details heroes: "Heróis" # Tooltip on hero shop button from /play @@ -247,7 +247,7 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: tome_select_a_thang: "Seleciona Alguém para " tome_available_spells: "Feitiços Disponíveis" tome_your_skills: "As Tuas Habilidades" -# tome_help: "Help" + tome_help: "Ajuda" tome_current_method: "Método Atual" hud_continue_short: "Continuar" code_saved: "Código Guardado" @@ -327,9 +327,9 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: purchasing: "A adquirir..." declined: "O teu cartão foi recusado." retrying: "Erro do servidor, a tentar novamente." -# prompt_title: "Not Enough Gems" -# prompt_body: "Do you want to get more?" -# prompt_button: "Enter Shop" + prompt_title: "Sem Gemas Suficientes" + prompt_body: "Queres obter mais?" + prompt_button: "Entrar na Loja" choose_hero: choose_hero: "Escolhe o Teu Herói" @@ -355,9 +355,9 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: range: "Alcance" # As in "attack or visual range" blocks: "Bloqueia" # As in "this shield blocks this much damage" skills: "Habilidades" -# available_for_purchase: "Available for Purchase" -# level_to_unlock: "Level to unlock:" -# restricted_to_certain_heroes: "Only certain heroes can play this level." + available_for_purchase: "Disponível para Aquirir" + level_to_unlock: "Nível para desbloquear:" + restricted_to_certain_heroes: "Apenas certos heróis podem jogar este nível." skill_docs: writable: "escrevível" # Hover over "attack" in Your Skills while playing a level to see most of this @@ -793,13 +793,13 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: account: recently_played: "Jogados Recentemente" no_recent_games: "Sem jogos jogados nas passadas duas semanas." -# payments: "Payments" -# service_apple: "Apple" -# service_web: "Web" -# paid_on: "Paid On" -# service: "Service" -# price: "Price" -# gems: "Gems" + payments: "Pagamentos" + service_apple: "Apple" + service_web: "Web" + paid_on: "Pago Em" + service: "Serviço" + price: "Preço" + gems: "Gemas" loading_error: could_not_load: "Erro ao carregar do servidor" @@ -932,16 +932,16 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: # use_list_2: "If used on a website, include a link near the usage, for example underneath an image, or in a general attributions page where you might also mention other Creative Commons works and open source software being used on the site. Something that's already clearly referencing CodeCombat, such as a blog post mentioning CodeCombat, does not need some separate attribution." # art_paragraph_2: "If the content being used is created not by CodeCombat but instead by a user of codecombat.com, attribute them instead, and follow attribution directions provided in that resource's description if there are any." rights_title: "Direitos Reservados" -# rights_desc: "All rights are reserved for Levels themselves. This includes" + rights_desc: "Todos os direitos estão reservedos aos próprios Níveis. Isto inclui" rights_scripts: "Scripts" - rights_unit: "Configuração da unidade" - rights_description: "Descrição" -# rights_writings: "Writings" -# rights_media: "Media (sounds, music) and any other creative content made specifically for that Level and not made generally available when creating Levels." + rights_unit: "Configurações das unidades" + rights_description: "Descrições" + rights_writings: "Textos" + rights_media: "Mídia (sons, música) e quaisquer outros conteúdos creativos feitos especificamente para esse Nível e que não foram disponibilizados para a criação de Níveis." # rights_clarification: "To clarify, anything that is made available in the Level Editor for the purpose of making levels is under CC, whereas the content created with the Level Editor or uploaded in the course of creation of Levels is not." -# nutshell_title: "In a Nutshell" -# nutshell_description: "Any resources we provide in the Level Editor are free to use as you like for creating Levels. But we reserve the right to restrict distribution of the Levels themselves (that are created on codecombat.com) so that they may be charged for in the future, if that's what ends up happening." -# canonical: "The English version of this document is the definitive, canonical version. If there are any discrepencies between translations, the English document takes precedence." + nutshell_title: "Resumidamente" + nutshell_description: "Qualquer um dos recursos que fornecemos no Editor de Níveis são de uso livre para criares Níveis. Mas reservamos o direito de distribuição restrita dos próprios Níveis (que são criados em codecombat.com) pelo que podemos cobrar por eles no futuro, se for isso que acabar por acontecer." + canonical: "A versão Inglesa deste documento é a versão definitiva e sobera. Se houver discrepâncias entre traduções, o documento Inglês prevalece." ladder_prizes: title: "Prémios do Torneio" # This section was for an old tournament and doesn't need new translations now. From abf75281caacec200fe0c06cc514f89da91afd1e Mon Sep 17 00:00:00 2001 From: Imperadeiro98 Date: Sat, 29 Nov 2014 21:25:46 +0000 Subject: [PATCH 2/3] Update pt-PT.coffee --- app/locale/pt-PT.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/locale/pt-PT.coffee b/app/locale/pt-PT.coffee index f217151d4..b7954c22e 100644 --- a/app/locale/pt-PT.coffee +++ b/app/locale/pt-PT.coffee @@ -329,7 +329,7 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: retrying: "Erro do servidor, a tentar novamente." prompt_title: "Sem Gemas Suficientes" prompt_body: "Queres obter mais?" - prompt_button: "Entrar na Loja" + prompt_button: "Entra na Loja" choose_hero: choose_hero: "Escolhe o Teu Herói" @@ -932,16 +932,16 @@ module.exports = nativeDescription: "Português (Portugal)", englishDescription: # use_list_2: "If used on a website, include a link near the usage, for example underneath an image, or in a general attributions page where you might also mention other Creative Commons works and open source software being used on the site. Something that's already clearly referencing CodeCombat, such as a blog post mentioning CodeCombat, does not need some separate attribution." # art_paragraph_2: "If the content being used is created not by CodeCombat but instead by a user of codecombat.com, attribute them instead, and follow attribution directions provided in that resource's description if there are any." rights_title: "Direitos Reservados" - rights_desc: "Todos os direitos estão reservedos aos próprios Níveis. Isto inclui" + rights_desc: "Todos os direitos estão reservados aos próprios Níveis. Isto inclui" rights_scripts: "Scripts" rights_unit: "Configurações das unidades" rights_description: "Descrições" rights_writings: "Textos" - rights_media: "Mídia (sons, música) e quaisquer outros conteúdos creativos feitos especificamente para esse Nível e que não foram disponibilizados para a criação de Níveis." + rights_media: "Mídia (sons, música) e quaisquer outros conteúdos criativos feitos especificamente para esse Nível e que não foram disponibilizados para a criação de Níveis." # rights_clarification: "To clarify, anything that is made available in the Level Editor for the purpose of making levels is under CC, whereas the content created with the Level Editor or uploaded in the course of creation of Levels is not." nutshell_title: "Resumidamente" nutshell_description: "Qualquer um dos recursos que fornecemos no Editor de Níveis são de uso livre para criares Níveis. Mas reservamos o direito de distribuição restrita dos próprios Níveis (que são criados em codecombat.com) pelo que podemos cobrar por eles no futuro, se for isso que acabar por acontecer." - canonical: "A versão Inglesa deste documento é a versão definitiva e sobera. Se houver discrepâncias entre traduções, o documento Inglês prevalece." + canonical: "A versão Inglesa deste documento é a versão definitiva e soberana. Se houver discrepâncias entre traduções, o documento Inglês prevalece." ladder_prizes: title: "Prémios do Torneio" # This section was for an old tournament and doesn't need new translations now. From 6fccae579a7633749551d00c9ab1e9e363d451fb Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 29 Nov 2014 15:31:34 -0800 Subject: [PATCH 3/3] Made d3 load dynamically for the pages that use it. Refactored a bunch of templates and sass files to have their names match with their respective views. --- app/core/ModuleLoader.coffee | 6 ++++++ app/styles/account/{profile.sass => profile-view.sass} | 0 .../account/{unsubscribe.sass => unsubscribe-view.sass} | 0 .../{wizard-settings.sass => wizard-settings-view.sass} | 0 .../{wizard_settings.sass => wizard-settings-modal.sass} | 0 ..._profile_code_modal.jade => job-profile-code-modal.jade} | 0 .../{job_profile.jade => job-profile-treema-view.jade} | 0 .../account/{profile.jade => job-profile-view.jade} | 0 .../account/{unsubscribe.jade => unsubscribe-view.jade} | 0 .../{wizard_settings.jade => wizard-settings-view.jade} | 0 .../{wizard_settings.jade => wizard-settings-view.jade} | 0 app/views/account/JobProfileTreemaView.coffee | 2 +- app/views/account/UnsubscribeView.coffee | 2 +- app/views/account/WizardSettingsView.coffee | 2 +- app/views/admin/GrowthView.coffee | 2 ++ app/views/modal/WizardSettingsModal.coffee | 2 +- app/views/play/ladder/LadderTabView.coffee | 1 + app/views/play/ladder/MyMatchesTabView.coffee | 1 + app/views/user/JobProfileCodeModal.coffee | 4 ++-- app/views/user/JobProfileView.coffee | 2 +- config.coffee | 5 ++++- 21 files changed, 21 insertions(+), 8 deletions(-) rename app/styles/account/{profile.sass => profile-view.sass} (100%) rename app/styles/account/{unsubscribe.sass => unsubscribe-view.sass} (100%) rename app/styles/account/{wizard-settings.sass => wizard-settings-view.sass} (100%) rename app/styles/modal/{wizard_settings.sass => wizard-settings-modal.sass} (100%) rename app/templates/account/{job_profile_code_modal.jade => job-profile-code-modal.jade} (100%) rename app/templates/account/{job_profile.jade => job-profile-treema-view.jade} (100%) rename app/templates/account/{profile.jade => job-profile-view.jade} (100%) rename app/templates/account/{unsubscribe.jade => unsubscribe-view.jade} (100%) rename app/templates/account/{wizard_settings.jade => wizard-settings-view.jade} (100%) rename app/templates/modal/{wizard_settings.jade => wizard-settings-view.jade} (100%) diff --git a/app/core/ModuleLoader.coffee b/app/core/ModuleLoader.coffee index b5035a619..8ef0b4b62 100644 --- a/app/core/ModuleLoader.coffee +++ b/app/core/ModuleLoader.coffee @@ -17,6 +17,12 @@ module.exports = ModuleLoader = class ModuleLoader extends CocoClass @loaded = {} @queue = new createjs.LoadQueue() @queue.on('fileload', @onFileLoad, @) + wrapped = _.wrap window.require, (func, name, loaderPath) -> + # vendor libraries aren't actually wrapped with common.js, so short circuit those requires + return {} if _.string.startsWith(name, 'vendor/') + return func(name, loaderPath) + _.extend wrapped, window.require # for functions like 'list' + window.require = wrapped load: (path, first=true) -> if first diff --git a/app/styles/account/profile.sass b/app/styles/account/profile-view.sass similarity index 100% rename from app/styles/account/profile.sass rename to app/styles/account/profile-view.sass diff --git a/app/styles/account/unsubscribe.sass b/app/styles/account/unsubscribe-view.sass similarity index 100% rename from app/styles/account/unsubscribe.sass rename to app/styles/account/unsubscribe-view.sass diff --git a/app/styles/account/wizard-settings.sass b/app/styles/account/wizard-settings-view.sass similarity index 100% rename from app/styles/account/wizard-settings.sass rename to app/styles/account/wizard-settings-view.sass diff --git a/app/styles/modal/wizard_settings.sass b/app/styles/modal/wizard-settings-modal.sass similarity index 100% rename from app/styles/modal/wizard_settings.sass rename to app/styles/modal/wizard-settings-modal.sass diff --git a/app/templates/account/job_profile_code_modal.jade b/app/templates/account/job-profile-code-modal.jade similarity index 100% rename from app/templates/account/job_profile_code_modal.jade rename to app/templates/account/job-profile-code-modal.jade diff --git a/app/templates/account/job_profile.jade b/app/templates/account/job-profile-treema-view.jade similarity index 100% rename from app/templates/account/job_profile.jade rename to app/templates/account/job-profile-treema-view.jade diff --git a/app/templates/account/profile.jade b/app/templates/account/job-profile-view.jade similarity index 100% rename from app/templates/account/profile.jade rename to app/templates/account/job-profile-view.jade diff --git a/app/templates/account/unsubscribe.jade b/app/templates/account/unsubscribe-view.jade similarity index 100% rename from app/templates/account/unsubscribe.jade rename to app/templates/account/unsubscribe-view.jade diff --git a/app/templates/account/wizard_settings.jade b/app/templates/account/wizard-settings-view.jade similarity index 100% rename from app/templates/account/wizard_settings.jade rename to app/templates/account/wizard-settings-view.jade diff --git a/app/templates/modal/wizard_settings.jade b/app/templates/modal/wizard-settings-view.jade similarity index 100% rename from app/templates/modal/wizard_settings.jade rename to app/templates/modal/wizard-settings-view.jade diff --git a/app/views/account/JobProfileTreemaView.coffee b/app/views/account/JobProfileTreemaView.coffee index 76dc6ae53..cb9ea69cf 100644 --- a/app/views/account/JobProfileTreemaView.coffee +++ b/app/views/account/JobProfileTreemaView.coffee @@ -1,5 +1,5 @@ CocoView = require 'views/core/CocoView' -template = require 'templates/account/job_profile' +template = require 'templates/account/job-profile-treema-view' {me} = require 'core/auth' module.exports = class JobProfileTreemaView extends CocoView diff --git a/app/views/account/UnsubscribeView.coffee b/app/views/account/UnsubscribeView.coffee index 3a056bff8..409edc5fe 100644 --- a/app/views/account/UnsubscribeView.coffee +++ b/app/views/account/UnsubscribeView.coffee @@ -1,5 +1,5 @@ RootView = require 'views/core/RootView' -template = require 'templates/account/unsubscribe' +template = require 'templates/account/unsubscribe-view' {me} = require 'core/auth' module.exports = class UnsubscribeView extends RootView diff --git a/app/views/account/WizardSettingsView.coffee b/app/views/account/WizardSettingsView.coffee index cf7599fb7..ba417054c 100644 --- a/app/views/account/WizardSettingsView.coffee +++ b/app/views/account/WizardSettingsView.coffee @@ -1,5 +1,5 @@ CocoView = require 'views/core/CocoView' -template = require 'templates/account/wizard_settings' +template = require 'templates/account/wizard-settings-view' {me} = require 'core/auth' ThangType = require 'models/ThangType' SpriteBuilder = require 'lib/sprites/SpriteBuilder' diff --git a/app/views/admin/GrowthView.coffee b/app/views/admin/GrowthView.coffee index c43319f03..1bc5957ab 100644 --- a/app/views/admin/GrowthView.coffee +++ b/app/views/admin/GrowthView.coffee @@ -2,6 +2,8 @@ RootView = require 'views/core/RootView' template = require 'templates/admin/growth' RealTimeCollection = require 'collections/RealTimeCollection' +require 'vendor/d3' + # Growth View ################### # # Display interesting growth data. diff --git a/app/views/modal/WizardSettingsModal.coffee b/app/views/modal/WizardSettingsModal.coffee index d2dc85ba4..53344cbe5 100644 --- a/app/views/modal/WizardSettingsModal.coffee +++ b/app/views/modal/WizardSettingsModal.coffee @@ -1,5 +1,5 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/modal/wizard_settings' +template = require 'templates/modal/wizard-settings-modal' WizardLank = require 'lib/surface/WizardLank' ThangType = require 'models/ThangType' {me} = require 'core/auth' diff --git a/app/views/play/ladder/LadderTabView.coffee b/app/views/play/ladder/LadderTabView.coffee index ea9c3f026..857961e2b 100644 --- a/app/views/play/ladder/LadderTabView.coffee +++ b/app/views/play/ladder/LadderTabView.coffee @@ -7,6 +7,7 @@ User = require 'models/User' LeaderboardCollection = require 'collections/LeaderboardCollection' {teamDataFromLevel} = require './utils' ModelModal = require 'views/modal/ModelModal' +require 'vendor/d3' HIGHEST_SCORE = 1000000 diff --git a/app/views/play/ladder/MyMatchesTabView.coffee b/app/views/play/ladder/MyMatchesTabView.coffee index 011b99779..eebc92ab8 100644 --- a/app/views/play/ladder/MyMatchesTabView.coffee +++ b/app/views/play/ladder/MyMatchesTabView.coffee @@ -4,6 +4,7 @@ LevelSession = require 'models/LevelSession' LeaderboardCollection = require 'collections/LeaderboardCollection' LadderSubmissionView = require 'views/play/common/LadderSubmissionView' {teamDataFromLevel} = require './utils' +require 'vendor/d3' module.exports = class MyMatchesTabView extends CocoView id: 'my-matches-tab-view' diff --git a/app/views/user/JobProfileCodeModal.coffee b/app/views/user/JobProfileCodeModal.coffee index 1312dd2a1..8ce8839e6 100644 --- a/app/views/user/JobProfileCodeModal.coffee +++ b/app/views/user/JobProfileCodeModal.coffee @@ -1,9 +1,9 @@ ModalView = require 'views/core/ModalView' -template = require 'templates/account/job_profile_code_modal' +template = require 'templates/account/job-profile-code-modal' LevelSessionCodeView = require 'views/common/LevelSessionCodeView' module.exports = class JobProfileCodeModal extends ModalView - id: 'job_profile_code_modal' + id: 'job-profile-code-modal' template: template modalWidthPercent: 90 plain: true diff --git a/app/views/user/JobProfileView.coffee b/app/views/user/JobProfileView.coffee index f67ff3954..9f056d48d 100644 --- a/app/views/user/JobProfileView.coffee +++ b/app/views/user/JobProfileView.coffee @@ -1,5 +1,5 @@ UserView = require 'views/common/UserView' -template = require 'templates/account/profile' +template = require 'templates/account/job-profile-view' User = require 'models/User' LevelSession = require 'models/LevelSession' CocoCollection = require 'collections/CocoCollection' diff --git a/config.coffee b/config.coffee index 41dd91c5e..595fbe820 100644 --- a/config.coffee +++ b/config.coffee @@ -64,7 +64,7 @@ exports.config = #- vendor.js, all the vendor libraries 'javascripts/vendor.js': [ regJoin('^vendor/(?!scripts/Box2d)') - regJoin('^bower_components/(?!aether)') + regJoin('^bower_components/(?!(aether|d3))') ] #- Other vendor libraries in separate bunches @@ -76,6 +76,9 @@ exports.config = 'javascripts/lodash.js': regJoin('^bower_components/lodash/dist/lodash.js') 'javascripts/aether.js': regJoin('^bower_components/aether/build/aether.js') + # Any vendor libraries we don't want the client to load immediately + 'javascripts/app/vendor/d3.js': regJoin('^bower_components/d3') + #- test, demo libraries 'javascripts/test-app.js': regJoin('^test/app/') 'javascripts/demo-app.js': regJoin('^test/demo/')