This commit is contained in:
Nick Winter 2015-10-22 06:41:59 -07:00
commit 0ca3bdc597
24 changed files with 353 additions and 340 deletions

Binary file not shown.

After

(image error) Size: 10 KiB

View file

@ -112,7 +112,7 @@ module.exports = class CocoRouter extends Backbone.Router
'multiplayer': go('MultiplayerView') 'multiplayer': go('MultiplayerView')
'play': go('play/CampaignView') 'play(/)': go('play/CampaignView') # extra slash is to get Facebook app to work
'play/ladder/:levelID/:leagueType/:leagueID': go('ladder/LadderView') 'play/ladder/:levelID/:leagueType/:leagueID': go('ladder/LadderView')
'play/ladder/:levelID': go('ladder/LadderView') 'play/ladder/:levelID': go('ladder/LadderView')
'play/ladder': go('ladder/MainLadderView') 'play/ladder': go('ladder/MainLadderView')
@ -131,11 +131,15 @@ module.exports = class CocoRouter extends Backbone.Router
#'user/:slugOrID/profile': go('user/JobProfileView') #'user/:slugOrID/profile': go('user/JobProfileView')
'user/:slugOrID/profile': go('EmployersView') # Show the not-recruiting-now screen 'user/:slugOrID/profile': go('EmployersView') # Show the not-recruiting-now screen
'*name/': 'removeTrailingSlash'
'*name': go('NotFoundView') '*name': go('NotFoundView')
routeToServer: (e) -> routeToServer: (e) ->
window.location.href = window.location.href window.location.href = window.location.href
removeTrailingSlash: (e) ->
@navigate e, {trigger: true}
routeDirectly: (path, args) -> routeDirectly: (path, args) ->
path = "views/#{path}" if not _.string.startsWith(path, 'views/') path = "views/#{path}" if not _.string.startsWith(path, 'views/')
ViewClass = @tryToLoadModule path ViewClass = @tryToLoadModule path

View file

@ -13,6 +13,7 @@ module.exports.createAetherOptions = (options) ->
skipDuplicateUserInfoInFlow: true # Optimization that won't work if we are stepping with frames skipDuplicateUserInfoInFlow: true # Optimization that won't work if we are stepping with frames
yieldConditionally: options.functionName is 'plan' yieldConditionally: options.functionName is 'plan'
simpleLoops: true simpleLoops: true
whileTrueAutoYield: true
globals: ['Vector', '_'] globals: ['Vector', '_']
problems: problems:
jshint_W040: {level: 'ignore'} jshint_W040: {level: 'ignore'}

View file

@ -7,7 +7,7 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# old_browser: "Uh oh, your browser is too old to run CodeCombat. Sorry!" # Warning that shows up on really old Firefox/Chrome/Safari # old_browser: "Uh oh, your browser is too old to run CodeCombat. Sorry!" # Warning that shows up on really old Firefox/Chrome/Safari
# old_browser_suffix: "You can try anyway, but it probably won't work." # old_browser_suffix: "You can try anyway, but it probably won't work."
# ipad_browser: "Bad news: CodeCombat doesn't run on iPad in the browser. Good news: our native iPad app is awaiting Apple approval." # ipad_browser: "Bad news: CodeCombat doesn't run on iPad in the browser. Good news: our native iPad app is awaiting Apple approval."
# campaign: "Campaign" campaign: "Kampanija"
for_beginners: "Naujokams" for_beginners: "Naujokams"
# multiplayer: "Multiplayer" # Not currently shown on home page # multiplayer: "Multiplayer" # Not currently shown on home page
# for_developers: "For Developers" # Not currently shown on home page. # for_developers: "For Developers" # Not currently shown on home page.
@ -22,11 +22,11 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
account: "Paskyra" account: "Paskyra"
profile: "Profilis" profile: "Profilis"
stats: "Statistika" stats: "Statistika"
# code: "Code" code: "Kodas"
# admin: "Admin" # Only shows up when you are an admin admin: "Administratorius" # Only shows up when you are an admin
home: "Pradžia" home: "Pradžia"
# contribute: "Contribute" contribute: "Prisidėti"
# legal: "Legal" legal: "Teisė"
about: "Apie" about: "Apie"
contact: "Kontaktai" contact: "Kontaktai"
twitter_follow: "Sekti Twitter" twitter_follow: "Sekti Twitter"
@ -59,8 +59,8 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
owned: "Turima" # For items you own owned: "Turima" # For items you own
locked: "Užrakinta" locked: "Užrakinta"
purchasable: "Perkamas" # For a hero you unlocked but haven't purchased purchasable: "Perkamas" # For a hero you unlocked but haven't purchased
# available: "Available" available: "Prieinama"
# skills_granted: "Skills Granted" # Property documentation details skills_granted: "Suteikti įgūdžiai" # Property documentation details
heroes: "Herojai" # Tooltip on hero shop button from /play heroes: "Herojai" # Tooltip on hero shop button from /play
achievements: "Pasiekimai" # Tooltip on achievement list button from /play achievements: "Pasiekimai" # Tooltip on achievement list button from /play
account: "Paskyra" # Tooltip on account button from /play account: "Paskyra" # Tooltip on account button from /play
@ -69,15 +69,15 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
next: "Kitas" # Go from choose hero to choose inventory before playing a level next: "Kitas" # Go from choose hero to choose inventory before playing a level
change_hero: "Keisti Herojų" # Go back from choose inventory to choose hero change_hero: "Keisti Herojų" # Go back from choose inventory to choose hero
choose_inventory: "Naudoti daiktus" choose_inventory: "Naudoti daiktus"
# buy_gems: "Buy Gems" buy_gems: "Pirkti Deimantus"
# subscription_required: "Subscription Required" # subscription_required: "Subscription Required"
# anonymous: "Anonymous Player" # anonymous: "Anonymous Player"
level_difficulty: "Sudėtingumas: " level_difficulty: "Sudėtingumas: "
campaign_beginner: "Naujoko kampanija" campaign_beginner: "Naujoko kampanija"
# awaiting_levels_adventurer_prefix: "We release new levels every week." awaiting_levels_adventurer_prefix: "Kiekvieną savaitę sukuriame naujus lygius."
# awaiting_levels_adventurer: "Sign up as an Adventurer" awaiting_levels_adventurer: "Prisijunk kaip Nuotykių Ieškotojas"
# awaiting_levels_adventurer_suffix: "to be the first to play new levels." awaiting_levels_adventurer_suffix: "kad pamatytum juos pirmas."
# adjust_volume: "Adjust volume" adjust_volume: "Reguliuoti garsą"
# campaign_multiplayer: "Multiplayer Arenas" # campaign_multiplayer: "Multiplayer Arenas"
# campaign_multiplayer_description: "... in which you code head-to-head against other players." # campaign_multiplayer_description: "... in which you code head-to-head against other players."
# campaign_old_multiplayer: "(Deprecated) Old Multiplayer Arenas" # campaign_old_multiplayer: "(Deprecated) Old Multiplayer Arenas"
@ -91,76 +91,76 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# placeholder: "email address" # placeholder: "email address"
# title: "Excellent Work, Apprentice" # title: "Excellent Work, Apprentice"
# login: login:
# sign_up: "Create Account" sign_up: "Sukurti paskyrą"
# log_in: "Log In" log_in: "Prisijungti"
# logging_in: "Logging In" logging_in: "Prisijungimas..."
# log_out: "Log Out" log_out: "Atsijungti"
# forgot_password: "Forgot your password?" forgot_password: "Pamiršote slaptažodį?"
# authenticate_gplus: "Authenticate G+" authenticate_gplus: "Prisijungti su G+"
# load_profile: "Load G+ Profile" load_profile: "Kraunamas G+ profilis"
# finishing: "Finishing" finishing: "Baiginėjama"
# sign_in_with_facebook: "Sign in with Facebook" sign_in_with_facebook: "Prisijungti su Facebook"
# sign_in_with_gplus: "Sign in with G+" sign_in_with_gplus: "Prisijungti su G+"
# signup_switch: "Want to create an account?" signup_switch: "Norite sukurti paskyrą?"
# signup: signup:
# email_announcements: "Receive announcements by email" email_announcements: "Gauti pranešimus elektroniniu paštu"
# creating: "Creating Account..." creating: "Kuriama paskyra..."
# sign_up: "Sign Up" sign_up: "Užsiregistruoti"
# log_in: "log in with password" log_in: "prisijungti slaptažodžio pagalba"
# social_signup: "Or, you can sign up through Facebook or G+:" social_signup: "Arba galite prisijungti Facebook arba G+:"
# required: "You need to log in before you can go that way." required: "PRieš tęsiant kelią turite prisijungti."
# login_switch: "Already have an account?" login_switch: "Jau turite paskyrą?"
# recover: # recover:
# recover_account_title: "Recover Account" # recover_account_title: "Recover Account"
# send_password: "Send Recovery Password" # send_password: "Send Recovery Password"
# recovery_sent: "Recovery email sent." # recovery_sent: "Recovery email sent."
# items: items:
# primary: "Primary" primary: "Pagrindiniai"
# secondary: "Secondary" secondary: "Pagalbiniai"
# armor: "Armor" armor: "Šarvai"
# accessories: "Accessories" accessories: "Priedai"
# misc: "Misc" misc: "Kiti"
# books: "Books" books: "Knygos"
common: common:
# back: "Back" # When used as an action verb, like "Navigate backward" back: "Atgal" # When used as an action verb, like "Navigate backward"
# continue: "Continue" # When used as an action verb, like "Continue forward" continue: "Tęsti" # When used as an action verb, like "Continue forward"
loading: "Loading..." loading: "Kraunama..."
# saving: "Saving..." saving: "Saugoma..."
# sending: "Sending..." sending: "Siunčiama..."
# send: "Send" send: "Siųsti"
# cancel: "Cancel" cancel: "Atšaukti"
# save: "Save" save: "Išsaugoti"
# publish: "Publish" publish: "Paskelbti"
# create: "Create" create: "Kurti"
# fork: "Fork" fork: "Išsišakojimas"
# play: "Play" # When used as an action verb, like "Play next level" play: "Žaisti" # When used as an action verb, like "Play next level"
# retry: "Retry" retry: "Pakartoti"
# actions: "Actions" actions: "Veiksmai"
# info: "Info" info: "Informacija"
# help: "Help" help: "Pagalba"
# watch: "Watch" # watch: "Watch"
# unwatch: "Unwatch" # unwatch: "Unwatch"
# submit_patch: "Submit Patch" # submit_patch: "Submit Patch"
# submit_changes: "Submit Changes" # submit_changes: "Submit Changes"
# save_changes: "Save Changes" # save_changes: "Save Changes"
# general: general:
# and: "and" and: "ir"
# name: "Name" name: "Vardas"
# date: "Date" date: "Data"
# body: "Body" # body: "Body"
# version: "Version" # version: "Version"
# pending: "Pending" # pending: "Pending"
# accepted: "Accepted" # accepted: "Accepted"
# rejected: "Rejected" # rejected: "Rejected"
# withdrawn: "Withdrawn" # withdrawn: "Withdrawn"
# accept: "Accept" accept: "Priimti"
# reject: "Reject" reject: "Atmesti"
# withdraw: "Withdraw" # withdraw: "Withdraw"
# submitter: "Submitter" # submitter: "Submitter"
# submitted: "Submitted" # submitted: "Submitted"
@ -176,131 +176,131 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# result: "Result" # result: "Result"
# results: "Results" # results: "Results"
# description: "Description" # description: "Description"
# or: "or" or: "arba"
# subject: "Subject" # subject: "Subject"
# email: "Email" # email: "Email"
# password: "Password" password: "Slaptažodis"
# message: "Message" # message: "Message"
# code: "Code" code: "Kodas"
# ladder: "Ladder" # ladder: "Ladder"
# when: "When" # when: "When"
# opponent: "Opponent" # opponent: "Opponent"
# rank: "Rank" rank: "Rangas"
# score: "Score" # score: "Score"
# win: "Win" win: "Pergalė"
# loss: "Loss" loss: "Pralaimėjimas"
# tie: "Tie" tie: "Lygiosios"
# easy: "Easy" easy: "Lengvas"
# medium: "Medium" medium: "Vidutinis"
# hard: "Hard" hard: "Sunkus"
# player: "Player" player: "Žaidėjas"
# player_level: "Level" # Like player level 5, not like level: Dungeons of Kithgard player_level: "Lygis" # Like player level 5, not like level: Dungeons of Kithgard
# warrior: "Warrior" warrior: "Karys"
# ranger: "Ranger" ranger: "Žvalgas"
# wizard: "Wizard" wizard: "Burtininkas"
# units: units:
# second: "second" second: "sekundė"
# seconds: "seconds" seconds: "sekundės"
# minute: "minute" minute: "minutė"
# minutes: "minutes" minutes: "minutės"
# hour: "hour" hour: "valanda"
# hours: "hours" hours: "hours"
# day: "day" day: "diena"
# days: "days" days: "dienos"
# week: "week" week: "savaitė"
# weeks: "weeks" weeks: "savaitės"
# month: "month" month: "mėnuo"
# months: "months" months: "mėnesiai"
# year: "year" year: "metai"
# years: "years" years: "metai"
# play_level: play_level:
# done: "Done" done: "Gerai"
# next_game: "Next game" next_game: "Kitas žaidimas"
# show_menu: "Show game menu" show_menu: "Parodyti žaidimo meniu"
# home: "Home" # Not used any more, will be removed soon. # home: "Home" # Not used any more, will be removed soon.
# level: "Level" # Like "Level: Dungeons of Kithgard" level: "Lygis" # Like "Level: Dungeons of Kithgard"
# skip: "Skip" skip: "Praleisti"
# game_menu: "Game Menu" game_menu: "Žaidimo meniu"
# guide: "Guide" guide: "Vedlys"
# restart: "Restart" restart: "Paleisti iš naujo"
# goals: "Goals" goals: "Tikslai"
# goal: "Goal" goal: "Tikslas"
# running: "Running..." running: "Leidžiama..."
# success: "Success!" success: "Sėkmingai!"
# incomplete: "Incomplete" incomplete: "Neužbaigta"
# timed_out: "Ran out of time" timed_out: "Laikas baigėsi"
# failing: "Failing" failing: "Nesėkmingai"
# action_timeline: "Action Timeline" # action_timeline: "Action Timeline"
# click_to_select: "Click on a unit to select it." # click_to_select: "Click on a unit to select it."
# control_bar_multiplayer: "Multiplayer" control_bar_multiplayer: "Žaidimas keliese"
# control_bar_join_game: "Join Game" control_bar_join_game: "Prisijungti prie žaidimo"
# reload: "Reload" reload: "Perkrauti"
# reload_title: "Reload All Code?" reload_title: "Perkrauti visą kodą?"
# reload_really: "Are you sure you want to reload this level back to the beginning?" reload_really: "Ar tikrai norite atsukti visą lygį į pradžią?"
# reload_confirm: "Reload All" reload_confirm: "Perkrauti viską"
# victory: "Victory" victory: "Pergalė"
# victory_title_prefix: "" # victory_title_prefix: ""
# victory_title_suffix: " Complete" victory_title_suffix: " baigta"
# victory_sign_up: "Sign Up to Save Progress" victory_sign_up: "Užsiregistruokite, kad išsaugotumėte pažangą"
# victory_sign_up_poke: "Want to save your code? Create a free account!" victory_sign_up_poke: "Norite išsaugoti savo kodą? Sukurkite paskyrą nemokamai!"
# victory_rate_the_level: "Rate the level: " # Only in old-style levels. # victory_rate_the_level: "Rate the level: " # Only in old-style levels.
# victory_return_to_ladder: "Return to Ladder" # victory_return_to_ladder: "Return to Ladder"
# victory_play_continue: "Continue" victory_play_continue: "Tęsti"
# victory_saving_progress: "Saving Progress" victory_saving_progress: "Išsaugoma pažanga"
# victory_go_home: "Go Home" victory_go_home: "Į Pradžią"
# victory_review: "Tell us more!" # victory_review: "Tell us more!"
# victory_review_placeholder: "How was the level?" victory_review_placeholder: "Ar Jums patiko lygis?"
# victory_hour_of_code_done: "Are You Done?" victory_hour_of_code_done: "Ar pabaigėte?"
# victory_hour_of_code_done_yes: "Yes, I'm finished with my Hour of Code™!" # victory_hour_of_code_done_yes: "Yes, I'm finished with my Hour of Code™!"
# victory_experience_gained: "XP Gained" victory_experience_gained: "Gauta XP"
# victory_gems_gained: "Gems Gained" victory_gems_gained: "Gauta Deimantų"
# victory_new_item: "New Item" victory_new_item: "Naujas Daiktas"
# victory_viking_code_school: "Holy smokes, that was a hard level you just beat! If you aren't already a software developer, you should be. You just got fast-tracked for acceptance with Viking Code School, where you can take your skills to the next level and become a professional web developer in 14 weeks." # victory_viking_code_school: "Holy smokes, that was a hard level you just beat! If you aren't already a software developer, you should be. You just got fast-tracked for acceptance with Viking Code School, where you can take your skills to the next level and become a professional web developer in 14 weeks."
# victory_become_a_viking: "Become a Viking" # victory_become_a_viking: "Become a Viking"
# victory_bloc: "Great work! Your skills are improving, and someone's taking notice. If you've considered becoming a software developer, this may be your lucky day. Bloc is an online bootcamp that pairs you 1-on-1 with an expert mentor who will help train you into a professional developer! By beating A Mayhem of Munchkins, you're now eligible for a $500 price reduction with the code: CCRULES" # victory_bloc: "Great work! Your skills are improving, and someone's taking notice. If you've considered becoming a software developer, this may be your lucky day. Bloc is an online bootcamp that pairs you 1-on-1 with an expert mentor who will help train you into a professional developer! By beating A Mayhem of Munchkins, you're now eligible for a $500 price reduction with the code: CCRULES"
# victory_bloc_cta: "Meet your mentor learn about Bloc" # victory_bloc_cta: "Meet your mentor learn about Bloc"
# guide_title: "Guide" guide_title: "Vedlys"
# tome_minion_spells: "Your Minions' Spells" # Only in old-style levels. # tome_minion_spells: "Your Minions' Spells" # Only in old-style levels.
# tome_read_only_spells: "Read-Only Spells" # Only in old-style levels. # tome_read_only_spells: "Read-Only Spells" # Only in old-style levels.
# tome_other_units: "Other Units" # Only in old-style levels. # tome_other_units: "Other Units" # Only in old-style levels.
# tome_cast_button_run: "Run" tome_cast_button_run: "Paleisti"
# tome_cast_button_running: "Running" tome_cast_button_running: "Leidžiama"
# tome_cast_button_ran: "Ran" tome_cast_button_ran: "Paleista"
# tome_submit_button: "Submit" tome_submit_button: "Pateikti"
# tome_reload_method: "Reload original code for this method" # Title text for individual method reload button. # tome_reload_method: "Reload original code for this method" # Title text for individual method reload button.
# tome_select_method: "Select a Method" tome_select_method: "Pasirinkti Metodą"
# tome_see_all_methods: "See all methods you can edit" # Title text for method list selector (shown when there are multiple programmable methods). tome_see_all_methods: "Visi metodai, kuriuos galite keisti" # Title text for method list selector (shown when there are multiple programmable methods).
# tome_select_a_thang: "Select Someone for " # tome_select_a_thang: "Select Someone for "
# tome_available_spells: "Available Spells" tome_available_spells: "Prieinami Kerai"
# tome_your_skills: "Your Skills" tome_your_skills: "Jūsų Įgūdžiai"
# tome_current_method: "Current Method" tome_current_method: "Vartojamas Metodas"
# hud_continue_short: "Continue" hud_continue_short: "Tęsti"
# code_saved: "Code Saved" code_saved: "Kodas išsaugotas"
# skip_tutorial: "Skip (esc)" skip_tutorial: "Praleisti (ESC)"
# keyboard_shortcuts: "Key Shortcuts" keyboard_shortcuts: "Mygtukai"
# loading_ready: "Ready!" loading_ready: "Pirmyn!"
# loading_start: "Start Level" loading_start: "Pradėti lygį"
# problem_alert_title: "Fix Your Code" problem_alert_title: "Taisyti kodą"
# time_current: "Now:" time_current: "Dabar:"
# time_total: "Max:" time_total: "Max:"
# time_goto: "Go to:" # time_goto: "Go to:"
# non_user_code_problem_title: "Unable to Load Level" non_user_code_problem_title: "Nepavyko pakrauti lygio"
# infinite_loop_title: "Infinite Loop Detected" infinite_loop_title: "Pastebėtas begalinis ciklas!"
# infinite_loop_description: "The initial code to build the world never finished running. It's probably either really slow or has an infinite loop. Or there might be a bug. You can either try running this code again or reset the code to the default state. If that doesn't fix it, please let us know." # infinite_loop_description: "The initial code to build the world never finished running. It's probably either really slow or has an infinite loop. Or there might be a bug. You can either try running this code again or reset the code to the default state. If that doesn't fix it, please let us know."
# check_dev_console: "You can also open the developer console to see what might be going wrong." # check_dev_console: "You can also open the developer console to see what might be going wrong."
# check_dev_console_link: "(instructions)" # check_dev_console_link: "(instructions)"
# infinite_loop_try_again: "Try Again" # infinite_loop_try_again: "Try Again"
# infinite_loop_reset_level: "Reset Level" # infinite_loop_reset_level: "Reset Level"
# infinite_loop_comment_out: "Comment Out My Code" # infinite_loop_comment_out: "Comment Out My Code"
# tip_toggle_play: "Toggle play/paused with Ctrl+P." tip_toggle_play: "Įjunkite ir išjunkite Pauzę spaudžiant Ctrl+P."
# tip_scrub_shortcut: "Use Ctrl+[ and Ctrl+] to rewind and fast-forward." tip_scrub_shortcut: "Naudokite Ctrl+[ ir Ctrl+] persukimui pirmyn ir atgal."
# tip_guide_exists: "Click the guide, inside game menu (at the top of the page), for useful info." tip_guide_exists: "Pasirinkite punktą Vedlys žaidimo meniu (puslapio viršuje), jame rasite naudingos informacijos."
# tip_open_source: "CodeCombat is 100% open source!" tip_open_source: "CodeCombat - 100% atviro kodo!"
# tip_tell_friends: "Enjoying CodeCombat? Tell your friends about us!" tip_tell_friends: "Jums patinka CodeCombat? Papasakokite savo draugams!"
# tip_beta_launch: "CodeCombat launched its beta in October, 2013." # tip_beta_launch: "CodeCombat launched its beta in October, 2013."
# tip_think_solution: "Think of the solution, not the problem." tip_think_solution: "Galvok ne apie problemą, o apie sprendimą."
# tip_theory_practice: "In theory, there is no difference between theory and practice. But in practice, there is. - Yogi Berra" # 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_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_debugging_program: "If debugging is the process of removing bugs, then programming must be the process of putting them in. - Edsger W. Dijkstra"
@ -345,22 +345,22 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# tip_paper_and_pen: "Before you start coding, you can always plan with a sheet of paper and a pen." # tip_paper_and_pen: "Before you start coding, you can always plan with a sheet of paper and a pen."
# solve_then_write: "First, solve the problem. Then, write the code. - John Johnson" # solve_then_write: "First, solve the problem. Then, write the code. - John Johnson"
# game_menu: game_menu:
# inventory_tab: "Inventory" inventory_tab: "Inventorius"
# save_load_tab: "Save/Load" save_load_tab: "Įrašyti / Atkurti"
# options_tab: "Options" options_tab: "Pasirinkimai"
# guide_tab: "Guide" guide_tab: "Vedlys"
# guide_video_tutorial: "Video Tutorial" guide_video_tutorial: "Video vadovėlis"
# guide_tips: "Tips" guide_tips: "Patarimai"
# multiplayer_tab: "Multiplayer" multiplayer_tab: "Žaidimas keliese"
# auth_tab: "Sign Up" auth_tab: "Registruotis"
# inventory_caption: "Equip your hero" inventory_caption: "Parenk savo herojų"
# choose_hero_caption: "Choose hero, language" choose_hero_caption: "Pasirink herijų, kalbo"
# save_load_caption: "... and view history" save_load_caption: "... ir peržiūrėk istoriją"
# options_caption: "Configure settings" options_caption: "Konfigūruoti nustatymus"
# guide_caption: "Docs and tips" guide_caption: "Dokumentai ir patarimai"
# multiplayer_caption: "Play with friends!" multiplayer_caption: "Žaisk su draugais!"
# auth_caption: "Save your progress." auth_caption: "Išsaugok savo pažangą."
# leaderboard: # leaderboard:
# leaderboard: "Leaderboard" # leaderboard: "Leaderboard"
@ -376,18 +376,18 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# difficulty: "Difficulty" # difficulty: "Difficulty"
# gold_collected: "Gold Collected" # gold_collected: "Gold Collected"
# inventory: inventory:
# choose_inventory: "Equip Items" choose_inventory: "Naudoti daiktus"
# equipped_item: "Equipped" equipped_item: "Naudojama"
# required_purchase_title: "Required" required_purchase_title: "Reikalaujama"
# available_item: "Available" available_item: "Prieinama"
# restricted_title: "Restricted" restricted_title: "Uždrausta"
# should_equip: "(double-click to equip)" should_equip: "(double-click kad naudotum)"
# equipped: "(equipped)" equipped: "(naudojama)"
# locked: "(locked)" locked: "(užrakinta)"
# restricted: "(restricted in this level)" restricted: "(uždrausta šiame lygyje)"
# equip: "Equip" equip: "Naudoti"
# unequip: "Unequip" unequip: "Nenaudoti"
# buy_gems: # buy_gems:
# few_gems: "A few gems" # few_gems: "A few gems"
@ -489,43 +489,43 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# subscribe_prepaid: "Click Subscribe to use prepaid code" # subscribe_prepaid: "Click Subscribe to use prepaid code"
# using_prepaid: "Using prepaid code for monthly subscription" # using_prepaid: "Using prepaid code for monthly subscription"
# choose_hero: choose_hero:
# choose_hero: "Choose Your Hero" choose_hero: "Pasirink Herojų"
# programming_language: "Programming Language" programming_language: "Programavimo kalba"
# programming_language_description: "Which programming language do you want to use?" programming_language_description: "Kokią programavimo kalbą norėtum naudoti?"
# default: "Default" default: "Numatytasis"
# experimental: "Experimental" # experimental: "Experimental"
# python_blurb: "Simple yet powerful, great for beginners and experts." python_blurb: "Paprasta bet galinga. Puikiai tinka ir naujokams ir ekspertams."
# javascript_blurb: "The language of the web. (Not the same as Java.)" javascript_blurb: "WWW tinklo kalba. (Nepainiokite su Java.)"
# coffeescript_blurb: "Nicer JavaScript syntax." coffeescript_blurb: "JavaScript su malonesne sintakse."
# clojure_blurb: "A modern Lisp." clojure_blurb: "Šiolaikinis Lisp."
# lua_blurb: "Game scripting language." lua_blurb: "Žaidimų skriptų kalba."
# io_blurb: "Simple but obscure." # io_blurb: "Simple but obscure."
# status: "Status" # status: "Status"
# hero_type: "Type" hero_type: "Klasė"
# weapons: "Weapons" weapons: "Ginklai"
# weapons_warrior: "Swords - Short Range, No Magic" weapons_warrior: "Kardai - artimas atstumas, be Kerų"
# weapons_ranger: "Crossbows, Guns - Long Range, No Magic" weapons_ranger: "Arbaletai, Šautuvai - tolimas atstumas, be Kerų"
# weapons_wizard: "Wands, Staffs - Long Range, Magic" weapons_wizard: "stebuklų lazdelės ir skipetrai - tolimas atstumas, magija"
# attack: "Damage" # Can also translate as "Attack" attack: "Žala" # Can also translate as "Attack"
# health: "Health" health: "Sveikata"
# speed: "Speed" speed: "Greitis"
# regeneration: "Regeneration" regeneration: "Atsistatymas"
# range: "Range" # As in "attack or visual range" range: "Nuotolis" # As in "attack or visual range"
# blocks: "Blocks" # As in "this shield blocks this much damage" blocks: "Blokuoja" # As in "this shield blocks this much damage"
# backstab: "Backstab" # As in "this dagger does this much backstab damage" backstab: "Slaptasis smūgis" # As in "this dagger does this much backstab damage"
# skills: "Skills" skills: "Įgūdžiai"
# attack_1: "Deals" attack_1: "Padaro"
# attack_2: "of listed" attack_2: "įvardinto"
# attack_3: "weapon damage." attack_3: "ginklo žalos."
# health_1: "Gains" health_1: "Gauna"
# health_2: "of listed" health_2: "įvardintų"
# health_3: "armor health." health_3: "šarvų sveikatos taškų."
# speed_1: "Moves at" speed_1: "Juda"
# speed_2: "meters per second." speed_2: "metrų per sekundę greičiu."
# available_for_purchase: "Available for Purchase" # Shows up when you have unlocked, but not purchased, a hero in the hero store available_for_purchase: "Galima pirkti" # Shows up when you have unlocked, but not purchased, a hero in the hero store
# level_to_unlock: "Level to unlock:" # Label for which level you have to beat to unlock a particular hero (click a locked hero in the store to see) level_to_unlock: "Atrakinama lygyje:" # Label for which level you have to beat to unlock a particular hero (click a locked hero in the store to see)
# restricted_to_certain_heroes: "Only certain heroes can play this level." restricted_to_certain_heroes: "Tik kai kurie herojai gali žaisti šiame lygyje."
# skill_docs: # skill_docs:
# writable: "writable" # Hover over "attack" in Your Skills while playing a level to see most of this # writable: "writable" # Hover over "attack" in Your Skills while playing a level to see most of this
@ -755,25 +755,25 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# sample_profile: "See a sample profile" # sample_profile: "See a sample profile"
# view_profile: "View Your Profile" # view_profile: "View Your Profile"
# keyboard_shortcuts: keyboard_shortcuts:
# keyboard_shortcuts: "Keyboard Shortcuts" keyboard_shortcuts: "Mygtukai"
# space: "Space" space: "Tarpas"
# enter: "Enter" enter: "Enter"
# press_enter: "press enter" press_enter: "paspauskite enter"
# escape: "Escape" escape: "Escape"
# shift: "Shift" shift: "Shift"
# run_code: "Run current code." run_code: "Paleisti programos kodą."
# run_real_time: "Run in real time." run_real_time: "Paleisti realiuoju laiku."
# continue_script: "Continue past current script." # continue_script: "Continue past current script."
# skip_scripts: "Skip past all skippable scripts." # skip_scripts: "Skip past all skippable scripts."
# toggle_playback: "Toggle play/pause." toggle_playback: "Pauzė/Paleisti."
# scrub_playback: "Scrub back and forward through time." # scrub_playback: "Scrub back and forward through time."
# single_scrub_playback: "Scrub back and forward through time by a single frame." # single_scrub_playback: "Scrub back and forward through time by a single frame."
# scrub_execution: "Scrub through current spell execution." # scrub_execution: "Scrub through current spell execution."
# toggle_debug: "Toggle debug display." # toggle_debug: "Toggle debug display."
# toggle_grid: "Toggle grid overlay." toggle_grid: "Įjungti tinklelį."
# toggle_pathfinding: "Toggle pathfinding overlay." # toggle_pathfinding: "Toggle pathfinding overlay."
# beautify: "Beautify your code by standardizing its formatting." beautify: "Tvarkyti Jūsų kodą standartizuojant jo formatą."
# maximize_editor: "Maximize/minimize code editor." # maximize_editor: "Maximize/minimize code editor."
# community: # community:
@ -1319,30 +1319,30 @@ module.exports = nativeDescription: "lietuvių kalba", englishDescription: "Lith
# poll: "Poll" # poll: "Poll"
# user_polls_record: "Poll Voting History" # user_polls_record: "Poll Voting History"
# concepts: concepts:
# advanced_strings: "Advanced Strings" # advanced_strings: "Advanced Strings"
# algorithms: "Algorithms" algorithms: "Algoritmai (Algorithms)"
# arguments: "Arguments" arguments: "Argumentai (Arguments)"
# arithmetic: "Arithmetic" arithmetic: "Aritmetika (Arithmetic)"
# arrays: "Arrays" arrays: "Masyvai (Arrays)"
# basic_syntax: "Basic Syntax" basic_syntax: "Pagrindinė sintaksė (Basic Syntax)"
# boolean_logic: "Boolean Logic" boolean_logic: "Bulio logika (Boolean Logic)"
# break_statements: "Break Statements" # break_statements: "Break Statements"
# classes: "Classes" classes: "Klasės (Classes)"
# continue_statements: "Continue Statements" # continue_statements: "Continue Statements"
# for_loops: "For Loops" for_loops: "Ciklai 'For' (For Loops)"
# functions: "Functions" functions: "Funkcijos (Functions)"
# graphics: "Graphics" graphics: "Grafika (Graphics)"
# if_statements: "If Statements" # if_statements: "If Statements"
# input_handling: "Input Handling" input_handling: "Įvesties apdirbimas (Input Handling)"
# math_operations: "Math Operations" math_operations: "Matematiniai operatoriai )Math Operations)"
# object_literals: "Object Literals" # object_literals: "Object Literals"
# parameters: "Parameters" parameters: "Parametrai (Parameters)"
# strings: "Strings" strings: "Eilutės (Strings)"
# variables: "Variables" variables: "Kintamieji (Variables)"
# vectors: "Vectors" vectors: "Vektoriai (Vectors)"
# while_loops: "Loops" while_loops: "Ciklai (Loops)"
# recursion: "Recursion" recursion: "Rekursija (Recursion)"
# delta: # delta:
# added: "Added" # added: "Added"

View file

@ -4,10 +4,6 @@ module.exports =
'editor:campaign-analytics-modal-closed': c.object {title: 'Campaign editor analytics modal closed'}, 'editor:campaign-analytics-modal-closed': c.object {title: 'Campaign editor analytics modal closed'},
targetLevelSlug: {type: 'string'} targetLevelSlug: {type: 'string'}
'editor:save-new-version': c.object {title: 'Save New Version', description: 'Published when a version gets saved', required: ['major', 'commitMessage']},
major: {type: 'boolean'}
commitMessage: {type: 'string'}
'editor:view-switched': c.object {title: 'Level View Switched', description: 'Published whenever the view switches'}, 'editor:view-switched': c.object {title: 'Level View Switched', description: 'Published whenever the view switches'},
targetURL: {type: 'string'} targetURL: {type: 'string'}

View file

@ -1,3 +1,3 @@
#users, #months #users-input, #months-input
max-width: 100px max-width: 100px

View file

@ -14,6 +14,9 @@ h1, h2, h3, h4, h5, h6
a a
cursor: pointer cursor: pointer
iframe
border: none
.error .error
left: 8px left: 8px

View file

@ -172,3 +172,15 @@ block content
| Illustration | Illustration
p(data-i18n="about.retrostyle_blurb") p(data-i18n="about.retrostyle_blurb")
| RetroStyle Games | RetroStyle Games
li.row
a(href="http://basicer.com/")
img(src="/images/pages/about/rob_small.png").img-thumbnail
.team_bio
h4.team_name
a(href="http://basicer.com/") Rob Blanckaert
p(data-i18n="about.rob_title")
| Compiler Engineer
p(data-i18n="about.rob_blurb")
| Codes things and stuff.

View file

@ -15,7 +15,7 @@ else
- var godmode = me.get('permissions', true).indexOf('godmode') != -1; - var godmode = me.get('permissions', true).indexOf('godmode') != -1;
.form-group .form-group
label.control-label(for="name", data-i18n="general.name") Name label.control-label(for="name", data-i18n="general.name") Name
input#name.form-control(name="name", type="text", value="#{name}") input#name-input.form-control(name="name", type="text", value="#{name}")
.form-group .form-group
label.control-label(for="email", data-i18n="general.email") Email label.control-label(for="email", data-i18n="general.email") Email
input#email.form-control(name="email", type="text", value="#{email}") input#email.form-control(name="email", type="text", value="#{email}")
@ -31,7 +31,7 @@ else
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
.panel-title(data-i18n="account_settings.picture_tab") .panel-title(data-i18n="account_settings.picture_tab")
.panel-body #profile-photo-panel-body.panel-body
img.profile-photo(src=me.getPhotoURL(230), draggable="false") img.profile-photo(src=me.getPhotoURL(230), draggable="false")
input#photoURL(type="hidden", value=me.get('photoURL')||'') input#photoURL(type="hidden", value=me.get('photoURL')||'')
button#upload-photo-button.btn.form-control.btn-primary(data-i18n="account_settings.upload_picture") button#upload-photo-button.btn.form-control.btn-primary(data-i18n="account_settings.upload_picture")
@ -59,9 +59,11 @@ else
.form-group .form-group
label.control-label(for="password1", data-i18n="account_settings.type_in_password") label.control-label(for="password1", data-i18n="account_settings.type_in_password")
input#password1.form-control(name="password1", type="password") input#password1.form-control(name="password1", type="password")
button#delete-account-button.btn.form-control.btn-primary(data-i18n="account_settings.delete_this_account") button#delete-account-btn.btn.form-control.btn-primary(data-i18n="account_settings.delete_this_account")
.col-md-6 .col-md-6
- var subs = view.getEmailSubsDict();
#email-panel.panel.panel-default #email-panel.panel.panel-default
.panel-heading .panel-heading
@ -159,6 +161,6 @@ else
input#email_ambassadorNews(name="email_ambassadorNews", type="checkbox", checked=subs.ambassadorNews) input#email_ambassadorNews(name="email_ambassadorNews", type="checkbox", checked=subs.ambassadorNews)
span(data-i18n="contribute.ambassador_subscribe_desc").help-block Get emails on support updates and multiplayer developments. span(data-i18n="contribute.ambassador_subscribe_desc").help-block Get emails on support updates and multiplayer developments.
button#toggle-all-button.btn.btn-primary.form-control(data-i18n="account_settings.email_toggle") Toggle All button#toggle-all-btn.btn.btn-primary.form-control(data-i18n="account_settings.email_toggle") Toggle All
.clearfix .clearfix

View file

@ -10,7 +10,7 @@ block content
a(href="/account", data-i18n="nav.account") a(href="/account", data-i18n="nav.account")
li.active(data-i18n="account.payments") li.active(data-i18n="account.payments")
if payments.models.length if view.payments.models.length
table.table.table-striped table.table.table-striped
tr tr
th(data-i18n="account.purchased") th(data-i18n="account.purchased")
@ -18,7 +18,7 @@ block content
th(data-i18n="account.service") th(data-i18n="account.service")
th(data-i18n="account.price") th(data-i18n="account.price")
th(data-i18n="account.gems") th(data-i18n="account.gems")
for payment in payments.models for payment in view.payments.models
- var service = payment.get('service') - var service = payment.get('service')
tr tr
if payment.get('productID') if payment.get('productID')

View file

@ -30,17 +30,17 @@ block content
.form-group .form-group
label.control-label.col-md-2(for="users") Users label.control-label.col-md-2(for="users") Users
.col-md-2 .col-md-2
input#users.form-control(name="users", type="number", value="#{purchase.users}", min=1) input#users-input.form-control(name="users", type="number", value="#{purchase.users}", min=1)
.form-group .form-group
label.control-label.col-md-2(for="months") Months label.control-label.col-md-2(for="months") Months
.col-md-2 .col-md-2
input#months.form-control(name="months", type="number", value="#{purchase.months}", min=1) input#months-input.form-control(name="months", type="number", value="#{purchase.months}", min=1)
.form-group .form-group
label.control-label.col-md-2(data-i18n="account_prepaid.purchase_total") label.control-label.col-md-2(data-i18n="account_prepaid.purchase_total")
.col-md-10 .col-md-10
p.form-control-static $ p.form-control-static $
span#total #{purchase.total.toFixed(2)} span#total #{purchase.total.toFixed(2)}
button#purchase-button.btn.btn-success.pull-right(data-i18n="account_prepaid.purchase_button") button#purchase-btn.btn.btn-success.pull-right(data-i18n="account_prepaid.purchase_button")
.row .row
.col-md-12 .col-md-12
.panel.panel-default .panel.panel-default
@ -60,9 +60,9 @@ block content
!= info != info
p p
span.spr span.spr
button.btn.btn-info.btn-check-code Lookup prepaid code button#lookup-code-btn.btn.btn-info Lookup prepaid code
span span
button.btn.btn-success.btn-redeem-code Apply to your account button#redeem-code-btn.btn.btn-success Apply to your account
.row .row
.col-md-12 .col-md-12
.panel.panel-default .panel.panel-default

View file

@ -26,10 +26,10 @@ block outer_content
.alert.alert-danger.lt-ie9 .alert.alert-danger.lt-ie9
strong(data-i18n="home.no_ie") CodeCombat does not run in Internet Explorer 8 or older. Sorry! strong(data-i18n="home.no_ie") CodeCombat does not run in Internet Explorer 8 or older. Sorry!
if isIPadBrowser || isMobile if view.isIPadBrowser() || view.isMobile()
.alert.alert-danger.mobile .alert.alert-danger.mobile
strong(data-i18n="home.no_mobile") CodeCombat wasn't designed for mobile devices and may not work! strong(data-i18n="home.no_mobile") CodeCombat wasn't designed for mobile devices and may not work!
else if isOldBrowser else if view.isOldBrowser()
.alert.alert-danger.old-browser .alert.alert-danger.old-browser
strong(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry! strong(data-i18n="home.old_browser") Uh oh, your browser is too old to run CodeCombat. Sorry!
br br
@ -37,7 +37,7 @@ block outer_content
block extra_footer_content block extra_footer_content
if explainsHourOfCode if view.explainsHourOfCode
// Does not show up unless lang is en-US. // Does not show up unless lang is en-US.
div.hour-of-code-explanation div.hour-of-code-explanation
| The 'Hour of Code' is a nationwide initiative by | The 'Hour of Code' is a nationwide initiative by

View file

@ -6,7 +6,7 @@ module.exports = class HomeView extends RootView
template: template template: template
events: events:
'click #play-button': 'onClickBeginnerCampaign' 'click #play-button': 'onClickPlayButton'
constructor: -> constructor: ->
super() super()
@ -18,23 +18,7 @@ module.exports = class HomeView extends RootView
# Show the Hour of Code footer explanation in English until it's been more than a day # Show the Hour of Code footer explanation in English until it's been more than a day
@explainsHourOfCode = true @explainsHourOfCode = true
getRenderData: -> onClickPlayButton: (e) ->
c = super()
if $.browser
majorVersion = $.browser.versionNumber
c.isOldBrowser = true if $.browser.mozilla && majorVersion < 25
c.isOldBrowser = true if $.browser.chrome && majorVersion < 31 # Noticed Gems in the Deep not loading with 30
c.isOldBrowser = true if $.browser.safari && majorVersion < 6 # 6 might have problems with Aether, or maybe just old minors of 6: https://errorception.com/projects/51a79585ee207206390002a2/errors/547a202e1ead63ba4e4ac9fd
else
console.warn 'no more jquery browser version...'
c.isEnglish = _.string.startsWith (me.get('preferredLanguage') or 'en'), 'en'
c.languageName = me.get('preferredLanguage')
c.explainsHourOfCode = @explainsHourOfCode
c.isMobile = @isMobile()
c.isIPadBrowser = @isIPadBrowser()
c
onClickBeginnerCampaign: (e) ->
@playSound 'menu-button-click' @playSound 'menu-button-click'
e.preventDefault() e.preventDefault()
e.stopImmediatePropagation() e.stopImmediatePropagation()
@ -45,6 +29,16 @@ module.exports = class HomeView extends RootView
super(arguments...) super(arguments...)
@$el.addClass 'hour-of-code' if @explainsHourOfCode @$el.addClass 'hour-of-code' if @explainsHourOfCode
isOldBrowser: ->
if $.browser
majorVersion = $.browser.versionNumber
return true if $.browser.mozilla && majorVersion < 25
return true if $.browser.chrome && majorVersion < 31 # Noticed Gems in the Deep not loading with 30
return true if $.browser.safari && majorVersion < 6 # 6 might have problems with Aether, or maybe just old minors of 6: https://errorception.com/projects/51a79585ee207206390002a2/errors/547a202e1ead63ba4e4ac9fd
else
console.warn 'no more jquery browser version...'
return false
setUpHourOfCode: -> setUpHourOfCode: ->
# All this HoC stuff is for the 2014-2015 year. 2015-2016 year lands at /hoc instead (the courses view). # All this HoC stuff is for the 2014-2015 year. 2015-2016 year lands at /hoc instead (the courses view).
# TODO: get rid of all this sometime in November 2015 when code.org/learn updates to the new version for Hour of Code tutorials. # TODO: get rid of all this sometime in November 2015 when code.org/learn updates to the new version for Hour of Code tutorials.

View file

@ -13,12 +13,11 @@ module.exports = class AccountSettingsView extends CocoView
className: 'countainer-fluid' className: 'countainer-fluid'
events: events:
'change .panel input': 'onInputChanged' 'change .panel input': 'onChangePanelInput'
'change #name': 'checkNameExists' 'change #name-input': 'onChangeNameInput'
'click #toggle-all-button': 'toggleEmailSubscriptions' 'click #toggle-all-btn': 'onClickToggleAllButton'
'click .profile-photo': 'onEditProfilePhoto' 'click #profile-photo-panel-body': 'onClickProfilePhotoPanelBody'
'click #upload-photo-button': 'onEditProfilePhoto' 'click #delete-account-btn': 'onClickDeleteAccountButton'
'click #delete-account-button': 'confirmAccountDeletion'
constructor: (options) -> constructor: (options) ->
super options super options
@ -29,29 +28,27 @@ module.exports = class AccountSettingsView extends CocoView
super() super()
@openModalView new AuthModal() if me.get('anonymous') @openModalView new AuthModal() if me.get('anonymous')
getRenderData: -> getEmailSubsDict: ->
c = super() subs = {}
return c unless me return subs unless me
c.subs = {} subs[sub] = 1 for sub in me.getEnabledEmails()
c.subs[sub] = 1 for sub in me.getEnabledEmails() return subs
c
#- Form input callbacks #- Form input callbacks
onInputChanged: (e) -> onChangePanelInput: (e) ->
$(e.target).addClass 'changed' $(e.target).addClass 'changed'
if (JSON.stringify(document.getElementById('email1').className)).indexOf("changed") > -1 or (JSON.stringify(document.getElementById('password1').className)).indexOf("changed") > -1 if (JSON.stringify(document.getElementById('email1').className)).indexOf("changed") > -1 or (JSON.stringify(document.getElementById('password1').className)).indexOf("changed") > -1
$(e.target).removeClass 'changed' $(e.target).removeClass 'changed'
else else
@trigger 'input-changed' @trigger 'input-changed'
toggleEmailSubscriptions: => onClickToggleAllButton: ->
subs = @getSubscriptions() subs = @getSubscriptions()
$('#email-panel input[type="checkbox"]', @$el).prop('checked', not _.any(_.values(subs))).addClass('changed') $('#email-panel input[type="checkbox"]', @$el).prop('checked', not _.any(_.values(subs))).addClass('changed')
@trigger 'input-changed' @trigger 'input-changed'
checkNameExists: => onChangeNameInput: ->
name = $('#name', @$el).val() name = $('#name-input', @$el).val()
return if name is me.get 'name' return if name is me.get 'name'
User.getUnconflictedName name, (newName) => User.getUnconflictedName name, (newName) =>
forms.clearFormAlerts(@$el) forms.clearFormAlerts(@$el)
@ -67,7 +64,7 @@ module.exports = class AccountSettingsView extends CocoView
#- Just copied from OptionsView, TODO refactor #- Just copied from OptionsView, TODO refactor
confirmAccountDeletion: -> onClickDeleteAccountButton: ->
forms.clearFormAlerts(@$el) forms.clearFormAlerts(@$el)
myEmail = me.get 'email' myEmail = me.get 'email'
email1 = document.getElementById('email1').value email1 = document.getElementById('email1').value
@ -141,7 +138,7 @@ module.exports = class AccountSettingsView extends CocoView
layout: 'topCenter' layout: 'topCenter'
url: "/db/user/#{myID}" url: "/db/user/#{myID}"
onEditProfilePhoto: (e) -> onClickProfilePhotoPanelBody: (e) ->
return if window.application.isIPadApp # TODO: have an iPad-native way of uploading a photo, since we don't want to load FilePicker on iPad (memory) return if window.application.isIPadApp # TODO: have an iPad-native way of uploading a photo, since we don't want to load FilePicker on iPad (memory)
photoContainer = @$el.find('.profile-photo') photoContainer = @$el.find('.profile-photo')
onSaving = => onSaving = =>
@ -229,8 +226,8 @@ module.exports = class AccountSettingsView extends CocoView
$('.nano').nanoScroller({scrollTo: @$el.find('.has-error')}) $('.nano').nanoScroller({scrollTo: @$el.find('.has-error')})
grabOtherData: -> grabOtherData: ->
@$el.find('#name').val @suggestedName if @suggestedName @$el.find('#name-input').val @suggestedName if @suggestedName
me.set 'name', @$el.find('#name').val() me.set 'name', @$el.find('#name-input').val()
me.set 'email', @$el.find('#email').val() me.set 'email', @$el.find('#email').val()
for emailName, enabled of @getSubscriptions() for emailName, enabled of @getSubscriptions()
me.setEmailSubscription emailName, enabled me.setEmailSubscription emailName, enabled

View file

@ -11,8 +11,3 @@ module.exports = class PaymentsView extends RootView
super(options) super(options)
@payments = new CocoCollection([], { url: '/db/payment', model: Payment, comparator:'_id' }) @payments = new CocoCollection([], { url: '/db/payment', model: Payment, comparator:'_id' })
@supermodel.loadCollection(@payments, 'payments', {cache: false}) @supermodel.loadCollection(@payments, 'payments', {cache: false})
getRenderData: ->
c = super()
c.payments = @payments
c

View file

@ -16,12 +16,12 @@ module.exports = class PrepaidView extends RootView
className: 'container-fluid' className: 'container-fluid'
events: events:
'change #users': 'onUsersChanged' 'change #users-input': 'onChangeUsersInput'
'change #months': 'onMonthsChanged' 'change #months-input': 'onChangeMonthsInput'
'click #purchase-button': 'onPurchaseClicked' 'click #purchase-btn': 'onClickPurchaseButton'
'click #redeem-button': 'onRedeemClicked' 'click #redeem-btn': 'onClickRedeemButton' # DNE?
'click .btn-check-code': 'onClickCheckCode' 'click #lookup-code-btn': 'onClickLookupCodeButton'
'click .btn-redeem-code': 'onClickRedeemCode' 'click #redeem-code-btn': 'onClickRedeemCodeButton'
subscriptions: subscriptions:
'stripe:received-token': 'onStripeReceivedToken' 'stripe:received-token': 'onStripeReceivedToken'
@ -63,10 +63,10 @@ module.exports = class PrepaidView extends RootView
updateTotal: -> updateTotal: ->
@purchase.total = getPrepaidCodeAmount(@baseAmount, @purchase.users, @purchase.months) @purchase.total = getPrepaidCodeAmount(@baseAmount, @purchase.users, @purchase.months)
@renderSelectors("#total", "#users", "#months") @renderSelectors("#total", "#users-input", "#months-input")
# Form Input Callbacks # Form Input Callbacks
onUsersChanged: (e) -> onChangeUsersInput: (e) ->
newAmount = $(e.target).val() newAmount = $(e.target).val()
newAmount = 1 if newAmount < 1 newAmount = 1 if newAmount < 1
@purchase.users = newAmount @purchase.users = newAmount
@ -81,7 +81,7 @@ module.exports = class PrepaidView extends RootView
@updateTotal() @updateTotal()
onMonthsChanged: (e) -> onChangeMonthsInput: (e) ->
newAmount = $(e.target).val() newAmount = $(e.target).val()
newAmount = 1 if newAmount < 1 newAmount = 1 if newAmount < 1
@purchase.months = newAmount @purchase.months = newAmount
@ -96,8 +96,8 @@ module.exports = class PrepaidView extends RootView
@updateTotal() @updateTotal()
onPurchaseClicked: (e) -> onClickPurchaseButton: (e) ->
return unless $("#users").val() >= 3 or $("#months").val() >= 3 return unless $("#users-input").val() >= 3 or $("#months-input").val() >= 3
@purchaseTimestamp = new Date().getTime() @purchaseTimestamp = new Date().getTime()
@stripeAmount = @purchase.total * 100 @stripeAmount = @purchase.total * 100
@description = "Prepaid Code for " + @purchase.users + " users / " + @purchase.months + " months" @description = "Prepaid Code for " + @purchase.users + " users / " + @purchase.months + " months"
@ -108,7 +108,7 @@ module.exports = class PrepaidView extends RootView
bitcoin: true bitcoin: true
alipay: if me.get('country') is 'china' or (me.get('preferredLanguage') or 'en-US')[...2] is 'zh' then true else 'auto' alipay: if me.get('country') is 'china' or (me.get('preferredLanguage') or 'en-US')[...2] is 'zh' then true else 'auto'
onRedeemClicked: (e) -> onClickRedeemButton: (e) ->
@ppc = $('#ppc').val() @ppc = $('#ppc').val()
unless @ppc unless @ppc
@ -209,7 +209,7 @@ module.exports = class PrepaidView extends RootView
@prepaid = new Prepaid() @prepaid = new Prepaid()
@prepaid.fetch(options) @prepaid.fetch(options)
onClickCheckCode: (e) -> onClickLookupCodeButton: (e) ->
@ppc = $('.input-ppc').val() @ppc = $('.input-ppc').val()
unless @ppc unless @ppc
@statusMessage "You must enter a code.", "error" @statusMessage "You must enter a code.", "error"
@ -218,7 +218,7 @@ module.exports = class PrepaidView extends RootView
@render?() @render?()
@loadPrepaid(@ppc) @loadPrepaid(@ppc)
onClickRedeemCode: (e) -> onClickRedeemCodeButton: (e) ->
@ppc = $('.input-ppc').val() @ppc = $('.input-ppc').val()
options = options =
url: '/db/subscription/-/subscribe_prepaid' url: '/db/subscription/-/subscribe_prepaid'

View file

@ -16,9 +16,6 @@ module.exports = class ArticleEditView extends RootView
'click #history-button': 'showVersionHistory' 'click #history-button': 'showVersionHistory'
'click #save-button': 'openSaveModal' 'click #save-button': 'openSaveModal'
subscriptions:
'editor:save-new-version': 'saveNewArticle'
constructor: (options, @articleID) -> constructor: (options, @articleID) ->
super options super options
@article = new Article(_id: @articleID) @article = new Article(_id: @articleID)
@ -82,7 +79,10 @@ module.exports = class ArticleEditView extends RootView
return false return false
openSaveModal: -> openSaveModal: ->
@openModalView(new SaveVersionModal({model: @article})) modal = new SaveVersionModal({model: @article})
@openModalView(modal)
@listenToOnce modal, 'save-new-version', @saveNewArticle
@listenToOnce modal, 'hidden', -> @stopListening(modal)
saveNewArticle: (e) -> saveNewArticle: (e) ->
@treema.endExistingEdits() @treema.endExistingEdits()

View file

@ -45,7 +45,7 @@ module.exports = class SaveVersionModal extends ModalView
if @isPatch then @submitPatch() else @saveChanges() if @isPatch then @submitPatch() else @saveChanges()
saveChanges: -> saveChanges: ->
Backbone.Mediator.publish 'editor:save-new-version', { @trigger 'save-new-version', {
major: @$el.find('#major-version').prop('checked') major: @$el.find('#major-version').prop('checked')
commitMessage: @$el.find('#commit-message').val() commitMessage: @$el.find('#commit-message').val()
} }

View file

@ -167,7 +167,6 @@ module.exports = class ThangTypeEditView extends RootView
subscriptions: subscriptions:
'editor:thang-type-color-groups-changed': 'onColorGroupsChanged' 'editor:thang-type-color-groups-changed': 'onColorGroupsChanged'
'editor:save-new-version': 'saveNewThangType'
# init / render # init / render
@ -590,7 +589,10 @@ module.exports = class ThangTypeEditView extends RootView
_.delay((-> document.location.reload()), 500) _.delay((-> document.location.reload()), 500)
openSaveModal: -> openSaveModal: ->
@openModalView new SaveVersionModal model: @thangType modal = new SaveVersionModal model: @thangType
@openModalView modal
@listenToOnce modal, 'save-new-version', @saveNewThangType
@listenToOnce modal, 'hidden', -> @stopListening(modal)
startForking: (e) -> startForking: (e) ->
@openModalView new ForkModal model: @thangType, editorPath: 'thang' @openModalView new ForkModal model: @thangType, editorPath: 'thang'

View file

@ -152,7 +152,13 @@ module.exports = class Spell
skipProtectAPI = @skipProtectAPI or not writable skipProtectAPI = @skipProtectAPI or not writable
problemContext = @createProblemContext thang problemContext = @createProblemContext thang
includeFlow = (@levelType in ['hero', 'hero-ladder', 'hero-coop', 'course', 'course-ladder']) and not skipProtectAPI includeFlow = (@levelType in ['hero', 'hero-ladder', 'hero-coop', 'course', 'course-ladder']) and not skipProtectAPI
aetherOptions = createAetherOptions functionName: @name, codeLanguage: @language, functionParameters: @parameters, skipProtectAPI: skipProtectAPI, includeFlow: includeFlow, problemContext: problemContext aetherOptions = createAetherOptions
functionName: @name
codeLanguage: @language
functionParameters: @parameters
skipProtectAPI: skipProtectAPI
includeFlow: includeFlow
problemContext: problemContext
aether = new Aether aetherOptions aether = new Aether aetherOptions
if @worker if @worker
workerMessage = workerMessage =

View file

@ -121,7 +121,7 @@ module.exports = class LevelGuideView extends CocoView
tag.src = helpVideoURL + "?api=1&badge=0&byline=0&portrait=0&title=0" tag.src = helpVideoURL + "?api=1&badge=0&byline=0&portrait=0&title=0"
tag.height = @helpVideoHeight tag.height = @helpVideoHeight
tag.width = @helpVideoWidth tag.width = @helpVideoWidth
tag.frameborder = '0' tag.allowFullscreen = true
@$el.find('#help-video-player').replaceWith(tag) @$el.find('#help-video-player').replaceWith(tag)
@onMessageReceived = (e) => @onMessageReceived = (e) =>

View file

@ -43,6 +43,9 @@ exports.config =
watcher: watcher:
usePolling: true usePolling: true
server:
command: 'nodemon . --ext ".coffee|.js" --watch server --watch server_config.js --watch server_setup.coffee --watch app' + sysPath.sep + "schemas"
files: files:
javascripts: javascripts:
defaultExtension: 'coffee' defaultExtension: 'coffee'

View file

@ -32,7 +32,11 @@
"start": "node ./index.js", "start": "node ./index.js",
"test": "./node_modules/.bin/karma start", "test": "./node_modules/.bin/karma start",
"predeploy": "echo Starting deployment--hold onto your butts.; echo Skipping brunch build --production", "predeploy": "echo Starting deployment--hold onto your butts.; echo Skipping brunch build --production",
"postdeploy": "echo Deployed. Unclench." "postdeploy": "echo Deployed. Unclench.",
"postinstall": "bower install && brunch build",
"brunch": "brunch",
"bower": "bower",
"dev": "brunch watch --server"
}, },
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [
@ -83,7 +87,7 @@
"coffee-script-brunch": "https://github.com/brunch/coffee-script-brunch/tarball/master", "coffee-script-brunch": "https://github.com/brunch/coffee-script-brunch/tarball/master",
"coffeelint-brunch": "> 1.0 < 1.8", "coffeelint-brunch": "> 1.0 < 1.8",
"compressible": "~1.0.1", "compressible": "~1.0.1",
"commonjs-require-definition": "~0.2.0", "commonjs-require-definition": "0.2.0",
"css-brunch": "> 1.0 < 1.8", "css-brunch": "> 1.0 < 1.8",
"jade": "0.33.x", "jade": "0.33.x",
"jade-brunch": "> 1.0 < 1.8", "jade-brunch": "> 1.0 < 1.8",

View file

@ -128,11 +128,6 @@ setupRedirectMiddleware = (app) ->
nameOrID = req.path.split('/')[3] nameOrID = req.path.split('/')[3]
res.redirect 301, "/user/#{nameOrID}/profile" res.redirect 301, "/user/#{nameOrID}/profile"
setupTrailingSlashRemovingMiddleware = (app) ->
app.use (req, res, next) ->
# Remove trailing slashes except for in /file/.../ URLs, because those are treated as directory listings.
return res.redirect 301, req.url[...-1] if req.url.length > 1 and req.url.slice(-1) is '/' and not /\/file\//.test req.url
next()
exports.setupMiddleware = (app) -> exports.setupMiddleware = (app) ->
setupCountryRedirectMiddleware app, "china", "CN", "zh", "tokyo" setupCountryRedirectMiddleware app, "china", "CN", "zh", "tokyo"
@ -141,7 +136,6 @@ exports.setupMiddleware = (app) ->
setupExpressMiddleware app setupExpressMiddleware app
setupPassportMiddleware app setupPassportMiddleware app
setupOneSecondDelayMiddleware app setupOneSecondDelayMiddleware app
setupTrailingSlashRemovingMiddleware app
setupRedirectMiddleware app setupRedirectMiddleware app
setupErrorMiddleware app setupErrorMiddleware app
setupJavascript404s app setupJavascript404s app