From d361ab5809a81bb2280a44b28844e6b592eb76a9 Mon Sep 17 00:00:00 2001 From: barbuddha Date: Wed, 11 Jun 2014 09:56:15 +0400 Subject: [PATCH 01/21] Update ru.coffee --- app/locale/ru.coffee | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/locale/ru.coffee b/app/locale/ru.coffee index a50b1df39..31132122e 100644 --- a/app/locale/ru.coffee +++ b/app/locale/ru.coffee @@ -161,7 +161,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi autosave: "Настройки сохраняются автоматически" me_tab: "Я" picture_tab: "Аватар" -# upload_picture: "Upload a picture" + upload_picture: "Загрузить изображение" wizard_tab: "Волшебник" password_tab: "Пароль" emails_tab: "Email-адреса" @@ -175,9 +175,9 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi email_notifications: "Уведомления" # email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity." # email_any_notes: "Any Notifications" -# email_any_notes_description: "Disable to stop all activity notification emails." -# email_recruit_notes: "Job Opportunities" -# email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job." + email_any_notes_description: "Отключите, чтобы больше не получать извещения." + email_recruit_notes: "Возможности для работы" + email_recruit_notes_description: "Если вы действительно хорошо играете, то мы можем связаться с вами для предложения (лучшей) работы." contributor_emails: "Рассылки по классам участников" contribute_prefix: "Нам нужны люди, которые присоединятся к нашей команде! Зайдите на " contribute_page: "страницу участников," @@ -194,7 +194,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi account_profile: edit_settings: "Изменить настройки" -# done_editing_settings: "Done Editing" + done_editing_settings: "Завершить редактирование" profile_for_prefix: "Профиль для " profile_for_suffix: "" approved: "Одобрено" @@ -205,9 +205,9 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi # active: "Looking for interview offers now" # inactive: "Not looking for offers right now" # complete: "complete" -# next: "Next" -# next_city: "city?" -# next_country: "pick your country." + next: "Далее" + next_city: "Город?" + next_country: "Выберите вашу страну." # next_name: "name?" # next_short_description: "summarize yourself at a glance." # next_long_description: "describe the work you're looking for." @@ -320,7 +320,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi multiplayer: "Мультиплеер" restart: "Перезапустить" goals: "Цели" -# success: "Success!" + success: "Успешно!" # incomplete: "Incomplete" # timed_out: "Ran out of time" # failing: "Failing" @@ -345,7 +345,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi multiplayer_hint_label: "Подсказка: " multiplayer_hint: "кликните на ссылку, чтобы выделить её, затем нажмите ⌘-С или Ctrl-C, чтобы скопировать." multiplayer_coming_soon: "Больше возможностей мультиплеера на подходе!" -# multiplayer_sign_in_leaderboard: "Sign in or create an account and get your solution on the leaderboard." + multiplayer_sign_in_leaderboard: "Войдите или создайте аккаунт, чтобы ваше решение оказалось в таблице лидеров." guide_title: "Руководство" tome_minion_spells: "Заклинания ваших миньонов" tome_read_only_spells: "Заклинания только для чтения" @@ -362,9 +362,9 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi skip_tutorial: "Пропуск (Esc)" editor_config: "Настройки редактора" editor_config_title: "Настройки редактора" -# editor_config_level_language_label: "Language for This Level" + editor_config_level_language_label: "Язык для этого уровня" # editor_config_level_language_description: "Define the programming language for this particular level." -# editor_config_default_language_label: "Default Programming Language" + editor_config_default_language_label: "Язык по умолчанию" # editor_config_default_language_description: "Define the programming language you want to code in when starting new levels." editor_config_keybindings_label: "Сочетания клавиш" editor_config_keybindings_default: "По умолчанию (Ace)" @@ -375,7 +375,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi editor_config_indentguides_description: "Отображение вертикальных линий для лучшего обзора отступов." editor_config_behaviors_label: "Умное поведение" editor_config_behaviors_description: "Автозавершать квадратные, фигурные скобки и кавычки." -# keyboard_shortcuts: "Key Shortcuts" + keyboard_shortcuts: "Горячие клавиши" loading_ready: "Готово!" tip_insert_positions: "Shift+Клик по карте вставит координаты в редактор заклинаний." tip_toggle_play: "Переключайте воспроизведение/паузу комбинацией Ctrl+P." @@ -413,11 +413,11 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi infinite_loop_comment_out: "Закомментировать мой код" # keyboard_shortcuts: -# keyboard_shortcuts: "Keyboard Shortcuts" -# space: "Space" -# enter: "Enter" -# escape: "Escape" -# cast_spell: "Cast current spell." + keyboard_shortcuts: "Горячие клавиши" + space: "Пробел" + enter: "Enter" + escape: "Escape" + cast_spell: ".произнести текущее заклинание." # continue_script: "Continue past current script." # skip_scripts: "Skip past all skippable scripts." # toggle_playback: "Toggle play/pause." @@ -457,7 +457,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi thang_description: "Создавайте юнитов, определяйте их логику по умолчанию, графику и звук. В настоящий момент поддерживается импорт только векторной графики Flash." level_title: "Редактор уровней" level_description: "Включает в себя инструменты для написания сценариев, загрузки аудио и построения собственной логики для создания всевозможных уровней. Всё, что мы используем сами!" -# achievement_title: "Achievement Editor" + achievement_title: "Редактор достижений" got_questions: "Вопросы по использованию редакторов CodeCombat?" contact_us: "свяжитесь с нами!" hipchat_prefix: "Также вы можете найти нас в нашей" @@ -508,7 +508,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi article_search_title: "Искать статьи" thang_search_title: "Искать типы объектов" level_search_title: "Искать уровни" -# achievement_search_title: "Search Achievements" + achievement_search_title: "Искать достижения" read_only_warning2: "Примечание: вы не можете сохранять любые правки здесь, потому что вы не авторизованы." article: @@ -639,7 +639,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi introduction_desc_ending: "Мы надеемся, что вы присоединитесь к нашей команде!" introduction_desc_signature: "- Ник, Джордж, Скотт, Михаэль, Джереми и Глен" alert_account_message_intro: "Привет!" -# alert_account_message: "To subscribe for class emails, you'll need to be logged in first." + alert_account_message: "Чтобы подписаться за классовые сообщения, необходимо войти в аккаунт" archmage_summary: "Интересует работа над игровой графикой, дизайном пользовательского интерфейса, базой данных и организацией сервера, сетевым мультиплеером, физикой, звуком или производительностью игрового движка? Хотите помочь создать игру для помощи другим людям в изучении того, в чём вы хорошо разбираетесь? У нас много работы, и если вы опытный программист и хотите разрабатывать для CodeCombat, этот класс для вас. Мы будем рады вашей помощи в создании самой лучшей игры для программистов." archmage_introduction: "Одна из лучших черт в создании игр - то, что они синтезируют так много различных вещей. Графика, звук, сетевое взаимодействие в режиме реального времени, социальное сетевое взаимодействие, и, конечно, большинство из более распространённых аспектов программирования, от низкоуровневого управления базами данных и администрирования сервера до построения дизайна и интерфейсов, видимых пользователю. У нас много работы, и если вы опытный программист со страстным желанием погрузиться в действительно мельчайшие детали CodeCombat, этот класс для вас. Мы будем рады вашей помощи в создании самой лучшей игры для программистов." class_attributes: "Атрибуты класса" From a22a098fdc9b1292f909b5069551b0f8dcfa221d Mon Sep 17 00:00:00 2001 From: djsmith85 Date: Sat, 14 Jun 2014 14:02:42 +0200 Subject: [PATCH 02/21] Update de-DE.coffee --- app/locale/de-DE.coffee | 368 ++++++++++++++++++++-------------------- 1 file changed, 184 insertions(+), 184 deletions(-) diff --git a/app/locale/de-DE.coffee b/app/locale/de-DE.coffee index 2672111f6..b73d7240e 100644 --- a/app/locale/de-DE.coffee +++ b/app/locale/de-DE.coffee @@ -6,15 +6,15 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # send: "Send" cancel: "Abbrechen" save: "Speichern" -# publish: "Publish" -# create: "Create" + publish: "Publiziere" + create: "Erstelle" delay_1_sec: "1 Sekunde" delay_3_sec: "3 Sekunden" delay_5_sec: "5 Sekunden" manual: "Manuell" -# fork: "Fork" + fork: "Fork" play: "Abspielen" -# retry: "Retry" + retry: "Erneut versuchen" # watch: "Watch" # unwatch: "Unwatch" # submit_patch: "Submit Patch" @@ -26,14 +26,14 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: minutes: "Minuten" hour: "Stunde" hours: "Stunden" -# day: "day" -# days: "days" -# week: "week" -# weeks: "weeks" -# month: "month" -# months: "months" -# year: "year" -# years: "years" + day: "Tag" + days: "Tage" + week: "Woche" + weeks: "Wochen" + month: "Monat" + months: "Monate" + year: "Jahr" + years: "Jahre" modal: close: "Schließen" @@ -69,7 +69,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: login: sign_up: "Registrieren" log_in: "Einloggen" -# logging_in: "Logging In" + logging_in: "Logge ein" log_out: "Ausloggen" recover: "Account wiederherstellen" @@ -86,7 +86,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: creating: "Erzeuge Account..." sign_up: "Neuen Account anlegen" log_in: "mit Passwort einloggen" -# social_signup: "Or, you can sign up through Facebook or G+:" + social_signup: "oder, du registriest dich über Facebook oder G+:" # required: "You need to log in before you can go that way." home: @@ -128,7 +128,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: forum_page: "unser Forum" forum_suffix: "." send: "Sende Feedback" -# contact_candidate: "Contact Candidate" + contact_candidate: "Kontaktiere Kandidaten" # recruitment_reminder: "Use this form to reach out to candidates you are interested in interviewing. Remember that CodeCombat charges 15% of first-year salary. The fee is due upon hiring the employee and is refundable for 90 days if the employee does not remain employed. Part time, remote, and contract employees are free, as are interns." diplomat_suggestion: @@ -142,13 +142,13 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: wizard_settings: title: "Zauberer Einstellungen" customize_avatar: "Individualisiere deinen Avatar" -# active: "Active" -# color: "Color" -# group: "Group" + active: "Aktiv" + color: "Farbe" + group: "Gruppe" clothes: "Kleidung" trim: "Applikationen" cloud: "Wolke" -# team: "Team" + team: "Team" spell: "Zauber" boots: "Stiefel" hue: "Farbton" @@ -161,7 +161,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: autosave: "Sichere Änderungen automatisch" me_tab: "Ich" picture_tab: "Bild" -# upload_picture: "Upload a picture" + upload_picture: "Ein Bild hochladen" wizard_tab: "Zauberer" password_tab: "Passwort" emails_tab: "Emails" @@ -186,119 +186,119 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: error_saving: "Fehler beim Speichern" saved: "Änderungen gespeichert" password_mismatch: "Passwörter stimmen nicht überein." -# job_profile: "Job Profile" + job_profile: "Jobprofil" # job_profile_approved: "Your job profile has been approved by CodeCombat. Employers will be able to see it until you either mark it inactive or it has not been changed for four weeks." # job_profile_explanation: "Hi! Fill this out, and we will get in touch about finding you a software developer job." -# sample_profile: "See a sample profile" -# view_profile: "View Your Profile" + sample_profile: "Ein Beispielprofil ansehen" + view_profile: "Dein Profil ansehen" account_profile: -# settings: "Settings" -# edit_profile: "Edit Profile" + settings: "Einstellungen" + edit_profile: "Profil editieren" # done_editing: "Done Editing" profile_for_prefix: "Profil von " profile_for_suffix: "" # featured: "Featured" # not_featured: "Not Featured" # looking_for: "Looking for:" -# last_updated: "Last updated:" -# contact: "Contact" + last_updated: "zuletzt geändert:" + contact: "Kontakt" # active: "Looking for interview offers now" # inactive: "Not looking for offers right now" # complete: "complete" # next: "Next" -# next_city: "city?" -# next_country: "pick your country." -# next_name: "name?" + next_city: "Stadt?" + next_country: "Wähle dein Land." + next_name: "Name?" # next_short_description: "write a short description." # next_long_description: "describe your desired position." -# next_skills: "list at least five skills." + next_skills: "Liste mindestens fünf Fähigkeiten." # next_work: "chronicle your work history." # next_education: "recount your educational ordeals." -# next_projects: "show off up to three projects you've worked on." + next_projects: "Zeige bis zu 3 Projekte an denen du gearbeitet hast." # next_links: "add any personal or social links." -# next_photo: "add an optional professional photo." + next_photo: "Füge ein optionales professionelles Foto hinzu." # next_active: "mark yourself open to offers to show up in searches." -# example_blog: "Blog" -# example_personal_site: "Personal Site" -# links_header: "Personal Links" -# links_blurb: "Link any other sites or profiles you want to highlight, like your GitHub, your LinkedIn, or your blog." -# links_name: "Link Name" + example_blog: "Blog" + example_personal_site: "Persönliche Seite" + links_header: "Persönliche Links" + links_blurb: "Verlinke zu anderen Seiten oder Profilen die du hervorheben möchtest, wie z.B. dein GitHub, dein LinkedIn oder deinen Blog." + links_name: "Link-Name" # links_name_help: "What are you linking to?" -# links_link_blurb: "Link URL" + links_link_blurb: "Link URL" # basics_header: "Update basic info" # basics_active: "Open to Offers" # basics_active_help: "Want interview offers right now?" # basics_job_title: "Desired Job Title" # basics_job_title_help: "What role are you looking for?" -# basics_city: "City" -# basics_city_help: "City you want to work in (or live in now)." -# basics_country: "Country" -# basics_country_help: "Country you want to work in (or live in now)." + basics_city: "Stadt" + basics_city_help: "Stadt in der du arbeiten möchtest (oder jetzt lebst)." + basics_country: "Land" + basics_country_help: "Land in dem du arbeiten möchtest (oder jetzt lebst)." # basics_visa: "US Work Status" # basics_visa_help: "Are you authorized to work in the US, or do you need visa sponsorship?" # basics_looking_for: "Looking For" -# basics_looking_for_full_time: "Full-time" -# basics_looking_for_part_time: "Part-time" -# basics_looking_for_remote: "Remote" + basics_looking_for_full_time: "Vollzeit" + basics_looking_for_part_time: "Teilzeit" + basics_looking_for_remote: "Remote" # basics_looking_for_contracting: "Contracting" -# basics_looking_for_internship: "Internship" + basics_looking_for_internship: "Praktikum" # basics_looking_for_help: "What kind of developer position do you want?" -# name_header: "Fill in your name" -# name_anonymous: "Anonymous Developer" + name_header: "Trage deinen Namen ein" + name_anonymous: "Anonymer Entwickler" # name_help: "Name you want employers to see, like 'Nick Winter'." # short_description_header: "Write a short description of yourself" # short_description_blurb: "Add a tagline to help an employer quickly learn more about you." # short_description: "Tagline" # short_description_help: "Who are you, and what are you looking for? 140 characters max." -# skills_header: "Skills" +F skills_header: "Fähigkeiten" # skills_help: "Tag relevant developer skills in order of proficiency." -# long_description_header: "Describe your desired position" + long_description_header: "Beschreibe deine gewünschte Position" # long_description_blurb: "Tell employers how awesome you are and what role you want." # long_description: "Self Description" # long_description_help: "Describe yourself to potential employers. Keep it short and to the point. We recommend outlining the position that would most interest you. Tasteful markdown okay; 600 characters max." -# work_experience: "Work Experience" + work_experience: "Berufserfahrung" # work_header: "Chronicle your work history" # work_years: "Years of Experience" # work_years_help: "How many years of professional experience (getting paid) developing software do you have?" # work_blurb: "List your relevant work experience, most recent first." -# work_employer: "Employer" -# work_employer_help: "Name of your employer." + work_employer: "Arbeitgeber" + work_employer_help: "Name deines Arbeitgebers." # work_role: "Job Title" # work_role_help: "What was your job title or role?" # work_duration: "Duration" # work_duration_help: "When did you hold this gig?" -# work_description: "Description" -# work_description_help: "What did you do there? (140 chars; optional)" + work_description: "Beschreibung" + work_description_help: "Was hast du dort gemacht (140 Zeichen; optional)" # education: "Education" # education_header: "Recount your academic ordeals" # education_blurb: "List your academic ordeals." -# education_school: "School" -# education_school_help: "Name of your school." -# education_degree: "Degree" + education_school: "Schule" + education_school_help: "Name deiner Schule." + education_degree: "Abschluss" # education_degree_help: "What was your degree and field of study?" # education_duration: "Dates" -# education_duration_help: "When?" -# education_description: "Description" + education_duration_help: "Wann?" + education_description: "Beschreibung" # education_description_help: "Highlight anything about this educational experience. (140 chars; optional)" # our_notes: "Our Notes" -# projects: "Projects" -# projects_header: "Add 3 projects" -# projects_header_2: "Projects (Top 3)" + projects: "Projekte" + projects_header: "Füge 3 Projekte hinzu" + projects_header_2: "Projekte (Top 3)" # projects_blurb: "Highlight your projects to amaze employers." -# project_name: "Project Name" -# project_name_help: "What was the project called?" -# project_description: "Description" -# project_description_help: "Briefly describe the project." -# project_picture: "Picture" -# project_picture_help: "Upload a 230x115px or larger image showing off the project." -# project_link: "Link" -# project_link_help: "Link to the project." -# player_code: "Player Code" + project_name: "Projekt Name" + project_name_help: "Wie wurde das Projekt genannt?" + project_description: "Beschreibung" + project_description_help: "Beschreibe kurz das Projekt." + project_picture: "Bild" + project_picture_help: "Lade ein 230x115px oder größeres Bild hoch, welches das Projekt darstellt." + project_link: "Link" + project_link_help: "Verlinke zu dem Projekt." + player_code: "Spieler Code" -# employers: -# want_to_hire_our_players: "Hire CodeCombat Players" -# what: "What is CodeCombat?" + employers: + want_to_hire_our_players: "Stelle CodeCombat Spieler ein" + what: "Was ist CodeCombat?" # what_blurb: "CodeCombat is a multiplayer browser programming game. Players write code to control their forces in battle against other developers. We support JavaScript, Python, Lua, Clojure, CoffeeScript, and Io." # who: "Who Are the Players?" # who_blurb: "CodeCombateers are software developers who enjoy using their programming skills to play games. They range from college seniors at top 20 engineering programs to 20-year industry veterans." @@ -313,10 +313,10 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # why_blurb_6: "personally screened by us" # why_blurb_7: ". Stop screening and start hiring." # see_candidates: "Click here to see our candidates" -# candidate_name: "Name" + candidate_name: "Name" # candidate_location: "Location" # candidate_looking_for: "Looking For" -# candidate_role: "Role" + candidate_role: "Rolle" # candidate_top_skills: "Top Skills" # candidate_years_experience: "Yrs Exp" # candidate_last_updated: "Last Updated" @@ -375,10 +375,10 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: skip_tutorial: "Überspringen (Esc)" editor_config: "Editor Einstellungen" editor_config_title: "Editor Einstellungen" -# editor_config_level_language_label: "Language for This Level" -# editor_config_level_language_description: "Define the programming language for this particular level." -# editor_config_default_language_label: "Default Programming Language" -# editor_config_default_language_description: "Define the programming language you want to code in when starting new levels." + editor_config_level_language_label: "Sprache für dieses Level" + editor_config_level_language_description: "Lege die Programmiersprache für dieses bestimmte Level fest." + editor_config_default_language_label: "Voreinstellung Programmiersprache" + editor_config_default_language_description: "Definiere die Programmiersprache in der du programmieren möchtest wenn du ein neues Level beginnst." editor_config_keybindings_label: "Tastenbelegung" editor_config_keybindings_default: "Standard (Ace)" editor_config_keybindings_description: "Fügt zusätzliche Tastenkombinationen, bekannt aus anderen Editoren, hinzu" @@ -388,7 +388,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: editor_config_indentguides_description: "Zeigt vertikale Linien an um Einrückungen besser zu sehen." editor_config_behaviors_label: "Intelligentes Verhalten" editor_config_behaviors_description: "Vervollständigt automatisch Klammern und Anführungszeichen." -# keyboard_shortcuts: "Key Shortcuts" + keyboard_shortcuts: "Tastenkürzel" loading_ready: "Bereit!" tip_insert_positions: "Halte 'Umschalt' gedrückt und klicke auf die Karte um die Koordinaten einzufügen." tip_toggle_play: "Wechsel zwischen Play und Pause mit Strg+P." @@ -421,14 +421,14 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: time_current: "Aktuell" time_total: "Total" time_goto: "Gehe zu" -# infinite_loop_try_again: "Try Again" + infinite_loop_try_again: "Erneut versuchen" # infinite_loop_reset_level: "Reset Level" -# infinite_loop_comment_out: "Comment Out My Code" + infinite_loop_comment_out: "Meinen Code auskommentieren" -# keyboard_shortcuts: -# keyboard_shortcuts: "Keyboard Shortcuts" -# space: "Space" -# enter: "Enter" + keyboard_shortcuts: + keyboard_shortcuts: "Tastaturkürzel" + space: "Leertaste" + enter: "Eingabetaste" # escape: "Escape" # cast_spell: "Cast current spell." # continue_script: "Continue past current script." @@ -448,42 +448,42 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: av_entities_sub_title: "Entitäten" av_entities_users_url: "Benutzer" av_entities_active_instances_url: "Aktive Instanzen" -# av_entities_employer_list_url: "Employer List" + av_entities_employer_list_url: "Arbeitgeberliste" av_other_sub_title: "Sonstige" # av_other_debug_base_url: "Base (for debugging base.jade)" u_title: "Benutzerliste" lg_title: "Letzte Spiele" # clas: "CLAs" -# community: -# level_editor: "Level Editor" -# main_title: "CodeCombat Community" -# facebook: "Facebook" -# twitter: "Twitter" -# gplus: "Google+" + community: + level_editor: "Level Editor" + main_title: "CodeCombat Community" + facebook: "Facebook" + twitter: "Twitter" + gplus: "Google+" editor: main_title: "CodeCombat Editoren" main_description: "Entwerfe deine eigenen Level, Kampagnen, Einheiten und Lernmaterial. Wir stellen alle Werkzeuge zur Verfügung, die Du dafür benötigst!" article_title: "Artikel Editor" article_description: "Schreiben Sie Artikel, die anderen Spieler einen Überblick über Programmierkonzepte geben und in einer Vielzahl von Ebenen und Kampagnen genutzt werden können." -# thang_title: "Thang Editor" + thang_title: "Thang Editor" thang_description: "Entwerfe Einheiten, definiere ihre Standardlogik, Grafiken und Töne. Zurzeit werden nur Flash Vektorgrafiken unterstützt." level_title: "Level Editor" level_description: "Beinhaltet die Werkzeuge zum Scripten, Hochladen von Tönen und zur Konstruktion eigener Logik, damit jedes erdenkliches Level erstellt werden kann. Genau die Sachen, die wir selber benutzen!" # achievement_title: "Achievement Editor" -# got_questions: "Questions about using the CodeCombat editors?" + got_questions: "Fragen zur Benutzung des CodeCombat Editors?" contact_us: "setze dich mit uns in Verbindung!" hipchat_prefix: "Besuche uns auch in unserem" hipchat_url: "HipChat room." -# back: "Back" + back: "Zurück" revert: "Zurücksetzen" revert_models: "Models zurücksetzen." -# fork_title: "Fork New Version" -# fork_creating: "Creating Fork..." -# more: "More" -# wiki: "Wiki" -# live_chat: "Live Chat" + fork_title: "Forke neue Version" + fork_creating: "Erzeuge Fork..." + more: "Mehr" + wiki: "Wiki" + live_chat: "Live Chat" level_some_options: "Einige Einstellungsmöglichkeiten?" level_tab_thangs: "Thangs" level_tab_scripts: "Skripte" @@ -491,11 +491,11 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: level_tab_components: "Komponenten" level_tab_systems: "Systeme" level_tab_thangs_title: "Aktuelle Thangs" -# level_tab_thangs_all: "All" + level_tab_thangs_all: "Alle" level_tab_thangs_conditions: "Startbedingungen" level_tab_thangs_add: "Thangs hinzufügen" -# delete: "Delete" -# duplicate: "Duplicate" + delete: "Löschen" + duplicate: "Duplizieren" level_settings_title: "Einstellungen" level_component_tab_title: "Aktuelle Komponenten" level_component_btn_new: "neue Komponente erstellen" @@ -512,16 +512,16 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: new_component_title: "Neue Komponente erstellen" new_component_field_system: "System" new_article_title: "Erstelle einen neuen Artikel" -# new_thang_title: "Create a New Thang Type" + new_thang_title: "Erstelle einen neuen Thang-Typen" new_level_title: "Erstelle ein neues Level" -# new_article_title_login: "Log In to Create a New Article" -# new_thang_title_login: "Log In to Create a New Thang Type" -# new_level_title_login: "Log In to Create a New Level" + new_article_title_login: "Melde dich an um einen neuen Artikel zu erstellen" + new_thang_title_login: "Melde dich an um einen neuen Thang-Typen zu erstellen" + new_level_title_login: "Melde dich an um ein neues Level zu erstellen" # new_achievement_title: "Create a New Achievement" # new_achievement_title_login: "Log In to Create a New Achievement" -# article_search_title: "Search Articles Here" -# thang_search_title: "Search Thang Types Here" -# level_search_title: "Search Levels Here" + article_search_title: "Durchsuche Artikel hier" + thang_search_title: "Durchsuche Thang-Typen hier" + level_search_title: "Durchsuche Levels hier" # achievement_search_title: "Search Achievements" # read_only_warning2: "Note: you can't save any edits here, because you're not logged in." @@ -535,13 +535,13 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: body: "Inhalt" version: "Version" commit_msg: "Commit Nachricht" -# version_history: "Version History" + version_history: "Versionshistorie" version_history_for: "Versionsgeschichte für: " result: "Ergebnis" results: "Ergebnisse" description: "Beschreibung" or: "oder" -# subject: "Subject" + subject: "Betreff" email: "Email" password: "Passwort" message: "Nachricht" @@ -557,7 +557,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: easy: "Einfach" medium: "Mittel" hard: "Schwer" -# player: "Player" + player: "Spieler" about: who_is_codecombat: "Wer ist CodeCombat?" @@ -639,13 +639,13 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # rights_writings: "Writings" # rights_media: "Media (sounds, music) and any other creative content made specifically for that Level and not made generally available when creating Levels." # rights_clarification: "To clarify, anything that is made available in the Level Editor for the purpose of making levels is under CC, whereas the content created with the Level Editor or uploaded in the course of creation of Levels is not." -# nutshell_title: "In a Nutshell" + nutshell_title: "Zusammenfassung" # nutshell_description: "Any resources we provide in the Level Editor are free to use as you like for creating Levels. But we reserve the right to restrict distribution of the Levels themselves (that are created on codecombat.com) so that they may be charged for in the future, if that's what ends up happening." -# canonical: "The English version of this document is the definitive, canonical version. If there are any discrepencies between translations, the English document takes precedence." + canonical: "Die englische Version dieses Dokuments ist die definitive, kanonische Version. Sollte es Unterschiede zwischen den Übersetzungen geben, dann hat das englische Dokument Vorrang." # contribute: # page_title: "Contributing" -# character_classes_title: "Character Classes" + character_classes_title: "Charakter Klassen" # introduction_desc_intro: "We have high hopes for CodeCombat." # introduction_desc_pref: "We want to be where programmers of all stripes come to learn and play together, introduce others to the wonderful world of coding, and reflect the best parts of the community. We can't and don't want to do that alone; what makes projects like GitHub, Stack Overflow and Linux great are the people who use them and build on them. To that end, " # introduction_desc_github_url: "CodeCombat is totally open source" @@ -728,12 +728,12 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # counselor_join_desc: "tell us a little about yourself, what you've done and what you'd be interested in doing. We'll put you in our contact list and be in touch when we could use advice (not too often)." # more_about_counselor: "Learn More About Becoming a Counselor" # changes_auto_save: "Changes are saved automatically when you toggle checkboxes." -# diligent_scribes: "Our Diligent Scribes:" -# powerful_archmages: "Our Powerful Archmages:" -# creative_artisans: "Our Creative Artisans:" -# brave_adventurers: "Our Brave Adventurers:" -# translating_diplomats: "Our Translating Diplomats:" -# helpful_ambassadors: "Our Helpful Ambassadors:" + diligent_scribes: "Unsere fleißgen Schreiben:" + powerful_archmages: "Unsere mächtigen Erzmagier:" + creative_artisans: "Unsere kreativen Handwerker:" + brave_adventurers: "Unsere mutigen Abenteurer:" + translating_diplomats: "Unsere übersetzenden Diplomaten:" + helpful_ambassadors: "Unsere hilfreichen Botschafter:" classes: archmage_title: "Erzmagier" @@ -756,18 +756,18 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: my_matches: "Meine Matches" simulate: "Simuliere" # simulation_explanation: "By simulating games you can get your game ranked faster!" -# simulate_games: "Simulate Games!" + simulate_games: "Simuliere Spiele!" # simulate_all: "RESET AND SIMULATE GAMES" -# games_simulated_by: "Games simulated by you:" -# games_simulated_for: "Games simulated for you:" -# games_simulated: "Games simulated" -# games_played: "Games played" -# ratio: "Ratio" + games_simulated_by: "Spiele die durch dich simuliert worden:" + games_simulated_for: "Spiele die für dich simuliert worden:" + games_simulated: "simulierte Spiele" + games_played: "gespielte Spiele" + ratio: "Ratio" # leaderboard: "Leaderboard" # battle_as: "Battle as " -# summary_your: "Your " -# summary_matches: "Matches - " -# summary_wins: " Wins, " + summary_your: "Deine " + summary_matches: "Matches - " + summary_wins: " Siege, " # summary_losses: " Losses" # rank_no_code: "No New Code to Rank" # rank_my_game: "Rank My Game!" @@ -790,8 +790,8 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: warmup: "Aufwärmen" vs: "VS" # friends_playing: "Friends Playing" -# log_in_for_friends: "Log in to play with your friends!" -# social_connect_blurb: "Connect and play against your friends!" + log_in_for_friends: "Melde dich an um mit deinen Freunden zu spielen!" + social_connect_blurb: "Verbinde und spiele gegen deine Freunde!" # invite_friends_to_battle: "Invite your friends to join you in battle!" # fight: "Fight!" # watch_victory: "Watch your victory" @@ -801,8 +801,8 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # tournament_rules: "Tournament Rules" # tournament_blurb: "Write code, collect gold, build armies, crush foes, win prizes, and upgrade your career in our $40,000 Greed tournament! Check out the details" # tournament_blurb_blog: "on our blog" -# rules: "Rules" -# winners: "Winners" + rules: "Regeln" + winners: "Gewinner" # ladder_prizes: # title: "Tournament Prizes" @@ -811,8 +811,8 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # blurb_3: "to the top human and ogre players." # blurb_4: "Two teams means double the prizes!" # blurb_5: "(There will be two first place winners, two second-place winners, etc.)" -# rank: "Rank" -# prizes: "Prizes" + rank: "Rang" + prizes: "Gewinne" # total_value: "Total Value" # in_cash: "in cash" # custom_wizard: "Custom CodeCombat Wizard" @@ -838,55 +838,55 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # 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." + loading_error: + could_not_load: "Fehler beim Laden vom Server" + connection_failure: "Verbindung fehlgeschlagen." + unauthorized: "Du musst angemeldet sein. Hast du Cookies ausgeschaltet?" + forbidden: "Sie haben nicht die nötigen Berechtigungen." + not_found: "Nicht gefunden." + not_allowed: "Methode nicht erlaubt." + timeout: "Server timeout." + conflict: "Resourcen Konflikt." + bad_input: "Falsche Eingabe." + server_error: "Server Fehler." + unknown: "Unbekannter Fehler." -# 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" + resources: + your_sessions: "Meine Sessions" + level: "Level" + social_network_apis: "Social Network APIs" + facebook_status: "Facebook Status" + facebook_friends: "Facebook Freunde" + facebook_friend_sessions: "Facebook Freunde Sessions" + gplus_friends: "G+ Freunde" + gplus_friend_sessions: "G+ Freunde Sessions" # leaderboard: "Leaderboard" -# user_schema: "User Schema" -# user_profile: "User Profile" + user_schema: "Benutzerschema" + user_profile: "Benutzerprofil" # patches: "Patches" # patched_model: "Source Document" -# model: "Model" -# system: "System" -# component: "Component" -# components: "Components" -# thang: "Thang" -# thangs: "Thangs" -# level_session: "Your Session" -# opponent_session: "Opponent Session" -# article: "Article" -# user_names: "User Names" -# thang_names: "Thang Names" -# files: "Files" -# top_simulators: "Top Simulators" + model: "Model" + system: "System" + component: "Komponente" + components: "Komponenten" + thang: "Thang" + thangs: "Thangs" + level_session: "Deine Session" + opponent_session: "Gegner-Session" + article: "Artikel" + user_names: "Benutzernamen" + thang_names: "Thang Namen" + files: "Dateien" + top_simulators: "Top Simulatoren" # source_document: "Source Document" -# document: "Document" -# sprite_sheet: "Sprite Sheet" -# candidate_sessions: "Candidate Sessions" + document: "Dokument" + sprite_sheet: "Sprite Sheet" + candidate_sessions: "Kandidat-Sessions" -# delta: -# added: "Added" -# modified: "Modified" -# deleted: "Deleted" + delta: + added: "hinzugefügt" + modified: "modifiziert" + deleted: "gelöscht" # moved_index: "Moved Index" # text_diff: "Text Diff" # merge_conflict_with: "MERGE CONFLICT WITH" From 140541925e7694911083576680b38fcc8005eaa6 Mon Sep 17 00:00:00 2001 From: Michael Arnold Date: Sat, 14 Jun 2014 15:43:59 -0400 Subject: [PATCH 03/21] Changed final_score to match coding style. Extremely insignificant change, I just noticed that final_score was set as: final_score = final_score / fuzzies; compared to: "final_score /= fuzzies;" which is how the rest of your syntax is written. (Ex: "+=" and "-=") --- vendor/scripts/string_score.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/scripts/string_score.js b/vendor/scripts/string_score.js index d282858bf..497b4b619 100644 --- a/vendor/scripts/string_score.js +++ b/vendor/scripts/string_score.js @@ -124,7 +124,7 @@ //final_score = (word_score + abbreviation_score) / 2; final_score = ((abbreviation_score * (abbreviation_length / string_length)) + abbreviation_score) / 2; - final_score = final_score / fuzzies; + final_score /= fuzzies; if (start_of_string_bonus && (final_score + 0.15 < 1)) { final_score += 0.15; From babfa04a9ec7b9479c9e436d53ef19e0c38ca6f6 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sat, 14 Jun 2014 18:02:22 -0700 Subject: [PATCH 04/21] Fixed a tiny typo. --- app/locale/de-DE.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/locale/de-DE.coffee b/app/locale/de-DE.coffee index b73d7240e..8cfa9ca78 100644 --- a/app/locale/de-DE.coffee +++ b/app/locale/de-DE.coffee @@ -251,7 +251,7 @@ module.exports = nativeDescription: "Deutsch (Deutschland)", englishDescription: # short_description_blurb: "Add a tagline to help an employer quickly learn more about you." # short_description: "Tagline" # short_description_help: "Who are you, and what are you looking for? 140 characters max." -F skills_header: "Fähigkeiten" + skills_header: "Fähigkeiten" # skills_help: "Tag relevant developer skills in order of proficiency." long_description_header: "Beschreibe deine gewünschte Position" # long_description_blurb: "Tell employers how awesome you are and what role you want." From 66e2805a9ad5e286ad69085e315fe3eb9cbf6d42 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sat, 14 Jun 2014 20:59:28 -0700 Subject: [PATCH 05/21] Added StackLead integration. Employerified profile backgrounds. --- app/styles/employers.sass | 1 + app/views/account/profile_view.coffee | 5 +++ app/views/modal/employer_signup_modal.coffee | 7 +++-- server/commons/mapping.coffee | 2 +- server/routes/stacklead.coffee | 32 ++++++++++++++++++++ server_config.coffee | 3 +- 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 server/routes/stacklead.coffee diff --git a/app/styles/employers.sass b/app/styles/employers.sass index c04ddf56e..522785750 100644 --- a/app/styles/employers.sass +++ b/app/styles/employers.sass @@ -63,6 +63,7 @@ td:nth-child(7) select min-width: 100px +#employers-view, #profile-view.viewed-by-employer #outer-content-wrapper, #intermediate-content-wrapper, #inner-content-wrapper background: #949494 diff --git a/app/views/account/profile_view.coffee b/app/views/account/profile_view.coffee index 3cf4ab9f7..295269552 100644 --- a/app/views/account/profile_view.coffee +++ b/app/views/account/profile_view.coffee @@ -233,6 +233,8 @@ module.exports = class ProfileView extends View afterRender: -> super() + if me.get('employerAt') + @$el.addClass 'viewed-by-employer' return unless @user unless @user.get('jobProfile')?.projects?.length or @editing @$el.find('.right-column').hide() @@ -269,6 +271,9 @@ module.exports = class ProfileView extends View active = not @user.get('jobProfile').active @user.get('jobProfile').active = active @saveEdits() + if active and not (me.isAdmin() or @stackLed) + $.post "/stacklead" + @stackLed = true enterEspionageMode: -> postData = emailLower: @user.get('email').toLowerCase(), usernameLower: @user.get('name').toLowerCase() diff --git a/app/views/modal/employer_signup_modal.coffee b/app/views/modal/employer_signup_modal.coffee index 5c0aecdab..5aa2a8cde 100644 --- a/app/views/modal/employer_signup_modal.coffee +++ b/app/views/modal/employer_signup_modal.coffee @@ -83,7 +83,7 @@ module.exports = class EmployerSignupView extends View alert "There was an error signing the contract. Please contact team@codecombat.com with this error: #{error.responseText}" checkForFormSubmissionEnterPress: (e) -> - if e.which is 13 + if e.which is 13 if $("#signup-email").val() isnt '' and $("#signup-password").val() isnt '' @createAccount(e) else if $("#more-info-email").val() isnt '' @@ -104,7 +104,7 @@ module.exports = class EmployerSignupView extends View return forms.applyErrorsToForm(el, res.errors) unless res.valid @enableModalInProgress(el) auth.createUserWithoutReload userObject, null - + submitMoreInfoEmail: (e) => emailAddress = $("#more-info-email").val() window.tracker?.trackEvent 'Employer requested more information.' @@ -121,7 +121,8 @@ module.exports = class EmployerSignupView extends View message: "THIS IS AN AUTOMATED MESSAGE FROM THE EMPLOYER SIGNUP FORM \n Please send me more info about hiring CodeCombat players." success: successFunc error: errorFunc - + $.post "/stacklead", email: emailAddress + setHashToOpenModalAutomatically: (e) -> window.location.hash = "employerSignupLoggingIn" diff --git a/server/commons/mapping.coffee b/server/commons/mapping.coffee index 4b859632c..8e3188fa2 100644 --- a/server/commons/mapping.coffee +++ b/server/commons/mapping.coffee @@ -1,4 +1,3 @@ - module.exports.handlers = 'article': 'articles/article_handler' 'level': 'levels/level_handler' @@ -24,4 +23,5 @@ module.exports.routes = 'routes/mail' 'routes/sprites' 'routes/queue' + 'routes/stacklead' ] diff --git a/server/routes/stacklead.coffee b/server/routes/stacklead.coffee new file mode 100644 index 000000000..ffa5f3617 --- /dev/null +++ b/server/routes/stacklead.coffee @@ -0,0 +1,32 @@ +config = require '../../server_config' +request = require 'request' +log = require 'winston' + +module.exports.setup = (app) -> + app.post '/stacklead', (req, res) -> + return res.end() unless req.user + email = req.body.email or req.user.get 'email' + sendStackLead email, req.user + return res.end() + +module.exports.sendStackLead = sendStackLead = (email, user) -> + return unless key = config.mail.stackleadAPIKey + form = email: email, api_key: key + if user + form.first_name = firstName if firstName = user.get('firstName') + form.last_name = lastName if lastName = user.get('lastName') + if profile = user.get 'jobProfile' + form.name = name if name = profile.name + form.location = location if location = profile.city + form.location = location if location = profile.city + for link in (profile.links ? []) + form.linkedin = link.link if /linkedin/.test link.link + form.twitter = link.link if /twitter/.test link.link + form.company = company if company = profile.work?[0]?.employer + if linkedIn = user.get('signedEmployerAgreement')?.data + form.first_name = data.firstName if data.firstName + form.last_name = data.lastName if data.lastName + form.linkedin = data.publicProfileUrl if data.publicProfileUrl + data.company = company if company = data.positions?.values?[0]?.company?.name + request.post {uri: "https://stacklead.com/api/leads", form: form}, (err, res, body) -> + return log.error "Error sending StackLead request:", err or body if err or /error/.test body diff --git a/server_config.coffee b/server_config.coffee index a30cbde32..ec3c38dfd 100644 --- a/server_config.coffee +++ b/server_config.coffee @@ -26,9 +26,10 @@ config.mail = mailchimpAPIKey: process.env.COCO_MAILCHIMP_API_KEY or "" mailchimpWebhook: process.env.COCO_MAILCHIMP_WEBHOOK or "/mail/webhook" sendwithusAPIKey: process.env.COCO_SENDWITHUS_API_KEY or "" + stackleadAPIKey: process.env.COCO_STACKLEAD_API_KEY or "" cronHandlerPublicIP: process.env.COCO_CRON_PUBLIC_IP or "" cronHandlerPrivateIP: process.env.COCO_CRON_PRIVATE_IP or "" - + config.queue = accessKeyId: process.env.COCO_AWS_ACCESS_KEY_ID or "" secretAccessKey: process.env.COCO_AWS_SECRET_ACCESS_KEY or "" From 479c2a0cc14e0e4cb62ff07367c17efcd9b9b74a Mon Sep 17 00:00:00 2001 From: Fergus Leen Date: Sun, 15 Jun 2014 08:32:06 +0100 Subject: [PATCH 06/21] Added str around sys.maxsize --- scripts/devSetup/systemConfiguration.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/devSetup/systemConfiguration.py b/scripts/devSetup/systemConfiguration.py index 9d49e95ce..c8b2b99de 100644 --- a/scripts/devSetup/systemConfiguration.py +++ b/scripts/devSetup/systemConfiguration.py @@ -33,7 +33,6 @@ class SystemConfiguration(object): return 64 else: if self.operating_system == u"mac": - raise NotSupportedError(u"Your processor is determined to have a maxSize of" + sys.maxsize + + raise NotSupportedError(u"Your processor is determined to have a maxSize of" + str(sys.maxsize) + u",\n which doesn't correspond with a 64-bit architecture.") return 32 - From ff5f46e5fbe95a0af591018a88dfa8382d9e49f5 Mon Sep 17 00:00:00 2001 From: barbuddha Date: Mon, 16 Jun 2014 08:43:27 +0400 Subject: [PATCH 07/21] Update ru.coffee --- app/locale/ru.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/locale/ru.coffee b/app/locale/ru.coffee index 31132122e..d46cd12a1 100644 --- a/app/locale/ru.coffee +++ b/app/locale/ru.coffee @@ -417,7 +417,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi space: "Пробел" enter: "Enter" escape: "Escape" - cast_spell: ".произнести текущее заклинание." + cast_spell: "Произнести текущее заклинание." # continue_script: "Continue past current script." # skip_scripts: "Skip past all skippable scripts." # toggle_playback: "Toggle play/pause." @@ -639,7 +639,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi introduction_desc_ending: "Мы надеемся, что вы присоединитесь к нашей команде!" introduction_desc_signature: "- Ник, Джордж, Скотт, Михаэль, Джереми и Глен" alert_account_message_intro: "Привет!" - alert_account_message: "Чтобы подписаться за классовые сообщения, необходимо войти в аккаунт" + alert_account_message: "Чтобы подписаться на классовые сообщения, необходимо войти в аккаунт" archmage_summary: "Интересует работа над игровой графикой, дизайном пользовательского интерфейса, базой данных и организацией сервера, сетевым мультиплеером, физикой, звуком или производительностью игрового движка? Хотите помочь создать игру для помощи другим людям в изучении того, в чём вы хорошо разбираетесь? У нас много работы, и если вы опытный программист и хотите разрабатывать для CodeCombat, этот класс для вас. Мы будем рады вашей помощи в создании самой лучшей игры для программистов." archmage_introduction: "Одна из лучших черт в создании игр - то, что они синтезируют так много различных вещей. Графика, звук, сетевое взаимодействие в режиме реального времени, социальное сетевое взаимодействие, и, конечно, большинство из более распространённых аспектов программирования, от низкоуровневого управления базами данных и администрирования сервера до построения дизайна и интерфейсов, видимых пользователю. У нас много работы, и если вы опытный программист со страстным желанием погрузиться в действительно мельчайшие детали CodeCombat, этот класс для вас. Мы будем рады вашей помощи в создании самой лучшей игры для программистов." class_attributes: "Атрибуты класса" From 931f3ea33035dee515af977f6f369bf9dfa0c408 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 16 Jun 2014 11:38:25 +0200 Subject: [PATCH 08/21] Upsate /// Translate Enjoy --- app/locale/fr.coffee | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/locale/fr.coffee b/app/locale/fr.coffee index dae1e4266..dce3be2d7 100644 --- a/app/locale/fr.coffee +++ b/app/locale/fr.coffee @@ -193,13 +193,13 @@ module.exports = nativeDescription: "français", englishDescription: "French", t view_profile: "Voir votre profil" account_profile: -# settings: "Settings" -# edit_profile: "Edit Profile" -# done_editing: "Done Editing" + settings: "Paramètres" + edit_profile: "Editer Profil" + done_editing: "Modifications effectué" profile_for_prefix: "Profil pour " profile_for_suffix: "" -# featured: "Featured" -# not_featured: "Not Featured" + featured: "Complet" + not_featured: "Incomplet" looking_for: "à la recherche de:" last_updated: "Dernière Mise à jour:" contact: "Contact" @@ -220,7 +220,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t next_photo: "ajouter une photo professionelle (optionnel)." next_active: "déclarez vous ouvert aux offres pour apparaitre dans les recherches." example_blog: "Votre blog" -# example_personal_site: "Personal Site" + example_personal_site: "Site Web" links_header: "Liens personnels" links_blurb: "Lien vers d'autres sites ou profils que vous souhaitez mettre en avant, comme votre GitHub, LinkedIn ou votre blog." links_name: "Nom du lien" @@ -448,7 +448,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t av_entities_sub_title: "Entités" av_entities_users_url: "Utilisateurs" av_entities_active_instances_url: "Instances actives" -# av_entities_employer_list_url: "Employer List" + av_entities_employer_list_url: "Liste des employés" av_other_sub_title: "Autre" av_other_debug_base_url: "Base (pour debugger base.jade)" u_title: "Liste des utilisateurs" @@ -653,7 +653,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t introduction_desc_ending: "Nous espérons que vous allez joindre notre aventure!" introduction_desc_signature: "- Nick, George, Scott, Michael, Jeremy et Glen" alert_account_message_intro: "Et tiens!" -# alert_account_message: "To subscribe for class emails, you'll need to be logged in first." + alert_account_message: "Pour souscrire aux e-mails, vous devez être connecté" # archmage_summary: "Interested in working on game graphics, user interface design, database and server organization, multiplayer networking, physics, sound, or game engine performance? Want to help build a game to help other people learn what you are good at? We have a lot to do and if you are an experienced programmer and want to develop for CodeCombat, this class is for you. We would love your help building the best programming game ever." archmage_introduction: "L'une des meilleures parties de la création d'un jeu est qu'il regroupe tant de choses différentes. Graphismes, sons, réseau en temps réel, réseaux sociaux, et bien sur bien d'autres aspects de la programmation, de la gestion bas niveau de base de données, et de l'administration de serveur à l'élaboration d'interfaces utilisateur. Il y a tant à faire, et si vous êtes un programmeur expérimenté avec une aspiration à vraiment plonger dans le fond de CodeCombat, cette classe est faite pour vous. Nous aimerions avoir votre aide pour le meilleur jeu de développement de tous les temps." class_attributes: "Attributs de classe" @@ -860,7 +860,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t # facebook_friend_sessions: "Facebook Friend Sessions" # gplus_friends: "G+ Friends" # gplus_friend_sessions: "G+ Friend Sessions" -# leaderboard: "Leaderboard" + leaderboard: "Classement" # user_schema: "User Schema" # user_profile: "User Profile" patches: "Patchs" From c611cafa259757c2a5106f103cd6372ae7c9a3c2 Mon Sep 17 00:00:00 2001 From: Inez KEMENES Date: Mon, 16 Jun 2014 16:39:02 +0200 Subject: [PATCH 09/21] Update hu.coffee --- app/locale/hu.coffee | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/locale/hu.coffee b/app/locale/hu.coffee index ceb464809..debe8466e 100644 --- a/app/locale/hu.coffee +++ b/app/locale/hu.coffee @@ -26,14 +26,14 @@ module.exports = nativeDescription: "magyar", englishDescription: "Hungarian", t minutes: "percek" hour: "óra" hours: "órák" -# day: "day" -# days: "days" -# week: "week" -# weeks: "weeks" -# month: "month" -# months: "months" -# year: "year" -# years: "years" + day: "nap" + days: "napok" + week: "hét" + weeks: "hetek" + month: "hónap" + months: "hónapok" + year: "év" + years: "évek" modal: close: "Mégse" From 9a64ca5973297761ce6aafb009bf82d05b676ef5 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 16 Jun 2014 10:49:20 -0700 Subject: [PATCH 10/21] A few misc fixes. --- app/locale/ru.coffee | 2 +- app/schemas/definitions/bus.coffee | 4 ++-- app/schemas/subscriptions/bus.coffee | 2 +- app/views/play/level/tome/spell.coffee | 6 +++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/locale/ru.coffee b/app/locale/ru.coffee index d4a5accb7..b6abadad7 100644 --- a/app/locale/ru.coffee +++ b/app/locale/ru.coffee @@ -425,7 +425,7 @@ module.exports = nativeDescription: "русский", englishDescription: "Russi infinite_loop_reset_level: "Сбросить уровень" infinite_loop_comment_out: "Закомментировать мой код" -# keyboard_shortcuts: + keyboard_shortcuts: keyboard_shortcuts: "Горячие клавиши" space: "Пробел" enter: "Enter" diff --git a/app/schemas/definitions/bus.coffee b/app/schemas/definitions/bus.coffee index b5625025e..bdec6248f 100644 --- a/app/schemas/definitions/bus.coffee +++ b/app/schemas/definitions/bus.coffee @@ -7,8 +7,8 @@ module.exports = type: "object" properties: # TODO joined: - type: "boolean" + type: ["boolean", "null"] players: type: "object" required: ["joined", "players"] - additionalProperties: false \ No newline at end of file + additionalProperties: true diff --git a/app/schemas/subscriptions/bus.coffee b/app/schemas/subscriptions/bus.coffee index 91569ae7f..3e4702cfd 100644 --- a/app/schemas/subscriptions/bus.coffee +++ b/app/schemas/subscriptions/bus.coffee @@ -33,7 +33,7 @@ module.exports = type: "object" properties: message: - type: "string" + type: "object" bus: $ref: "bus" diff --git a/app/views/play/level/tome/spell.coffee b/app/views/play/level/tome/spell.coffee index a3f0de4ce..7c796482d 100644 --- a/app/views/play/level/tome/spell.coffee +++ b/app/views/play/level/tome/spell.coffee @@ -25,7 +25,11 @@ module.exports = class Spell teamSpells = @session.get('teamSpells') team = @session.get('team') ? 'humans' @useTranspiledCode = @permissions.readwrite.length and ((teamSpells and not _.contains(teamSpells[team], @spellKey)) or (@session.get('creator') isnt me.id and not (me.isAdmin() or 'employer' in me.get('permissions'))) or @spectateView) - #console.log @spellKey, "using transpiled code?", @useTranspiledCode + if @useTranspiledCode + console.log "#{@spellKey} is using transpiled code because permissions.readwrite is #{@permissions.readwrite} + #{if @spectateView then ', we are spectating' else ''} + #{if teamSpells and not _.contains(teamSpells[team], @spellKey) then ', teamSpells[' + team + '] does not have ' + @spellKey + ' (just ' + teamSpells[team] + ')' else ''} + #{if @session.get('creator') isnt me.id then ', and the session was created by ' + @session.get('creator') + ' but I am ' + me.id else ''}" @source = @originalSource = p.source @parameters = p.parameters if @permissions.readwrite.length and sessionSource = @session.getSourceFor(@spellKey) From 1786eab09ddfb7d0c2687805d8f8ee82ce22cf5c Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 14 Jun 2014 07:37:31 -0700 Subject: [PATCH 11/21] Initial work on a demo view. But brunch won't build demo-app.js for some reason. --- app/lib/Router.coffee | 5 +- app/styles/demo.sass | 14 ++++ app/templates/demo.jade | 22 ++++++ app/views/{test.coffee => TestView.coffee} | 59 ++------------- config.coffee | 3 +- demo/views/editor/PatchesView.demo.coffee | 21 ++++++ test/app/lib/requireUtils.coffee | 48 ++++++++++++ test/app/views/DemoView.coffee | 85 ++++++++++++++++++++++ 8 files changed, 201 insertions(+), 56 deletions(-) create mode 100644 app/styles/demo.sass create mode 100644 app/templates/demo.jade rename app/views/{test.coffee => TestView.coffee} (60%) create mode 100644 demo/views/editor/PatchesView.demo.coffee create mode 100644 test/app/lib/requireUtils.coffee create mode 100644 test/app/views/DemoView.coffee diff --git a/app/lib/Router.coffee b/app/lib/Router.coffee index 775a2dae5..d7ac1a1cc 100644 --- a/app/lib/Router.coffee +++ b/app/lib/Router.coffee @@ -16,8 +16,9 @@ module.exports = class CocoRouter extends Backbone.Router # editor views tend to have the same general structure 'editor/:model(/:slug_or_id)(/:subview)': 'editorModelView' - # Experimenting with direct links - 'test/*subpath': go('test') + # Direct links + 'test/*subpath': go('TestView') + 'demo/*subpath': go('DemoView') 'play/ladder/:levelID': go('play/ladder/ladder_view') 'play/ladder': go('play/ladder_home') diff --git a/app/styles/demo.sass b/app/styles/demo.sass new file mode 100644 index 000000000..dec0fcba3 --- /dev/null +++ b/app/styles/demo.sass @@ -0,0 +1,14 @@ +#demo-view + margin: 0 20px + + h2 + background: #add8e6 + font-family: Arial, Geneva, sans-serif + padding: 20px + font-weight: bold + + #demo-wrapper + width: 78% + + #demo-nav + width: 20% diff --git a/app/templates/demo.jade b/app/templates/demo.jade new file mode 100644 index 000000000..4c093d0fd --- /dev/null +++ b/app/templates/demo.jade @@ -0,0 +1,22 @@ +h2 Demo Page + +ol.breadcrumb + for path in parentFolders + li + a(href=path.url)= path.name + li.active= currentFolder + +.well.pull-left#demo-wrapper + #demo-area + +.nav.nav-pills.nav-stacked.pull-right.well#demo-nav + for child in children + li(class=child.type) + a(href=child.url).small + if child.type == 'folder' + span.glyphicon.glyphicon-folder-close + else + span.glyphicon.glyphicon-file + span.spl= child.name + if child.type == 'folder' + strong (#{child.size}) diff --git a/app/views/test.coffee b/app/views/TestView.coffee similarity index 60% rename from app/views/test.coffee rename to app/views/TestView.coffee index f4667fc44..e999b3b0f 100644 --- a/app/views/test.coffee +++ b/app/views/TestView.coffee @@ -1,7 +1,9 @@ CocoView = require 'views/kinds/CocoView' template = require 'templates/test' +requireUtils = require 'lib/requireUtils' -TEST_BASE_PATH = 'test/app/' +TEST_REQUIRE_PREFIX = 'test/app/' +TEST_URL_PREFIX = '/test/' module.exports = TestView = class TestView extends CocoView id: "test-view" @@ -33,67 +35,18 @@ module.exports = TestView = class TestView extends CocoView getRenderData: -> c = super(arguments...) - c.parentFolders = @getParentFolders() - c.children = @getChildren() + c.parentFolders = requireUtils.getParentFolders(@subPath, TEST_URL_PREFIX) + c.children = requireUtils.parseImmediateChildren(@specFiles, @subPath, TEST_REQUIRE_PREFIX, TEST_URL_PREFIX) parts = @subPath.split('/') c.currentFolder = parts[parts.length-1] or parts[parts.length-2] or 'All' c - - getParentFolders: -> - return [] unless @subPath - paths = [] - parts = @subPath.split('/') - while parts.length - parts.pop() - paths.unshift { - name: parts[parts.length-1] or 'All' - url: '/test/' + parts.join('/') - } - paths - - getChildren: -> - return [] unless @specFiles - folders = {} - files = {} - - requirePrefix = TEST_BASE_PATH + @subPath - if requirePrefix[requirePrefix.length-1] isnt '/' - requirePrefix += '/' - - for f in @specFiles - f = f[requirePrefix.length..] - continue unless f - parts = f.split('/') - name = parts[0] - group = if parts.length is 1 then files else folders - group[name] ?= 0 - group[name] += 1 - - children = [] - urlPrefix = '/test/'+@subPath - urlPrefix += '/' if urlPrefix[urlPrefix.length-1] isnt '/' - - for name in _.keys(folders) - children.push { - type:'folder', - url: urlPrefix+name - name: name+'/' - size: folders[name] - } - for name in _.keys(files) - children.push { - type:'file', - url: urlPrefix+name - name: name - } - children # RUNNING TESTS initSpecFiles: -> @specFiles = TestView.getAllSpecFiles() if @subPath - prefix = TEST_BASE_PATH + @subPath + prefix = TEST_REQUIRE_PREFIX + @subPath @specFiles = (f for f in @specFiles when f.startsWith prefix) @runTests: (specFiles) -> diff --git a/config.coffee b/config.coffee index 56adbd46d..eabcfcfc3 100644 --- a/config.coffee +++ b/config.coffee @@ -35,7 +35,8 @@ exports.config = (bower_components[\/\\]aether[\/\\]build[\/\\]aether.js) )/// 'javascripts/test-app.js': /^test[\/\\]app/ -# 'test/javascripts/test-vendor.js': /^test[\/\\](?=vendor)/ + 'javascripts/demo-app.js': /^demo/ + order: before: [ 'bower_components/jquery/dist/jquery.js' diff --git a/demo/views/editor/PatchesView.demo.coffee b/demo/views/editor/PatchesView.demo.coffee new file mode 100644 index 000000000..9004924ae --- /dev/null +++ b/demo/views/editor/PatchesView.demo.coffee @@ -0,0 +1,21 @@ +PatchesView = require 'views/editor/patches_view' +CocoModel = require 'models/CocoModel' + +class BlandModel extends CocoModel + @className: 'Bland' + @schema: { + type: 'object' + additionalProperties: false + properties: + number: {type: 'number'} + object: {type: 'object'} + string: {type: 'string'} + _id: {type: 'string'} + } + urlRoot: '/db/bland' + + +module.exports = -> + model = new BlandModel({_id:'12345'}) + new PatchesView(model) + diff --git a/test/app/lib/requireUtils.coffee b/test/app/lib/requireUtils.coffee new file mode 100644 index 000000000..a79fe790c --- /dev/null +++ b/test/app/lib/requireUtils.coffee @@ -0,0 +1,48 @@ +module.exports.getParentFolders = (subPath, urlPrefix='/test/') -> + return [] unless subPath + paths = [] + parts = subPath.split('/') + while parts.length + parts.pop() + paths.unshift { + name: parts[parts.length-1] or 'All' + url: urlPrefix + parts.join('/') + } + paths + +module.exports.parseImmediateChildren = (allChildren, subPath, baseRequirePath='test/app/', urlPrefix='/test/') -> + return [] unless allChildren + folders = {} + files = {} + + requirePrefix = baseRequirePath + subPath + if requirePrefix[requirePrefix.length-1] isnt '/' + requirePrefix += '/' + + for f in allChildren + f = f[requirePrefix.length..] + continue unless f + parts = f.split('/') + name = parts[0] + group = if parts.length is 1 then files else folders + group[name] ?= 0 + group[name] += 1 + + children = [] + urlPrefix += subPath + urlPrefix += '/' if urlPrefix[urlPrefix.length-1] isnt '/' + + for name in _.keys(folders) + children.push { + type:'folder', + url: urlPrefix+name + name: name+'/' + size: folders[name] + } + for name in _.keys(files) + children.push { + type:'file', + url: urlPrefix+name + name: name + } + children diff --git a/test/app/views/DemoView.coffee b/test/app/views/DemoView.coffee new file mode 100644 index 000000000..b3470ab9d --- /dev/null +++ b/test/app/views/DemoView.coffee @@ -0,0 +1,85 @@ +CocoView = require 'views/kinds/CocoView' +template = require 'templates/demo' +requireUtils = require 'lib/requireUtils' + +DEMO_REQUIRE_PREFIX = 'demo/app/' +DEMO_URL_PREFIX = '/demo/' + +### + What are demo files? + + They could be a function which returns an element to insert into the demo page. + But what about demoing achievements? They'll get put into the main html. Or modals. + Well, I was thinking that a single folder would show all demos at the same time, line them up. + But it'd be confusing to have a whole bunch of achievement demos show up all at the same time? + Maybe there could be a button to show all the demos. Hmm, that'd be cool. + It could work like Jasmine, where it modifies the path and so when you select to run them, they all run with page reloads. + I think for now, I'll just say: have it be a function which we can run anytime. + It may or may not return an element to be inserted into the main area. + + Another idea. Do we want root views to just take over the full view? + Or should they just go into the central part? + Probably should take over the full view, and if you want to get out of the demo, you navigate back. + +### + +module.exports = DemoView = class DemoView extends CocoView + id: "demo-view" + template: template + + # INITIALIZE + + constructor: (options, @subPath='') -> + super(options) + @subPath = @subPath[1..] if @subPath[0] is '/' + @loadDemoingLibs() unless DemoView.loaded + + loadDemoingLibs: -> + @queue = new createjs.LoadQueue() + @queue.on('complete', @scriptsLoaded, @) + for f in ['jasmine', 'jasmine-html', 'boot', 'mock-ajax', 'demo-app'] + @queue.loadFile({ + src: "/javascripts/#{f}.js" + type: createjs.LoadQueue.JAVASCRIPT + }) + + scriptsLoaded: -> + @initDemoFiles() + @children = requireUtils.parseImmediateChildren(@demoFiles, @subPath, DEMO_REQUIRE_PREFIX, DEMO_URL_PREFIX) + @render() + @runDemo() + + # RENDER DATA + + getRenderData: -> + c = super(arguments...) + c.parentFolders = requireUtils.getParentFolders(@subPath, DEMO_URL_PREFIX) + c.children = @children or [] + parts = @subPath.split('/') + c.currentFolder = parts[parts.length-1] or parts[parts.length-2] or 'All' + c + + # RUNNING DEMOS + + initDemoFiles: -> + @demoFiles = @getAllDemoFiles() + if @subPath + prefix = TEST_REQUIRE_PREFIX + @subPath + @demoFiles = (f for f in @demoFiles when f.startsWith prefix) + + runDemo: -> + # TODO: Maybe have an option to run all demos in this folder at the same time? + return unless @subPath and _.last(@subPath.split('/')).indexOf('.demo') > -1 + requirePath = DEMO_REQUIRE_PREFIX + @subPath + demoFunc = require requirePath + if not _.isFunction(demoFunc) + console.error "Demo files must export a function. #{requirePath} does not." + return + view = demoFunc() + return unless view + @$el.find('#demo-area').empty().append(view.el) + # TODO, maybe handle root views differently than modal views differently than everything else? + + getAllDemoFiles = -> + allFiles = window.require.list() + (f for f in allFiles when f.indexOf('.demo') > -1) From 1013f52c14b52789c91ff43694e971d90be15ad5 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 14 Jun 2014 08:20:01 -0700 Subject: [PATCH 12/21] The demo folder is now being compiled correctly, but still having brunch issues. vendor.js isn't happening. --- config.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/config.coffee b/config.coffee index eabcfcfc3..15b0b34ed 100644 --- a/config.coffee +++ b/config.coffee @@ -5,6 +5,7 @@ startsWith = (string, substring) -> exports.config = paths: 'public': 'public' + 'watched': ['app', 'test', 'vendor', 'demo', 'bower_components'] conventions: ignored: (path) -> startsWith(sysPath.basename(path), '_') sourceMaps: true From 493231798235f7a777abf4c4e2b2a8f5af4bb0c6 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Sat, 14 Jun 2014 15:02:14 -0700 Subject: [PATCH 13/21] Finally got the demo view working (mostly). Need to turn off third party ajax requests. --- {test/app => app}/lib/requireUtils.coffee | 0 {test/app => app}/views/DemoView.coffee | 13 ++++++++----- config.coffee | 3 +-- .../demo}/views/editor/PatchesView.demo.coffee | 9 ++++++++- 4 files changed, 17 insertions(+), 8 deletions(-) rename {test/app => app}/lib/requireUtils.coffee (100%) rename {test/app => app}/views/DemoView.coffee (90%) rename {demo => test/demo}/views/editor/PatchesView.demo.coffee (67%) diff --git a/test/app/lib/requireUtils.coffee b/app/lib/requireUtils.coffee similarity index 100% rename from test/app/lib/requireUtils.coffee rename to app/lib/requireUtils.coffee diff --git a/test/app/views/DemoView.coffee b/app/views/DemoView.coffee similarity index 90% rename from test/app/views/DemoView.coffee rename to app/views/DemoView.coffee index b3470ab9d..00def8100 100644 --- a/test/app/views/DemoView.coffee +++ b/app/views/DemoView.coffee @@ -2,7 +2,7 @@ CocoView = require 'views/kinds/CocoView' template = require 'templates/demo' requireUtils = require 'lib/requireUtils' -DEMO_REQUIRE_PREFIX = 'demo/app/' +DEMO_REQUIRE_PREFIX = 'test/demo/' DEMO_URL_PREFIX = '/demo/' ### @@ -37,7 +37,8 @@ module.exports = DemoView = class DemoView extends CocoView loadDemoingLibs: -> @queue = new createjs.LoadQueue() @queue.on('complete', @scriptsLoaded, @) - for f in ['jasmine', 'jasmine-html', 'boot', 'mock-ajax', 'demo-app'] + window.jasmine = {} # so that mock-ajax properly loads. It expects jasmine to be loaded + for f in ['mock-ajax', 'demo-app'] @queue.loadFile({ src: "/javascripts/#{f}.js" type: createjs.LoadQueue.JAVASCRIPT @@ -64,7 +65,7 @@ module.exports = DemoView = class DemoView extends CocoView initDemoFiles: -> @demoFiles = @getAllDemoFiles() if @subPath - prefix = TEST_REQUIRE_PREFIX + @subPath + prefix = DEMO_REQUIRE_PREFIX + @subPath @demoFiles = (f for f in @demoFiles when f.startsWith prefix) runDemo: -> @@ -75,11 +76,13 @@ module.exports = DemoView = class DemoView extends CocoView if not _.isFunction(demoFunc) console.error "Demo files must export a function. #{requirePath} does not." return + + jasmine.Ajax.install() view = demoFunc() return unless view - @$el.find('#demo-area').empty().append(view.el) + @$el.find('#demo-area').empty().append(view.$el) # TODO, maybe handle root views differently than modal views differently than everything else? - getAllDemoFiles = -> + getAllDemoFiles: -> allFiles = window.require.list() (f for f in allFiles when f.indexOf('.demo') > -1) diff --git a/config.coffee b/config.coffee index 15b0b34ed..9bbd3abff 100644 --- a/config.coffee +++ b/config.coffee @@ -5,7 +5,6 @@ startsWith = (string, substring) -> exports.config = paths: 'public': 'public' - 'watched': ['app', 'test', 'vendor', 'demo', 'bower_components'] conventions: ignored: (path) -> startsWith(sysPath.basename(path), '_') sourceMaps: true @@ -36,7 +35,7 @@ exports.config = (bower_components[\/\\]aether[\/\\]build[\/\\]aether.js) )/// 'javascripts/test-app.js': /^test[\/\\]app/ - 'javascripts/demo-app.js': /^demo/ + 'javascripts/demo-app.js': /^test[\/\\]demo/ order: before: [ diff --git a/demo/views/editor/PatchesView.demo.coffee b/test/demo/views/editor/PatchesView.demo.coffee similarity index 67% rename from demo/views/editor/PatchesView.demo.coffee rename to test/demo/views/editor/PatchesView.demo.coffee index 9004924ae..dd1c347b6 100644 --- a/demo/views/editor/PatchesView.demo.coffee +++ b/test/demo/views/editor/PatchesView.demo.coffee @@ -17,5 +17,12 @@ class BlandModel extends CocoModel module.exports = -> model = new BlandModel({_id:'12345'}) - new PatchesView(model) + v = new PatchesView(model) + v.load() + + # doesn't quite work yet. Intercepts a mixpanel request instead + r = jasmine.Ajax.requests.mostRecent() + r.send({statusCode:200, responseText:"[]"}) + v.render() + v From 2e40a536740b811d69a346d54a96bc80088e73b3 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Sun, 15 Jun 2014 23:19:37 +0200 Subject: [PATCH 14/21] Extracting third party scripts out of main --- app/assets/main.html | 108 ----------------------------------- app/initialize.coffee | 13 +++++ app/lib/facebook.coffee | 42 ++++++++++++++ app/lib/filepicker.coffee | 28 +++++++++ app/lib/google.coffee | 16 ++++++ app/lib/olark.coffee | 116 ++++++++++++++++++++++++++++++++++++++ app/lib/segmentio.coffee | 41 ++++++++++++++ app/lib/temp.txt | 18 ++++++ app/lib/twitter.coffee | 12 ++++ 9 files changed, 286 insertions(+), 108 deletions(-) create mode 100644 app/lib/facebook.coffee create mode 100644 app/lib/filepicker.coffee create mode 100644 app/lib/google.coffee create mode 100644 app/lib/olark.coffee create mode 100644 app/lib/segmentio.coffee create mode 100644 app/lib/temp.txt create mode 100644 app/lib/twitter.coffee diff --git a/app/assets/main.html b/app/assets/main.html index b0fac676c..9f583173b 100644 --- a/app/assets/main.html +++ b/app/assets/main.html @@ -55,123 +55,15 @@ authorize: true - - - - - - - -
- - - - -
- - - - - - - - - - - - diff --git a/app/initialize.coffee b/app/initialize.coffee index 08e0a4b39..938a6188b 100644 --- a/app/initialize.coffee +++ b/app/initialize.coffee @@ -19,6 +19,7 @@ definitionSchemas = init = -> # Set up Backbone.Mediator schemas + initializeVendors() setUpDefinitions() setUpChannels() Backbone.Mediator.setValidationEnabled document.location.href.search(/codecombat.com/) is -1 @@ -60,3 +61,15 @@ setUpChannels = -> setUpDefinitions = -> for definition of definitionSchemas Backbone.Mediator.addDefSchemas definitionSchemas[definition] + +initializeVendors = -> + initializers = + filepicker: require './lib/filepicker' + #olark: require './lib/olark' + facebook: require './lib/facebook' + google: require './lib/google' + twitter: require './lib/twitter' + #segmentio: require './lib/segmentio' + + for name, initializer of initializers + initializer() diff --git a/app/lib/facebook.coffee b/app/lib/facebook.coffee new file mode 100644 index 000000000..bc4834c0b --- /dev/null +++ b/app/lib/facebook.coffee @@ -0,0 +1,42 @@ +module.exports = initializeFacebook = -> + # Additional JS functions here + window.fbAsyncInit = -> + Backbone.Mediator.publish "fbapi-loaded" + FB.init + appId: (if document.location.origin is "http://localhost:3000" then "607435142676437" else "148832601965463") # App ID + channelUrl: document.location.origin + "/channel.html" # Channel File + status: true # check login status + cookie: true # enable cookies to allow the server to access the session + xfbml: true # parse XFBML + + + # This is fired for any auth related change, such as login, logout or session refresh. + FB.Event.subscribe "auth.authResponseChange", (response) -> + + # Here we specify what we do with the response anytime this event occurs. + if response.status is "connected" + + # They have logged in to the app. + Backbone.Mediator.publish "facebook-logged-in", + response: response + + else if response.status is "not_authorized" + # + else + # + + # Load the SDK asynchronously + ((d) -> + js = undefined + id = "facebook-jssdk" + ref = d.getElementsByTagName("script")[0] + return if d.getElementById(id) + js = d.createElement("script") + js.id = id + js.async = true + js.src = "//connect.facebook.net/en_US/all.js" + + #js.src = "//connect.facebook.net/en_US/all/debug.js"; + ref.parentNode.insertBefore js, ref + return + ) document diff --git a/app/lib/filepicker.coffee b/app/lib/filepicker.coffee new file mode 100644 index 000000000..5b4ee7f82 --- /dev/null +++ b/app/lib/filepicker.coffee @@ -0,0 +1,28 @@ +module.exports = initializeFilepicker = -> + ((a) -> + return if window.filepicker + b = a.createElement("script") + b.type = "text/javascript" + b.async = not 0 + b.src = ((if "https:" is a.location.protocol then "https:" else "http:")) + "//api.filepicker.io/v1/filepicker.js" + c = a.getElementsByTagName("script")[0] + c.parentNode.insertBefore b, c + d = {} + d._queue = [] + e = "pick,pickMultiple,pickAndStore,read,write,writeUrl,export,convert,store,storeUrl,remove,stat,setKey,constructWidget,makeDropPane".split(",") + f = (a, b) -> + -> + b.push [ + a + arguments_ + ] + return + + g = 0 + + while g < e.length + d[e[g]] = f(e[g], d._queue) + g++ + window.filepicker = d + return + ) document diff --git a/app/lib/google.coffee b/app/lib/google.coffee new file mode 100644 index 000000000..c664efb86 --- /dev/null +++ b/app/lib/google.coffee @@ -0,0 +1,16 @@ +module.exports = initializeGoogle = -> + onGPlusLoaded = -> + Backbone.Mediator.publish "gapi-loaded" + return + signinCallback = (authResult) -> + Backbone.Mediator.publish "gplus-logged-in", authResult if authResult["access_token"] + return + (-> + po = document.createElement("script") + po.type = "text/javascript" + po.async = true + po.src = "https://apis.google.com/js/client:plusone.js?onload=onGPlusLoaded" + s = document.getElementsByTagName("script")[0] + s.parentNode.insertBefore po, s + return + )() diff --git a/app/lib/olark.coffee b/app/lib/olark.coffee new file mode 100644 index 000000000..09187223d --- /dev/null +++ b/app/lib/olark.coffee @@ -0,0 +1,116 @@ +module.exports = initializeOlark = -> + window.olark or ((c) -> # + s = -> + a.P r + f[z] r + return + f[z] = -> + (a.s = a.s or []).push arguments_ + return + + a = f[z]._ = {} + q = c.methods.length + while q-- + ((n) -> + f[z][n] = -> + f[z] "call", n, arguments_ + return + + return + ) c.methods[q] + a.l = c.loader + a.i = nt + a.p = 0: +new Date + a.P = (u) -> + a.p[u] = new Date - a.p[0] + return + + (if f.addEventListener then f.addEventListener(r, s, false) else f.attachEvent("on" + r, s)) + ld = -> + p = (hd) -> + hd = "head" + [ + "<" + hd + "><" + i + " onl" + "oad=\"var d=" + g + ";d.getElementsByTagName('head')[0]." + j + "(d." + h + "('script'))." + k + "='" + l + "//" + a.l + "'" + "\"" + ">" + ].join "" + i = "body" + m = d[i] + return setTimeout(ld, 100) unless m + a.P 1 + j = "appendChild" + h = "createElement" + k = "src" + n = d[h]("div") + v = n[j](d[h](z)) + b = d[h]("iframe") + g = "document" + e = "domain" + o = undefined + n.style.display = "none" + m.insertBefore(n, m.firstChild).id = z + b.frameBorder = "0" + b.id = z + "-loader" + b.src = "javascript:false" if /MSIE[ ]+6/.test(navigator.userAgent) + b.allowTransparency = "true" + v[j] b + try + b.contentWindow[g].open() + catch w + c[e] = d[e] + o = "javascript:var d=" + g + ".open();d.domain='" + d.domain + "';" + b[k] = o + "void(0);" + try + t = b.contentWindow[g] + t.write p() + t.close() + catch x + b[k] = o + "d.write(\"" + p().replace(/"/g, String.fromCharCode(92) + "\"") + "\");d.close();" + a.P 2 + return + + ld() + return + + nt() + return + )( + loader: "static.olark.com/jsclient/loader0.js" + name: "olark" + methods: [ + "configure" + "extend" + "declare" + "identify" + ] + ) + + # custom configuration goes here (www.olark.com/documentation) + olark.identify "1451-787-10-5544" #]]> + diff --git a/app/lib/segmentio.coffee b/app/lib/segmentio.coffee new file mode 100644 index 000000000..eae7dd588 --- /dev/null +++ b/app/lib/segmentio.coffee @@ -0,0 +1,41 @@ +module.exports = initializeSegmentio = -> + analytics = analytics or [] + (-> + e = [ + "identify" + "track" + "trackLink" + "trackForm" + "trackClick" + "trackSubmit" + "page" + "pageview" + "ab" + "alias" + "ready" + "group" + ] + t = (e) -> + -> + analytics.push [e].concat(Array::slice.call(arguments_, 0)) + return + + n = 0 + + while n < e.length + analytics[e[n]] = t(e[n]) + n++ + return + )() + analytics.load = (e) -> + t = document.createElement("script") + t.type = "text/javascript" + t.async = not 0 + t.src = ((if "https:" is document.location.protocol then "https://" else "http://")) + "d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/" + e + "/analytics.min.js" + + n = document.getElementsByTagName("script")[0] + n.parentNode.insertBefore t, n + return + + + analytics.load "jsjzx9n4d2" diff --git a/app/lib/temp.txt b/app/lib/temp.txt new file mode 100644 index 000000000..345d300f6 --- /dev/null +++ b/app/lib/temp.txt @@ -0,0 +1,18 @@ +/*<",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',">"].join("")}var i="body",m=d[i];if(!m){ + return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){ + b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{ + b.contentWindow[g].open()}catch(w){ + c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{ + var t=b.contentWindow[g];t.write(p());t.close()}catch(x){ + b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({ + loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]}); + /* custom configuration goes here (www.olark.com/documentation) */ + olark.identify('1451-787-10-5544');/*]]>*/ diff --git a/app/lib/twitter.coffee b/app/lib/twitter.coffee new file mode 100644 index 000000000..eaba1f36f --- /dev/null +++ b/app/lib/twitter.coffee @@ -0,0 +1,12 @@ +module.exports = initializeTwitter = -> + ((d, s, id) -> + js = undefined + fjs = d.getElementsByTagName(s)[0] + p = (if /^http:/.test(d.location) then "http" else "https") + unless d.getElementById(id) + js = d.createElement(s) + js.id = id + js.src = p + "://platform.twitter.com/widgets.js" + fjs.parentNode.insertBefore js, fjs + return + ) document, "script", "twitter-wjs" From 1c671a3c25281d595b101a1e2fa8911a631e3e72 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Mon, 16 Jun 2014 12:55:58 +0200 Subject: [PATCH 15/21] Refactored vendor loading --- app/assets/main.html | 13 ------------- app/initialize.coffee | 18 +++++++++++++++--- app/lib/filepicker.coffee | 2 +- app/lib/linkedin.coffee | 12 ++++++++++++ app/lib/olark.coffee | 4 ++-- app/lib/segmentio.coffee | 2 +- app/lib/temp.txt | 18 ------------------ 7 files changed, 31 insertions(+), 38 deletions(-) create mode 100644 app/lib/linkedin.coffee delete mode 100644 app/lib/temp.txt diff --git a/app/assets/main.html b/app/assets/main.html index 9f583173b..1aede0254 100644 --- a/app/assets/main.html +++ b/app/assets/main.html @@ -43,19 +43,6 @@ - - - - -
diff --git a/app/initialize.coffee b/app/initialize.coffee index 938a6188b..9f0283488 100644 --- a/app/initialize.coffee +++ b/app/initialize.coffee @@ -18,8 +18,12 @@ definitionSchemas = 'misc': require './schemas/definitions/misc' init = -> - # Set up Backbone.Mediator schemas + # Don't initialize all the social scripts when visiting demo pages + if not (/.*\/demo\/.*/).exec window.location.href + initializeSocial() + initializeVendors() + # Set up Backbone.Mediator schemas setUpDefinitions() setUpChannels() Backbone.Mediator.setValidationEnabled document.location.href.search(/codecombat.com/) is -1 @@ -65,11 +69,19 @@ setUpDefinitions = -> initializeVendors = -> initializers = filepicker: require './lib/filepicker' - #olark: require './lib/olark' + segmentio: require './lib/segmentio' + + for name, initializer of initializers + initializer() + +initializeSocial = -> + initializers = + + olark: require './lib/olark' facebook: require './lib/facebook' google: require './lib/google' twitter: require './lib/twitter' - #segmentio: require './lib/segmentio' + linkedin: require './lib/linkedin' for name, initializer of initializers initializer() diff --git a/app/lib/filepicker.coffee b/app/lib/filepicker.coffee index 5b4ee7f82..fde8ccd50 100644 --- a/app/lib/filepicker.coffee +++ b/app/lib/filepicker.coffee @@ -14,7 +14,7 @@ module.exports = initializeFilepicker = -> -> b.push [ a - arguments_ + arguments ] return diff --git a/app/lib/linkedin.coffee b/app/lib/linkedin.coffee new file mode 100644 index 000000000..aca441148 --- /dev/null +++ b/app/lib/linkedin.coffee @@ -0,0 +1,12 @@ +module.exports = initializeLinkedIn = -> + window.linkedInAsyncInit = -> + Backbone.Mediator.publish 'linkedin-loaded' + + linkedInSnippet = + '' + + $('head').append(linkedInSnippet) diff --git a/app/lib/olark.coffee b/app/lib/olark.coffee index 09187223d..e0189da1c 100644 --- a/app/lib/olark.coffee +++ b/app/lib/olark.coffee @@ -11,7 +11,7 @@ module.exports = initializeOlark = -> f[z] r return f[z] = -> - (a.s = a.s or []).push arguments_ + (a.s = a.s or []).push arguments return a = f[z]._ = {} @@ -19,7 +19,7 @@ module.exports = initializeOlark = -> while q-- ((n) -> f[z][n] = -> - f[z] "call", n, arguments_ + f[z] "call", n, arguments return return diff --git a/app/lib/segmentio.coffee b/app/lib/segmentio.coffee index eae7dd588..afb156245 100644 --- a/app/lib/segmentio.coffee +++ b/app/lib/segmentio.coffee @@ -17,7 +17,7 @@ module.exports = initializeSegmentio = -> ] t = (e) -> -> - analytics.push [e].concat(Array::slice.call(arguments_, 0)) + analytics.push [e].concat(Array::slice.call(arguments, 0)) return n = 0 diff --git a/app/lib/temp.txt b/app/lib/temp.txt deleted file mode 100644 index 345d300f6..000000000 --- a/app/lib/temp.txt +++ /dev/null @@ -1,18 +0,0 @@ -/*<",i,' onl' + 'oad="var d=',g,";d.getElementsByTagName('head')[0].",j,"(d.",h,"('script')).",k,"='",l,"//",a.l,"'",'"',">"].join("")}var i="body",m=d[i];if(!m){ - return setTimeout(ld,100)}a.P(1);var j="appendChild",h="createElement",k="src",n=d[h]("div"),v=n[j](d[h](z)),b=d[h]("iframe"),g="document",e="domain",o;n.style.display="none";m.insertBefore(n,m.firstChild).id=z;b.frameBorder="0";b.id=z+"-loader";if(/MSIE[ ]+6/.test(navigator.userAgent)){ - b.src="javascript:false"}b.allowTransparency="true";v[j](b);try{ - b.contentWindow[g].open()}catch(w){ - c[e]=d[e];o="javascript:var d="+g+".open();d.domain='"+d.domain+"';";b[k]=o+"void(0);"}try{ - var t=b.contentWindow[g];t.write(p());t.close()}catch(x){ - b[k]=o+'d.write("'+p().replace(/"/g,String.fromCharCode(92)+'"')+'");d.close();'}a.P(2)};ld()};nt()})({ - loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]}); - /* custom configuration goes here (www.olark.com/documentation) */ - olark.identify('1451-787-10-5544');/*]]>*/ From ee791da34c5713ed48bfeb55a0282040a4bb0c54 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 16 Jun 2014 10:42:13 -0700 Subject: [PATCH 16/21] Moved services into their own folder, and made no services run for both testing and demo pages. --- app/initialize.coffee | 42 ++++++++++-------------- app/lib/{ => services}/facebook.coffee | 0 app/lib/{ => services}/filepicker.coffee | 1 + app/lib/{ => services}/google.coffee | 0 app/lib/{ => services}/linkedin.coffee | 0 app/lib/{ => services}/olark.coffee | 0 app/lib/{ => services}/segmentio.coffee | 0 app/lib/{ => services}/twitter.coffee | 0 8 files changed, 19 insertions(+), 24 deletions(-) rename app/lib/{ => services}/facebook.coffee (100%) rename app/lib/{ => services}/filepicker.coffee (95%) rename app/lib/{ => services}/google.coffee (100%) rename app/lib/{ => services}/linkedin.coffee (100%) rename app/lib/{ => services}/olark.coffee (100%) rename app/lib/{ => services}/segmentio.coffee (100%) rename app/lib/{ => services}/twitter.coffee (100%) diff --git a/app/initialize.coffee b/app/initialize.coffee index 9f0283488..2e76c6de4 100644 --- a/app/initialize.coffee +++ b/app/initialize.coffee @@ -18,11 +18,11 @@ definitionSchemas = 'misc': require './schemas/definitions/misc' init = -> - # Don't initialize all the social scripts when visiting demo pages - if not (/.*\/demo\/.*/).exec window.location.href - initializeSocial() - - initializeVendors() + path = document.location.pathname + testing = path.startsWith '/test' + demoing = path.startsWith '/demo' + initializeServices() unless testing or demoing + # Set up Backbone.Mediator schemas setUpDefinitions() setUpChannels() @@ -33,7 +33,6 @@ init = -> treemaExt = require 'treema-ext' treemaExt.setup() - filepicker.setKey('AvlkNoldcTOU4PvKi2Xm7z') $ -> init() @@ -66,22 +65,17 @@ setUpDefinitions = -> for definition of definitionSchemas Backbone.Mediator.addDefSchemas definitionSchemas[definition] -initializeVendors = -> - initializers = - filepicker: require './lib/filepicker' - segmentio: require './lib/segmentio' +initializeServices = -> + services = [ + './lib/services/filepicker' + './lib/services/segmentio' + './lib/services/olark' + './lib/services/facebook' + './lib/services/google' + './lib/services/twitter' + './lib/services/linkedin' + ] - for name, initializer of initializers - initializer() - -initializeSocial = -> - initializers = - - olark: require './lib/olark' - facebook: require './lib/facebook' - google: require './lib/google' - twitter: require './lib/twitter' - linkedin: require './lib/linkedin' - - for name, initializer of initializers - initializer() + for service in services + service = require service + service() diff --git a/app/lib/facebook.coffee b/app/lib/services/facebook.coffee similarity index 100% rename from app/lib/facebook.coffee rename to app/lib/services/facebook.coffee diff --git a/app/lib/filepicker.coffee b/app/lib/services/filepicker.coffee similarity index 95% rename from app/lib/filepicker.coffee rename to app/lib/services/filepicker.coffee index fde8ccd50..2c16b48bd 100644 --- a/app/lib/filepicker.coffee +++ b/app/lib/services/filepicker.coffee @@ -23,6 +23,7 @@ module.exports = initializeFilepicker = -> while g < e.length d[e[g]] = f(e[g], d._queue) g++ + d.setKey('AvlkNoldcTOU4PvKi2Xm7z') window.filepicker = d return ) document diff --git a/app/lib/google.coffee b/app/lib/services/google.coffee similarity index 100% rename from app/lib/google.coffee rename to app/lib/services/google.coffee diff --git a/app/lib/linkedin.coffee b/app/lib/services/linkedin.coffee similarity index 100% rename from app/lib/linkedin.coffee rename to app/lib/services/linkedin.coffee diff --git a/app/lib/olark.coffee b/app/lib/services/olark.coffee similarity index 100% rename from app/lib/olark.coffee rename to app/lib/services/olark.coffee diff --git a/app/lib/segmentio.coffee b/app/lib/services/segmentio.coffee similarity index 100% rename from app/lib/segmentio.coffee rename to app/lib/services/segmentio.coffee diff --git a/app/lib/twitter.coffee b/app/lib/services/twitter.coffee similarity index 100% rename from app/lib/twitter.coffee rename to app/lib/services/twitter.coffee From a3af0d2ea5f301c46b490a4331f2b3a716cc4cec Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 16 Jun 2014 10:42:28 -0700 Subject: [PATCH 17/21] Got the PatchView demo working. --- .../demo/views/editor/PatchesView.demo.coffee | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/demo/views/editor/PatchesView.demo.coffee b/test/demo/views/editor/PatchesView.demo.coffee index dd1c347b6..a06da6631 100644 --- a/test/demo/views/editor/PatchesView.demo.coffee +++ b/test/demo/views/editor/PatchesView.demo.coffee @@ -16,13 +16,28 @@ class BlandModel extends CocoModel module.exports = -> - model = new BlandModel({_id:'12345'}) + model = new BlandModel({_id:'12345', name:'name', original:'original'}) v = new PatchesView(model) v.load() - # doesn't quite work yet. Intercepts a mixpanel request instead + # Respond to request for pending patches. r = jasmine.Ajax.requests.mostRecent() - r.send({statusCode:200, responseText:"[]"}) + patches = [ + { + delta: null + commitMessage: 'Demo message' + creator: '12345' + created: "2014-01-01T12:00:00.000Z" + status: 'pending' + } + ] + r.response({ status:200, responseText: JSON.stringify patches }) + + # Respond to request for user ids -> names + r = jasmine.Ajax.requests.mostRecent() + names = { '12345': { name: 'Patchman' } } + r.response({ status:200, responseText: JSON.stringify names }) + v.render() v From d6bb7ffe81b36da6a4844d7a746bd03288de6746 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 16 Jun 2014 11:17:48 -0700 Subject: [PATCH 18/21] Fixing tests. Somehow segmentio loading was making the jasmine test runner load properly in WebKit browsers. No idea why. --- app/assets/javascripts/boot.js | 7 +------ app/views/TestView.coffee | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/boot.js b/app/assets/javascripts/boot.js index e9a9123a3..47b125211 100755 --- a/app/assets/javascripts/boot.js +++ b/app/assets/javascripts/boot.js @@ -160,12 +160,7 @@ * * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded. */ - var currentWindowOnload = window.onload; - - window.onload = function() { - if (currentWindowOnload) { - currentWindowOnload(); - } + window.runJasmine = function() { htmlReporter.initialize(); env.execute(); }; diff --git a/app/views/TestView.coffee b/app/views/TestView.coffee index e999b3b0f..ef1d02fbf 100644 --- a/app/views/TestView.coffee +++ b/app/views/TestView.coffee @@ -15,7 +15,7 @@ module.exports = TestView = class TestView extends CocoView constructor: (options, @subPath='') -> super(options) @subPath = @subPath[1..] if @subPath[0] is '/' - @loadTestingLibs() unless TestView.loaded + @loadTestingLibs() loadTestingLibs: -> @queue = new createjs.LoadQueue() @@ -30,6 +30,7 @@ module.exports = TestView = class TestView extends CocoView @initSpecFiles() @render() TestView.runTests(@specFiles) + window.runJasmine() # RENDER DATA From 3e24b2f86e856a74a25db763d5873b3bfed9d023 Mon Sep 17 00:00:00 2001 From: Scott Erickson Date: Mon, 16 Jun 2014 11:38:03 -0700 Subject: [PATCH 19/21] Fixed tests running in karma. --- app/assets/javascripts/run-tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/run-tests.js b/app/assets/javascripts/run-tests.js index d2afed5cd..ad1de1989 100644 --- a/app/assets/javascripts/run-tests.js +++ b/app/assets/javascripts/run-tests.js @@ -1,5 +1,6 @@ // Helper for running tests through Karma. // Hooks into the test view logic for running tests. -TestView = require('views/test'); +require('initialize'); +TestView = require('views/TestView'); TestView.runTests(); \ No newline at end of file From b6c8a170d1bbe2b1b69751b5b6cf10dc6d927226 Mon Sep 17 00:00:00 2001 From: Tery Lim Date: Tue, 17 Jun 2014 10:50:56 +0800 Subject: [PATCH 20/21] Fix typo for receive --- server/commons/errors.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/commons/errors.coffee b/server/commons/errors.coffee index 3f60ef852..74c50a1f8 100644 --- a/server/commons/errors.coffee +++ b/server/commons/errors.coffee @@ -39,6 +39,6 @@ module.exports.gatewayTimeoutError = (res, message="Gateway timeout") -> res.send 504, message res.end() -module.exports.clientTimeout = (res, message="The server did not recieve the client response in a timely manner") -> +module.exports.clientTimeout = (res, message="The server did not receive the client response in a timely manner") -> res.send 408, message res.end() From c4d741294b0ccb65c7c41ff77315fd20203caa7d Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Tue, 17 Jun 2014 10:31:16 -0700 Subject: [PATCH 21/21] Created multicore.coffee --- multicore.coffee | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 multicore.coffee diff --git a/multicore.coffee b/multicore.coffee new file mode 100644 index 000000000..194b5940e --- /dev/null +++ b/multicore.coffee @@ -0,0 +1,14 @@ +cluster = require 'cluster' +numCPUs = require('os').cpus().length + +if cluster.isMaster + for i in [0...numCPUs] + cluster.fork() + cluster.on 'exit', (worker, code, signal) -> + console.log 'worker' + worker.process.id + 'died' + cluster.fork() +else + require('coffee-script') + require('coffee-script/register') + server = require('./server') + server.startServer()