diff --git a/app/application.coffee b/app/application.coffee
index cc6acd63b..f44287599 100644
--- a/app/application.coffee
+++ b/app/application.coffee
@@ -5,10 +5,12 @@ locale = require 'locale/locale'
Tracker = require 'lib/Tracker'
CocoView = require 'views/kinds/CocoView'
+# Prevent Ctrl/Cmd + [ / ], P, S
+ctrlDefaultPrevented = [219, 221, 80, 83]
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 [219, 221] # prevent Ctrl/Cmd + [ / ]
+ else if (key.ctrl or key.command) and not key.alt and event.keyCode in ctrlDefaultPrevented
event.preventDefault()
elementAcceptsKeystrokes = (el) ->
diff --git a/app/assets/index.html b/app/assets/main.html
similarity index 99%
rename from app/assets/index.html
rename to app/assets/main.html
index b558ff66f..96306649e 100644
--- a/app/assets/index.html
+++ b/app/assets/main.html
@@ -35,6 +35,11 @@
+
+
+
diff --git a/app/initialize.coffee b/app/initialize.coffee
index 7670088db..80c33c9b7 100644
--- a/app/initialize.coffee
+++ b/app/initialize.coffee
@@ -1,5 +1,4 @@
app = require 'application'
-auth = require 'lib/auth'
init = ->
app.initialize()
@@ -10,15 +9,8 @@ init = ->
treemaExt.setup()
filepicker.setKey('AvlkNoldcTOU4PvKi2Xm7z')
-$ ->
- # Make sure we're "logged in" first.
- if auth.me.id
- init()
- else
- Backbone.Mediator.subscribeOnce 'me:synced', init
+$ -> init()
-window.init = init
-
handleNormalUrls = ->
# http://artsy.github.com/blog/2012/06/25/replacing-hashbang-routes-with-pushstate/
$(document).on "click", "a[href^='/']", (event) ->
diff --git a/app/lib/FacebookHandler.coffee b/app/lib/FacebookHandler.coffee
index ffd61b5a1..10a59c40c 100644
--- a/app/lib/FacebookHandler.coffee
+++ b/app/lib/FacebookHandler.coffee
@@ -1,5 +1,5 @@
CocoClass = require 'lib/CocoClass'
-{me, CURRENT_USER_KEY} = require 'lib/auth'
+{me} = require 'lib/auth'
{backboneFailure} = require 'lib/errors'
storage = require 'lib/storage'
@@ -59,7 +59,6 @@ module.exports = FacebookHandler = class FacebookHandler extends CocoClass
error: backboneFailure,
url: "/db/user?facebookID=#{r.id}&facebookAccessToken=#{@authResponse.accessToken}"
success: (model) ->
- storage.save(CURRENT_USER_KEY, model.attributes)
window.location.reload() if model.get('email') isnt oldEmail
})
diff --git a/app/lib/GPlusHandler.coffee b/app/lib/GPlusHandler.coffee
index 2ffd27805..8565a2075 100644
--- a/app/lib/GPlusHandler.coffee
+++ b/app/lib/GPlusHandler.coffee
@@ -1,5 +1,5 @@
CocoClass = require 'lib/CocoClass'
-{me, CURRENT_USER_KEY} = require 'lib/auth'
+{me} = require 'lib/auth'
{backboneFailure} = require 'lib/errors'
storage = require 'lib/storage'
GPLUS_TOKEN_KEY = 'gplusToken'
@@ -102,7 +102,6 @@ module.exports = GPlusHandler = class GPlusHandler extends CocoClass
error: backboneFailure,
url: "/db/user?gplusID=#{gplusID}&gplusAccessToken=#{@accessToken.access_token}"
success: (model) ->
- storage.save(CURRENT_USER_KEY, model.attributes)
window.location.reload() if wasAnonymous and not model.get('anonymous')
})
diff --git a/app/lib/Router.coffee b/app/lib/Router.coffee
index 65915dd56..7c12e1cb8 100644
--- a/app/lib/Router.coffee
+++ b/app/lib/Router.coffee
@@ -1,5 +1,3 @@
-{me} = require 'lib/auth'
-
gplusClientID = "800329290710-j9sivplv2gpcdgkrsis9rff3o417mlfa.apps.googleusercontent.com"
go = (path) -> -> @routeDirectly path, arguments
diff --git a/app/lib/auth.coffee b/app/lib/auth.coffee
index 78862d733..d46733089 100644
--- a/app/lib/auth.coffee
+++ b/app/lib/auth.coffee
@@ -1,20 +1,24 @@
{backboneFailure, genericFailure} = require 'lib/errors'
User = require 'models/User'
storage = require 'lib/storage'
-
-module.exports.CURRENT_USER_KEY = CURRENT_USER_KEY = 'whoami'
BEEN_HERE_BEFORE_KEY = 'beenHereBefore'
+init = ->
+ module.exports.me = window.me = new User(window.userObject) # inserted into main.html
+ trackFirstArrival()
+ if me and not me.get('testGroupNumber')?
+ # Assign testGroupNumber to returning visitors; new ones in server/routes/auth
+ me.set 'testGroupNumber', Math.floor(Math.random() * 256)
+ me.save()
+
+ me.loadGravatarProfile() if me.get('email')
+ Backbone.listenTo(me, 'sync', Backbone.Mediator.publish('me:synced', {me:me}))
+
module.exports.createUser = (userObject, failure=backboneFailure, nextURL=null) ->
user = new User(userObject)
user.save({}, {
- error: failure,
- success: (model) ->
- storage.save(CURRENT_USER_KEY, model)
- if nextURL
- window.location.href = nextURL
- else
- window.location.reload()
+ error: failure,
+ success: -> if nextURL then window.location.href = nextURL else window.location.reload()
})
module.exports.loginUser = (userObject, failure=genericFailure) ->
@@ -23,52 +27,15 @@ module.exports.loginUser = (userObject, failure=genericFailure) ->
username:userObject.email,
password:userObject.password
},
- (model) ->
- storage.save(CURRENT_USER_KEY, model)
- window.location.reload()
+ (model) -> window.location.reload()
)
jqxhr.fail(failure)
module.exports.logoutUser = ->
FB?.logout?()
- res = $.post('/auth/logout', {}, ->
- storage.save(CURRENT_USER_KEY, null)
- window.location.reload()
- )
+ res = $.post('/auth/logout', {}, -> window.location.reload())
res.fail(genericFailure)
-init = ->
- # Load the user from local storage, and refresh it from the server.
- # Also refresh and cache the gravatar info.
-
- storedUser = storage.load(CURRENT_USER_KEY)
- firstTime = not storedUser
- module.exports.me = window.me = new User(storedUser)
- me.url = -> '/auth/whoami'
- me.fetch()
-
- retry = -> me.fetch() # blindly try again
- error = -> setTimeout(retry, 1000) # blindly try again
- me.on 'error', error, @
- me.on 'sync', ->
- me.off 'error', error, @ if firstTime
- me.url = -> "/db/user/#{me.id}"
- trackFirstArrival() if firstTime
- if me and not me.get('testGroupNumber')?
- # Assign testGroupNumber to returning visitors; new ones in server/handlers/user
- me.set 'testGroupNumber', Math.floor(Math.random() * 256)
- me.save()
- storage.save(CURRENT_USER_KEY, me.attributes)
-
- me.loadGravatarProfile() if me.get('email')
- Backbone.listenTo(me, 'sync', userSynced)
-
-userSynced = (user) ->
- Backbone.Mediator.publish('me:synced', {me:user})
- storage.save(CURRENT_USER_KEY, user)
-
-init()
-
onSetVolume = (e) ->
return if e.volume is me.get('volume')
me.set('volume', e.volume)
@@ -83,3 +50,6 @@ trackFirstArrival = ->
return if beenHereBefore
window.tracker?.trackEvent 'First Arrived'
storage.save(BEEN_HERE_BEFORE_KEY, true)
+
+init()
+
diff --git a/app/lib/world/thang.coffee b/app/lib/world/thang.coffee
index 41544cbca..426e7541f 100644
--- a/app/lib/world/thang.coffee
+++ b/app/lib/world/thang.coffee
@@ -38,7 +38,7 @@ module.exports = class Thang
publishNote: (channel, event) ->
event.thang = @
@world.publishNote channel, event
-
+
setGoalState: (goalID, status) ->
@world.setGoalState goalID, status
diff --git a/app/lib/world/thang_state.coffee b/app/lib/world/thang_state.coffee
index 7ea6a9687..655f41b01 100644
--- a/app/lib/world/thang_state.coffee
+++ b/app/lib/world/thang_state.coffee
@@ -98,10 +98,14 @@ module.exports = class ThangState
storage = @trackedPropertyValues[propIndex]
value = @getStoredProp propIndex, type, storage
if prop is "pos"
- @thang.pos = @thang.pos.copy()
- @thang.pos.x = inverse * @thang.pos.x + ratio * value.x
- @thang.pos.y = inverse * @thang.pos.y + ratio * value.y
- @thang.pos.z = inverse * @thang.pos.z + ratio * value.z
+ if @thang.pos.distanceSquared(value) > 900
+ # Don't interpolate; it was probably a teleport. https://github.com/codecombat/codecombat/issues/738
+ @thang.pos = value
+ else
+ @thang.pos = @thang.pos.copy()
+ @thang.pos.x = inverse * @thang.pos.x + ratio * value.x
+ @thang.pos.y = inverse * @thang.pos.y + ratio * value.y
+ @thang.pos.z = inverse * @thang.pos.z + ratio * value.z
else if prop is "rotation"
@thang.rotation = inverse * @thang.rotation + ratio * value
@thang.partialState = true
diff --git a/app/locale/ar.coffee b/app/locale/ar.coffee
index ae1634a04..d98e9c0e6 100644
--- a/app/locale/ar.coffee
+++ b/app/locale/ar.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "العربية", englishDescription: "Arabi
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/bg.coffee b/app/locale/bg.coffee
index 02a48185f..5443c75a3 100644
--- a/app/locale/bg.coffee
+++ b/app/locale/bg.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "български език", englishDescri
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/ca.coffee b/app/locale/ca.coffee
index b556bb751..305bd992e 100644
--- a/app/locale/ca.coffee
+++ b/app/locale/ca.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Català", englishDescription: "Catalan", tr
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/cs.coffee b/app/locale/cs.coffee
index d46a5ffc9..f60722bf1 100644
--- a/app/locale/cs.coffee
+++ b/app/locale/cs.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "čeština", englishDescription: "Czech", tr
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/da.coffee b/app/locale/da.coffee
index e43633763..ce34dfa42 100644
--- a/app/locale/da.coffee
+++ b/app/locale/da.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "dansk", englishDescription: "Danish", trans
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/de.coffee b/app/locale/de.coffee
index 7450a566d..d451d6528 100644
--- a/app/locale/de.coffee
+++ b/app/locale/de.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Deutsch", englishDescription: "German", tra
tip_patience: "Geduld du musst haben, junger Padawan. - Yoda"
tip_documented_bug: "Ein dokumentierter Fehler ist kein Fehler; er ist ein Merkmal."
tip_impossible: "Es wirkt immer unmöglich bis es vollbracht ist. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
time_current: "Aktuell"
time_total: "Total"
time_goto: "Gehe zu"
diff --git a/app/locale/el.coffee b/app/locale/el.coffee
index db12d6a5c..a301dcb79 100644
--- a/app/locale/el.coffee
+++ b/app/locale/el.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "ελληνικά", englishDescription: "Gre
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/en-AU.coffee b/app/locale/en-AU.coffee
index 1ef791725..98b872bce 100644
--- a/app/locale/en-AU.coffee
+++ b/app/locale/en-AU.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "English (AU)", englishDescription: "English
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/en-GB.coffee b/app/locale/en-GB.coffee
index d815f11cc..d9f675858 100644
--- a/app/locale/en-GB.coffee
+++ b/app/locale/en-GB.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "English (UK)", englishDescription: "English
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/en-US.coffee b/app/locale/en-US.coffee
index 3e0d493e0..78aa5661b 100644
--- a/app/locale/en-US.coffee
+++ b/app/locale/en-US.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "English (US)", englishDescription: "English
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/en.coffee b/app/locale/en.coffee
index b52e049d6..7d35d42aa 100644
--- a/app/locale/en.coffee
+++ b/app/locale/en.coffee
@@ -12,6 +12,7 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
manual: "Manual"
fork: "Fork"
play: "Play"
+ retry: "Retry"
units:
second: "second"
@@ -264,6 +265,8 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
tip_patience: "Patience you must have, young Padawan. - Yoda"
tip_documented_bug: "A documented bug is not a bug; it is a feature."
tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+ tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+ tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
time_current: "Now:"
time_total: "Max:"
time_goto: "Go to:"
@@ -600,3 +603,27 @@ module.exports = nativeDescription: "English", englishDescription: "English", tr
tutorial: "tutorial"
new_to_programming: ". New to programming? Hit our beginner campaign to skill up."
so_ready: "I Am So Ready for This"
+
+ loading_error:
+ could_not_load: "Error loading from server"
+ connection_failure: "Connection failed."
+ unauthorized: "You need to be signed in. Do you have cookies disabled?"
+ forbidden: "You do not have the permissions."
+ not_found: "Not found."
+ not_allowed: "Method not allowed."
+ timeout: "Server timeout."
+ conflict: "Resource conflict."
+ bad_input: "Bad input."
+ server_error: "Server error."
+ unknown: "Unknown error."
+
+ resources:
+ your_sessions: "Your Sessions"
+ level: "Level"
+ social_network_apis: "Social Network APIs"
+ facebook_status: "Facebook Status"
+ facebook_friends: "Facebook Friends"
+ facebook_friend_sessions: "Facebook Friend Sessions"
+ gplus_friends: "G+ Friends"
+ gplus_friend_sessions: "G+ Friend Sessions"
+ leaderboard: 'leaderboard'
\ No newline at end of file
diff --git a/app/locale/es-419.coffee b/app/locale/es-419.coffee
index 62b503e40..a09319212 100644
--- a/app/locale/es-419.coffee
+++ b/app/locale/es-419.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "español (América Latina)", englishDescrip
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/es-ES.coffee b/app/locale/es-ES.coffee
index bbbccea1b..9111150f1 100644
--- a/app/locale/es-ES.coffee
+++ b/app/locale/es-ES.coffee
@@ -5,7 +5,7 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
sending: "Enviando..."
cancel: "Cancelar"
save: "Guardar"
-# create: "Create"
+ create: "Crear"
delay_1_sec: "1 segundo"
delay_3_sec: "3 segundos"
delay_5_sec: "5 segundos"
@@ -13,13 +13,13 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
fork: "Bifurcar"
play: "Jugar"
-# units:
-# second: "second"
-# seconds: "seconds"
-# minute: "minute"
-# minutes: "minutes"
-# hour: "hour"
-# hours: "hours"
+ units:
+ second: "segundo"
+ seconds: "segundos"
+ minute: "minuto"
+ minutes: "minutos"
+ hour: "hora"
+ hours: "horas"
modal:
close: "Cerrar"
@@ -53,7 +53,7 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
login:
sign_up: "Crear una cuenta"
log_in: "Entrar"
-# logging_in: "Logging In"
+ logging_in: "Entrando..."
log_out: "Salir"
recover: "recuperar cuenta"
@@ -76,12 +76,12 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
no_ie: "CodeCombat no funciona en Internet Explorer 9 o anteriores. ¡Lo sentimos!"
no_mobile: "¡CodeCombat no fue diseñado para dispositivos móviles y puede que no funcione!"
play: "Jugar"
-# old_browser: "Uh oh, your browser is too old to run CodeCombat. Sorry!"
-# old_browser_suffix: "You can try anyway, but it probably won't work."
-# campaign: "Campaign"
-# for_beginners: "For Beginners"
-# multiplayer: "Multiplayer"
-# for_developers: "For Developers"
+ old_browser: "Ay, su navegador es demasiado viejo para ejecutar CodeCombat. ¡Lo sentimos!"
+ old_browser_suffix: "Puede tentar de todos modos, pero probablemente no va a funcionar."
+ campaign: "Campaña"
+ for_beginners: "Para principiantes"
+ multiplayer: "Multijugador"
+ for_developers: "Para programadores"
play:
choose_your_level: "Elige tu nivel"
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "español (ES)", englishDescription: "Spanis
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/es.coffee b/app/locale/es.coffee
index 7ff407ced..e94a4f211 100644
--- a/app/locale/es.coffee
+++ b/app/locale/es.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "español", englishDescription: "Spanish", t
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/fa.coffee b/app/locale/fa.coffee
index 52b82c69e..424c6544d 100644
--- a/app/locale/fa.coffee
+++ b/app/locale/fa.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "فارسی", englishDescription: "Persian",
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/fi.coffee b/app/locale/fi.coffee
index e6f05d307..ea46d4b27 100644
--- a/app/locale/fi.coffee
+++ b/app/locale/fi.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "suomi", englishDescription: "Finnish", tran
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/fr.coffee b/app/locale/fr.coffee
index 5797e343e..8c77980bb 100644
--- a/app/locale/fr.coffee
+++ b/app/locale/fr.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "français", englishDescription: "French", t
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/he.coffee b/app/locale/he.coffee
index 2281828a4..d61d6c68e 100644
--- a/app/locale/he.coffee
+++ b/app/locale/he.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "עברית", englishDescription: "Hebrew",
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/hi.coffee b/app/locale/hi.coffee
index 5165f38e2..ffcdbc8c7 100644
--- a/app/locale/hi.coffee
+++ b/app/locale/hi.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "मानक हिन्दी", englishDe
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/hu.coffee b/app/locale/hu.coffee
index 2c8a626b3..eaa9a8077 100644
--- a/app/locale/hu.coffee
+++ b/app/locale/hu.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/id.coffee b/app/locale/id.coffee
index f142263d0..bdafc21fc 100644
--- a/app/locale/id.coffee
+++ b/app/locale/id.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Bahasa Indonesia", englishDescription: "Ind
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/it.coffee b/app/locale/it.coffee
index f6ca3ad08..5acb59898 100644
--- a/app/locale/it.coffee
+++ b/app/locale/it.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Italiano", englishDescription: "Italian", t
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/ja.coffee b/app/locale/ja.coffee
index f27bfce8f..86a87bb66 100644
--- a/app/locale/ja.coffee
+++ b/app/locale/ja.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "日本語", englishDescription: "Japanese",
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/ko.coffee b/app/locale/ko.coffee
index 1508eeb7a..c4f3f6ff6 100644
--- a/app/locale/ko.coffee
+++ b/app/locale/ko.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/lt.coffee b/app/locale/lt.coffee
index c411cccbc..fda003f0a 100644
--- a/app/locale/lt.coffee
+++ b/app/locale/lt.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/ms.coffee b/app/locale/ms.coffee
index 25ed25c51..fcba5465a 100644
--- a/app/locale/ms.coffee
+++ b/app/locale/ms.coffee
@@ -9,7 +9,7 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# delay_1_sec: "1 second"
# delay_3_sec: "3 seconds"
# delay_5_sec: "5 seconds"
-# manual: "Manual"
+ manual: "Panduan"
# fork: "Fork"
play: "Mula"
@@ -59,7 +59,7 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
recover:
recover_account_title: "Dapatkan Kembali Akaun"
- send_password: "Hantar kembali kata laluan"
+ send_password: "Hantar kembali kata-laluan"
signup:
# create_account_title: "Create Account to Save Progress"
@@ -102,7 +102,7 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
contact:
contact_us: "Hubungi CodeCombat"
- welcome: "Kami suka mendengar dari anda! Gunakan form ini dan hantar kami emel. "
+ welcome: "Kami gemar mendengar dari anda! Gunakan borang ini dan hantar emel kepada kami. "
contribute_prefix: "Jikalau anda berasa besar hati untuk menyumbang, sila lihat "
contribute_page: "laman kami untuk menyumbang"
# contribute_suffix: "!"
@@ -114,8 +114,8 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
diplomat_suggestion:
title: "Kami perlu menterjemahkan CodeCombat!"
sub_heading: "Kami memerlukan kemahiran bahasa anda."
- pitch_body: "Kami membina CodeCombat dalam Bahasa Inggeris, tetapi kami sudah ada pemain dari seluruh dunia. Kebanyakan mereka mahu bermain dalam Bahasa Melayu dan tidak memahami bahasa Inggeris, jikalau anda boleh tertutur dalam kedua-dua bahasa, harap anda boleh daftar untuk menjadi Diplomat dan menolong menterjemahkan laman CodeCombat dan kesemua level kepada Bahasa Melayu."
- missing_translations: "Sehingga kami dalam menterjemahkan kesemua kepada Bahasa Melayu, anda akan melihat Inggeris apabila Bahasa Melayu tiada dalam penterjemahan."
+ pitch_body: "Kami membina CodeCombat dalam Bahasa Inggeris, tetapi kami sudah ada pemain dari seluruh dunia. Kebanyakan mereka mahu bermain dalam Bahasa Melayu dan tidak memahami Bahasa Inggeris, jikalau anda boleh tertutur dalam kedua-dua bahasa, harap anda boleh daftar untuk menjadi Diplomat dan menolong menterjemahkan laman CodeCombat dan kesemua level kepada Bahasa Melayu."
+ missing_translations: "Sehingga kami dapat menterjemahkan kesemua kepada Bahasa Melayu, anda akan melihat Bahasa Inggeris apabila Bahasa Melayu tiada dalam penterjemahan."
learn_more: "Ketahui lebih lanjut untuk menjadi ahli Diplomat"
# subscribe_as_diplomat: "Subscribe as a Diplomat"
@@ -131,35 +131,35 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# saturation: "Saturation"
# lightness: "Lightness"
-# account_settings:
+ account_settings:
# title: "Account Settings"
-# not_logged_in: "Log in or create an account to change your settings."
-# autosave: "Changes Save Automatically"
-# me_tab: "Me"
-# picture_tab: "Picture"
+ not_logged_in: "Daftar masuk atau buat account untuk menukar \"setting\" anda."
+ autosave: "Pengubahsuaian disimpan secara automatik"
+ me_tab: "Saya"
+ picture_tab: "Gambar"
# wizard_tab: "Wizard"
-# password_tab: "Password"
-# emails_tab: "Emails"
+ password_tab: "Kata-laluan"
+ emails_tab: "Kesemua E-mel"
# admin: "Admin"
-# gravatar_select: "Select which Gravatar photo to use"
-# gravatar_add_photos: "Add thumbnails and photos to a Gravatar account for your email to choose an image."
-# gravatar_add_more_photos: "Add more photos to your Gravatar account to access them here."
+ gravatar_select: "Pilih mana gambar Gravatar photo digunakan"
+ gravatar_add_photos: "Tambah thumbnail and gambar-gambar kepada akaun Gravatar untuk emel anda untuk pilih imej."
+ gravatar_add_more_photos: "Tambah lebih gambar kepada akaun Gravatar dan aksess dari sana."
# wizard_color: "Wizard Clothes Color"
-# new_password: "New Password"
-# new_password_verify: "Verify"
+ new_password: "Kata-laluan baru"
+ new_password_verify: "Verifikasi"
# email_subscriptions: "Email Subscriptions"
-# email_announcements: "Announcements"
-# email_notifications: "Notifications"
+ email_announcements: "Pengumuman"
+ email_notifications: "Notifikasi"
# email_notifications_description: "Get periodic notifications for your account."
# email_announcements_description: "Get emails on the latest news and developments at CodeCombat."
# contributor_emails: "Contributor Class Emails"
-# contribute_prefix: "We're looking for people to join our party! Check out the "
-# contribute_page: "contribute page"
-# contribute_suffix: " to find out more."
+ contribute_prefix: "Kami sedang mencari orang untuk masuk 'parti' kami! Sila semak kepada "
+ contribute_page: "Laman untuk sumbangan"
+ contribute_suffix: " untuk mengetahui lebih lanjut."
# email_toggle: "Toggle All"
-# error_saving: "Error Saving"
-# saved: "Changes Saved"
-# password_mismatch: "Password does not match."
+ error_saving: "Masalah menyimpan"
+ saved: "Pengubahsuian disimpan"
+ password_mismatch: "Kata-laluan tidak sama."
account_profile:
# edit_settings: "Edit Settings"
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
@@ -336,7 +338,7 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
version: "Versi"
commit_msg: "Mesej Commit"
# history: "History"
-# version_history_for: "Version History for: "
+ version_history_for: "Versi History untuk: "
result: "Keputusan"
results: "Keputusan-keputusan"
description: "Deskripsi"
@@ -360,16 +362,16 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
about:
who_is_codecombat: "Siapa adalah CodeCombat?"
why_codecombat: "Kenapa CodeCombat?"
- who_description_prefix: "bersama memulai CodeCombat in 2013. Kami juga membuat (mengaturcara) "
+ who_description_prefix: "bersama memulai CodeCombat dalam 2013. Kami juga membuat (mengaturcara) "
who_description_suffix: "dalam 2008, mengembangkan ia kepada applikasi iOS dan applikasi web #1 untuk belajar menaip dalam karakter Cina dan Jepun."
who_description_ending: "Sekarang, sudah tiba masanya untuk mengajar orang untuk menaip kod."
# why_paragraph_1: "When making Skritter, George didn't know how to program and was constantly frustrated by his inability to implement his ideas. Afterwards, he tried learning, but the lessons were too slow. His housemate, wanting to reskill and stop teaching, tried Codecademy, but \"got bored.\" Each week another friend started Codecademy, then dropped off. We realized it was the same problem we'd solved with Skritter: people learning a skill via slow, intensive lessons when what they need is fast, extensive practice. We know how to fix that."
why_paragraph_2: "Mahu belajar untuk membina kod? Anda tidak perlu membaca dan belajar. Anda perlu menaip kod yang banyak dan bersuka-suka dengan masa yang terluang."
- why_paragraph_3_prefix: "Itulah semua tentang pengaturcaraan. Ia harus membuat anda gembira dan rasa berpuas hati. Tidak seperti"
+ why_paragraph_3_prefix: "Itulah semua mengenai pengaturcaraan. Ia harus membuat anda gembira dan rasa berpuas hati. Tidak seperti"
why_paragraph_3_italic: "yay satu badge"
why_paragraph_3_center: "tapi bersukaria seperti"
why_paragraph_3_italic_caps: "TIDAK MAK SAYA PERLU HABISKAN LEVEL!"
- why_paragraph_3_suffix: "Itulah kenapa CodeCombat adalah permainan multiplayer, tapi bukan sebuah khursus dibuat sebagai permainan. Kami tidak akan berhenti sehingga kamu tidak akan--tetapi buat masa kini, itulah perkara yang baik."
+ why_paragraph_3_suffix: "Itulah kenapa CodeCombat adalah permainan multiplayer, tapi bukan sebuah khursus dibuat sebagai permainan. Kami tidak akan berhenti sehingga anda tidak--tetapi buat masa kini, itulah perkara yang terbaik."
why_paragraph_4: "Jika kamu mahu berasa ketagih terhadap sesuatu permainan komputer, jadilah ketagih kepada permainan ini dan jadilah seorang pakar dalam zaman teknologi terkini."
why_ending: "Dan ia adalah percuma! "
why_ending_url: "Mulalah bermain sekarang!"
@@ -380,14 +382,14 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# michael_description: "Programmer, sys-admin, and undergrad technical wunderkind, Michael is the person keeping our servers online."
# glen_description: "Programmer and passionate game developer, with the motivation to make this world a better place, by developing things that matter. The word impossible can't be found in his dictionary. Learning new skills is his joy!"
-# legal:
-# page_title: "Legal"
-# opensource_intro: "CodeCombat is free to play and completely open source."
-# opensource_description_prefix: "Check out "
-# github_url: "our GitHub"
-# opensource_description_center: "and help out if you like! CodeCombat is built on dozens of open source projects, and we love them. See "
+ legal:
+ page_title: "Undang-Undang"
+ opensource_intro: "CodeCombat adalah percuma untuk bermain dan adalah open source."
+ opensource_description_prefix: "Sila lihat "
+ github_url: "GitHub kami"
+ opensource_description_center: "dan sumbang seberapa mampu! CodeCombat dibina atas beberapa projek open source, dan kami menyukainya. Sila lihat "
# archmage_wiki_url: "our Archmage wiki"
-# opensource_description_suffix: "for a list of the software that makes this game possible."
+ opensource_description_suffix: "senarai sofwe yang membolehkan permainan ini berfungsi."
# practices_title: "Respectful Best Practices"
# practices_description: "These are our promises to you, the player, in slightly less legalese."
# privacy_title: "Privacy"
@@ -399,26 +401,27 @@ module.exports = nativeDescription: "Bahasa Melayu", englishDescription: "Bahasa
# email_settings_url: "your email settings"
# email_description_suffix: "or through links in the emails we send, you can change your preferences and easily unsubscribe at any time."
# cost_title: "Cost"
-# cost_description: "Currently, CodeCombat is 100% free! One of our main goals is to keep it that way, so that as many people can play as possible, regardless of place in life. If the sky darkens, we might have to charge subscriptions or for some content, but we'd rather not. With any luck, we'll be able to sustain the company with:"
+ cost_description: "Buat masa ini, CodeCombat adalah 100% percuma! salah satu daripada tujuan kami adalah untuk membiarkan ia sebegitu, supaya ramai boleh bermain, di mana sahaja mereka berada. Jikalau langit menjadi gelap untuk kami, kami akan mengecaj untuk langganan atau untuk beberapa muatan, tapi kami lebih suka untuk tidak berbuat demikian. Jika kami bernasib baik, kami dapat menanggung syarikat kami dengan:"
+
# recruitment_title: "Recruitment"
# recruitment_description_prefix: "Here on CodeCombat, you're going to become a powerful wizard–not just in the game, but also in real life."
# url_hire_programmers: "No one can hire programmers fast enough"
# recruitment_description_suffix: "so once you've sharpened your skills and if you agree, we will demo your best coding accomplishments to the thousands of employers who are drooling for the chance to hire you. They pay us a little, they pay you"
# recruitment_description_italic: "a lot"
# recruitment_description_ending: "the site remains free and everybody's happy. That's the plan."
-# 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"
+ copyrights_title: "Hakcipta dan Pemelesenan"
+ contributor_title: "Persetujuan Lesen Penyumbang"
+ contributor_description_prefix: "Kesemua sumbangan, termasuk di dalam laman dan di dalam repositiri GitHub, tertakluk kepada"
# cla_url: "CLA"
-# contributor_description_suffix: "to which you should agree before contributing."
+ contributor_description_suffix: "di mana harus dipersetujui sebelum menyumbang."
# code_title: "Code - MIT"
-# code_description_prefix: "All code owned by CodeCombat or hosted on codecombat.com, both in the GitHub repository or in the codecombat.com database, is licensed under the"
+ code_description_prefix: "Kesemua kod yang dimiliki CodeCombat atau dihos di codecombat.com, termasuk di dalam repositori GitHub dan database codecombat.com, dilesenkan di bawah"
# mit_license_url: "MIT license"
-# code_description_suffix: "This includes all code in Systems and Components that are made available by CodeCombat for the purpose of creating levels."
+ code_description_suffix: "Ini termasuk kesemua kod Sistem dan Komponen yang sudah sedia ada untuk CodeCombat untuk membina level."
# art_title: "Art/Music - Creative Commons "
-# art_description_prefix: "All common content is available under the"
+ art_description_prefix: "Kesemua muatan umum boleh didapat di bawah"
# cc_license_url: "Creative Commons Attribution 4.0 International License"
-# art_description_suffix: "Common content is anything made generally available by CodeCombat for the purpose of creating Levels. This includes:"
+# art_description_suffix: "Common content is anything made generally available by CodeCombat for the purpose of creating Levels. This includes:"
# art_music: "Music"
# art_sound: "Sound"
# art_artwork: "Artwork"
diff --git a/app/locale/nb.coffee b/app/locale/nb.coffee
index b08126953..6035495d4 100644
--- a/app/locale/nb.coffee
+++ b/app/locale/nb.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Norsk Bokmål", englishDescription: "Norweg
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/nl-BE.coffee b/app/locale/nl-BE.coffee
index a4824a9eb..bcc6c0875 100644
--- a/app/locale/nl-BE.coffee
+++ b/app/locale/nl-BE.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Nederlands (België)", englishDescription:
tip_patience: "Geduld moet je hebben, jonge Padawan. - Yoda"
tip_documented_bug: "Een gedocumenteerde fout is geen fout; het is deel van het programma."
tip_impossible: "Het lijkt altijd onmogelijk tot het gedaan wordt. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
time_current: "Nu:"
time_total: "Maximum:"
time_goto: "Ga naar:"
diff --git a/app/locale/nl-NL.coffee b/app/locale/nl-NL.coffee
index 3664ba69d..59783a502 100644
--- a/app/locale/nl-NL.coffee
+++ b/app/locale/nl-NL.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Nederlands (Nederland)", englishDescription
tip_patience: "Geduld moet je hebben, jonge Padawan. - Yoda"
tip_documented_bug: "Een gedocumenteerde fout is geen fout; het is deel van het programma."
tip_impossible: "Het lijkt altijd onmogelijk tot het gedaan wordt. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
time_current: "Nu:"
time_total: "Maximum:"
time_goto: "Ga naar:"
diff --git a/app/locale/nl.coffee b/app/locale/nl.coffee
index e69fe027d..afcd5d37f 100644
--- a/app/locale/nl.coffee
+++ b/app/locale/nl.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Nederlands", englishDescription: "Dutch", t
tip_patience: "Geduld moet je hebben, jonge Padawan. - Yoda"
tip_documented_bug: "Een gedocumenteerde fout is geen fout; het is deel van het programma."
tip_impossible: "Het lijkt altijd onmogelijk tot het gedaan wordt. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
time_current: "Nu:"
time_total: "Maximum:"
time_goto: "Ga naar:"
diff --git a/app/locale/nn.coffee b/app/locale/nn.coffee
index 4dc969190..88c9d7d35 100644
--- a/app/locale/nn.coffee
+++ b/app/locale/nn.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Norwegian Nynorsk", englishDescription: "No
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/no.coffee b/app/locale/no.coffee
index a64438ce8..aa3c48484 100644
--- a/app/locale/no.coffee
+++ b/app/locale/no.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Norsk", englishDescription: "Norwegian", tr
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/pl.coffee b/app/locale/pl.coffee
index 72db4f7ce..b858762ce 100644
--- a/app/locale/pl.coffee
+++ b/app/locale/pl.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/pt-BR.coffee b/app/locale/pt-BR.coffee
index d1bdfe010..1e350d8e1 100644
--- a/app/locale/pt-BR.coffee
+++ b/app/locale/pt-BR.coffee
@@ -5,7 +5,7 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
sending: "Enviando..."
cancel: "Cancelar"
save: "Salvar"
-# create: "Create"
+ create: "Criar"
delay_1_sec: "1 segundo"
delay_3_sec: "3 segundos"
delay_5_sec: "5 segundos"
@@ -13,13 +13,13 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
fork: "Fork"
play: "Jogar"
-# units:
-# second: "second"
-# seconds: "seconds"
-# minute: "minute"
-# minutes: "minutes"
-# hour: "hour"
-# hours: "hours"
+ unidades:
+ second: "segundo"
+ seconds: "segundos"
+ minute: "minuto"
+ minutes: "minutos"
+ hour: "hora"
+ hours: "horas"
modal:
close: "Fechar"
@@ -53,7 +53,7 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
login:
sign_up: "Criar conta"
log_in: "Entrar"
-# logging_in: "Logging In"
+ logging_in: "Entrando"
log_out: "Sair"
recover: "Recuperar sua conta"
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "português do Brasil", englishDescription:
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/pt-PT.coffee b/app/locale/pt-PT.coffee
index fa98c389f..5ad78369a 100644
--- a/app/locale/pt-PT.coffee
+++ b/app/locale/pt-PT.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Português europeu", englishDescription: "P
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/pt.coffee b/app/locale/pt.coffee
index eeb23e9d2..09d07b3db 100644
--- a/app/locale/pt.coffee
+++ b/app/locale/pt.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "português", englishDescription: "Portugues
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/ro.coffee b/app/locale/ro.coffee
index 673eac87f..d32ba3c6d 100644
--- a/app/locale/ro.coffee
+++ b/app/locale/ro.coffee
@@ -5,7 +5,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
sending: "Se trimite..."
cancel: "Anulează"
save: "Salvează"
-# create: "Create"
+ create: "Crează"
delay_1_sec: "1 secundă"
delay_3_sec: "3 secunde"
delay_5_sec: "5 secunde"
@@ -13,13 +13,13 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
fork: "Fork"
play: "Joacă"
-# units:
-# second: "second"
-# seconds: "seconds"
-# minute: "minute"
-# minutes: "minutes"
-# hour: "hour"
-# hours: "hours"
+ units:
+ second: "secundă"
+ seconds: "secunde"
+ minute: "minut"
+ minutes: "minute"
+ hour: "oră"
+ hours: "ore"
modal:
close: "Inchide"
@@ -53,7 +53,7 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
login:
sign_up: "Crează cont"
log_in: "Log In"
-# logging_in: "Logging In"
+ logging_in: "Se conectează"
log_out: "Log Out"
recover: "recuperează cont"
@@ -226,8 +226,8 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
skip_tutorial: "Sari peste (esc)"
editor_config: "Editor Config"
editor_config_title: "Configurare Editor"
-# editor_config_language_label: "Programming Language"
-# editor_config_language_description: "Define the programming language you want to code in."
+ editor_config_language_label: "Limbaj de Programare"
+ editor_config_language_description: "Definește limbajul de programare în care vrei să codezi."
editor_config_keybindings_label: "Mapare taste"
editor_config_keybindings_default: "Default (Ace)"
editor_config_keybindings_description: "Adaugă comenzi rapide suplimentare cunoscute din editoarele obisnuite."
@@ -246,17 +246,17 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
tip_beta_launch: "CodeCombat a fost lansat beta in Octombrie 2013."
tip_js_beginning: "JavaScript este doar începutul."
tip_autocast_setting: "Ajutează setările de autocast apăsând pe rotița de pe buton."
-# think_solution: "Think of the solution, not the problem."
-# tip_theory_practice: "In theory, there is no difference between theory and practice. But in practice, there is. - Yogi Berra"
-# tip_error_free: "There are two ways to write error-free programs; only the third one works. - Alan Perlis"
-# tip_debugging_program: "If debugging is the process of removing bugs, then programming must be the process of putting them in. - Edsger W. Dijkstra"
-# tip_forums: "Head over to the forums and tell us what you think!"
+ think_solution: "Gândește-te la soluție, nu la problemă."
+ tip_theory_practice: "Teoretic nu este nici o diferență înte teorie și practică. Dar practic este. - Yogi Berra"
+ tip_error_free: "Există doar două metode de a scrie un program fără erori; numai a treia funcționează. - Alan Perlis"
+ tip_debugging_program: "Dacă a face debuggin este procesul de a scoate bug-uri, atunci a programa este procesul de a introduce bug-uri. - Edsger W. Dijkstra"
+ tip_forums: "Intră pe forum și spune-ți părerea!"
tip_baby_coders: "În vitor până și bebelușii vor fi Archmage."
tip_morale_improves: "Se va încărca până până când va crește moralul."
tip_all_species: "Noi credem în șanse egale de a învăța programare pentru toate speciile."
-# tip_reticulating: "Reticulating spines."
+ tip_reticulating: "Reticulating spines."
tip_harry: "Ha un Wizard, "
-# tip_great_responsibility: "With great coding skill comes great debug responsibility."
+ tip_great_responsibility: "With great coding skill comes great debug responsibility."
# tip_munchkin: "If you don't eat your vegetables, a munchkin will come after you while you're asleep."
# tip_binary: "There are only 10 types of people in the world: those who understand binary, and those who don't."
# tip_commitment_yoda: "A programmer must have the deepest commitment, the most serious mind. ~ Yoda"
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
@@ -585,16 +587,16 @@ module.exports = nativeDescription: "limba română", englishDescription: "Roman
warmup: "Încălzire"
vs: "VS"
-# multiplayer_launch:
-# introducing_dungeon_arena: "Introducing Dungeon Arena"
-# new_way: "The new way to compete with code."
-# to_battle: "To Battle, Developers!"
-# modern_day_sorcerer: "You know how to code? That's badass. You're a modern-day sorcerer! Isn't about time that you used your magic coding powers to command your minions in epic combat? And we're not talking robots here."
-# arenas_are_here: "CodeCombat head-to-head multiplayer arenas are here."
-# ladder_explanation: "Choose your heroes, enchant your human or ogre armies, and climb your way over defeated fellow Wizards to reach the top of the ladders–then challenge your friends in our glorious, asynchronous multiplayer coding arenas. If you're feeling creative, you can even"
-# fork_our_arenas: "fork our arenas"
-# create_worlds: "and create your own worlds."
-# javascript_rusty: "JavaScript a bit rusty? Don't worry; there's a"
-# tutorial: "tutorial"
-# new_to_programming: ". New to programming? Hit our beginner campaign to skill up."
-# so_ready: "I Am So Ready for This"
+ multiplayer_launch:
+ introducing_dungeon_arena: "Prezentăm Dungeon Arena"
+ new_way: "Noul mod de a concura prin linii de cod."
+ to_battle: "La luptă, Developers!"
+ modern_day_sorcerer: "Știi să programezie? Tare. Ești un vrăjitor al noii ere! Nu crezi ca este timpul să îți folosești puterile de programare pentru a conduce în lupte epice minionii tăi? Și nu vorbim despre roboți aici."
+ arenas_are_here: "Arenele CodeCombat multiplayer 1v1 sunt aici."
+ ladder_explanation: "Alegeți eroii,vrăjește armatele de orci sau oameni, și croiește-ți drumul luptând și învingând alți Vrăjitori pentru a ajunge în topul clasamentului. Dacă te simți creativ poți chiar să"
+ fork_our_arenas: "să dai fork la arenele noastre"
+ create_worlds: "și să îți creezi propriile lumi."
+ javascript_rusty: "N-ai mai pus mâna pe JavaScript? Nicio problemă; există un"
+ tutorial: "tutorial"
+ new_to_programming: ". Nou in tainele programării? Încearcă campania de începători pentru ați dezolvata abilitățile."
+ so_ready: "Sunt atât de pregătit pentru asta!"
diff --git a/app/locale/ru.coffee b/app/locale/ru.coffee
index 701d4c0a9..bbe0667c3 100644
--- a/app/locale/ru.coffee
+++ b/app/locale/ru.coffee
@@ -226,8 +226,8 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi
skip_tutorial: "Пропуск (Esc)"
editor_config: "Настройки редактора"
editor_config_title: "Настройки редактора"
-# editor_config_language_label: "Programming Language"
-# editor_config_language_description: "Define the programming language you want to code in."
+ editor_config_language_label: "Язык программирования"
+ editor_config_language_description: "Определяет язык, на котором вы хотите программировать."
editor_config_keybindings_label: "Сочетания клавиш"
editor_config_keybindings_default: "По умолчанию (Ace)"
editor_config_keybindings_description: "Добавляет дополнительные сочетания, известные из популярных редакторов."
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi
tip_patience: "Терпением ты обладать должен, юный падаван. - Yoda"
tip_documented_bug: "Документированный баг не является багом; это фича."
tip_impossible: "Это всегда кажется невозможным, пока не сделано. - Nelson Mandela"
+ tip_talk_is_cheap: "Слова ничего не стоят. Покажи мне код. - Linus Torvalds"
+ tip_first_language: "Наиболее катастрофическая вещь, которую вы можете выучить - ваш первый язык программирования. - Alan Kay"
time_current: "Текущее:"
time_total: "Максимальное:"
time_goto: "Перейти на:"
diff --git a/app/locale/sk.coffee b/app/locale/sk.coffee
index 7d712fcfd..70214b991 100644
--- a/app/locale/sk.coffee
+++ b/app/locale/sk.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "slovenčina", englishDescription: "Slovak",
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/sl.coffee b/app/locale/sl.coffee
index 565ae2335..4815699e8 100644
--- a/app/locale/sl.coffee
+++ b/app/locale/sl.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "slovenščina", englishDescription: "Sloven
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/sr.coffee b/app/locale/sr.coffee
index 9c49c79ee..ba3d37cf9 100644
--- a/app/locale/sr.coffee
+++ b/app/locale/sr.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "српски", englishDescription: "Serbian
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/sv.coffee b/app/locale/sv.coffee
index 64556f8ba..9da2588d2 100644
--- a/app/locale/sv.coffee
+++ b/app/locale/sv.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Svenska", englishDescription: "Swedish", tr
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/th.coffee b/app/locale/th.coffee
index 9904dde0c..f5806b980 100644
--- a/app/locale/th.coffee
+++ b/app/locale/th.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "ไทย", englishDescription: "Thai", tra
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/tr.coffee b/app/locale/tr.coffee
index b5c4b3d57..f72b6e2a0 100644
--- a/app/locale/tr.coffee
+++ b/app/locale/tr.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Türkçe", englishDescription: "Turkish", t
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/uk.coffee b/app/locale/uk.coffee
index 21c88cbf1..dd8967069 100644
--- a/app/locale/uk.coffee
+++ b/app/locale/uk.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "українська мова", englishDesc
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/ur.coffee b/app/locale/ur.coffee
index ea9c2377e..3af879f81 100644
--- a/app/locale/ur.coffee
+++ b/app/locale/ur.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "اُردُو", englishDescription: "Urdu",
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/vi.coffee b/app/locale/vi.coffee
index 6a04a79c4..b8a3dfbf5 100644
--- a/app/locale/vi.coffee
+++ b/app/locale/vi.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "Tiếng Việt", englishDescription: "Vietn
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/zh-HANS.coffee b/app/locale/zh-HANS.coffee
index deede5373..36b055bd1 100644
--- a/app/locale/zh-HANS.coffee
+++ b/app/locale/zh-HANS.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "简体中文", englishDescription: "Chinese
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/zh-HANT.coffee b/app/locale/zh-HANT.coffee
index 29f4d258a..82ee4eee3 100644
--- a/app/locale/zh-HANT.coffee
+++ b/app/locale/zh-HANT.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "繁体中文", englishDescription: "Chinese
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/locale/zh.coffee b/app/locale/zh.coffee
index d3ee927da..9aafa1d91 100644
--- a/app/locale/zh.coffee
+++ b/app/locale/zh.coffee
@@ -264,6 +264,8 @@ module.exports = nativeDescription: "中文", englishDescription: "Chinese", tra
# tip_patience: "Patience you must have, young Padawan. - Yoda"
# tip_documented_bug: "A documented bug is not a bug; it is a feature."
# tip_impossible: "It always seems impossible until it's done. - Nelson Mandela"
+# tip_talk_is_cheap: "Talk is cheap. Show me the code. - Linus Torvalds"
+# tip_first_language: "The most disastrous thing that you can ever learn is your first programming language. - Alan Kay"
# time_current: "Now:"
# time_total: "Max:"
# time_goto: "Go to:"
diff --git a/app/styles/base.sass b/app/styles/base.sass
index fc6e45c03..30980c1fb 100644
--- a/app/styles/base.sass
+++ b/app/styles/base.sass
@@ -167,7 +167,15 @@ a[data-toggle="modal"]
width: 50%
margin: 0 25%
.progress-bar
- width: 100%
+ width: 0%
+ transition: width 0.1s ease
+
+ .errors .alert
+ padding: 5px
+ display: block
+ margin: 10px auto
+ .btn
+ margin-left: 10px
.modal
.wait
@@ -210,3 +218,18 @@ body[lang='ru'], body[lang|='zh'], body[lang='ja'], body[lang='pl'], body[lang='
text-transform: uppercase
letter-spacing: -1px !important
+@media only screen and (max-width: 800px)
+ .main-content-area
+ width: 100%
+ .content
+ width: 100%
+
+ .footer-link-text a
+ font-size: 17px
+ margin-left: 3px
+ margin-right: 3px
+
+ .share-buttons
+ margin-bottom: 20px
+ .partner-badges
+ display: none
diff --git a/app/styles/common/top_nav.sass b/app/styles/common/top_nav.sass
index 1f9f64e9d..9a41771fe 100644
--- a/app/styles/common/top_nav.sass
+++ b/app/styles/common/top_nav.sass
@@ -95,3 +95,33 @@
li
color: #ebebeb
padding: 8px 20px
+
+
+#mobile-nav
+ display: none
+@media only screen and (max-width: 800px)
+ #top-nav
+ display: none
+ #mobile-nav
+ display: inline
+ a.navbar-brand
+ padding: 4px 20px 0px 20px
+
+ button.navbar-toggle
+ background: #483a2d
+ border: 2px solid #2f261d
+ span.icon-bar
+ background: #F9E612
+
+ ul li
+ font-family: 'Bangers', cursive
+ font-weight: normal
+ color: #fff
+ font-size: 25px
+ margin-top: 5px
+ margin-bottom: 5px
+ .header-font
+ color: #fff
+ .footer-link-text
+ width: 100%
+ display: ineline
diff --git a/app/styles/home.sass b/app/styles/home.sass
index c239a916c..e2ba1fdb0 100644
--- a/app/styles/home.sass
+++ b/app/styles/home.sass
@@ -92,3 +92,38 @@
width: 660px
height: 382px
pointer-events: none
+#mobile-trailer-wrapper
+ display: none
+
+@media only screen and (max-width: 800px)
+ #home-view
+ #site-slogan
+ font-size: 30px
+ #trailer-wrapper
+ display: none
+ #mobile-trailer-wrapper
+ display: inline-block
+
+ width: 100%
+ iframe
+ display: block
+ margin: 0 auto
+ .game-mode-wrapper
+ width: 100%
+ img
+ width: 100%
+ .play-text
+ position: absolute
+ right: 45px
+ bottom: 0px
+ color: $yellow
+ font-size: 50px
+ font-family: Bangers
+ @include transition(color .10s linear)
+
+
+
+
+ h1
+ text-align: center
+ margin-top: 0
diff --git a/app/styles/play/ladder.sass b/app/styles/play/ladder.sass
index e1df78f63..149caeac1 100644
--- a/app/styles/play/ladder.sass
+++ b/app/styles/play/ladder.sass
@@ -70,3 +70,8 @@
#must-log-in button
margin-right: 10px
+
+@media only screen and (max-width: 800px)
+ #ladder-view
+ #level-column img
+ width: 100%
\ No newline at end of file
diff --git a/app/styles/play/ladder/ladder_tab.sass b/app/styles/play/ladder/ladder_tab.sass
new file mode 100644
index 000000000..6d65cc5a6
--- /dev/null
+++ b/app/styles/play/ladder/ladder_tab.sass
@@ -0,0 +1,42 @@
+#ladder-tab-view
+ .name-col-cell
+ max-width: 150px
+ white-space: nowrap
+ overflow: hidden
+ text-overflow: ellipsis
+
+ .bar rect
+ fill: steelblue
+ shape-rendering: crispEdges
+
+ .bar text
+ fill: #fff
+
+ .specialbar rect
+ fill: #555555
+
+
+ .axis path, .axis line
+ fill: none
+ stroke: #555555
+ shape-rendering: crispEdges
+
+ .humans-bar
+ fill: #bf3f3f
+ shape-rendering: crispEdges
+ .ogres-bar
+ fill: #3f44bf
+ shape-rendering: crispEdges
+ text
+ fill: #555555
+
+ .rank-text
+ font-size: 15px
+ fill: #555555
+
+ .humans-rank-text
+ fill: #bf3f3f
+
+ .ogres-rank-text
+ fill: #3f44bf
+
\ No newline at end of file
diff --git a/app/styles/play/ladder/my_matches_tab.sass b/app/styles/play/ladder/my_matches_tab.sass
new file mode 100644
index 000000000..a68f12225
--- /dev/null
+++ b/app/styles/play/ladder/my_matches_tab.sass
@@ -0,0 +1,29 @@
+#my-matches-tab-view
+ .axis path, .axis line
+ fill: none
+ stroke: #555
+ shape-rendering: crispEdges
+ .x.axis.path
+ display: none
+
+ .line
+ fill: none
+ stroke: steelblue
+ stroke-width: 1.5px
+
+ .humans-line
+ fill: none
+ stroke: #bf3f3f
+ stroke-width: 1.5px
+
+ .ogres-line
+ fill: none
+ stroke: #3f44bf
+ stroke-width: 1.5px
+
+ .axis text
+ stroke: none
+ fill: #555555
+ shape-rendering: crispEdges
+
+
\ No newline at end of file
diff --git a/app/templates/account/profile.jade b/app/templates/account/profile.jade
index 7cd6d0750..65dc9786b 100644
--- a/app/templates/account/profile.jade
+++ b/app/templates/account/profile.jade
@@ -16,7 +16,7 @@ block content
else
span(data-i18n="account_profile.profile") Profile
- if loading
+ if loadingProfile
p(data-i18n="common.loading") Loading...
else if !user.get('emailHash')
diff --git a/app/templates/base.jade b/app/templates/base.jade
index 7bc9817f2..3aec9624e 100644
--- a/app/templates/base.jade
+++ b/app/templates/base.jade
@@ -1,6 +1,28 @@
body
#fb-root
block header
+ .nav.navbar.navbar-fixed-top#mobile-nav
+ .content.clearfix
+ .navbar-header
+ button.navbar-toggle(type="button" data-toggle="collapse" data-target="#collapsible-navbar")
+ span.sr-only Toggle navigation
+ span.icon-bar
+ span.icon-bar
+ span.icon-bar
+
+ a.navbar-brand(href='/')
+ img(src="/images/pages/base/logo.png", title="CodeCombat - Learn how to code by playing a game", alt="CodeCombat")
+ .collapse.navbar-collapse#collapsible-navbar
+ ul.nav.navbar-nav
+ li.play
+ a.header-font(href='/play', data-i18n="nav.play") Levels
+ li.editor
+ a.header-font(href='/editor', data-i18n="nav.editor") Editor
+ li.blog
+ a.header-font(href='http://blog.codecombat.com/', data-i18n="nav.blog") Blog
+ li.forum
+ a.header-font(href='http://discourse.codecombat.com/', data-i18n="nav.forum") Forum
+
.nav.navbar.navbar-fixed-top#top-nav
.content.clearfix
.navbar-header
@@ -32,6 +54,10 @@ body
if me.isAdmin()
li.admin
a.header-font(href='/admin', data-i18n="nav.admin") Admin
+
+
+
+
block outer_content
#outer-content-wrapper
diff --git a/app/templates/home.jade b/app/templates/home.jade
index 9e5d3be94..376ea27fb 100644
--- a/app/templates/home.jade
+++ b/app/templates/home.jade
@@ -7,7 +7,8 @@ block content
#trailer-wrapper
img(src="/images/pages/home/video_border.png")
-
+ #mobile-trailer-wrapper
+
hr
.alert.alert-danger.lt-ie10
@@ -21,7 +22,7 @@ block content
strong(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry!
br
span(data-i18n="home.old_browser_suffix") You can try anyway, but it probably won't work.
-
+
a#beginner-campaign(href="/play/level/rescue-mission")
div.game-mode-wrapper
if isEnglish
diff --git a/app/templates/loading.jade b/app/templates/loading.jade
index 519808a00..df2fc0eb5 100644
--- a/app/templates/loading.jade
+++ b/app/templates/loading.jade
@@ -1,4 +1,6 @@
.loading-screen
h1(data-i18n="common.loading") Loading...
- .progress.progress-striped.active
- .progress-bar
\ No newline at end of file
+ .progress
+ .progress-bar
+
+ .errors
\ No newline at end of file
diff --git a/app/templates/loading_error.jade b/app/templates/loading_error.jade
new file mode 100644
index 000000000..b56ede4ac
--- /dev/null
+++ b/app/templates/loading_error.jade
@@ -0,0 +1,31 @@
+.alert.alert-danger.loading-error-alert
+ span(data-i18n="loading_error.could_not_load") Error loading from server
+ span (
+ span(data-i18n="resources.#{name}")
+ span )
+ if !responseText
+ strong(data-i18n="loading_error.connection_failure") Connection failed.
+ else if status === 401
+ strong(data-i18n="loading_error.unauthorized") You need to be signed in. Do you have cookies disabled?
+ else if status === 403
+ strong(data-i18n="loading_error.forbidden") You do not have the permissions.
+ else if status === 404
+ strong(data-i18n="loading_error.not_found") Not found.
+ else if status === 405
+ strong(data-i18n="loading_error.not_allowed") Method not allowed.
+ else if status === 408
+ strong(data-i18n="loading_error.timeout") Server timeout.
+ else if status === 409
+ strong(data-i18n="loading_error.conflict") Resource conflict.
+ else if status === 422
+ strong(data-i18n="loading_error.bad_input") Bad input.
+ else if status >= 500
+ strong(data-i18n="loading_error.server_error") Server error.
+ else
+ strong(data-i18n="loading_error.unknown") Unknown error.
+
+ if resourceIndex !== undefined
+ button.btn.btn-sm.retry-loading-resource(data-i18n="common.retry", data-resource-index=resourceIndex) Retry
+ if requestIndex !== undefined
+ button.btn.btn-sm.retry-loading-request(data-i18n="common.retry", data-request-index=requestIndex) Retry
+
\ No newline at end of file
diff --git a/app/templates/play/ladder/ladder_tab.jade b/app/templates/play/ladder/ladder_tab.jade
index 16ab8e17e..1b7d7351e 100644
--- a/app/templates/play/ladder/ladder_tab.jade
+++ b/app/templates/play/ladder/ladder_tab.jade
@@ -1,6 +1,7 @@
div#columns.row
for team in teams
div.column.col-md-4
+ div(id="histogram-display-#{team.name}", class="histogram-display",data-team-name=team.name)
table.table.table-bordered.table-condensed.table-hover
tr
th
diff --git a/app/templates/play/ladder/my_matches_tab.jade b/app/templates/play/ladder/my_matches_tab.jade
index 6b235148a..4975fa963 100644
--- a/app/templates/play/ladder/my_matches_tab.jade
+++ b/app/templates/play/ladder/my_matches_tab.jade
@@ -11,14 +11,14 @@ div#columns.row
tr
th(colspan=4, style="color: #{team.primaryColor}")
- span(data-i18n="ladder.summary_your") Your
+ span(data-i18n="ladder.summary_your") Your
|#{team.name}
|
- span(data-i18n="ladder.summary_matches") Matches -
+ span(data-i18n="ladder.summary_matches") Matches -
|#{team.wins}
- span(data-i18n="ladder.summary_wins") Wins,
+ span(data-i18n="ladder.summary_wins") Wins,
|#{team.losses}
- span(data-i18n="ladder.summary_losses") Losses
+ span(data-i18n="ladder.summary_losses") Losses
if team.session
tr
@@ -34,7 +34,9 @@ div#columns.row
if team.chartData
tr
th(colspan=4, style="color: #{team.primaryColor}")
- img(src="https://chart.googleapis.com/chart?chs=450x125&cht=lxy&chco=#{team.chartColor}&chtt=Score%3A+#{team.currentScore}&chts=#{team.chartColor},16,r&chf=a,s,000000FF&chls=2&chm=o,#{team.chartColor},0,4&chd=t:#{team.chartData}&chxt=y&chxr=0,#{team.minScore},#{team.maxScore}")
+ div(class="score-chart-wrapper", data-team-name=team.name, id="score-chart-#{team.name}")
+
+
tr
th(data-i18n="general.result") Result
diff --git a/app/templates/play/level/level_loading.jade b/app/templates/play/level/level_loading.jade
index 66e42995b..cfd949909 100644
--- a/app/templates/play/level/level_loading.jade
+++ b/app/templates/play/level/level_loading.jade
@@ -35,6 +35,8 @@
strong.tip.rare(data-i18n='play_level.tip_no_try') Do. Or do not. There is no try. - Yoda
strong.tip.rare(data-i18n='play_level.tip_patience') Patience you must have, young Padawan. - Yoda
strong.tip.rare(data-i18n='play_level.tip_documented_bug') A documented bug is not a bug; it is a feature.
+ strong.tip.rare(data-i18n='play_level.tip_talk_is_cheap') Talk is cheap. Show me the code. - Linus Torvalds
+ strong.tip.rare(data-i18n='play_level.tip_first_language') The most disastrous thing that you can ever learn is your first programming language. - Alan Kay
strong.tip.rare
span(data-i18n='play_level.tip_harry') Yer a Wizard,
span= me.get('name') || 'Anoner'
diff --git a/app/views/account/profile_view.coffee b/app/views/account/profile_view.coffee
index 32faec138..f61f7f1e2 100644
--- a/app/views/account/profile_view.coffee
+++ b/app/views/account/profile_view.coffee
@@ -5,21 +5,21 @@ User = require 'models/User'
module.exports = class ProfileView extends View
id: "profile-view"
template: template
- loading: true
+ loadingProfile: true
constructor: (options, @userID) ->
super options
@user = User.getByID(@userID)
- @loading = false if 'gravatarProfile' of @user
+ @loadingProfile = false if 'gravatarProfile' of @user
@listenTo(@user, 'change', @userChanged)
@listenTo(@user, 'error', @userError)
userChanged: (user) ->
- @loading = false if 'gravatarProfile' of user
+ @loadingProfile = false if 'gravatarProfile' of user
@render()
userError: (user) ->
- @loading = false
+ @loadingProfile = false
@render()
getRenderData: ->
@@ -28,7 +28,7 @@ module.exports = class ProfileView extends View
grav = grav.entry[0] if grav
addedContext =
user: @user
- loading: @loading
+ loadingProfile: @loadingProfile
myProfile: @user.id is context.me.id
grav: grav
photoURL: @user.getPhotoURL()
diff --git a/app/views/editor/thang/colors_tab_view.coffee b/app/views/editor/thang/colors_tab_view.coffee
index ed438fb46..a858f4385 100644
--- a/app/views/editor/thang/colors_tab_view.coffee
+++ b/app/views/editor/thang/colors_tab_view.coffee
@@ -21,6 +21,10 @@ module.exports = class ColorsTabView extends CocoView
@interval = setInterval f, 1000
super options
+ destroy: ->
+ clearInterval @interval
+ super()
+
afterRender: ->
super()
@createShapeButtons()
diff --git a/app/views/kinds/CocoView.coffee b/app/views/kinds/CocoView.coffee
index ed81e4a20..768072a26 100644
--- a/app/views/kinds/CocoView.coffee
+++ b/app/views/kinds/CocoView.coffee
@@ -2,6 +2,7 @@ SuperModel = require 'models/SuperModel'
utils = require 'lib/utils'
CocoClass = require 'lib/CocoClass'
loadingScreenTemplate = require 'templates/loading'
+loadingErrorTemplate = require 'templates/loading_error'
visibleModal = null
waitingModal = null
@@ -18,13 +19,26 @@ module.exports = class CocoView extends Backbone.View
'click a': 'toggleModal'
'click button': 'toggleModal'
'click li': 'toggleModal'
+ 'click .retry-loading-resource': 'onRetryResource'
+ 'click .retry-loading-request': 'onRetryRequest'
subscriptions: {}
shortcuts: {}
+ # load progress properties
+ loadProgress:
+ num: 0
+ denom: 0
+ showing: false
+ resources: [] # models and collections
+ requests: [] # jqxhr's
+ somethings: [] # everything else
+ progress: 0
+
# Setup, Teardown
constructor: (options) ->
+ @loadProgress = _.cloneDeep @loadProgress
@supermodel ?= options?.supermodel or new SuperModel()
@options = options
@subscriptions = utils.combineAncestralObject(@, 'subscriptions')
@@ -33,6 +47,7 @@ module.exports = class CocoView extends Backbone.View
@shortcuts = utils.combineAncestralObject(@, 'shortcuts')
@subviews = {}
@listenToShortcuts()
+ @updateProgressBar = _.debounce @updateProgressBar, 100
# Backbone.Mediator handles subscription setup/teardown automatically
super options
@@ -74,7 +89,7 @@ module.exports = class CocoView extends Backbone.View
return @template if _.isString(@template)
@$el.html @template(@getRenderData())
@afterRender()
- @showLoading() if @startsLoading
+ @showLoading() if @startsLoading or @loading() # TODO: Remove startsLoading entirely
@$el.i18n()
@
@@ -89,6 +104,101 @@ module.exports = class CocoView extends Backbone.View
context
afterRender: ->
+
+ # Resource and request loading management for any given view
+
+ addResourceToLoad: (modelOrCollection, name, value=1) ->
+ @loadProgress.resources.push {resource:modelOrCollection, value:value, name:name}
+ @listenToOnce modelOrCollection, 'sync', @updateProgress
+ @listenTo modelOrCollection, 'error', @onResourceLoadFailed
+ @updateProgress()
+
+ addRequestToLoad: (jqxhr, name, retryFunc, value=1) ->
+ @loadProgress.requests.push {request:jqxhr, value:value, name: name, retryFunc: retryFunc}
+ jqxhr.done @updateProgress
+ jqxhr.fail @onRequestLoadFailed
+
+ addSomethingToLoad: (name, value=1) ->
+ @loadProgress.somethings.push {loaded: false, name: name, value: value}
+ @updateProgress()
+
+ somethingLoaded: (name) ->
+ r = _.find @loadProgress.somethings, {name: name}
+ return console.error 'Could not find something called', name if not r
+ r.loaded = true
+ @updateProgress(name)
+
+ loading: ->
+ return false if @loaded
+ for r in @loadProgress.resources
+ return true if not r.resource.loaded
+ for r in @loadProgress.requests
+ return true if not r.request.status
+ for r in @loadProgress.somethings
+ return true if not r.loaded
+ return false
+
+ updateProgress: =>
+ console.debug 'Loaded', r.name if arguments[0] and r = _.find @loadProgress.resources, {resource:arguments[0]}
+ console.debug 'Loaded', r.name if arguments[2] and r = _.find @loadProgress.requests, {request:arguments[2]}
+ console.debug 'Loaded', r.name if arguments[0] and r = _.find @loadProgress.somethings, {name:arguments[0]}
+
+ denom = 0
+ denom += r.value for r in @loadProgress.resources
+ denom += r.value for r in @loadProgress.requests
+ denom += r.value for r in @loadProgress.somethings
+ num = @loadProgress.num
+ num += r.value for r in @loadProgress.resources when r.resource.loaded
+ num += r.value for r in @loadProgress.requests when r.request.status
+ num += r.value for r in @loadProgress.somethings when r.loaded
+ #console.log 'update progress', @, num, denom, arguments
+
+ progress = if denom then num / denom else 0
+ # sometimes the denominator isn't known from the outset, so make sure the overall progress only goes up
+ @loadProgress.progress = progress if progress > @loadProgress.progress
+ @updateProgressBar()
+ if num is denom and not @loaded
+ @loaded = true
+ @onLoaded()
+
+ updateProgressBar: =>
+ prog = "#{parseInt(@loadProgress.progress*100)}%"
+ @$el.find('.loading-screen .progress-bar').css('width', prog)
+
+ onLoaded: ->
+ @render()
+
+ # Error handling for loading
+
+ onResourceLoadFailed: (resource, jqxhr) ->
+ for r, index in @loadProgress.resources
+ break if r.resource is resource
+ @$el.find('.loading-screen .errors').append(loadingErrorTemplate({
+ status:jqxhr.status,
+ name: r.name
+ resourceIndex: index,
+ responseText: jqxhr.responseText
+ })).i18n()
+
+ onRetryResource: (e) ->
+ r = @loadProgress.resources[$(e.target).data('resource-index')]
+ r.resource.fetch()
+ $(e.target).closest('.loading-error-alert').remove()
+
+ onRequestLoadFailed: (jqxhr) =>
+ for r, index in @loadProgress.requests
+ break if r.request is jqxhr
+ @$el.find('.loading-screen .errors').append(loadingErrorTemplate({
+ status:jqxhr.status,
+ name: r.name
+ requestIndex: index,
+ responseText: jqxhr.responseText
+ }))
+
+ onRetryRequest: (e) ->
+ r = @loadProgress.requests[$(e.target).data('request-index')]
+ @[r.retryFunc]?()
+ $(e.target).closest('.loading-error-alert').remove()
# Modals
diff --git a/app/views/play/ladder/ladder_tab.coffee b/app/views/play/ladder/ladder_tab.coffee
index db4eff8ad..b9fddcf38 100644
--- a/app/views/play/ladder/ladder_tab.coffee
+++ b/app/views/play/ladder/ladder_tab.coffee
@@ -1,4 +1,5 @@
CocoView = require 'views/kinds/CocoView'
+CocoClass = require 'lib/CocoClass'
Level = require 'models/Level'
LevelSession = require 'models/LevelSession'
CocoCollection = require 'models/CocoCollection'
@@ -18,7 +19,6 @@ class LevelSessionsCollection extends CocoCollection
module.exports = class LadderTabView extends CocoView
id: 'ladder-tab-view'
template: require 'templates/play/ladder/ladder_tab'
- startsLoading: true
events:
'click .connect-facebook': 'onConnectFacebook'
@@ -32,6 +32,7 @@ module.exports = class LadderTabView extends CocoView
constructor: (options, @level, @sessions) ->
super(options)
+ @addSomethingToLoad("social_network_apis")
@teams = teamDataFromLevel @level
@leaderboards = {}
@refreshLadder()
@@ -40,17 +41,18 @@ module.exports = class LadderTabView extends CocoView
checkFriends: ->
return if @checked or (not window.FB) or (not window.gapi)
@checked = true
-
- @loadingFacebookFriends = true
+
+ @addSomethingToLoad("facebook_status")
FB.getLoginStatus (response) =>
@facebookStatus = response.status
- if @facebookStatus is 'connected' then @loadFacebookFriendSessions() else @loadingFacebookFriends = false
+ @loadFacebookFriends() if @facebookStatus is 'connected'
+ @somethingLoaded("facebook_status")
if application.gplusHandler.loggedIn is undefined
- @loadingGPlusFriends = true
@listenToOnce(application.gplusHandler, 'checked-state', @gplusSessionStateLoaded)
else
@gplusSessionStateLoaded()
+ @somethingLoaded("social_network_apis")
# FACEBOOK
@@ -60,16 +62,24 @@ module.exports = class LadderTabView extends CocoView
onConnectedWithFacebook: -> location.reload() if @connecting
+ loadFacebookFriends: ->
+ @addSomethingToLoad("facebook_friends")
+ FB.api '/me/friends', @onFacebookFriendsLoaded
+
+ onFacebookFriendsLoaded: (response) =>
+ @facebookData = response.data
+ @loadFacebookFriendSessions()
+ @somethingLoaded("facebook_friends")
+
loadFacebookFriendSessions: ->
- FB.api '/me/friends', (response) =>
- @facebookData = response.data
- levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
- url = "/db/level/#{levelFrag}/leaderboard_facebook_friends"
- $.ajax url, {
- data: { friendIDs: (f.id for f in @facebookData) }
- method: 'POST'
- success: @onFacebookFriendSessionsLoaded
- }
+ levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
+ url = "/db/level/#{levelFrag}/leaderboard_facebook_friends"
+ jqxhr = $.ajax url, {
+ data: { friendIDs: (f.id for f in @facebookData) }
+ method: 'POST'
+ success: @onFacebookFriendSessionsLoaded
+ }
+ @addRequestToLoad(jqxhr, 'facebook_friend_sessions', 'loadFacebookFriendSessions')
onFacebookFriendSessionsLoaded: (result) =>
friendsMap = {}
@@ -79,9 +89,7 @@ module.exports = class LadderTabView extends CocoView
friend.otherTeam = if friend.team is 'humans' then 'ogres' else 'humans'
friend.imageSource = "http://graph.facebook.com/#{friend.facebookID}/picture"
@facebookFriendSessions = result
- @loadingFacebookFriends = false
- @renderMaybe()
-
+
# GOOGLE PLUS
onConnectGPlus: ->
@@ -93,21 +101,23 @@ module.exports = class LadderTabView extends CocoView
gplusSessionStateLoaded: ->
if application.gplusHandler.loggedIn
- @loadingGPlusFriends = true
+ @addSomethingToLoad("gplus_friends")
application.gplusHandler.loadFriends @gplusFriendsLoaded
- else
- @loadingGPlusFriends = false
- @renderMaybe()
gplusFriendsLoaded: (friends) =>
@gplusData = friends.items
+ @loadGPlusFriendSessions()
+ @somethingLoaded("gplus_friends")
+
+ loadGPlusFriendSessions: ->
levelFrag = "#{@level.get('original')}.#{@level.get('version').major}"
url = "/db/level/#{levelFrag}/leaderboard_gplus_friends"
- $.ajax url, {
+ jqxhr = $.ajax url, {
data: { friendIDs: (f.id for f in @gplusData) }
method: 'POST'
success: @onGPlusFriendSessionsLoaded
}
+ @addRequestToLoad(jqxhr, 'gplus_friend_sessions', 'loadGPlusFriendSessions')
onGPlusFriendSessionsLoaded: (result) =>
friendsMap = {}
@@ -117,30 +127,29 @@ module.exports = class LadderTabView extends CocoView
friend.otherTeam = if friend.team is 'humans' then 'ogres' else 'humans'
friend.imageSource = friendsMap[friend.gplusID].image.url
@gplusFriendSessions = result
- @loadingGPlusFriends = false
- @renderMaybe()
# LADDER LOADING
refreshLadder: ->
- promises = []
for team in @teams
- @leaderboards[team.id]?.off 'sync'
+ @leaderboards[team.id]?.destroy()
teamSession = _.find @sessions.models, (session) -> session.get('team') is team.id
@leaderboards[team.id] = new LeaderboardData(@level, team.id, teamSession)
- promises.push @leaderboards[team.id].promise
- @loadingLeaderboards = true
- $.when(promises...).then(@leaderboardsLoaded)
- leaderboardsLoaded: =>
- @loadingLeaderboards = false
- @renderMaybe()
-
- renderMaybe: ->
- return if @loadingFacebookFriends or @loadingLeaderboards or @loadingGPlusFriends
- @startsLoading = false
- @render()
+ @addResourceToLoad @leaderboards[team.id], 'leaderboard', 3
+ render: ->
+ super()
+
+ @$el.find('.histogram-display').each (i, el) =>
+ histogramWrapper = $(el)
+ team = _.find @teams, name: histogramWrapper.data('team-name')
+ histogramData = null
+ $.when(
+ $.get("/db/level/#{@level.get('slug')}/histogram_data?team=#{team.name.toLowerCase()}", (data) -> histogramData = data)
+ ).then =>
+ @generateHistogram(histogramWrapper, histogramData, team.name.toLowerCase())
+
getRenderData: ->
ctx = super()
ctx.level = @level
@@ -153,6 +162,82 @@ module.exports = class LadderTabView extends CocoView
ctx.onGPlus = application.gplusHandler.loggedIn
ctx
+ generateHistogram: (histogramElement, histogramData, teamName) ->
+ #renders twice, hack fix
+ if $("#"+histogramElement.attr("id")).has("svg").length then return
+ histogramData = histogramData.map (d) -> d*100
+
+ margin =
+ top: 20
+ right: 20
+ bottom: 30
+ left: 0
+
+ width = 300 - margin.left - margin.right
+ height = 125 - margin.top - margin.bottom
+
+ formatCount = d3.format(",.0")
+
+ x = d3.scale.linear().domain([-3000,6000]).range([0,width])
+
+ data = d3.layout.histogram().bins(x.ticks(20))(histogramData)
+ y = d3.scale.linear().domain([0,d3.max(data, (d) -> d.y)]).range([height,0])
+
+ #create the x axis
+ xAxis = d3.svg.axis().scale(x).orient("bottom").ticks(5).outerTickSize(0)
+
+ svg = d3.select("#"+histogramElement.attr("id")).append("svg")
+ .attr("width", width + margin.left + margin.right)
+ .attr("height", height + margin.top + margin.bottom)
+ .append("g")
+ .attr("transform","translate(#{margin.left},#{margin.top})")
+ barClass = "bar"
+ if teamName.toLowerCase() is "ogres" then barClass = "ogres-bar"
+ if teamName.toLowerCase() is "humans" then barClass = "humans-bar"
+
+ bar = svg.selectAll(".bar")
+ .data(data)
+ .enter().append("g")
+ .attr("class",barClass)
+ .attr("transform", (d) -> "translate(#{x(d.x)},#{y(d.y)})")
+
+ bar.append("rect")
+ .attr("x",1)
+ .attr("width",width/20)
+ .attr("height", (d) -> height - y(d.y))
+ if @leaderboards[teamName].session?
+ playerScore = @leaderboards[teamName].session.get('totalScore') * 100
+ scorebar = svg.selectAll(".specialbar")
+ .data([playerScore])
+ .enter().append("g")
+ .attr("class","specialbar")
+ .attr("transform", "translate(#{x(playerScore)},#{y(9001)})")
+
+ scorebar.append("rect")
+ .attr("x",1)
+ .attr("width",3)
+ .attr("height",height - y(9001))
+ rankClass = "rank-text"
+ if teamName.toLowerCase() is "ogres" then rankClass = "rank-text ogres-rank-text"
+ if teamName.toLowerCase() is "humans" then rankClass = "rank-text humans-rank-text"
+
+ message = "#{histogramData.length} players"
+ if @leaderboards[teamName].session? then message="#{@leaderboards[teamName].myRank}/#{histogramData.length}"
+ svg.append("g")
+ .append("text")
+ .attr("class",rankClass)
+ .attr("y",0)
+ .attr("text-anchor","end")
+ .attr("x",width)
+ .text(message)
+
+ #Translate the x-axis up
+ svg.append("g")
+ .attr("class", "x axis")
+ .attr("transform","translate(0," + height + ")")
+ .call(xAxis)
+
+
consolidateFriends: ->
allFriendSessions = (@facebookFriendSessions or []).concat(@gplusFriendSessions or [])
sessions = _.uniq allFriendSessions, false, (session) -> session._id
@@ -160,9 +245,16 @@ module.exports = class LadderTabView extends CocoView
sessions.reverse()
sessions
-class LeaderboardData
+class LeaderboardData extends CocoClass
+ ###
+ Consolidates what you need to load for a leaderboard into a single Backbone Model-like object.
+ ###
+
constructor: (@level, @team, @session) ->
- _.extend @, Backbone.Events
+ super()
+ @fetch()
+
+ fetch: ->
@topPlayers = new LeaderboardCollection(@level, {order:-1, scoreOffset: HIGHEST_SCORE, team: @team, limit: 20})
promises = []
promises.push @topPlayers.fetch()
@@ -173,18 +265,24 @@ class LeaderboardData
promises.push @playersAbove.fetch()
@playersBelow = new LeaderboardCollection(@level, {order:-1, scoreOffset: score, limit: 4, team: @team})
promises.push @playersBelow.fetch()
- level = "#{level.get('original')}.#{level.get('version').major}"
+ level = "#{@level.get('original')}.#{@level.get('version').major}"
success = (@myRank) =>
promises.push $.ajax "/db/level/#{level}/leaderboard_rank?scoreOffset=#{@session.get('totalScore')}&team=#{@team}", {success}
@promise = $.when(promises...)
@promise.then @onLoad
+ @promise.fail @onFail
@promise
onLoad: =>
+ return if @destroyed
@loaded = true
- @trigger 'sync'
+ @trigger 'sync', @
# TODO: cache user ids -> names mapping, and load them here as needed,
# and apply them to sessions. Fetching each and every time is too costly.
+
+ onFail: (resource, jqxhr) =>
+ return if @destroyed
+ @trigger 'error', @, jqxhr
inTopSessions: ->
return me.id in (session.attributes.creator for session in @topPlayers.models)
@@ -201,3 +299,7 @@ class LeaderboardData
startRank = @myRank - 4
session.rank = startRank + i for session, i in l
l
+
+ allResources: ->
+ resources = [@topPlayers, @playersAbove, @playersBelow]
+ return (r for r in resources when r)
diff --git a/app/views/play/ladder/my_matches_tab.coffee b/app/views/play/ladder/my_matches_tab.coffee
index ac8223442..e3f0fc62a 100644
--- a/app/views/play/ladder/my_matches_tab.coffee
+++ b/app/views/play/ladder/my_matches_tab.coffee
@@ -48,6 +48,8 @@ module.exports = class MyMatchesTabView extends CocoView
@startsLoading = false
@render()
+
+
getRenderData: ->
ctx = super()
ctx.level = @level
@@ -80,7 +82,9 @@ module.exports = class MyMatchesTabView extends CocoView
team.losses = _.filter(team.matches, {state: 'loss'}).length
scoreHistory = team.session?.get('scoreHistory')
if scoreHistory?.length > 1
+ team.scoreHistory = scoreHistory
scoreHistory = _.last scoreHistory, 100 # Chart URL needs to be under 2048 characters for GET
+
team.currentScore = Math.round scoreHistory[scoreHistory.length - 1][1] * 100
team.chartColor = team.primaryColor.replace '#', ''
#times = (s[0] for s in scoreHistory)
@@ -109,7 +113,69 @@ module.exports = class MyMatchesTabView extends CocoView
else if session.get 'isRanking'
rankingState = 'ranking'
@setRankingButtonText button, rankingState
+
+ @$el.find('.score-chart-wrapper').each (i, el) =>
+ scoreWrapper = $(el)
+ team = _.find @teams, name: scoreWrapper.data('team-name')
+ @generateScoreLineChart(scoreWrapper.attr('id'), team.scoreHistory, team.name)
+
+ generateScoreLineChart: (wrapperID, scoreHistory,teamName) =>
+ margin =
+ top: 20
+ right: 20
+ bottom: 30
+ left: 50
+
+ width = 450 - margin.left - margin.right
+ height = 125
+ x = d3.time.scale().range([0,width])
+ y = d3.scale.linear().range([height,0])
+
+ xAxis = d3.svg.axis().scale(x).orient("bottom").ticks(4).outerTickSize(0)
+ yAxis = d3.svg.axis().scale(y).orient("left").ticks(4).outerTickSize(0)
+
+ line = d3.svg.line().x(((d) -> x(d.date))).y((d) -> y(d.close))
+ selector = "#" + wrapperID
+
+ svg = d3.select(selector).append("svg")
+ .attr("width", width + margin.left + margin.right)
+ .attr("height", height + margin.top + margin.bottom)
+ .append("g")
+ .attr("transform","translate(#{margin.left},#{margin.top})")
+ time = 0
+ data = scoreHistory.map (d) ->
+ time +=1
+ return {
+ date: time
+ close: d[1] * 100
+ }
+
+ x.domain(d3.extent(data, (d) -> d.date))
+ y.domain(d3.extent(data, (d) -> d.close))
+
+
+
+ svg.append("g")
+ .attr("class", "y axis")
+ .call(yAxis)
+ .append("text")
+ .attr("transform", "rotate(-90)")
+ .attr("y",4)
+ .attr("dy", ".75em")
+ .style("text-anchor","end")
+ .text("Score")
+ lineClass = "line"
+ if teamName.toLowerCase() is "ogres" then lineClass = "ogres-line"
+ if teamName.toLowerCase() is "humans" then lineClass = "humans-line"
+ svg.append("path")
+ .datum(data)
+ .attr("class",lineClass)
+ .attr("d",line)
+
+
+
+
readyToRank: (session) ->
return false unless session?.get('levelID') # If it hasn't been denormalized, then it's not ready.
return false unless c1 = session.get('code')
diff --git a/app/views/play/ladder_view.coffee b/app/views/play/ladder_view.coffee
index 6d1e90313..58366fa58 100644
--- a/app/views/play/ladder_view.coffee
+++ b/app/views/play/ladder_view.coffee
@@ -24,7 +24,6 @@ class LevelSessionsCollection extends CocoCollection
module.exports = class LadderView extends RootView
id: 'ladder-view'
template: require 'templates/play/ladder'
- startsLoading: true
subscriptions:
'application:idle-changed': 'onIdleChanged'
@@ -38,18 +37,18 @@ module.exports = class LadderView extends RootView
constructor: (options, @levelID) ->
super(options)
@level = new Level(_id:@levelID)
- p1 = @level.fetch()
+ @level.fetch()
@sessions = new LevelSessionsCollection(levelID)
- p2 = @sessions.fetch({})
+ @sessions.fetch({})
+ @addResourceToLoad(@sessions, 'your_sessions')
+ @addResourceToLoad(@level, 'level')
@simulator = new Simulator()
@listenTo(@simulator, 'statusUpdate', @updateSimulationStatus)
@teams = []
- $.when(p1, p2).then @onLoaded
- onLoaded: =>
+ onLoaded: ->
@teams = teamDataFromLevel @level
- @startsLoading = false
- @render()
+ super()
getRenderData: ->
ctx = super()
@@ -63,7 +62,7 @@ module.exports = class LadderView extends RootView
afterRender: ->
super()
- return if @startsLoading
+ return if @loading()
@insertSubView(@ladderTab = new LadderTabView({}, @level, @sessions))
@insertSubView(@myMatchesTab = new MyMatchesTabView({}, @level, @sessions))
@refreshInterval = setInterval(@fetchSessionsAndRefreshViews.bind(@), 10 * 1000)
@@ -72,7 +71,7 @@ module.exports = class LadderView extends RootView
@showPlayModal(hash) if @sessions.loaded
fetchSessionsAndRefreshViews: ->
- return if @destroyed or application.userIsIdle or @$el.find('#simulate.active').length or (new Date() - 2000 < @lastRefreshTime) or @startsLoading
+ return if @destroyed or application.userIsIdle or @$el.find('#simulate.active').length or (new Date() - 2000 < @lastRefreshTime) or @loading()
@sessions.fetch({"success": @refreshViews})
refreshViews: =>
diff --git a/app/views/play/level/modal/victory_modal.coffee b/app/views/play/level/modal/victory_modal.coffee
index 3eb7d21f5..3fe539b99 100644
--- a/app/views/play/level/modal/victory_modal.coffee
+++ b/app/views/play/level/modal/victory_modal.coffee
@@ -78,7 +78,7 @@ module.exports = class VictoryModal extends View
c = super()
c.body = @body
c.me = me
- c.hasNextLevel = _.isObject(@level.get('nextLevel')) and (@level.get('name') isnt "Mobile Artillery")
+ c.hasNextLevel = _.isObject(@level.get('nextLevel'))
c.levelName = utils.i18n @level.attributes, 'name'
c.level = @level
if c.level.get('type') is 'ladder'
diff --git a/app/views/play/level/playback_view.coffee b/app/views/play/level/playback_view.coffee
index 43b744255..4a3e4d359 100644
--- a/app/views/play/level/playback_view.coffee
+++ b/app/views/play/level/playback_view.coffee
@@ -44,7 +44,6 @@ module.exports = class PlaybackView extends View
'⌘+[, ctrl+[': 'onScrubBack'
'⌘+], ctrl+]': 'onScrubForward'
-
# popover that shows at the current mouse position on the progressbar, using the bootstrap popover.
# Could make this into a jQuery plugins itself theoretically.
class HoverPopup extends $.fn.popover.Constructor
diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee
index 17a813459..4951b6915 100644
--- a/app/views/play/level/tome/spell_view.coffee
+++ b/app/views/play/level/tome/spell_view.coffee
@@ -63,7 +63,7 @@ module.exports = class SpellView extends View
@createFirepad()
else
# needs to happen after the code generating this view is complete
- setTimeout @onLoaded, 1
+ setTimeout @onAllLoaded, 1
createACE: ->
# Test themes and settings here: http://ace.ajax.org/build/kitchen-sink.html
@@ -178,9 +178,9 @@ module.exports = class SpellView extends View
else
@ace.setValue @previousSource
@ace.clearSelection()
- @onLoaded()
+ @onAllLoaded()
- onLoaded: =>
+ onAllLoaded: =>
@spell.transpile @spell.source
@spell.loaded = true
Backbone.Mediator.publish 'tome:spell-loaded', spell: @spell
diff --git a/bower.json b/bower.json
index bd24eb94c..e73834bc5 100644
--- a/bower.json
+++ b/bower.json
@@ -35,7 +35,8 @@
"aether": "~0.1.18",
"underscore.string": "~2.3.3",
"firebase": "~1.0.2",
- "catiline": "~2.9.3"
+ "catiline": "~2.9.3",
+ "d3": "~3.4.4"
},
"overrides": {
"backbone": {
diff --git a/config.coffee b/config.coffee
index f64a3d7ac..1a860cb76 100644
--- a/config.coffee
+++ b/config.coffee
@@ -65,6 +65,7 @@ exports.config =
# Aether before box2d for some strange Object.defineProperty thing
'bower_components/aether/build/aether.js'
+ 'bower_components/d3/d3.min.js'
]
stylesheets:
defaultExtension: 'sass'
diff --git a/scripts/windows/coco-dev-setup/batch/config/config.coco b/scripts/windows/coco-dev-setup/batch/config/config.coco
index c79721d85..eba46b0f4 100755
--- a/scripts/windows/coco-dev-setup/batch/config/config.coco
+++ b/scripts/windows/coco-dev-setup/batch/config/config.coco
@@ -1,6 +1,8 @@
-version=1.0
-author=GlenDC
-copyright=CodeCombat.com 2013-2014
-github_url=https://github.com/codecombat/codecombat.git
-github_ssh=git@github.com:codecombat/codecombat.git
-database_backup=http://23.21.59.137/dump.tar.gz
\ No newline at end of file
+
+
+ 1.2
+ GlenDC
+ CodeCombat.com 2013-2014
+ https://github.com/codecombat/codecombat.git
+ git@github.com:codecombat/codecombat.git
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/config/downloads.coco b/scripts/windows/coco-dev-setup/batch/config/downloads.coco
index 6f4d23b22..771189954 100755
--- a/scripts/windows/coco-dev-setup/batch/config/downloads.coco
+++ b/scripts/windows/coco-dev-setup/batch/config/downloads.coco
@@ -1,23 +1,38 @@
-[general]
- [32]
- nodejs=http://nodejs.org/dist/v0.10.25/node-v0.10.25-x86.msi
- ruby=http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct
- python=https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi
- [64]
- nodejs=http://nodejs.org/dist/v0.10.25/x64/node-v0.10.25-x64.msi
- ruby=http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353-x64.exe?direct
- python=https://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi
- winsdk=http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe
- [general]
- gitbash=https://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe
- visualstudio2010=http://download.microsoft.com/download/1/D/9/1D9A6C0E-FC89-43EE-9658-B9F0E3A76983/vc_web.exe
-[Win7]
- [32]
- mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip
- [64]
- mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.5.4.zip
-[Vista]
- [64]
- mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2.5.4.zip
- [32]
- mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip
\ No newline at end of file
+
+
+
+
+ http://nodejs.org/dist/v0.10.25/node-v0.10.25-x86.msi
+ http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct
+ http://s3.amazonaws.com/CodeCombatLargeFiles/python-32.msi
+ http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe
+
+
+ http://nodejs.org/dist/v0.10.25/x64/node-v0.10.25-x64.msi
+ http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353-x64.exe?direct
+ http://s3.amazonaws.com/CodeCombatLargeFiles/python-64.msi
+ http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe
+ http://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe
+
+
+ https://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe
+ http://download.microsoft.com/download/C/6/D/C6D0FD4E-9E53-4897-9B91-836EBA2AACD3/vcredist_x86.exe
+
+
+
+
+ http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip
+
+
+ http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.5.4.zip
+
+
+
+
+ http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip
+
+
+ http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2.5.4.zip
+
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/config/tips.coco b/scripts/windows/coco-dev-setup/batch/config/tips.coco
index 0a4bb84c4..896086692 100755
--- a/scripts/windows/coco-dev-setup/batch/config/tips.coco
+++ b/scripts/windows/coco-dev-setup/batch/config/tips.coco
@@ -4,4 +4,4 @@
4) Having questions/suggestions? Talk with us on HipChat via CodeCombat.com
You can find a step-by-step guide for this installation on our wiki.
- https://github.com/codecombat/codecombat/wiki/
\ No newline at end of file
+ github.com/codecombat/codecombat/wiki/Setup-on-Windows:-a-step-by-step-guide
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/de.coco b/scripts/windows/coco-dev-setup/batch/localisation/de.coco
index 01c77c7ea..fc257a64d 100755
--- a/scripts/windows/coco-dev-setup/batch/localisation/de.coco
+++ b/scripts/windows/coco-dev-setup/batch/localisation/de.coco
@@ -1,66 +1,82 @@
-[global]
- native=Deutsch
- intro=Ab jetzt senden wir unser Feedback in Englisch!
-[install]
- [system]
- bit=-Bit System erkannt.
- prefix=Es wurde das Betriebssystem
- sufix=erkannt.
- xp=Windows XP wird nicht unterstützt. Installation abgebrochen.
- [process]
- sks=Sind die für CodeCombat benötigten Programme bereits installiert?
- skq=Wir empfehlen Ihnen, mit „Nein“ zu antorten, falls Sie unsicher sind.
- skc=Überspringe Installation der Programme...
- 1=Ohne Software von Drittanbietern könnte CodeCombat nicht entwickelt werden.
- 2=Aus diesem Grund müssen Sie diese Software installieren,
- 3=um sich in der Community zu engagieren.
- 4=Wenn Sie ein Programm bereits installiert haben, brechen Sie die Installation bitte ab.
- prefix=Haben Sie bereits die aktuellste Version von
- sufix=installiert?
- downloading=wird heruntergeladen...
- installing=wird installiert...
- unzipping=wird entpackt...
- cleaning=wird aufgeräumt...
- mongodbpath=Bitte geben Sie den kompletten Pfad an, an dem MongoDB installiert werden soll
-[github]
- [intro]
- opensource=Wie Du bereits weißt, ist CodeCombat Open Source.
- online=Unser Quellcode ist komplett auf Github.
- manual=Wenn Du möchtest, kannst du das komplette Git Repository selbst herunterladen und nach deinen wünschen einrichten.
- norec=Allerdings empfehlen wir, dass du den Prozess statt dessen uns überlässt.
- [skip]
- question=Willst du das lokale Git Setup selbst vornehmen?
- consequence=Bit vergewissere dich, dass das Repository korrekt heruntergeladen wurde, bevor du fortfährst.
- donotclose=Bitte schließe dieses Fenster nicht.
- wait=Wenn du fertig bist, drücke eine beliebige Taste zum Fortfahren...
- [process]
- path=Gebe bitte den kompletten Pfad zu deinem CodeCombat Git Repository ein:
- checkout=Bitte gib den kompletten Pfad ein, an dem du die CodeCombat Umgebung einrichten willst
- bashi=Diese Installation benötigt die Git Bash.
- bashp64=Die Git Bash ist standardmäßig in 'C:\Program Files (x86)\Git' installiert.
- bashp32=Die Git Bash ist standardmäßig in 'C:\Program Files\Git' installiert.
- bashq=Bitte gebe den kompletten Pfad zur Git Bash ein, oder drücke Enter, um den Standardpfad zu verwenden
- ssh=Willst du das Repository via SSH auschecken?
-[npm]
- install=Installing bower, brunch, nodemon and sendwithus...
- binstall=Installing bower packages...
- sass=Installing sass...
- npm=Installing npm...
- brnch=Starting brunch....
- mongodb=Setting up a MongoDB database for you...
- database=Downloading the last version of the CodeCombat database...
- script=Preparing the automatic startup script for you...
-[error]
- path=Dieser Pfad existiert bereits. Willst du ihn wirklich überschreiben?
- exist=Dieser Pfad exisitert nicht. Bitte versuche es erneut...
-[end]
- succesfull=Die CodeCombat Entwicklungsumgebung wurde erfoglreich installiert.
- thankyou=Vielen Dank für die Unterstützung und bis bald.
- readme=Willst du das README lesen, um weitere Informationen zu erhalten?
-[start]
- 1=Von nun an kannst du die Entwicklungsumgebung starten unter
- 2=einmal mit der Maus klicken.
- 3= 1) Einfach Doppelklicken
- 4=und warten bis die Entwicklungsumgebung fertig geladen hat.
- 5= 2) Jetzt 'localhost:3000' in deinem bevorzugten Browser aufrufen.
- 6=Fertig. Du bist nun bereit, bei CodeCombat mitzuarbeiten!
\ No newline at end of file
+
+
+
+ Deutsch
+ Ab jetzt senden wir unser Feedback in Englisch!
+
+
+
+ -Bit System erkannt.
+ Es wurde das Betriebssystem
+ erkannt.
+ Windows XP wird nicht unterstützt. Installation abgebrochen.
+
+
+ Sind die für CodeCombat benötigten Programme bereits installiert?
+ Wir empfehlen Ihnen, mit „Nein“ zu antorten, falls Sie unsicher sind.
+ Überspringe Installation der Programme...
+ Ohne Software von Drittanbietern könnte CodeCombat nicht entwickelt werden.
+ Aus diesem Grund müssen Sie diese Software installieren,
+ um sich in der Community zu engagieren.
+ Wenn Sie ein Programm bereits installiert haben, brechen Sie die Installation bitte ab.
+ Make sure to select the option that adds the application to your Windows Path, if the option is available.
+ Haben Sie bereits die aktuellste Version von
+ installiert?
+ wird heruntergeladen...
+ wird installiert...
+ wird entpackt...
+ wird aufgeräumt...
+ Bitte geben Sie den kompletten Pfad an, an dem MongoDB installiert werden soll
+
+
+
+
+ Wie Du bereits weißt, ist CodeCombat Open Source.
+ Unser Quellcode ist komplett auf Github.
+ Wenn Du möchtest, kannst du das komplette Git Repository selbst herunterladen und nach deinen wünschen einrichten.
+ Allerdings empfehlen wir, dass du den Prozess statt dessen uns überlässt.
+
+
+ Willst du das lokale Git Setup selbst vornehmen?
+ Bit vergewissere dich, dass das Repository korrekt heruntergeladen wurde, bevor du fortfährst.
+ Bitte schließe dieses Fenster nicht.
+ Wenn du fertig bist, drücke eine beliebige Taste zum Fortfahren...
+
+
+ Gebe bitte den kompletten Pfad zu deinem CodeCombat Git Repository ein:
+ Bitte gib den kompletten Pfad ein, an dem du die CodeCombat Umgebung einrichten willst
+ Diese Installation benötigt die Git Bash.
+ Die Git Bash ist standardmäßig in 'C:\Program Files (x86)\Git' installiert.
+ Die Git Bash ist standardmäßig in 'C:\Program Files\Git' installiert.
+ Bitte gebe den kompletten Pfad zur Git Bash ein, oder drücke Enter, um den Standardpfad zu verwenden
+ Willst du das Repository via SSH auschecken?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ Dieser Pfad existiert bereits. Willst du ihn wirklich überschreiben?
+ Dieser Pfad exisitert nicht. Bitte versuche es erneut...
+
+
+ Die CodeCombat Entwicklungsumgebung wurde erfoglreich installiert.
+ Vielen Dank für die Unterstützung und bis bald.
+ Willst du das README lesen, um weitere Informationen zu erhalten?
+
+
+ Von nun an kannst du die Entwicklungsumgebung starten unter
+ einmal mit der Maus klicken.
+ 1) Einfach Doppelklicken
+ und warten bis die Entwicklungsumgebung fertig geladen hat.
+ 2) Jetzt 'localhost:3000' in deinem bevorzugten Browser aufrufen.
+ Fertig. Du bist nun bereit, bei CodeCombat mitzuarbeiten!
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/en.coco b/scripts/windows/coco-dev-setup/batch/localisation/en.coco
index 71f18b2d1..947890ee8 100755
--- a/scripts/windows/coco-dev-setup/batch/localisation/en.coco
+++ b/scripts/windows/coco-dev-setup/batch/localisation/en.coco
@@ -1,66 +1,82 @@
-[global]
- native=English
- intro=From now on we'll send our feedback in English!
-[install]
- [system]
- bit=-bit computer detected.
- prefix=The operating system
- sufix=was detected.
- xp=We don't support Windows XP, installation cancelled.
- [process]
- sks=Have you already installed all the software needed for CodeCombat?
- skq=We recommand that you reply negative in case you're not sure.
- skc=Skipping the installation of the software...
- 1=CodeCombat couldn't be developed without third-party software.
- 2=That's why you'll need to install this software,
- 3=in order to start contributing to our community.
- 4=Cancel the installation if you already have the application.
- prefix=Do you already have the latest version of
- sufix=installed?
- downloading=is downloading...
- installing=is installing...
- unzipping=is unzipping...
- cleaning=is cleaning...
- mongodbpath=Please define the full path where mongodb should be installed
-[github]
- [intro]
- opensource=CodeCombat is opensource, like you already know.
- online=All our sourcecode can be found online at Github.
- manual=You can choose to do the entire Git setup yourself.
- norec=However we recommend that you instead let us handle it instead.
- [skip]
- question=Do you want to do the Local Git setup manually yourself?
- consequence=Make sure you have correctly setup your repository before processing.
- donotclose=Do not close this window please.
- wait=When you're ready, press any key to continue...
- [process]
- path=Please give the full path of your CodeCombat git repository:
- checkout=Please enter the full path where you want to install your CodeCombat environment
- bashi=This installation requires Git Bash.
- bashp64=Git bash is by default installed at 'C:\Program Files (x86)\Git'.
- bashp32=Git bash is by default installed at 'C:\Program Files\Git'.
- bashq=Please enter the full path where git bash is installed or just press enter if it's in the default location
- ssh=Do you want to checkout the repository via ssh?
-[npm]
- install=Installing bower, brunch, nodemon and sendwithus...
- binstall=Installing bower packages...
- sass=Installing sass...
- npm=Installing npm...
- brnch=Starting brunch....
- mongodb=Setting up a MongoDB database for you...
- db=Downloading the last version of the CodeCombat database...
- script=Preparing the automatic startup script for you...
-[error]
- path=That path already exists, are you sure you want to overwrite it?
- exist=That path doesn't exist. Please try again...
-[end]
- succesfull=The setup of the CodeCombat Dev. Environment was succesfull.
- thankyou=Thank you already for your contribution and see you soon.
- readme=Do you want to read the README for more information?
-[start]
- 1=From now on you can start the dev. environment at
- 2=the touch of a single mouse click.
- 3= 1) Just double click
- 4= and let the environment start up.
- 5= 2) Now just open 'localhost:3000' in your prefered browser.
- 6=That's it, you're now ready to start working on CodeCombat!
\ No newline at end of file
+
+
+
+ English
+ From now on we'll send our feedback in English!
+
+
+
+ -bit computer detected.
+ The operating system
+ was detected.
+ We don't support Windows XP, installation cancelled.
+
+
+ Have you already installed all the software needed for CodeCombat?
+ We recommand that you reply negative in case you're not sure.
+ Skipping the installation of the software...
+ CodeCombat couldn't be developed without third-party software.
+ That's why you'll need to install this software,
+ in order to start contributing to our community.
+ Cancel the installation if you already have the application.
+ Make sure to select the option that adds the application to your Windows Path, if the option is available.
+ Do you already have the latest version of
+ installed?
+ is downloading...
+ is installing...
+ is unzipping...
+ is cleaning...
+ Please define the full path where mongodb should be installed
+
+
+
+
+ CodeCombat is opensource, like you already know.
+ All our sourcecode can be found online at Github.
+ You can choose to do the entire Git setup yourself.
+ However we recommend that you instead let us handle it instead.
+
+
+ Do you want to do the Local Git setup manually yourself?
+ Make sure you have correctly setup your repository before processing.
+ Do not close this window please.
+ When you're ready, press any key to continue...
+
+
+ Please give the full path of your CodeCombat git repository:
+ Please enter the full path where you want to install your CodeCombat environment
+ This installation requires Git Bash.
+ Git bash is by default installed at 'C:\Program Files (x86)\Git'.
+ Git bash is by default installed at 'C:\Program Files\Git'.
+ Please enter the full path where git bash is installed or just press enter if it's in the default location
+ Do you want to checkout the repository via ssh?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ That path already exists, are you sure you want to overwrite it?
+ That path doesn't exist. Please try again...
+
+
+ The setup of the CodeCombat Dev. Environment was succesfull.
+ Thank you already for your contribution and see you soon.
+ Do you want to read the README for more information?
+
+
+ From now on you can start the dev. environment at
+ the touch of a single mouse click.
+ 1) Just double click
+ and let the environment start up.
+ 2) Now just open 'localhost:3000' in your prefered browser.
+ That's it, you're now ready to start working on CodeCombat!
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/fr.coco b/scripts/windows/coco-dev-setup/batch/localisation/fr.coco
new file mode 100755
index 000000000..1c92b433c
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/localisation/fr.coco
@@ -0,0 +1,82 @@
+
+
+
+ français
+ From now on we'll send our feedback in English!
+
+
+
+ -bit computer detected.
+ The operating system
+ was detected.
+ We don't support Windows XP, installation cancelled.
+
+
+ Have you already installed all the software needed for CodeCombat?
+ We recommand that you reply negative in case you're not sure.
+ Skipping the installation of the software...
+ CodeCombat couldn't be developed without third-party software.
+ That's why you'll need to install this software,
+ in order to start contributing to our community.
+ Cancel the installation if you already have the application.
+ Make sure to select the option that adds the application to your Windows Path, if the option is available.
+ Do you already have the latest version of
+ installed?
+ is downloading...
+ is installing...
+ is unzipping...
+ is cleaning...
+ Please define the full path where mongodb should be installed
+
+
+
+
+ CodeCombat is opensource, like you already know.
+ All our sourcecode can be found online at Github.
+ You can choose to do the entire Git setup yourself.
+ However we recommend that you instead let us handle it instead.
+
+
+ Do you want to do the Local Git setup manually yourself?
+ Make sure you have correctly setup your repository before processing.
+ Do not close this window please.
+ When you're ready, press any key to continue...
+
+
+ Please give the full path of your CodeCombat git repository:
+ Please enter the full path where you want to install your CodeCombat environment
+ This installation requires Git Bash.
+ Git bash is by default installed at 'C:\Program Files (x86)\Git'.
+ Git bash is by default installed at 'C:\Program Files\Git'.
+ Please enter the full path where git bash is installed or just press enter if it's in the default location
+ Do you want to checkout the repository via ssh?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ That path already exists, are you sure you want to overwrite it?
+ That path doesn't exist. Please try again...
+
+
+ The setup of the CodeCombat Dev. Environment was succesfull.
+ Thank you already for your contribution and see you soon.
+ Do you want to read the README for more information?
+
+
+ From now on you can start the dev. environment at
+ the touch of a single mouse click.
+ 1) Just double click
+ and let the environment start up.
+ 2) Now just open 'localhost:3000' in your prefered browser.
+ That's it, you're now ready to start working on CodeCombat!
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/languages.coco b/scripts/windows/coco-dev-setup/batch/localisation/languages.coco
index da3331dfe..a267d65d0 100755
--- a/scripts/windows/coco-dev-setup/batch/localisation/languages.coco
+++ b/scripts/windows/coco-dev-setup/batch/localisation/languages.coco
@@ -1,3 +1,7 @@
en
nl
-de
\ No newline at end of file
+de
+fr
+zh
+zh-HANT
+zh-HANS
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/nl.coco b/scripts/windows/coco-dev-setup/batch/localisation/nl.coco
index cae6e19ed..654d45c97 100755
--- a/scripts/windows/coco-dev-setup/batch/localisation/nl.coco
+++ b/scripts/windows/coco-dev-setup/batch/localisation/nl.coco
@@ -1,66 +1,82 @@
-[global]
- native=Nederlands
- intro=Vanaf nu geven we onze feedback in het Nederlands!
-[install]
- [system]
- bit=-bit computer gedetecteerd.
- prefix=Het besturingsysteem
- sufix=is gedetecteerd.
- xp=Wij ondersteunen Windows XP niet, installatie geanulleerd.
- [process]
- sks=Heb je alle benodige software al geinstalleerd?
- skq=We raden aan dat je negatief antwoord indien je niet zeker bent.
- skc=De installatie van software wordt geanulleerd...
- 1=CodeCombat kon niet worden ontwikkeld zonder third-party software.
- 2=Dat is waarom je deze software moet installeren,
- 3=zodat je je kan beginnen met het bijdragen tot onze gemeenschap.
- 4=Annuleer de installatie als je de applicatie al hebt.
- prefix=Heb je al de laatste versie van
- sufix=geinstalleerd?
- downloading=is aan het downloaden...
- installing=is aan het installeren...
- unzipping=is aan het uitpakken...
- cleaning=is aan het opkuisen...
- mongodbpath=Geef het volledige pad op, waar mongodb mag worden geinstalleerd
-[github]
- [intro]
- opensource=CodeCombat is opensource, zoals je waarschijnlijk wel al weet.
- online=Je kan al onze sourcecode vinden op Github.
- manual=Indien je wil, kan je de Git setup manueel doen.
- norec=Maar wij raden aan dat je ons dit automatisch laat afhandellen.
- [skip]
- question=Wil je de lokale Git setup manueel doen?
- consequence=Zorg er zeker voor dat jouw git repository correct is.
- donotclose=Sluit dit venster niet alsjeblieft.
- wait=Wanneer je klaar bent, druk dan eender welke toets om verder te gaan...
- [process]
- path=Geef alsjeblieft het volledige pad van je CodeCombat git repository:
- checkout=Geef alsjeblieft het volledige pad waar je de CodeCombat Ontwikkelings omgeving will installeren
- bashi=Deze installatie maakt gebruik van Git Bash.
- bashp64=Git bash is normaal geinstalleerd in 'C:\Program Files (x86)\Git'.
- bashp32=Git bash is normaal geinstalleerd in 'C:\Program Files\Git'.
- bashq=Geef alsjeblieft het volledige pad op van Git Bash of druk gewoon op enter indien je het pad niet gewijzigd heeft
- ssh=Wil je het git project downloaden via ssh?
-[npm]
- install=Installing bower, brunch, nodemon and sendwithus...
- binstall=Installing bower packages...
- sass=Installing sass...
- npm=Installing npm...
- brnch=Starting brunch....
- mongodb=Setting up a MongoDB database for you...
- database=Downloading the last version of the CodeCombat database...
- script=Preparing the automatic startup script for you...
-[error]
- path=Dat pad bestaat al, ben je zeker dat je het wil overschrijven?
- exist=Dat pad bestaat niet, probeer alsjeblieft opnieuw...
-[end]
- succesfull=De installatie van de CodeCombat-Ontwikkelings omgeving was succesvol.
- thankyou=Alvast bedankt voor al je werk en tot binnenkort.
- readme=Wil je de LEESMIJ lezen voor meer informatie?
-[start]
- 1=Vanaf nu kan je de ontwikkelings omgeving opstarten
- 2=met het gemak van een enkele muisklik.
- 3= 1) Dubbelklik op
- 4=en laat de omgeving opstarten.
- 5= 2) Nu kan je 'localhost:3000' openen in je browser naar voorkeur.
- 6=Dat is het, je bent nu klaar om te starten met je werk aan CodeCombat.
\ No newline at end of file
+
+
+
+ Nederlands
+ Vanaf nu geven we onze feedback in het Nederlands!
+
+
+
+ -bit computer gedetecteerd.
+ Het besturingsysteem
+ is gedetecteerd.
+ Wij ondersteunen Windows XP niet, installatie geanulleerd.
+
+
+ Heb je alle benodige software al geinstalleerd?
+ We raden aan dat je negatief antwoord indien je niet zeker bent.
+ De installatie van software wordt geanulleerd...
+ CodeCombat kon niet worden ontwikkeld zonder third-party software.
+ Dat is waarom je deze software moet installeren,
+ zodat je je kan beginnen met het bijdragen tot onze gemeenschap.
+ Annuleer de installatie als je de applicatie al hebt.
+ Zorg er zeker voor dat je de optie selecteert dat de applicatie aan je Windows Path toevoegt, als de optie beschikbaar is.
+ Heb je al de laatste versie van
+ geinstalleerd?
+ is aan het downloaden...
+ is aan het installeren...
+ is aan het uitpakken...
+ is aan het opkuisen...
+ Geef het volledige pad op, waar mongodb mag worden geinstalleerd
+
+
+
+
+ CodeCombat is opensource, zoals je waarschijnlijk wel al weet.
+ Je kan al onze sourcecode vinden op Github.
+ Indien je wil, kan je de Git setup manueel doen.
+ Maar wij raden aan dat je ons dit automatisch laat afhandellen.
+
+
+ Wil je de lokale Git setup manueel doen?
+ Zorg er zeker voor dat jouw git repository correct is.
+ Sluit dit venster niet alsjeblieft.
+ Wanneer je klaar bent, druk dan eender welke toets om verder te gaan...
+
+
+ Geef alsjeblieft het volledige pad van je CodeCombat git repository:
+ Geef alsjeblieft het volledige pad waar je de CodeCombat Ontwikkelings omgeving will installeren
+ Deze installatie maakt gebruik van Git Bash.
+ Git bash is normaal geinstalleerd in 'C:\Program Files (x86)\Git'.
+ Git bash is normaal geinstalleerd in 'C:\Program Files\Git'.
+ Geef alsjeblieft het volledige pad op van Git Bash of druk gewoon op enter indien je het pad niet gewijzigd heeft
+ Wil je het git project downloaden via ssh?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ Dat pad bestaat al, ben je zeker dat je het wil overschrijven?
+ Dat pad bestaat niet, probeer alsjeblieft opnieuw...
+
+
+ De installatie van de CodeCombat-Ontwikkelings omgeving was succesvol.
+ Alvast bedankt voor al je werk en tot binnenkort.
+ Wil je de LEESMIJ lezen voor meer informatie?
+
+
+ Vanaf nu kan je de ontwikkelings omgeving opstarten
+ met het gemak van een enkele muisklik.
+ 1) Dubbelklik op
+ en laat de omgeving opstarten.
+ 2) Nu kan je 'localhost:3000' openen in je browser naar voorkeur.
+ Dat is het, je bent nu klaar om te starten met je werk aan CodeCombat.
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/zh-HANS.coco b/scripts/windows/coco-dev-setup/batch/localisation/zh-HANS.coco
new file mode 100755
index 000000000..2eca2705c
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/localisation/zh-HANS.coco
@@ -0,0 +1,82 @@
+
+
+
+ 简体中文
+ From now on we'll send our feedback in English!
+
+
+
+ -bit computer detected.
+ The operating system
+ was detected.
+ We don't support Windows XP, installation cancelled.
+
+
+ Have you already installed all the software needed for CodeCombat?
+ We recommand that you reply negative in case you're not sure.
+ Skipping the installation of the software...
+ CodeCombat couldn't be developed without third-party software.
+ That's why you'll need to install this software,
+ in order to start contributing to our community.
+ Cancel the installation if you already have the application.
+ Make sure to select the option that adds the application to your Windows Path, if the option is available.
+ Do you already have the latest version of
+ installed?
+ is downloading...
+ is installing...
+ is unzipping...
+ is cleaning...
+ Please define the full path where mongodb should be installed
+
+
+
+
+ CodeCombat is opensource, like you already know.
+ All our sourcecode can be found online at Github.
+ You can choose to do the entire Git setup yourself.
+ However we recommend that you instead let us handle it instead.
+
+
+ Do you want to do the Local Git setup manually yourself?
+ Make sure you have correctly setup your repository before processing.
+ Do not close this window please.
+ When you're ready, press any key to continue...
+
+
+ Please give the full path of your CodeCombat git repository:
+ Please enter the full path where you want to install your CodeCombat environment
+ This installation requires Git Bash.
+ Git bash is by default installed at 'C:\Program Files (x86)\Git'.
+ Git bash is by default installed at 'C:\Program Files\Git'.
+ Please enter the full path where git bash is installed or just press enter if it's in the default location
+ Do you want to checkout the repository via ssh?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ That path already exists, are you sure you want to overwrite it?
+ That path doesn't exist. Please try again...
+
+
+ The setup of the CodeCombat Dev. Environment was succesfull.
+ Thank you already for your contribution and see you soon.
+ Do you want to read the README for more information?
+
+
+ From now on you can start the dev. environment at
+ the touch of a single mouse click.
+ 1) Just double click
+ and let the environment start up.
+ 2) Now just open 'localhost:3000' in your prefered browser.
+ That's it, you're now ready to start working on CodeCombat!
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/zh-HANT.coco b/scripts/windows/coco-dev-setup/batch/localisation/zh-HANT.coco
new file mode 100755
index 000000000..93bcefd87
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/localisation/zh-HANT.coco
@@ -0,0 +1,82 @@
+
+
+
+ 繁体中文
+ From now on we'll send our feedback in English!
+
+
+
+ -bit computer detected.
+ The operating system
+ was detected.
+ We don't support Windows XP, installation cancelled.
+
+
+ Have you already installed all the software needed for CodeCombat?
+ We recommand that you reply negative in case you're not sure.
+ Skipping the installation of the software...
+ CodeCombat couldn't be developed without third-party software.
+ That's why you'll need to install this software,
+ in order to start contributing to our community.
+ Cancel the installation if you already have the application.
+ Make sure to select the option that adds the application to your Windows Path, if the option is available.
+ Do you already have the latest version of
+ installed?
+ is downloading...
+ is installing...
+ is unzipping...
+ is cleaning...
+ Please define the full path where mongodb should be installed
+
+
+
+
+ CodeCombat is opensource, like you already know.
+ All our sourcecode can be found online at Github.
+ You can choose to do the entire Git setup yourself.
+ However we recommend that you instead let us handle it instead.
+
+
+ Do you want to do the Local Git setup manually yourself?
+ Make sure you have correctly setup your repository before processing.
+ Do not close this window please.
+ When you're ready, press any key to continue...
+
+
+ Please give the full path of your CodeCombat git repository:
+ Please enter the full path where you want to install your CodeCombat environment
+ This installation requires Git Bash.
+ Git bash is by default installed at 'C:\Program Files (x86)\Git'.
+ Git bash is by default installed at 'C:\Program Files\Git'.
+ Please enter the full path where git bash is installed or just press enter if it's in the default location
+ Do you want to checkout the repository via ssh?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ That path already exists, are you sure you want to overwrite it?
+ That path doesn't exist. Please try again...
+
+
+ The setup of the CodeCombat Dev. Environment was succesfull.
+ Thank you already for your contribution and see you soon.
+ Do you want to read the README for more information?
+
+
+ From now on you can start the dev. environment at
+ the touch of a single mouse click.
+ 1) Just double click
+ and let the environment start up.
+ 2) Now just open 'localhost:3000' in your prefered browser.
+ That's it, you're now ready to start working on CodeCombat!
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/localisation/zh.coco b/scripts/windows/coco-dev-setup/batch/localisation/zh.coco
new file mode 100755
index 000000000..b84d84146
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/localisation/zh.coco
@@ -0,0 +1,82 @@
+
+
+
+ 中文
+ From now on we'll send our feedback in English!
+
+
+
+ -bit computer detected.
+ The operating system
+ was detected.
+ We don't support Windows XP, installation cancelled.
+
+
+ Have you already installed all the software needed for CodeCombat?
+ We recommand that you reply negative in case you're not sure.
+ Skipping the installation of the software...
+ CodeCombat couldn't be developed without third-party software.
+ That's why you'll need to install this software,
+ in order to start contributing to our community.
+ Cancel the installation if you already have the application.
+ Make sure to select the option that adds the application to your Windows Path, if the option is available.
+ Do you already have the latest version of
+ installed?
+ is downloading...
+ is installing...
+ is unzipping...
+ is cleaning...
+ Please define the full path where mongodb should be installed
+
+
+
+
+ CodeCombat is opensource, like you already know.
+ All our sourcecode can be found online at Github.
+ You can choose to do the entire Git setup yourself.
+ However we recommend that you instead let us handle it instead.
+
+
+ Do you want to do the Local Git setup manually yourself?
+ Make sure you have correctly setup your repository before processing.
+ Do not close this window please.
+ When you're ready, press any key to continue...
+
+
+ Please give the full path of your CodeCombat git repository:
+ Please enter the full path where you want to install your CodeCombat environment
+ This installation requires Git Bash.
+ Git bash is by default installed at 'C:\Program Files (x86)\Git'.
+ Git bash is by default installed at 'C:\Program Files\Git'.
+ Please enter the full path where git bash is installed or just press enter if it's in the default location
+ Do you want to checkout the repository via ssh?
+
+
+
+ Installing bower, brunch, nodemon and sendwithus...
+ Installing bower packages...
+ Installing sass...
+ Installing npm...
+ Starting brunch....
+ Setting up a MongoDB database for you...
+ Downloading the last version of the CodeCombat database...
+
+
+
+ That path already exists, are you sure you want to overwrite it?
+ That path doesn't exist. Please try again...
+
+
+ The setup of the CodeCombat Dev. Environment was succesfull.
+ Thank you already for your contribution and see you soon.
+ Do you want to read the README for more information?
+
+
+ From now on you can start the dev. environment at
+ the touch of a single mouse click.
+ 1) Just double click
+ and let the environment start up.
+ 2) Now just open 'localhost:3000' in your prefered browser.
+ That's it, you're now ready to start working on CodeCombat!
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat
index b72e74dbd..8d85be8b1 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_app.bat
@@ -6,8 +6,8 @@ if NOT exist "%temp_directory%" (
md %temp_directory%
)
-call get_local_text install-process-prefix
-call get_local_text install-process-sufix
+call get_local_text install_process_prefix install process prefix
+call get_local_text install_process_sufix install process sufix
call ask_question "!install_process_prefix! %1 !install_process_sufix!"
@@ -18,7 +18,7 @@ if "%result%"=="true" (
call print_dashed_seperator
call get_extension %2 download_extension
-call get_local_text install-process-downloading
+call get_local_text install_process_downloading install process downloading
echo %1 !install_process_downloading!
set "install_file=!temp_directory!%1.!download_extension!"
%curl_app% -k %2 -o !install_file!
@@ -34,10 +34,10 @@ if "%download_extension%"=="zip" (
goto:get_mongodb_path
:get_mongodb_path
- call get_local_text install-process-mongodbpath
+ call get_local_text install_process_mongodbpath install process mongodbpath
set /p "mongodb_path=!install_process_mongodbpath!: "
if exist "%mongodb_path%" (
- call get_local_text error-path
+ call get_local_text error_path error path
call ask_question "!error_path!"
if "!result!"=="false" (
call print_dashed_seperator
@@ -52,14 +52,14 @@ if "%download_extension%"=="zip" (
goto:clean_up
)
-call get_local_text install-process-installing
+call get_local_text install_process_installing install process installing
echo %1 !install_process_installing!
echo.
start /WAIT !install_file!
goto:clean_up
:clean_up
- call get_local_text install-process-cleaning
+ call get_local_text install_process_cleaning install process cleaning
echo %1 !install_process_cleaning!
rmdir /s /q "!temp_directory!"
goto:exit_installation
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat
index 65c41f58d..3c5f798fd 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/download_and_install_applications.bat
@@ -1,16 +1,16 @@
call print_install_header
call print_dashed_seperator
-call get_local_text install-process-sks
+call get_local_text install_process_sks install process sks
echo !install_process_sks!
-call get_local_text install-process-skq
+call get_local_text install_process_skq install process skq
call ask_question "!install_process_skq!"
call print_dashed_seperator
if "%result%"=="true" (
- call get_local_text install-process-skc
+ call get_local_text install_process_skc install process skc
echo !install_process_skc!
call print_dashed_seperator
goto:exit_setup
@@ -20,22 +20,27 @@ call get_system_information
call print_dashed_seperator
if %system_info_os% == XP (
- call get_local_text install-system-xp
+ call get_local_text install_system_xp install system xp
echo !install_system_xp!
call print_exit
)
-call get_category ..\\config\\downloads.coco downloads download_names downloads_count general-general general-%system_info_bit% %system_info_os%-%system_info_bit%
+call get_variables ..\\config\\downloads.coco downloads download_names downloads_count 0 general general
+call get_variables ..\\config\\downloads.coco downloads download_names downloads_count 2 %system_info_os% b%system_info_bit%
+call get_variables ..\\config\\downloads.coco downloads download_names downloads_count 3 general b%system_info_bit%
-call get_local_text install-process-1
-call get_local_text install-process-2
-call get_local_text install-process-3
-call get_local_text install-process-4
+call get_local_text install_process_s1 install process s1
+call get_local_text install_process_s2 install process s2
+call get_local_text install_process_s3 install process s3
+call get_local_text install_process_s4 install process s4
+call get_local_text install_process_winpath install process winpath
-echo !install_process_1!
-echo !install_process_2!
-echo !install_process_3!
-echo !install_process_4!
+echo !install_process_s1!
+echo !install_process_s2!
+echo !install_process_s3!
+echo !install_process_s4!
+echo.
+echo !install_process_winpath!
call print_dashed_seperator
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_config.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_config.bat
index 8925febdf..21c975aaf 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_config.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_config.bat
@@ -1 +1,3 @@
-for /f "delims=" %%a in ('..\\utilities\\get_var.exe ..\\config\\config.coco %1') do set "%%a"
\ No newline at end of file
+for /F "delims=" %%F in ('call run_script .\\get_var.ps1 ..\\config\\config.coco %1') do (
+ set "%1=%%F"
+)
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_download.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_download.bat
index e72c2cca6..2f884b366 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_download.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_download.bat
@@ -1 +1,3 @@
-for /f "delims=" %%a in ('..\\utilities\\get_var.exe ..\\config\\downloads.coco %1') do set "%%a"
\ No newline at end of file
+for /F "delims=" %%F in ('call run_script .\\get_var.ps1 ..\\config\\downloads.coco %2 %3 %4 %5') do (
+ set "%1=%%F"
+)
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_extension.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_extension.bat
index 6e4525784..bbcd05b5e 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_extension.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_extension.bat
@@ -1,3 +1,3 @@
-for /f "delims=" %%a in ('..\\utilities\\get_extension.exe %1 %2') do (
- %%a
+for /F "delims=" %%F in ('call run_script .\\get_extension.ps1 %1') do (
+ set "%2=%%F"
)
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_extension.ps1 b/scripts/windows/coco-dev-setup/batch/scripts/get_extension.ps1
new file mode 100755
index 000000000..631132f74
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_extension.ps1
@@ -0,0 +1,18 @@
+$url = ($args[0].ToLower())
+
+if($url.Contains("zip"))
+{
+ Write-Host "zip"
+}
+elseif($url.Contains("exe"))
+{
+ Write-Host "exe"
+}
+elseif($url.Contains("msi"))
+{
+ Write-Host "msi"
+}
+elseif($url.Contains("tar.gz"))
+{
+ Write-Host "tar.gz"
+}
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat
index 54223b7c0..eb9c88ef5 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_language.bat
@@ -5,7 +5,7 @@ call print_dashed_seperator
call get_array ..\\localisation\\languages.coco languages language_count
for /l %%i in (1,1,%language_count%) do (
- call get_text !languages[%%i]! "global-native"
+ call get_text !languages[%%i]! global_native global native
echo [%%i] !global_native!
)
@@ -27,10 +27,10 @@ goto:get_localisation_id
goto:get_localisation_id
) else (
set language_id=!languages[%local_id%]!
- call get_text !language_id! "global-native"
+ call get_text !language_id! global_native global native
call print_dashed_seperator
echo You have choosen !global_native! as your language.
- call get_text !language_id! "global-intro"
+ call get_text !language_id! global_intro global intro
echo !global_intro!
call print_seperator
)
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_local_text.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_local_text.bat
index c27e768d9..9a54a78c5 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_local_text.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_local_text.bat
@@ -1 +1 @@
-call get_text %language_id% %1
\ No newline at end of file
+call get_text !language_id! %1 %2 %3 %4 %5
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat
index 542ffe73c..908399932 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_system_information.bat
@@ -16,15 +16,15 @@ if "%version%" == "6.3" ( call:set_os Win7 )
goto:end
:set_bit
- call get_local_text install-system-bit
+ call get_local_text install_system_bit install system bit
set system_info_bit=%~1
echo %system_info_bit%%install_system_bit%
goto:eof
:set_os
set system_info_os=%~1
- call get_local_text install-system-prefix
- call get_local_text install-system-sufix
+ call get_local_text install_system_prefix install system prefix
+ call get_local_text install_system_sufix install system sufix
echo %install_system_prefix% %system_info_os% %install_system_sufix%
goto:eof
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat
index a212b3625..aacdf94f2 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_text.bat
@@ -1,3 +1,3 @@
-for /f "delims=" %%a in ('..\\utilities\\get_var.exe ..\\localisation\\%1.coco %2') do (
- set "%%a"
+for /F "delims=" %%F in ('call run_script .\\get_var.ps1 ..\\localisation\\%1.coco %3 %4 %5 %6') do (
+ set "%2=%%F"
)
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_var.ps1 b/scripts/windows/coco-dev-setup/batch/scripts/get_var.ps1
new file mode 100755
index 000000000..5e63443fb
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_var.ps1
@@ -0,0 +1,27 @@
+$xml_file = [xml](get-content $args[0])
+if($args.count -eq 2)
+{
+ $var_output = ($xml_file.variables.($args[1]))
+}
+elseif($args.count -eq 3)
+{
+ $var_output = ($xml_file.variables.($args[1]).($args[2]))
+}
+elseif($args.count -eq 4)
+{
+ $var_output = ($xml_file.variables.($args[1]).($args[2]).($args[3]))
+}
+elseif($args.count -eq 5)
+{
+ $var_output = ($xml_file.variables.($args[1]).($args[2]).($args[3]).($args[4]))
+}
+elseif($args.count -eq 6)
+{
+ $var_output = ($xml_file.variables.($args[1]).($args[2]).($args[3]).($args[4]).($args[5]))
+}
+elseif($args.count -eq 7)
+{
+ $var_output = ($xml_file.variables.($args[1]).($args[2]).($args[3]).($args[4]).($args[5]).($args[6]))
+}
+
+Write-Host "$var_output"
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_variables.bat b/scripts/windows/coco-dev-setup/batch/scripts/get_variables.bat
new file mode 100755
index 000000000..a53805fac
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_variables.bat
@@ -0,0 +1,4 @@
+set count=0
+for /F "delims=" %%F in ('call run_script.bat .\\get_variables.ps1 %*') do (
+ %%F
+)
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/get_variables.ps1 b/scripts/windows/coco-dev-setup/batch/scripts/get_variables.ps1
new file mode 100755
index 000000000..6d94b4324
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/scripts/get_variables.ps1
@@ -0,0 +1,33 @@
+$xml_file = [xml](get-content $args[0])
+$arr_value = $args[1]
+$arr_name = $args[2]
+$arr_counter = $args[3]
+$counter = $args[4]
+
+if($args.count -eq 6)
+{
+ $root = $xml_file.variables.($args[5])
+}
+elseif($args.count -eq 7)
+{
+ $root = $xml_file.variables.($args[5]).($args[6])
+}
+elseif($args.count -eq 8)
+{
+ $root = $xml_file.variables.($args[5]).($args[6]).($args[7])
+}
+elseif($args.count -eq 9)
+{
+ $nodes = $xml_file.variables.($args[5]).($args[6]).($args[7]).($args[8])
+}
+
+foreach ($node in $root.ChildNodes)
+{
+ $counter += 1
+ $value = $node.InnerText
+ $name = $node.Name
+ Write-Host set "$arr_value[$counter]=$value"
+ Write-Host set "$arr_name[$counter]=$name"
+}
+
+Write-Host set "$arr_counter=$counter"
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat b/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat
index 6c8952bc3..e9add16ca 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/github_setup.bat
@@ -1,10 +1,10 @@
call print_github_header
call print_dashed_seperator
-call get_local_text github-intro-opensource
-call get_local_text github-intro-online
-call get_local_text github-intro-manual
-call get_local_text github-intro-norec
+call get_local_text github_intro_opensource github intro opensource
+call get_local_text github_intro_online github intro online
+call get_local_text github_intro_manual github intro manual
+call get_local_text github_intro_norec github intro norec
echo !github_intro_opensource!
echo !github_intro_online!
@@ -13,23 +13,23 @@ echo !github_intro_norec!
call print_dashed_seperator
-call get_local_text github-skip-question
+call get_local_text github_skip_question github skip question
call ask_question "!github_skip_question!"
call print_dashed_seperator
if "%result%"=="true" (
- call get_local_text github-skip-consequence
+ call get_local_text github_skip_consequence github skip consequence
echo !github_skip_consequence!
- call get_local_text github-skip-donotclose
+ call get_local_text github_skip_donotclose github skip donotclose
echo !github_skip_donotclose!
- call get_local_text github-skip-wait
+ call get_local_text github_skip_wait github skip wait
set /p "github_skip_wait=!github_skip_wait!"
call print_dashed_seperator
- call get_local_text github-process-path
+ call get_local_text github_process_path github process path
call get_path_safe "!github_process_path!"
set "repository_path=!tmp_safe_path!"
@@ -39,7 +39,7 @@ if "%result%"=="true" (
goto:get_bash_path
:get_bash_path
- call get_local_text github-process-bashi
+ call get_local_text github_process_bashi github process bashi
echo !github_process_bashi!
if not defined install_system_bit (
@@ -49,14 +49,14 @@ goto:get_bash_path
)
if "%system_info_bit%"=="64" (
- call get_local_text github-process-bashp64
+ call get_local_text github_process_bashp64 github process bashp64
echo !github_process_bashp64!
) else (
- call get_local_text github-process-bashp32
+ call get_local_text github_process_bashp32 github process bashp32
echo !github_process_bashp32!
)
- call get_local_text github-process-bashq
+ call get_local_text github_process_bashq github process bashq
set /p "git_bash_path=!github_process_bashq!: "
if not defined git_bash_path (
@@ -69,7 +69,7 @@ goto:get_bash_path
)
if not exist "%git_bash_path%" (
- call get_local_text error-exist
+ call get_local_text error_exist error exist
echo !error_exist!
call print_dashed_seperator
goto:get_bash_path
@@ -80,10 +80,10 @@ goto:eof
:get_git_path
call print_dashed_seperator
- call get_local_text github-process-checkout
+ call get_local_text github_process_checkout github process checkout
set /p "repository_path=!github_process_checkout!: "
if exist !repository_path! (
- call get_local_text error-path
+ call get_local_text error_path error path
call ask_question "!error_path!"
if "!result!"=="false" (
call print_dashed_seperator
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/run_script.bat b/scripts/windows/coco-dev-setup/batch/scripts/run_script.bat
new file mode 100755
index 000000000..1e4797008
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/batch/scripts/run_script.bat
@@ -0,0 +1,2 @@
+@echo off
+PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& "%*"
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/batch/scripts/setup.bat b/scripts/windows/coco-dev-setup/batch/scripts/setup.bat
index df02ccc36..7c137563f 100755
--- a/scripts/windows/coco-dev-setup/batch/scripts/setup.bat
+++ b/scripts/windows/coco-dev-setup/batch/scripts/setup.bat
@@ -2,14 +2,14 @@
setlocal EnableDelayedExpansion
Color 0A
-mode con: cols=78 lines=55
+mode con: cols=79 lines=55
call print_header
call print_dashed_seperator
-call get_config version
-call get_config author
-call get_config copyright
+call get_config.bat version
+call get_config.bat author
+call get_config.bat copyright
echo Welcome to the automated Installation of the CodeCombat Dev. Environment!
echo v%version% authored by %author% and published by %copyright%.
call print_seperator
@@ -32,32 +32,32 @@ call github_setup
call print_finished_header
call print_dashed_seperator
-call get_local_text end-succesfull
-call get_local_text end-thankyou
+call get_local_text end_succesfull end succesfull
+call get_local_text end_thankyou end thankyou
echo %end_succesfull%
echo %end_thankyou%
call print_dashed_seperator
-call get_local_text start-1
-call get_local_text start-2
-call get_local_text start-3
-call get_local_text start-4
-call get_local_text start-5
-call get_local_text start-6
+call get_local_text start_s1 start s1
+call get_local_text start_s2 start s2
+call get_local_text start_s3 start s3
+call get_local_text start_s4 start s4
+call get_local_text start_s5 start s5
+call get_local_text start_s6 start s6
-echo !start_1!
-echo !start_2!
+echo !start_s1!
+echo !start_s2!
echo.
-echo !start_3! '!repository_path!\coco\SCOCODE.bat'
-echo !start_4!
-echo !start_5!
+echo !start_s3! '!repository_path!\coco\SCOCODE.bat'
+echo !start_s4!
+echo !start_s5!
echo.
-echo !start_6!
+echo !start_s6!
call print_dashed_seperator
-call get_local_text end-readme
+call get_local_text end_readme end readme
call ask_question "!end_readme!"
if "%result%"=="true" (
diff --git a/scripts/windows/coco-dev-setup/coco-dev-win-setup-1.0.zip b/scripts/windows/coco-dev-setup/coco-dev-win-setup-1.0.zip
deleted file mode 100755
index 95bb68fee..000000000
Binary files a/scripts/windows/coco-dev-setup/coco-dev-win-setup-1.0.zip and /dev/null differ
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/config.coco b/scripts/windows/coco-dev-setup/last_step_succesfull/config.coco
new file mode 100755
index 000000000..ae8c66f56
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/config.coco
@@ -0,0 +1,6 @@
+
+
+ 1.0
+ GlenDC
+ CodeCombat.com 2013-2014
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/downloads.coco b/scripts/windows/coco-dev-setup/last_step_succesfull/downloads.coco
new file mode 100755
index 000000000..2a0472c41
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/downloads.coco
@@ -0,0 +1,24 @@
+
+
+
+
+ http://nodejs.org/dist/v0.10.25/node-v0.10.25-x86.msi
+ http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353.exe?direct
+ http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi
+
+
+ http://nodejs.org/dist/v0.10.25/x64/node-v0.10.25-x64.msi
+ http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.0.0-p353-x64.exe?direct
+ http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi
+
+ https://msysgit.googlecode.com/files/Git-1.8.5.2-preview20131230.exe
+
+
+ mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip
+ mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.5.4.zip
+
+
+ mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-i386-2.5.4.zip
+ mongodb=http://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2.5.4.zip
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/en.coco b/scripts/windows/coco-dev-setup/last_step_succesfull/en.coco
new file mode 100755
index 000000000..a2e1f9fca
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/en.coco
@@ -0,0 +1,53 @@
+
+
+
+ English
+ Bye Bye!
+
+
+ Installation has begun, this can take a while... Please stay tuned...
+ Don't close any windows please, unless specified explicitly.
+
+
+ [DOWNLOADING AND INSTALLING 3RD PARTY SOFTWARE]
+ downloading:
+ installing:
+ Download and Installation cancelled...
+ Software has been installed...
+ Installation of the Developers Environment is complete!
+ Installation has been stopped...
+ unpacking and moving:
+ Installing bower, brunch, nodemon and sendwithus...
+
+
+ CodeCombat is safely stored on a git repository.
+ Therefore you need a git command-line application (Git-bash).
+ Examples: git-bash, CygWin, ...
+ Do you already have git-bash?
+ Enter the path to where you installed Git-bash
+ Checking out the Git Repository...
+ Please enter your github username:
+
+
+ Do you already have the latest version of node-js installed?
+ Please enter the full path of the location you installed nodejs to:
+
+
+ Do you already have the latest version of ruby installed?
+
+
+ Do you already have the latest version of mongo-db installed?
+ Enter the path where you would like to install MongoDB:
+
+
+ Do you already have the latest version of python installed?
+
+
+ Sadly we can't support Windows XP... Please upgrade your OS!
+ Machine OS cannot be determined...
+ Report your OS to the developers @ CodeCombat.com...
+ ... Cleaning up has been disabled... Terminating Script!
+ The path to your git application is incorrect, please try again...
+ The path you entered is invalid, please try again...
+
+
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/get_config.bat b/scripts/windows/coco-dev-setup/last_step_succesfull/get_config.bat
new file mode 100755
index 000000000..3849e22c2
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/get_config.bat
@@ -0,0 +1,3 @@
+powershell .\get_var.ps1 config.coco %1 > var.tmp
+set /p %1= < var.tmp
+del /q var.tmp
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/get_download.bat b/scripts/windows/coco-dev-setup/last_step_succesfull/get_download.bat
new file mode 100755
index 000000000..fde3799e3
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/get_download.bat
@@ -0,0 +1,4 @@
+@ECHO off
+powershell .\get_var.ps1 downloads.coco %2 %3 %4 %5 %6 > var.tmp
+set /p %1= < var.tmp
+del /q var.tmp
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/get_text.bat b/scripts/windows/coco-dev-setup/last_step_succesfull/get_text.bat
new file mode 100755
index 000000000..5cae1d431
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/get_text.bat
@@ -0,0 +1,4 @@
+@ECHO off
+powershell .\get_var.ps1 %1.coco %3 %4 %5 %6 %7 > var.tmp
+set /p %2= < var.tmp
+del /q var.tmp
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/get_var.ps1 b/scripts/windows/coco-dev-setup/last_step_succesfull/get_var.ps1
new file mode 100755
index 000000000..77573929f
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/get_var.ps1
@@ -0,0 +1,17 @@
+$xml_file = [xml](get-content $args[0])
+if($args.count -eq 2)
+{
+ $xml_file.variables.($args[1])
+}
+elseif($args.count -eq 3)
+{
+ $xml_file.variables.($args[1]).($args[2])
+}
+elseif($args.count -eq 4)
+{
+ $xml_file.variables.($args[1]).($args[2]).($args[3])
+}
+elseif($args.count -eq 5)
+{
+ $xml_file.variables.($args[1]).($args[2]).($args[3]).($args[4])
+}
\ No newline at end of file
diff --git a/scripts/windows/coco-dev-setup/last_step_succesfull/run_script.bat b/scripts/windows/coco-dev-setup/last_step_succesfull/run_script.bat
new file mode 100755
index 000000000..dfc6e6cc0
--- /dev/null
+++ b/scripts/windows/coco-dev-setup/last_step_succesfull/run_script.bat
@@ -0,0 +1,2 @@
+@echo off
+powershell "& "%*"
\ No newline at end of file
diff --git a/server/commons/Handler.coffee b/server/commons/Handler.coffee
index d026ea54f..f38885fd9 100644
--- a/server/commons/Handler.coffee
+++ b/server/commons/Handler.coffee
@@ -311,8 +311,9 @@ module.exports = class Handler
for prop in @getEditableProperties req, document
if (val = req.body[prop])?
document.set prop, val
- else if document.get(prop)? and req.method isnt 'PATCH'
- document.set prop, 'undefined'
+ # Hold on, gotta think about that one
+ #else if document.get(prop)? and req.method isnt 'PATCH'
+ # document.set prop, 'undefined'
obj = document.toObject()
# Hack to get saving of Users to work. Probably should replace these props with strings
diff --git a/server/levels/level_handler.coffee b/server/levels/level_handler.coffee
index c58738d20..ad26fe0e1 100644
--- a/server/levels/level_handler.coffee
+++ b/server/levels/level_handler.coffee
@@ -36,6 +36,7 @@ LevelHandler = class LevelHandler extends Handler
return @getRandomSessionPair(req,res,args[0]) if args[1] is 'random_session_pair'
return @getLeaderboardFacebookFriends(req, res, args[0]) if args[1] is 'leaderboard_facebook_friends'
return @getLeaderboardGPlusFriends(req, res, args[0]) if args[1] is 'leaderboard_gplus_friends'
+ return @getHistogramData(req, res, args[0]) if args[1] is 'histogram_data'
return @sendNotFoundError(res)
@@ -118,6 +119,18 @@ LevelHandler = class LevelHandler extends Handler
query = Session.find(sessionQuery).select('-screenshot')
query.exec (err, results) =>
if err then @sendDatabaseError(res, err) else @sendSuccess res, results
+
+ getHistogramData: (req, res,slug) ->
+ query = Session.aggregate [
+ {$match: {"levelID":slug, "submitted": true, "team":req.query.team}}
+ {$project: {totalScore: 1, _id: 0}}
+ ]
+
+ query.exec (err, data) =>
+ if err? then return @sendDatabaseError res, err
+ valueArray = _.pluck data, "totalScore"
+ @sendSuccess res, valueArray
+
getLeaderboard: (req, res, id) ->
sessionsQueryParameters = @makeLeaderboardQueryParameters(req, id)
diff --git a/server/queues/scoring.coffee b/server/queues/scoring.coffee
index 327abf949..cd4670708 100644
--- a/server/queues/scoring.coffee
+++ b/server/queues/scoring.coffee
@@ -43,17 +43,17 @@ module.exports.addPairwiseTaskToQueueFromRequest = (req, res) ->
addPairwiseTaskToQueue = (taskPair, cb) ->
LevelSession.findOne(_id:taskPair[0]).lean().exec (err, firstSession) =>
- if err? then return cb err, false
+ if err? then return cb err
LevelSession.find(_id:taskPair[1]).exec (err, secondSession) =>
- if err? then return cb err, false
+ if err? then return cb err
try
taskPairs = generateTaskPairs(secondSession, firstSession)
catch e
- if e then return cb e, false
+ if e then return cb e
sendEachTaskPairToTheQueue taskPairs, (taskPairError) ->
- if taskPairError? then return cb taskPairError,false
- cb null, true
+ if taskPairError? then return cb taskPairError
+ cb null
module.exports.resimulateAllSessions = (req, res) ->
unless isUserAdmin req then return errors.unauthorized res, "Unauthorized. Even if you are authorized, you shouldn't do this"
@@ -68,8 +68,8 @@ module.exports.resimulateAllSessions = (req, res) ->
majorVersion: levelMajorVersion
query = LevelSession
- .find(findParameters)
- .lean()
+ .find(findParameters)
+ .lean()
query.exec (err, result) ->
if err? then return errors.serverError res, err
@@ -100,14 +100,12 @@ resimulateSession = (originalLevelID, levelMajorVersion, session, cb) =>
cb null
-
-
module.exports.createNewTask = (req, res) ->
requestSessionID = req.body.session
originalLevelID = req.body.originalLevelID
currentLevelID = req.body.levelID
requestLevelMajorVersion = parseInt(req.body.levelMajorVersion)
-
+
async.waterfall [
validatePermissions.bind(@,req,requestSessionID)
fetchAndVerifyLevelType.bind(@,currentLevelID)
@@ -115,12 +113,12 @@ module.exports.createNewTask = (req, res) ->
updateSessionToSubmit
fetchInitialSessionsToRankAgainst.bind(@, requestLevelMajorVersion, originalLevelID)
generateAndSendTaskPairsToTheQueue
-
+
], (err, successMessageObject) ->
if err? then return errors.serverError res, "There was an error submitting the game to the queue:#{err}"
sendResponseObject req, res, successMessageObject
-
+
validatePermissions = (req,sessionID, callback) ->
if isUserAnonymous req then return callback "You are unauthorized to submit that game to the simulator"
if isUserAdmin req then return callback null
@@ -136,7 +134,7 @@ validatePermissions = (req,sessionID, callback) ->
query.exec (err, retrievedSession) ->
if err? then return callback err
userHasPermissionToSubmitCode = retrievedSession.creator is req.user?.id and
- not _.isEqual(retrievedSession.code, retrievedSession.submittedCode)
+ not _.isEqual(retrievedSession.code, retrievedSession.submittedCode)
unless userHasPermissionToSubmitCode then return callback "You are unauthorized to submit that game to the simulator"
callback null
@@ -209,7 +207,7 @@ generateAndSendTaskPairsToTheQueue = (sessionToRankAgainst,submittedSession, cal
sendEachTaskPairToTheQueue taskPairs, (taskPairError) ->
if taskPairError? then return callback taskPairError
callback null, {"message": "All task pairs were succesfully sent to the queue"}
-
+
module.exports.dispatchTaskToConsumer = (req, res) ->
async.waterfall [
@@ -221,7 +219,7 @@ module.exports.dispatchTaskToConsumer = (req, res) ->
constructTaskLogObject.bind(@, getUserIDFromRequest(req))
processTaskObject
], (err, taskObjectToSend) ->
- if err?
+ if err?
if typeof err is "string" and err.indexOf "No more games in the queue" isnt -1
res.send(204, "No games to score.")
return res.end()
@@ -229,16 +227,16 @@ module.exports.dispatchTaskToConsumer = (req, res) ->
return errors.serverError res, "There was an error dispatching the task: #{err}"
sendResponseObject req, res, taskObjectToSend
-
-
+
+
checkSimulationPermissions = (req, cb) ->
- if isUserAnonymous req
+ if isUserAnonymous req
cb "You need to be logged in to simulate games"
else
cb null
-
+
receiveMessageFromSimulationQueue = (cb) ->
- scoringTaskQueue.receiveMessage (err, message) ->
+ scoringTaskQueue.receiveMessage (err, message) ->
if err? then return cb "No more games in the queue, error:#{err}"
if messageIsInvalid(message) then return cb "Message received from queue is invalid"
cb null, message
@@ -292,90 +290,190 @@ processTaskObject = (taskObject,taskLogObject, message, cb) ->
cb null, taskObject
getSessionInformation = (sessionIDString, callback) ->
- findParameters =
+ findParameters =
_id: sessionIDString
selectString = 'submitDate team submittedCode teamSpells levelID creator creatorName'
query = LevelSession
- .findOne(findParameters)
- .select(selectString)
- .lean()
-
+ .findOne(findParameters)
+ .select(selectString)
+ .lean()
+
query.exec (err, session) ->
if err? then return callback err, {"error":"There was an error retrieving the session."}
callback null, session
module.exports.processTaskResult = (req, res) ->
- clientResponseObject = verifyClientResponse req.body, res
+ async.waterfall [
+ verifyClientResponse.bind(@,req.body)
+ fetchTaskLog.bind(@)
+ checkTaskLog.bind(@)
+ deleteQueueMessage.bind(@)
+ fetchLevelSession.bind(@)
+ checkSubmissionDate.bind(@)
+ logTaskComputation.bind(@)
+ updateSessions.bind(@)
+ indexNewScoreArray.bind(@)
+ addMatchToSessions.bind(@)
+ updateUserSimulationCounts.bind(@, req.user._id)
+ determineIfSessionShouldContinueAndUpdateLog.bind(@)
+ findNearestBetterSessionID.bind(@)
+ addNewSessionsToQueue.bind(@)
+ ], (err, results) ->
+ if err is "shouldn't continue"
+ sendResponseObject req, res, {"message":"The scores were updated successfully, person lost so no more games are being inserted!"}
+ else if err is "no session was found"
+ sendResponseObject req, res, {"message":"There were no more games to rank (game is at top)!"}
+ else if err?
+ errors.serverError res, "There was an error:#{err}"
+ else
+ sendResponseObject req, res, {"message":"The scores were updated successfully and more games were sent to the queue!"}
- return unless clientResponseObject?
- TaskLog.findOne {_id: clientResponseObject.taskID}, (err, taskLog) ->
- return errors.serverError res, "There was an error retrieiving the task log object" if err?
+verifyClientResponse = (responseObject, callback) ->
+ #TODO: better verification
+ unless typeof responseObject is "object"
+ callback "The response to that query is required to be a JSON object."
+ else
+ @clientResponseObject = responseObject
+ log.info "Verified client response!"
+ callback null, responseObject
- taskLogJSON = taskLog.toObject()
+fetchTaskLog = (responseObject, callback) ->
+ findParameters =
+ _id: responseObject.taskID
+ query = TaskLog
+ .findOne(findParameters)
+ query.exec (err, taskLog) =>
+ @taskLog = taskLog
+ log.info "Fetched task log!"
+ callback err, taskLog.toObject()
- return errors.badInput res, "That computational task has already been performed" if taskLogJSON.calculationTimeMS
- return handleTimedOutTask req, res, clientResponseObject if hasTaskTimedOut taskLogJSON.sentDate
+checkTaskLog = (taskLog, callback) ->
+ if taskLog.calculationTimeMS then return callback "That computational task has already been performed"
+ if hasTaskTimedOut taskLog.sentDate then return callback "The task has timed out"
+ log.info "Checked task log"
+ callback null
- scoringTaskQueue.deleteMessage clientResponseObject.receiptHandle, (err) ->
- console.log "Deleted message."
- if err? then return errors.badInput res, "The queue message is already back in the queue, rejecting results."
+deleteQueueMessage = (callback) ->
+ scoringTaskQueue.deleteMessage @clientResponseObject.receiptHandle, (err) ->
+ log.info "Deleted queue message"
+ callback err
- LevelSession.findOne(_id: clientResponseObject.originalSessionID).lean().exec (err, levelSession) ->
- if err? then return errors.serverError res, "There was a problem finding the level session:#{err}"
-
- supposedSubmissionDate = new Date(clientResponseObject.sessions[0].submitDate)
-
- if Number(supposedSubmissionDate) isnt Number(levelSession.submitDate)
- return sendResponseObject req, res, {"message":"The game has been resubmitted. Removing from queue..."}
-
- logTaskComputation clientResponseObject, taskLog, (logErr) ->
- if logErr? then return errors.serverError res, "There as a problem logging the task computation: #{logErr}"
-
- updateSessions clientResponseObject, (updateError, newScoreArray) ->
- if updateError? then return errors.serverError res, "There was an error updating the scores.#{updateError}"
-
- newScoresObject = _.indexBy newScoreArray, 'id'
-
- addMatchToSessions clientResponseObject, newScoresObject, (err, data) ->
- if err? then return errors.serverError res, "There was an error updating the sessions with the match! #{JSON.stringify err}"
-
- incrementUserSimulationCount req.user._id, 'simulatedBy'
- incrementUserSimulationCount levelSession.creator, 'simulatedFor'
-
- originalSessionID = clientResponseObject.originalSessionID
- originalSessionTeam = clientResponseObject.originalSessionTeam
- originalSessionRank = parseInt clientResponseObject.originalSessionRank
-
- determineIfSessionShouldContinueAndUpdateLog originalSessionID, originalSessionRank, (err, sessionShouldContinue) ->
- if err? then return errors.serverError res, "There was an error determining if the session should continue, #{err}"
-
- if sessionShouldContinue
- opposingTeam = calculateOpposingTeam(originalSessionTeam)
- opponentID = _.pull(_.keys(newScoresObject), originalSessionID)
- sessionNewScore = newScoresObject[originalSessionID].totalScore
- opponentNewScore = newScoresObject[opponentID].totalScore
-
- levelOriginalID = levelSession.level.original
- levelOriginalMajorVersion = levelSession.level.majorVersion
- findNearestBetterSessionID levelOriginalID, levelOriginalMajorVersion, originalSessionID, sessionNewScore, opponentNewScore, opponentID, opposingTeam, (err, opponentSessionID) ->
- if err? then return errors.serverError res, "There was an error finding the nearest sessionID!"
- if opponentSessionID
- addPairwiseTaskToQueue [originalSessionID, opponentSessionID], (err, success) ->
- if err? then return errors.serverError res, "There was an error sending the pairwise tasks to the queue!"
- sendResponseObject req, res, {"message":"The scores were updated successfully and more games were sent to the queue!"}
- else
- LevelSession.update {_id: originalSessionID}, {isRanking: false}, {multi: false}, (err, affected) ->
- if err? then return errors.serverError res, "There was an error marking the victorious session as not being ranked."
- return sendResponseObject req, res, {"message":"There were no more games to rank (game is at top)!"}
- else
- console.log "Player lost, achieved rank #{originalSessionRank}"
- LevelSession.update {_id: originalSessionID}, {isRanking: false}, {multi: false}, (err, affected) ->
- if err? then return errors.serverError res, "There was an error marking the completed session as not being ranked."
- sendResponseObject req, res, {"message":"The scores were updated successfully, person lost so no more games are being inserted!"}
+fetchLevelSession = (callback) ->
+ findParameters =
+ _id: @clientResponseObject.originalSessionID
+ query = LevelSession
+ .findOne(findParameters)
+ .lean()
+ query.exec (err, session) =>
+ @levelSession = session
+ log.info "Fetched level session"
+ callback err
-determineIfSessionShouldContinueAndUpdateLog = (sessionID, sessionRank, cb) ->
+checkSubmissionDate = (callback) ->
+ supposedSubmissionDate = new Date(@clientResponseObject.sessions[0].submitDate)
+ if Number(supposedSubmissionDate) isnt Number(@levelSession.submitDate)
+ callback "The game has been resubmitted. Removing from queue..."
+ else
+ log.info "Checked submission date"
+ callback null
+
+logTaskComputation = (callback) ->
+ @taskLog.set('calculationTimeMS',@clientResponseObject.calculationTimeMS)
+ @taskLog.set('sessions')
+ @taskLog.calculationTimeMS = @clientResponseObject.calculationTimeMS
+ @taskLog.sessions = @clientResponseObject.sessions
+ @taskLog.save (err, saved) ->
+ log.info "Logged task computation"
+ callback err
+
+updateSessions = (callback) ->
+ sessionIDs = _.pluck @clientResponseObject.sessions, 'sessionID'
+
+ async.map sessionIDs, retrieveOldSessionData, (err, oldScores) =>
+ if err? then callback err, {"error": "There was an error retrieving the old scores"}
+
+ oldScoreArray = _.toArray putRankingFromMetricsIntoScoreObject @clientResponseObject, oldScores
+ newScoreArray = bayes.updatePlayerSkills oldScoreArray
+ saveNewScoresToDatabase newScoreArray, callback
+
+
+saveNewScoresToDatabase = (newScoreArray, callback) ->
+ async.eachSeries newScoreArray, updateScoreInSession, (err) ->
+ log.info "Saved new scores to database"
+ callback err,newScoreArray
+
+
+updateScoreInSession = (scoreObject,callback) ->
+ LevelSession.findOne {"_id": scoreObject.id}, (err, session) ->
+ if err? then return callback err, null
+
+ session = session.toObject()
+ newTotalScore = scoreObject.meanStrength - 1.8 * scoreObject.standardDeviation
+ scoreHistoryAddition = [Date.now(), newTotalScore]
+ updateObject =
+ meanStrength: scoreObject.meanStrength
+ standardDeviation: scoreObject.standardDeviation
+ totalScore: newTotalScore
+ $push: {scoreHistory: {$each: [scoreHistoryAddition], $slice: -1000}}
+
+ LevelSession.update {"_id": scoreObject.id}, updateObject, callback
+ log.info "New total score for session #{scoreObject.id} is #{updateObject.totalScore}"
+
+indexNewScoreArray = (newScoreArray, callback) ->
+ newScoresObject = _.indexBy newScoreArray, 'id'
+ @newScoresObject = newScoresObject
+ callback null, newScoresObject
+
+addMatchToSessions = (newScoreObject, callback) ->
+ matchObject = {}
+ matchObject.date = new Date()
+ matchObject.opponents = {}
+ for session in @clientResponseObject.sessions
+ sessionID = session.sessionID
+ matchObject.opponents[sessionID] = {}
+ matchObject.opponents[sessionID].sessionID = sessionID
+ matchObject.opponents[sessionID].userID = session.creator
+ matchObject.opponents[sessionID].metrics = {}
+ matchObject.opponents[sessionID].metrics.rank = Number(newScoreObject[sessionID].gameRanking)
+
+ log.info "Match object computed, result: #{matchObject}"
+ log.info "Writing match object to database..."
+ #use bind with async to do the writes
+ sessionIDs = _.pluck @clientResponseObject.sessions, 'sessionID'
+ async.each sessionIDs, updateMatchesInSession.bind(@,matchObject), (err) -> callback err
+
+updateMatchesInSession = (matchObject, sessionID, callback) ->
+ currentMatchObject = {}
+ currentMatchObject.date = matchObject.date
+ currentMatchObject.metrics = matchObject.opponents[sessionID].metrics
+ opponentsClone = _.cloneDeep matchObject.opponents
+ opponentsClone = _.omit opponentsClone, sessionID
+ opponentsArray = _.toArray opponentsClone
+ currentMatchObject.opponents = opponentsArray
+
+ sessionUpdateObject =
+ $push: {matches: {$each: [currentMatchObject], $slice: -200}}
+ log.info "Updating session #{sessionID}"
+ LevelSession.update {"_id":sessionID}, sessionUpdateObject, callback
+
+updateUserSimulationCounts = (reqUserID,callback) ->
+ incrementUserSimulationCount reqUserID, 'simulatedBy', (err) =>
+ if err? then return callback err
+ incrementUserSimulationCount @levelSession.creator, 'simulatedFor', callback
+
+incrementUserSimulationCount = (userID, type, callback) =>
+ inc = {}
+ inc[type] = 1
+ User.update {_id: userID}, {$inc: inc}, (err, affected) ->
+ log.error "Error incrementing #{type} for #{userID}: #{err}" if err
+ callback err
+
+determineIfSessionShouldContinueAndUpdateLog = (cb) ->
+ sessionID = @clientResponseObject.originalSessionID
+ sessionRank = parseInt @clientResponseObject.originalSessionRank
+
queryParameters =
_id: sessionID
@@ -394,18 +492,26 @@ determineIfSessionShouldContinueAndUpdateLog = (sessionID, sessionRank, cb) ->
totalNumberOfGamesPlayed = updatedSession.numberOfWinsAndTies + updatedSession.numberOfLosses
if totalNumberOfGamesPlayed < 10
console.log "Number of games played is less than 10, continuing..."
- cb null, true
+ cb null
else
ratio = (updatedSession.numberOfLosses) / (totalNumberOfGamesPlayed)
if ratio > 0.33
- cb null, false
+ cb "shouldn't continue"
console.log "Ratio(#{ratio}) is bad, ending simulation"
else
console.log "Ratio(#{ratio}) is good, so continuing simulations"
- cb null, true
+ cb null
-findNearestBetterSessionID = (levelOriginalID, levelMajorVersion, sessionID, sessionTotalScore, opponentSessionTotalScore, opponentSessionID, opposingTeam, cb) ->
+findNearestBetterSessionID = (cb) ->
+ levelOriginalID = @levelSession.level.original
+ levelMajorVersion = @levelSession.level.majorVersion
+ sessionID = @clientResponseObject.originalSessionID
+ sessionTotalScore = @newScoresObject[sessionID].totalScore
+ opponentSessionID = _.pull(_.keys(@newScoresObject), sessionID)
+ opponentSessionTotalScore = @newScoresObject[opponentSessionID].totalScore
+ opposingTeam = calculateOpposingTeam(@clientResponseObject.originalSessionTeam)
+
retrieveAllOpponentSessionIDs sessionID, (err, opponentSessionIDs) ->
if err? then return cb err, null
@@ -434,23 +540,23 @@ findNearestBetterSessionID = (levelOriginalID, levelMajorVersion, sessionID, ses
selectString = '_id totalScore'
query = LevelSession.findOne(queryParameters)
- .sort(sortParameters)
- .limit(limitNumber)
- .select(selectString)
- .lean()
+ .sort(sortParameters)
+ .limit(limitNumber)
+ .select(selectString)
+ .lean()
console.log "Finding session with score near #{opponentSessionTotalScore}"
query.exec (err, session) ->
if err? then return cb err, session
- unless session then return cb err, null
+ unless session then return cb "no session was found"
console.log "Found session with score #{session.totalScore}"
cb err, session._id
retrieveAllOpponentSessionIDs = (sessionID, cb) ->
query = LevelSession.findOne({"_id":sessionID})
- .select('matches.opponents.sessionID matches.date submitDate')
- .lean()
+ .select('matches.opponents.sessionID matches.date submitDate')
+ .lean()
query.exec (err, session) ->
if err? then return cb err, null
opponentSessionIDs = (match.opponents[0].sessionID for match in session.matches when match.date > session.submitDate)
@@ -462,56 +568,15 @@ calculateOpposingTeam = (sessionTeam) ->
opposingTeams = _.pull teams, sessionTeam
return opposingTeams[0]
-incrementUserSimulationCount = (userID, type) ->
- inc = {}
- inc[type] = 1
- User.update {_id: userID}, {$inc: inc}, (err, affected) ->
- log.error "Error incrementing #{type} for #{userID}: #{err}" if err
-
-
-addMatchToSessions = (clientResponseObject, newScoreObject, callback) ->
- matchObject = {}
- matchObject.date = new Date()
- matchObject.opponents = {}
- for session in clientResponseObject.sessions
- sessionID = session.sessionID
- matchObject.opponents[sessionID] = {}
- matchObject.opponents[sessionID].sessionID = sessionID
- matchObject.opponents[sessionID].userID = session.creator
- matchObject.opponents[sessionID].metrics = {}
- matchObject.opponents[sessionID].metrics.rank = Number(newScoreObject[sessionID].gameRanking)
-
- log.info "Match object computed, result: #{matchObject}"
- log.info "Writing match object to database..."
- #use bind with async to do the writes
- sessionIDs = _.pluck clientResponseObject.sessions, 'sessionID'
- async.each sessionIDs, updateMatchesInSession.bind(@,matchObject), (err) -> callback err, null
-
-updateMatchesInSession = (matchObject, sessionID, callback) ->
- currentMatchObject = {}
- currentMatchObject.date = matchObject.date
- currentMatchObject.metrics = matchObject.opponents[sessionID].metrics
- opponentsClone = _.cloneDeep matchObject.opponents
- opponentsClone = _.omit opponentsClone, sessionID
- opponentsArray = _.toArray opponentsClone
- currentMatchObject.opponents = opponentsArray
-
- sessionUpdateObject =
- $push: {matches: {$each: [currentMatchObject], $slice: -200}}
- log.info "Updating session #{sessionID}"
- LevelSession.update {"_id":sessionID}, sessionUpdateObject, callback
-
+addNewSessionsToQueue = (sessionID, callback) ->
+ sessions = [@clientResponseObject.originalSessionID, sessionID]
+ addPairwiseTaskToQueue sessions, callback
messageIsInvalid = (message) -> (not message?) or message.isEmpty()
sendEachTaskPairToTheQueue = (taskPairs, callback) -> async.each taskPairs, sendTaskPairToQueue, callback
-
-
-
-
-
generateTaskPairs = (submittedSessions, sessionToScore) ->
taskPairs = []
for session in submittedSessions
@@ -532,10 +597,6 @@ isUserAnonymous = (req) -> if req.user? then return req.user.get('anonymous') el
isUserAdmin = (req) -> return Boolean(req.user?.isAdmin())
-
-
-
-
sendResponseObject = (req,res,object) ->
res.setHeader('Content-Type', 'application/json')
res.send(object)
@@ -545,51 +606,6 @@ hasTaskTimedOut = (taskSentTimestamp) -> taskSentTimestamp + scoringTaskTimeoutI
handleTimedOutTask = (req, res, taskBody) -> errors.clientTimeout res, "The results weren't provided within the timeout"
-verifyClientResponse = (responseObject, res) ->
- unless typeof responseObject is "object"
- errors.badInput res, "The response to that query is required to be a JSON object."
- null
- else
- responseObject
-
-logTaskComputation = (taskObject,taskLogObject, callback) ->
- taskLogObject.calculationTimeMS = taskObject.calculationTimeMS
- taskLogObject.sessions = taskObject.sessions
- taskLogObject.save callback
-
-
-updateSessions = (taskObject,callback) ->
- sessionIDs = _.pluck taskObject.sessions, 'sessionID'
-
- async.map sessionIDs, retrieveOldSessionData, (err, oldScores) ->
- if err? then callback err, {"error": "There was an error retrieving the old scores"}
-
- oldScoreArray = _.toArray putRankingFromMetricsIntoScoreObject taskObject, oldScores
- newScoreArray = bayes.updatePlayerSkills oldScoreArray
- saveNewScoresToDatabase newScoreArray, callback
-
-
-saveNewScoresToDatabase = (newScoreArray, callback) ->
- async.eachSeries newScoreArray, updateScoreInSession, (err) -> callback err,newScoreArray
-
-
-updateScoreInSession = (scoreObject,callback) ->
- LevelSession.findOne {"_id": scoreObject.id}, (err, session) ->
- if err? then return callback err, null
-
- session = session.toObject()
- newTotalScore = scoreObject.meanStrength - 1.8 * scoreObject.standardDeviation
- scoreHistoryAddition = [Date.now(), newTotalScore]
- updateObject =
- meanStrength: scoreObject.meanStrength
- standardDeviation: scoreObject.standardDeviation
- totalScore: newTotalScore
- $push: {scoreHistory: {$each: [scoreHistoryAddition], $slice: -1000}}
-
- LevelSession.update {"_id": scoreObject.id}, updateObject, callback
- log.info "New total score for session #{scoreObject.id} is #{updateObject.totalScore}"
-
-
putRankingFromMetricsIntoScoreObject = (taskObject,scoreObject) ->
scoreObject = _.indexBy scoreObject, 'id'
scoreObject[session.sessionID].gameRanking = session.metrics.rank for session in taskObject.sessions
diff --git a/server/routes/auth.coffee b/server/routes/auth.coffee
index dcb8ea12a..76612e2e0 100644
--- a/server/routes/auth.coffee
+++ b/server/routes/auth.coffee
@@ -71,9 +71,7 @@ module.exports.setup = (app) ->
if req.user
sendSelf(req, res)
else
- user = new User({anonymous:true})
- user.set 'testGroupNumber', Math.floor(Math.random() * 256) # also in app/lib/auth
- user.set 'preferredLanguage', languages.languageCodeFromAcceptedLanguages req.acceptedLanguages
+ user = makeNewUser(req)
makeNext = (req, res) -> -> sendSelf(req, res)
next = makeNext(req, res)
loginUser(req, res, user, false, next)
@@ -84,21 +82,6 @@ module.exports.setup = (app) ->
res.send(UserHandler.formatEntity(req, req.user))
res.end()
- loginUser = (req, res, user, send=true, next=null) ->
- user.save((err) ->
- if err
- return @sendDatabaseError(res, err)
-
- req.logIn(user, (err) ->
- if err
- return @sendDatabaseError(res, err)
-
- if send
- return @sendSuccess(res, user)
- next() if next
- )
- )
-
app.post('/auth/logout', (req, res) ->
req.logout()
res.end()
@@ -155,6 +138,26 @@ module.exports.setup = (app) ->
res.send "Unsubscribed #{req.query.email} from all CodeCombat emails. Sorry to see you go! Account settings
"
res.end()
+module.exports.loginUser = loginUser = (req, res, user, send=true, next=null) ->
+ user.save((err) ->
+ if err
+ return @sendDatabaseError(res, err)
+
+ req.logIn(user, (err) ->
+ if err
+ return @sendDatabaseError(res, err)
+
+ if send
+ return @sendSuccess(res, user)
+ next() if next
+ )
+ )
+
+module.exports.makeNewUser = makeNewUser = (req) ->
+ user = new User({anonymous:true})
+ user.set 'testGroupNumber', Math.floor(Math.random() * 256) # also in app/lib/auth
+ user.set 'preferredLanguage', languages.languageCodeFromAcceptedLanguages req.acceptedLanguages
+
createMailOptions = (receiver, password) ->
# TODO: use email templates here
options =
@@ -163,4 +166,4 @@ createMailOptions = (receiver, password) ->
replyTo: config.mail.username
subject: "[CodeCombat] Password Reset"
text: "You can log into your account with: #{password}"
-#
+
diff --git a/server_setup.coffee b/server_setup.coffee
index e0a72f4dc..c06482a85 100644
--- a/server_setup.coffee
+++ b/server_setup.coffee
@@ -9,6 +9,8 @@ baseRoute = require './server/routes/base'
user = require './server/users/user_handler'
logging = require './server/commons/logging'
config = require './server_config'
+auth = require './server/routes/auth'
+UserHandler = require('./server/users/user_handler')
###Middleware setup functions implementation###
# 2014-03-03: Try not using this and see if it's still a problem
@@ -85,7 +87,19 @@ exports.setupMiddleware = (app) ->
setupFallbackRouteToIndex = (app) ->
app.all '*', (req, res) ->
- res.sendfile path.join(__dirname, 'public', 'index.html')
+ if req.user
+ sendMain(req, res)
+ else
+ user = auth.makeNewUser(req)
+ makeNext = (req, res) -> -> sendMain(req, res)
+ next = makeNext(req, res)
+ auth.loginUser(req, res, user, false, next)
+
+sendMain = (req, res) ->
+ fs.readFile path.join(__dirname, 'public', 'main.html'), 'utf8', (err,data) ->
+ # insert the user object directly into the html so the application can have it immediately
+ data = data.replace('"userObjectTag"', JSON.stringify(UserHandler.formatEntity(req, req.user)))
+ res.send data
setupFacebookCrossDomainCommunicationRoute = (app) ->
app.get '/channel.html', (req, res) ->