Merge branch 'master' into production

This commit is contained in:
Nick Winter 2015-12-02 12:07:50 -08:00
commit 28f6dd1fe1
8 changed files with 55 additions and 48 deletions

View file

@ -19,6 +19,7 @@ preventBackspace = (event) ->
if event.keyCode is 8 and not elementAcceptsKeystrokes(event.srcElement or event.target)
event.preventDefault()
else if (key.ctrl or key.command) and not key.alt and event.keyCode in ctrlDefaultPrevented
console.debug "Prevented keystroke", key
event.preventDefault()
elementAcceptsKeystrokes = (el) ->

View file

@ -12,14 +12,14 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
multiplayer: "Multiplayer" # Not currently shown on home page
for_developers: "Pro vývojáře" # Not currently shown on home page.
or_ipad: "Nebo stáhnout pro iPad"
# hoc_class_code: "I Have a Class Code"
# hoc_enter: "Enter"
hoc_class_code: "Mám heslo pro třídu"
hoc_enter: "Vstoupit"
# hoc_title: "Hour of Code?"
nav:
play: "Úrovně" # The top nav bar entry where players choose which levels to play
community: "Komunita"
# courses: "Courses"
courses: "Kurzy"
editor: "Editor"
blog: "Blog"
forum: "Fórum"
@ -35,7 +35,7 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
contact: "Kontakt"
twitter_follow: "Sledovat na Twitteru"
teachers: "Učitelé"
# careers: "Careers"
careers: "Kariéry"
modal:
close: "Zavřít"
@ -405,7 +405,7 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
prompt_body: "Chcete získat více?"
prompt_button: "Vstoupit do obchodu"
recovered: "Obnovení již zakoupených drahokamů proběhlo úspěšně. Aktualizujte stránku prosím."
# price: "x3500 / mo"
price: "x3500 / měs."
subscribe:
comparison_blurb: "Sharpen your skills with a CodeCombat subscription!"
@ -415,10 +415,10 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
feature4: "<strong>3500 bonusových drahokamů</strong> každý měsíc!"
feature5: "Video tutoriály"
feature6: "Premiová e-mailová podpora"
# feature7: "Private <strong>Clans</strong>"
feature7: "Soukromé <strong>Klany</strong>"
free: "Zdarma"
month: "měsíc"
# must_be_logged: "You must be logged in first. Please create an account or log in from the menu above."
must_be_logged: "Musíte se nejdříve přihlásit. Prosím vytvořte si účet nebo se přihlaste z menu nahoře."
subscribe_title: "Předplatné"
unsubscribe: "Zrušit předplatné"
confirm_unsubscribe: "Potvrdit zrušení"
@ -442,14 +442,14 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
# parents_blurb1a: "Computer programming is an essential skill that your child will undoubtedly use as an adult. By 2020, basic software skills will be needed by 77% of jobs, and software engineers are in high demand across the world. Did you know that Computer Science is the highest-paid university degree?"
parents_blurb2: "Za $9.99 USD/měsíc, získají nové výzvy každý týden a osobní emailovou podporu od profesionálních programátorů." # {change}
parents_blurb3: "Bez rizika: 100% záruka vrácení peněz, jednoduché zrušení předplatného na 1 kliknutí."
# payment_methods: "Payment Methods"
payment_methods: "Platební metody"
# payment_methods_title: "Accepted Payment Methods"
# payment_methods_blurb1: "We currently accept credit cards and Alipay. You can also PayPal 29.97 USD to nick@codecombat.com with your account email in the memo to purchase three months' subscription and gems, or $99 for a year."
# payment_methods_blurb2: "If you require an alternate form of payment, please contact"
# sale_already_subscribed: "You're already subscribed!"
# sale_blurb1: "Save $21"
# sale_blurb2: "off regular subscription price of $120 for a whole year!"
# sale_button: "Sale!"
sale_button: "Výprodej!"
# sale_button_title: "Save $21 when you purchase a 1 year subscription"
# sale_click_here: "Click Here"
# sale_ends: "Ends"
@ -507,7 +507,7 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
lua_blurb: "Jazyk pro skriptování her."
io_blurb: "Jednoduchý ale nejasný."
status: "Stav"
# hero_type: "Type"
hero_type: "Typ"
weapons: "Zbraně"
weapons_warrior: "Meče - Krátká vzdálenost, Žádná magie"
weapons_ranger: "Kuše, Zbraně - Dlouhá vzdálenost, Žádná magie"
@ -735,18 +735,18 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
autosave: "Automatické ukládání změn"
me_tab: "O mne"
picture_tab: "Obrázek"
# delete_account_tab: "Delete Your Account"
# wrong_email: "Wrong Email"
# wrong_password: "Wrong Password"
delete_account_tab: "Smazat váš účet"
wrong_email: "Špatný email"
wrong_password: "Neplatné heslo"
upload_picture: "Nahrát obrázek"
# delete_this_account: "Delete this account permanently"
# reset_progress_tab: "Reset All Progress"
# reset_your_progress: "Clear all your progress and start over"
delete_this_account: "Smazat tento účet natrvalo"
reset_progress_tab: "Resetovat všechen postup"
reset_your_progress: "Smazat všechen postup a začít znovu"
# god_mode: "God Mode"
password_tab: "Heslo"
emails_tab: "Emaily"
admin: "Admin"
# manage_subscription: "Click here to manage your subscription."
manage_subscription: "Klikněte zde ke správě vašeho předplatného."
new_password: "Nové heslo"
new_password_verify: "Potvrdit"
# type_in_email: "Type in your email to confirm account deletion."
@ -1240,11 +1240,11 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
account:
payments: "Platby"
# prepaid_codes: "Prepaid Codes"
prepaid_codes: "Předplacené kódy"
purchased: "Zaplaceno"
# sale: "Sale"
sale: "Výprodej"
subscription: "Předplatné"
# invoices: "Invoices"
invoices: "Faktury"
service_apple: "Apple"
service_web: "Web"
paid_on: "Zaplaceno přes"
@ -1347,7 +1347,7 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
user_remarks: "Poznámky uživatele"
versions: "Verze"
items: "Předměty"
# hero: "Hero"
hero: "Hrdina"
heroes: "Hrdinové"
achievement: "Úspěch"
clas: "CLA"
@ -1358,35 +1358,35 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
# poll: "Poll"
# user_polls_record: "Poll Voting History"
# concepts:
# advanced_strings: "Advanced Strings"
# algorithms: "Algorithms"
# arguments: "Arguments"
# arithmetic: "Arithmetic"
# arrays: "Arrays"
# basic_syntax: "Basic Syntax"
# boolean_logic: "Boolean Logic"
concepts:
advanced_strings: "Pokročilé řetězce"
algorithms: "Algoritmy"
arguments: "Parametry"
arithmetic: "Aritmetika"
arrays: "Pole"
basic_syntax: "Základní syntaxe"
boolean_logic: "Booleanovská logika"
# break_statements: "Break Statements"
# classes: "Classes"
classes: "Třídy"
# continue_statements: "Continue Statements"
# for_loops: "For Loops"
# functions: "Functions"
# graphics: "Graphics"
# if_statements: "If Statements"
# input_handling: "Input Handling"
# math_operations: "Math Operations"
for_loops: "For cykly"
functions: "Funkce"
graphics: "Grafika"
if_statements: "Konstrukce If"
input_handling: "Zpracování vstupu"
math_operations: "Matematické operace"
# object_literals: "Object Literals"
# parameters: "Parameters"
# strings: "Strings"
# variables: "Variables"
# vectors: "Vectors"
# while_loops: "Loops"
# recursion: "Recursion"
parameters: "Parametry"
strings: "Řetězce"
variables: "Proměnné"
vectors: "Vektory"
while_loops: "Cykly"
recursion: "Rekurze"
delta:
added: "Přidáno"
modified: "Změněno"
# not_modified: "Not Modified"
not_modified: "Nezměněno"
deleted: "Smazáno"
moved_index: "Index přemístěn"
text_diff: "Rozdíl textu"

View file

@ -92,7 +92,7 @@ module.exports = class ClanDetailsView extends RootView
userConceptsMap = {}
if @campaigns.loaded
levelCount = 0
for campaign in @campaigns.models
for campaign in @campaigns.models when campaign.get('type') is 'hero'
campaignID = campaign.id
lastLevelIndex = 0
for levelID, level of campaign.get('levels')
@ -181,8 +181,7 @@ module.exports = class ClanDetailsView extends RootView
@campaignLevelProgressions = []
@conceptsProgression = []
@arenas = []
for campaign in @campaigns.models
continue if campaign.get('slug') is 'auditions'
for campaign in @campaigns.models when campaign.get('type') is 'hero'
campaignLevelProgression =
ID: campaign.id
slug: campaign.get('slug')

View file

@ -85,6 +85,8 @@ module.exports = class DuelStatsView extends CocoView
'arrow-tower': 100
palisade: 10
peasant: 50
thrower: 9
scout: 18
powers = humans: 0, ogres: 0
for thang in @options.thangs when thang.health > 0 and thang.exists
powers[thang.team] += @costTable[thang.type] or 0 if powers[thang.team]?

View file

@ -424,6 +424,7 @@ module.exports = class PlayLevelView extends RootView
@simulator.fetchAndSimulateOneGame()
shouldSimulate: ->
return false # Performance is too bad right now, gotta fix it first.
# Crude heuristics are crude.
defaultCores = 2
cores = window.navigator.hardwareConcurrency or defaultCores # Available on Chrome/Opera, soon Safari

View file

@ -119,6 +119,7 @@
"uglify-js": "^2.5.0"
},
"optionalDependencies": {
"newrelic": "^1.24.0",
"webworker-threads": "~0.5.5"
},
"license": "MIT for the code, and CC-BY for the art and music",

View file

@ -1,3 +1,5 @@
require 'newrelic' if process.env.NEW_RELIC_LICENSE_KEY?
do (setupLodash = this) ->
GLOBAL._ = require 'lodash'
_.str = require 'underscore.string'

View file

@ -25,7 +25,8 @@ exports.middleware = (req, res, next) ->
path = req.route?.path or '/*'
stat = req.method + "." + path.replace /[^A-Za-z0-9]+/g, '_'
realClient.timing stat, ms
name = req.user?._id
realClient.unique 'users', name if name
res.once 'finish', recordMetrics
res.once 'error', cleanup
@ -39,5 +40,5 @@ exports.trace = (name, callback) ->
return callback unless realClient
time = process.hrtime()
(args...) ->
realClient.timing name, ms
realClient.timing name.replace(/[^A-Za-z0-9]+/g, '_'), ms
return callback.apply(this, args)