From e00959a885d07b884cff5c6cb4908eb8c8ed3ad2 Mon Sep 17 00:00:00 2001 From: Darredevil Date: Thu, 26 Jun 2014 02:09:25 +0300 Subject: [PATCH 1/8] Added joke tip --- app/templates/play/level/level_loading.jade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/templates/play/level/level_loading.jade b/app/templates/play/level/level_loading.jade index 9cfc3622d..89e652a00 100644 --- a/app/templates/play/level/level_loading.jade +++ b/app/templates/play/level/level_loading.jade @@ -25,6 +25,7 @@ strong.tip(data-i18n='play_level.tip_impossible') It always seems impossible until it's done. - Nelson Mandela strong.tip.rare(data-i18n='play_level.tip_baby_coders') In the future, even babies will be Archmages. + strong.tip.rare(data-i18n='play_level.tip_joke') Q: How many programmers does it take to change a light bulb? A: None, it's a hardware problem. strong.tip.rare(data-i18n='play_level.tip_morale_improves') Loading will continue until morale improves. strong.tip.rare(data-i18n='play_level.tip_all_species') We believe in equal opportunities to learn programming for all species. strong.tip.rare(data-i18n='play_level.tip_reticulating') Reticulating spines. @@ -42,4 +43,4 @@ span= me.get('name') || 'Anoner' .errors - \ No newline at end of file + From 4309bfbe672bac3f4289812d8ec6aba5cff8f709 Mon Sep 17 00:00:00 2001 From: Darredevil Date: Wed, 9 Jul 2014 23:01:53 +0300 Subject: [PATCH 2/8] new Documentation page --- app/styles/docs/components.sass | 30 ++++++++++++++++++++++++++- app/templates/docs/components.jade | 23 +++++++++++++++++--- app/views/docs/components_view.coffee | 1 + 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/app/styles/docs/components.sass b/app/styles/docs/components.sass index 177b11a39..63146250d 100644 --- a/app/styles/docs/components.sass +++ b/app/styles/docs/components.sass @@ -1,2 +1,30 @@ #docs-components-view - color: saddlebrown \ No newline at end of file + color: saddlebrown + +.main + position : relative + + .left + bottom: 10em + left: 10em + overflow-y: scroll + overflow-x: hidden + position: fixed + top: 5em + white-space: nowrap + width: 20% + -webkit-overflow-scrolling: touch + + .right + left: 28em + bottom: 10em + position: fixed + overflow-y: scroll + overflow-x: hidden + right: 10em + top: 5em + //width: 80% + -webkit-overflow-scrolling: touch + + .specialList + list-style-type: none \ No newline at end of file diff --git a/app/templates/docs/components.jade b/app/templates/docs/components.jade index 20c3afb27..ceb0b5d72 100644 --- a/app/templates/docs/components.jade +++ b/app/templates/docs/components.jade @@ -1,6 +1,23 @@ extends /templates/base + block content - ul - for component in components - li= component.get('name') \ No newline at end of file + div.main + div.left + ul + for component in components + li= component.get('name') + ul + each doc in component.attributes.propertyDocumentation + a(href="##{component.get('name')}#{doc.name}") + li + | #{doc.name} + + div.right + ul + for component in components + each doc in component.attributes.propertyDocumentation + li(id="#{component.get('name')}#{doc.name}") + | #{doc.name} + ul.specialList + li=doc.description diff --git a/app/views/docs/components_view.coffee b/app/views/docs/components_view.coffee index f80decee3..14f942e44 100644 --- a/app/views/docs/components_view.coffee +++ b/app/views/docs/components_view.coffee @@ -18,6 +18,7 @@ module.exports = class UnnamedView extends RootView onLoaded: -> console.log 'we have the components...', (c.get('name') for c in @componentDocs.models) + console.log 'we have the attributes...', (c.attributes for c in @componentDocs.models) super() getRenderData: -> From 0ee0b2d5e384ebd2aec30881d36a4403871d980d Mon Sep 17 00:00:00 2001 From: Alphir Date: Wed, 9 Jul 2014 22:13:05 +0200 Subject: [PATCH 3/8] Update fr.coffee --- app/locale/fr.coffee | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/app/locale/fr.coffee b/app/locale/fr.coffee index 5a55252d0..45dc5903b 100644 --- a/app/locale/fr.coffee +++ b/app/locale/fr.coffee @@ -235,7 +235,7 @@ module.exports = nativeDescription: "français", englishDescription: "French", t basics_city_help: "Ville dans laquelle vous souhaitez travailler (ou dans laquelle vous vivez actuellement)." basics_country: "Pays" basics_country_help: "Pays dans lequel vous souhaitez travailler (ou dans lequel vous vivez actuellement)." - basics_visa: "Status de travail aux Etats-Unis" + basics_visa: "Statut de travail aux Etats-Unis" basics_visa_help: "Etes vous autorisé à travailler aux Etats-Unis ou avez vous besoin d'un parrainage pour le visa ?" basics_looking_for: "Recherche" basics_looking_for_full_time: "Temps plein" @@ -248,60 +248,60 @@ module.exports = nativeDescription: "français", englishDescription: "French", t name_anonymous: "Developpeur Anonyme" name_help: "Le nom que vous souhaitez que l'employeur voie, par exemple 'Chuck Norris'." short_description_header: "Décrivez vous en quelques mots" -# short_description_blurb: "Add a tagline to help an employer quickly learn more about you." + short_description_blurb: "Ajoutez une phrase d'accroche pour permettre à un employeur d'en savoir plus sur vous." short_description: "Description courte" short_description_help: "Qui êtes vous et que recherchez vous ? 140 caractères max." skills_header: "Compétences" skills_help: "Notez vos compétence de développement par ordre de maitrise." long_description_header: "Détaillez votre poste souhaité" -# 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." + long_description_blurb: "Faites savoir aux employeurs combien vous êtes génial et quel poste vous voulez." + long_description: "Biographie" + long_description_help: "Décrivez-vous aux potentiels employeurs. Soyez bref et direct. Nous vous recommandons de bien indiquer quel poste vous intéresse le plus. 600 caractères max." work_experience: "Experience de travail" -# 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_role: "Job Title" -# work_role_help: "What was your job title or role?" -# work_duration: "Duration" + work_header: "Présentez votre parcours professionnel" + work_years: "Années d'expérience" + work_years_help: "Combien d'années d'expérience professionnelle (salarié) avez-vous dans le développement logiciel ?" + work_blurb: "Lister vos missions les plus pertinentes, les plus récentes en premier." + work_employer: "Employeur" + work_employer_help: "Nom de votre employeur." + work_role: "Titre du poste" + work_role_help: "Quel était l'intitulé de votre mission ou votre poste ?" + work_duration: "Durée" # 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: "Description" + work_description_help: "Qu'est-ce que vous y avez fait ? (140 carac.; optionel)" 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_degree_help: "What was your degree and field of study?" -# education_duration: "Dates" -# education_duration_help: "When?" -# education_description: "Description" -# education_description_help: "Highlight anything about this educational experience. (140 chars; optional)" + education_header: "Racontez vos exploits scolaires" + education_blurb: "Lister vos exploits scolaires." + education_school: "Etablissement" + education_school_help: "Nom de l'établissement." + education_degree: "Diplôme" + education_degree_help: "Quel était votre diplôme et votre domaine d'étude ?" + education_duration: "Dates" + education_duration_help: "Quand ?" + education_description: "Description" + education_description_help: "Mettez en avant ce que vous voulez à propos de votre parcours scolaire. (140 carac.; optionel)" our_notes: "Notes" projects: "Projets" -# projects_header: "Add 3 projects" -# projects_header_2: "Projects (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." + projects_header: "Ajoutez 3 projets" + projects_header_2: "Projets (Top 3)" + projects_blurb: "Mettez en avant vos projets pour épater les employeurs." + project_name: "Nom du projet" + project_name_help: "Comment avez-vous appelé votre projet ?" + project_description: "Description" + project_description_help: "Décrivez brièvement le projet." + project_picture: "Image" + project_picture_help: "Chargez une image de 230x115px oou plus grande pour présenter votre projet." + project_link: "Lien" + project_link_help: "Lien vers le projet." # player_code: "Player Code" employers: -# want_to_hire_our_players: "Hire CodeCombat Players" -# what: "What is 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." + want_to_hire_our_players: "Embaucher un Joueur CodeCombat" + what: "Qu'est-ce que CodeCombat?" + what_blurb: "CodeCombat est un jeu de programmation multijoueur par navigateur. Les Joueurs écrivent le code pour contrôler leurs troupes dans des batailles contre d'autres développeurs. Nous prenons en charge JavaScript, Python, Lua, Clojure, CoffeeScript, et Io." + who: "Qui sont les Joueurs ?" + who_blurb: "CodeCombatants sont des développeurs logiciel qui aiment utiliser leurs compétences en programmation pour jouer. Ils sont tout aussi bien des étudiants issus des 20 meilleures écoles d'ingénieurs que des vétérans dans le milieu depuis plus de 20 ans." # how: "How Do We Find Developers?" # how_blurb: "We host competitive tournaments to attract competitive software engieneers. We then use in-house algorithms to identify the best players among the top 5% of tournament winners." # why: "Why Hire Through Us?" From 0ed8d2b3711e42e4466a898902da5ef2bbadc513 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 9 Jul 2014 13:41:42 -0700 Subject: [PATCH 4/8] Merged in the full-screen editor, and fixed a spell palette multi-language bug while at it. --- app/styles/play/level.sass | 6 ++++ app/styles/play/level/tome/problem_alert.sass | 28 +++++++++++++++---- app/styles/play/level/tome/spell.sass | 17 ++++++++++- app/styles/play/level/tome/spell_debug.sass | 10 +++++-- app/styles/play/level/tome/spell_list.sass | 9 ++++-- .../play/level/tome/spell_list_entry.sass | 25 ++++++++++++++--- .../level/tome/spell_list_entry_thangs.sass | 11 ++++++-- app/styles/play/level/tome/spell_palette.sass | 15 +++++++++- app/styles/play/level/tome/tome.sass | 12 ++++++-- app/templates/play/level/tome/spell.jade | 1 + .../play/level/tome/spell_list_tab_entry.jade | 5 ++++ .../play/level/tome/spell_palette.jade | 1 + app/views/play/level/modal/docs_modal.coffee | 1 - .../play/level/tome/doc_formatter.coffee | 3 +- .../tome/spell_list_tab_entry_view.coffee | 9 ++++++ bower.json | 6 +++- 16 files changed, 135 insertions(+), 24 deletions(-) diff --git a/app/styles/play/level.sass b/app/styles/play/level.sass index 64ea6e43a..3abc58d24 100644 --- a/app/styles/play/level.sass +++ b/app/styles/play/level.sass @@ -37,6 +37,12 @@ body.is-playing right: 0 top: 0px bottom: 0 + transition: width 0.5s ease-in-out + &.fullscreen-editor + position: fixed + width: 100% + height: 100% + z-index: 20 #pointer position: absolute diff --git a/app/styles/play/level/tome/problem_alert.sass b/app/styles/play/level/tome/problem_alert.sass index df410f680..d26a3ad5b 100644 --- a/app/styles/play/level/tome/problem_alert.sass +++ b/app/styles/play/level/tome/problem_alert.sass @@ -6,13 +6,14 @@ bottom: -120px left: 10px right: 10px - background: transparent url(/images/level/code_editor_error_background.png) no-repeat - background-size: 100% 100% + background: transparent border: 0 padding: 18px 35px 18px 14px text-shadow: none color: white word-wrap: break-word + border-image: url(/images/level/code_editor_error_background.png) 16 20 fill round + border-width: 16px 20px .close @include opacity(0.80) @@ -30,11 +31,28 @@ //&.alert-error &.alert-warning - background-image: url(/images/level/code_editor_warning_background.png) + border-image-source: url(/images/level/code_editor_warning_background.png) &.alert-info - background-image: url(/images/level/code_editor_info_background.png) + border-image-source: url(/images/level/code_editor_info_background.png) &.alert-style // Do we ever want to do this for style? - background-image: url(/images/level/code_editor_info_background.png) + border-image-source: url(/images/level/code_editor_info_background.png) + +html.no-borderimage + .problem-alert + border-width: 0 + border-image: none + background: transparent url(/images/level/code_editor_error_background.png) no-repeat + background-size: 100% 100% + + &.alert-warning + background-image: url(/images/level/code_editor_warning_background.png) + + &.alert-info + background-image: url(/images/level/code_editor_info_background.png) + + &.alert-style + // Do we ever want to do this for style? + background-image: url(/images/level/code_editor_info_background.png) \ No newline at end of file diff --git a/app/styles/play/level/tome/spell.sass b/app/styles/play/level/tome/spell.sass index 73d727457..291403dc0 100644 --- a/app/styles/play/level/tome/spell.sass +++ b/app/styles/play/level/tome/spell.sass @@ -26,6 +26,13 @@ top: 0 height: 100% width: 100% + + span.code-background + border-width: 22px + border-image: url(/images/level/code_editor_background.png) 22 fill round + + img.code-background + display: none .save-status display: none @@ -64,7 +71,7 @@ .ace_gutter background-color: rgba(255, 255, 255, 0.25) - width: 40px + width: 47px margin-left: 4px border-bottom: 1px dotted #2f261d @@ -133,3 +140,11 @@ .ace_searchbtn, .ace_replacebtn padding: 0px 4px + +html.no-borderimage + #spell-view + span.code-background + display: none + img.code-background + display: block + diff --git a/app/styles/play/level/tome/spell_debug.sass b/app/styles/play/level/tome/spell_debug.sass index 976675c2e..d06143caa 100644 --- a/app/styles/play/level/tome/spell_debug.sass +++ b/app/styles/play/level/tome/spell_debug.sass @@ -6,8 +6,8 @@ min-width: 250px max-width: 400px padding: 10px - background: transparent url(/images/level/popover_background.png) - background-size: 100% 100% + border-image: url(/images/level/popover_background.png) 18 fill round + border-width: 8px .progress position: relative span @@ -15,4 +15,10 @@ display: block color: black width: 100% + +html.no-borderimage + .spell-debug-view + background: transparent url(/images/level/popover_background.png) + background-size: 100% 100% + border: 0 diff --git a/app/styles/play/level/tome/spell_list.sass b/app/styles/play/level/tome/spell_list.sass index 0af5f314f..0692a47a0 100644 --- a/app/styles/play/level/tome/spell_list.sass +++ b/app/styles/play/level/tome/spell_list.sass @@ -8,6 +8,11 @@ left: 0% right: 10% padding: 4% - background: transparent url(/images/level/popover_background.png) - background-size: 100% 100% + border-image: url(/images/level/popover_background.png) 18 fill round + border-width: 15px +html.no-borderimage + #spell-list-view + background: transparent url(/images/level/popover_background.png) + background-size: 100% 100% + border: 0 \ No newline at end of file diff --git a/app/styles/play/level/tome/spell_list_entry.sass b/app/styles/play/level/tome/spell_list_entry.sass index 8d036dd57..8f8683c41 100644 --- a/app/styles/play/level/tome/spell_list_entry.sass +++ b/app/styles/play/level/tome/spell_list_entry.sass @@ -17,15 +17,15 @@ width: -webkit-calc(100% - 100px) width: calc(100% - 100px) padding: 0px 8px - background: transparent url(/images/level/code_editor_tab_background.png) no-repeat - background-size: 100% 100% + border-width: 3px + border-image: url(/images/level/code_editor_tab_background.png) 4 fill repeat text-align: center &.read-only background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%,rgba(0,0,0,0.2) 100%), url(/images/level/code_editor_tab_background.png) background-size: 100% 100% - .spell-list-button, .thang-avatar-wrapper, .reload-code, .beautify-code + .spell-list-button, .thang-avatar-wrapper, .reload-code, .beautify-code, .fullscreen-code width: $childSize height: $childSize margin: $childMargin @@ -41,6 +41,15 @@ .beautify-code float: right + .fullscreen-code + float: right + &:not(.maximized) + .icon-resize-small + display: none + &.maximized + .icon-fullscreen + display: none + .btn.btn-small background: transparent padding: 0 @@ -49,7 +58,7 @@ border-color: transparent @include box-shadow(none) - .icon-chevron-down, .icon-repeat, .icon-magnet + .icon-chevron-down, .icon-repeat, .icon-magnet, .icon-fullscreen, .icon-resize-small margin-top: 7px .thang-avatar-wrapper @@ -94,3 +103,11 @@ .thang-avatar-wrapper margin: 0 5px 0 0 //margin: 2px 10px 2px 5px + + +html.no-borderimage + .spell-list-entry-view.spell-tab + border-width: 0 + border-image: none + background: transparent url(/images/level/code_editor_tab_background.png) no-repeat + background-size: 100% 100% \ No newline at end of file diff --git a/app/styles/play/level/tome/spell_list_entry_thangs.sass b/app/styles/play/level/tome/spell_list_entry_thangs.sass index 0f005675a..5398423f9 100644 --- a/app/styles/play/level/tome/spell_list_entry_thangs.sass +++ b/app/styles/play/level/tome/spell_list_entry_thangs.sass @@ -10,8 +10,8 @@ max-height: 500px overflow: scroll padding: 4% - background: transparent url(/images/level/popover_background.png) - background-size: 100% 100% + border-image: url(/images/level/popover_background.png) 18 fill round + border-width: 15px .thang-avatar-view cursor: pointer @@ -20,4 +20,9 @@ display: inline-block - +html.no-borderimage + .spell-list-entry-view + .spell-list-entry-thangs-view + background: transparent url(/images/level/popover_background.png) + background-size: 100% 100% + border: 0 \ No newline at end of file diff --git a/app/styles/play/level/tome/spell_palette.sass b/app/styles/play/level/tome/spell_palette.sass index 5e19cc0ce..3e2f78794 100644 --- a/app/styles/play/level/tome/spell_palette.sass +++ b/app/styles/play/level/tome/spell_palette.sass @@ -17,13 +17,20 @@ z-index: 0 //overflow-y: auto - img + .code-palette-background position: absolute left: 0 top: 0 width: 100% height: 100% z-index: -1 + + span.code-palette-background + border-width: 25px + border-image: url(/images/level/code_palette_background.png) 25 fill round + + img.code-palette-background + display: none &.disabled @include opacity(0.80) @@ -86,3 +93,9 @@ &.io background-image: url(/images/pages/home/language_logo_io.png) +html.no-borderimage + #spell-palette-view + span.code-palette-background + display: none + img.code-palette-background + display: block \ No newline at end of file diff --git a/app/styles/play/level/tome/tome.sass b/app/styles/play/level/tome/tome.sass index 773005d64..370cc293d 100644 --- a/app/styles/play/level/tome/tome.sass +++ b/app/styles/play/level/tome/tome.sass @@ -37,9 +37,8 @@ .popover padding: 10px 10px 30px 10px - background: transparent url(/images/level/popover_background.png) - background-size: 100% 100% - border: 0 + border-image: url(/images/level/popover_background.png) 18 fill round + border-width: 15px @include box-shadow(0 0 0 #000) h1:not(.not-code), h2:not(.not-code), h3:not(.not-code), h4:not(.not-code), h5:not(.not-code), h6:not(.not-code) @@ -70,3 +69,10 @@ pre display: inline-block padding: 5px + +html.no-borderimage + #tome-view + .popover + background: transparent url(/images/level/popover_background.png) + background-size: 100% 100% + border: 0 diff --git a/app/templates/play/level/tome/spell.jade b/app/templates/play/level/tome/spell.jade index 85fcdbda0..32a97806d 100644 --- a/app/templates/play/level/tome/spell.jade +++ b/app/templates/play/level/tome/spell.jade @@ -1,4 +1,5 @@ img(src="/images/level/code_editor_background.png").code-background +span.code-background div.ace diff --git a/app/templates/play/level/tome/spell_list_tab_entry.jade b/app/templates/play/level/tome/spell_list_tab_entry.jade index 8ebad097f..9199b8a48 100644 --- a/app/templates/play/level/tome/spell_list_tab_entry.jade +++ b/app/templates/play/level/tome/spell_list_tab_entry.jade @@ -4,10 +4,15 @@ code #{methodSignature} +.btn.btn-small.fullscreen-code(title="Expand code editor") + i.icon-fullscreen + i.icon-resize-small + .btn.btn-small.reload-code(title="Reload original code for " + spell.name) i.icon-repeat .btn.btn-small.beautify-code(title="Ctrl+Shift+B: Beautify code for " + spell.name) i.icon-magnet + .clearfix \ No newline at end of file diff --git a/app/templates/play/level/tome/spell_palette.jade b/app/templates/play/level/tome/spell_palette.jade index 2164a970b..2344bfdaf 100644 --- a/app/templates/play/level/tome/spell_palette.jade +++ b/app/templates/play/level/tome/spell_palette.jade @@ -1,4 +1,5 @@ img(src="/images/level/code_palette_background.png").code-palette-background +span.code-palette-background .code-language-logo ul(class="nav nav-pills" + (tabbed ? ' multiple-tabs' : '')) each slug, group in entryGroupSlugs diff --git a/app/views/play/level/modal/docs_modal.coffee b/app/views/play/level/modal/docs_modal.coffee index 72aa6b8d0..9970b8916 100644 --- a/app/views/play/level/modal/docs_modal.coffee +++ b/app/views/play/level/modal/docs_modal.coffee @@ -8,7 +8,6 @@ utils = require 'lib/utils' module.exports = class DocsModal extends View template: template id: 'docs-modal' - plain: true shortcuts: 'enter': 'hide' diff --git a/app/views/play/level/tome/doc_formatter.coffee b/app/views/play/level/tome/doc_formatter.coffee index 2d256c3ad..d159d08e4 100644 --- a/app/views/play/level/tome/doc_formatter.coffee +++ b/app/views/play/level/tome/doc_formatter.coffee @@ -83,7 +83,7 @@ module.exports = class DocFormatter @doc.title = if @options.shortenize then @doc.shorterName else @doc.shortName # Grab the language-specific documentation for some sub-properties, if we have it. - toTranslate = [{obj: @doc, prop: 'example'}, {obj: @doc, prop: 'returns'}] + toTranslate = [{obj: @doc, prop: 'description'}, {obj: @doc, prop: 'example'}, {obj: @doc, prop: 'returns'}] for arg in (@doc.args ? []) toTranslate.push {obj: arg, prop: 'example'}, {obj: arg, prop: 'description'} for {obj, prop} in toTranslate @@ -93,6 +93,7 @@ module.exports = class DocFormatter obj[prop] = null formatPopover: -> + console.log "gotta do the popover", @doc content = popoverTemplate doc: @doc, language: @options.language, value: @formatValue(), marked: marked, argumentExamples: (arg.example or arg.default or arg.name for arg in @doc.args ? []) owner = if @doc.owner is 'this' then @options.thang else window[@doc.owner] content = content.replace /#{spriteName}/g, @options.thang.type ? @options.thang.spriteName # Prefer type, and excluded the quotes we'd get with @formatValue diff --git a/app/views/play/level/tome/spell_list_tab_entry_view.coffee b/app/views/play/level/tome/spell_list_tab_entry_view.coffee index 1938cc1e4..32d4682b1 100644 --- a/app/views/play/level/tome/spell_list_tab_entry_view.coffee +++ b/app/views/play/level/tome/spell_list_tab_entry_view.coffee @@ -18,6 +18,7 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView 'click .spell-list-button': 'onDropdownClick' 'click .reload-code': 'onCodeReload' 'click .beautify-code': 'onBeautifyClick' + 'click .fullscreen-code': 'onFullscreenClick' constructor: (options) -> super options @@ -86,6 +87,14 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView return unless @controlsEnabled Backbone.Mediator.publish 'spell-beautify', spell: @spell + onFullscreenClick: -> + unless $('.fullscreen-code').hasClass 'maximized' + $('#code-area').addClass 'fullscreen-editor' + $('.fullscreen-code').addClass 'maximized' + else + $('#code-area').removeClass 'fullscreen-editor' + $('.fullscreen-code').removeClass 'maximized' + updateReloadButton: -> changed = @spell.hasChanged null, @spell.getSource() @$el.find('.reload-code').css('display', if changed then 'inline-block' else 'none') diff --git a/bower.json b/bower.json index 357b9d431..e979e2f49 100644 --- a/bower.json +++ b/bower.json @@ -44,7 +44,8 @@ "bootstrap": "~3.1.1", "validated-backbone-mediator": "~0.1.3", "jquery.browser": "~0.0.6", - "zatanna": "~0.0.2" + "zatanna": "~0.0.2", + "modernizr": "~2.8.3" }, "overrides": { "backbone": { @@ -81,6 +82,9 @@ "./dist/fonts/glyphicons-halflings-regular.ttf", "./dist/fonts/glyphicons-halflings-regular.woff" ] + }, + "modernizr": { + "main": "modernizr.js" } } } From bcf3c19f8190873fadc7e7c033c28beb1081f71b Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 9 Jul 2014 15:32:57 -0700 Subject: [PATCH 5/8] Some slight improvements to the components docs page; still don't know how to get it to be full-height with independently scrolling columsn, though. --- app/styles/docs/components.sass | 36 ++++++++++------------------ app/templates/docs/components.jade | 38 +++++++++++++++--------------- 2 files changed, 31 insertions(+), 43 deletions(-) diff --git a/app/styles/docs/components.sass b/app/styles/docs/components.sass index 63146250d..fc1dec4f5 100644 --- a/app/styles/docs/components.sass +++ b/app/styles/docs/components.sass @@ -1,30 +1,18 @@ #docs-components-view color: saddlebrown -.main - position : relative + .row - .left - bottom: 10em - left: 10em - overflow-y: scroll - overflow-x: hidden - position: fixed - top: 5em - white-space: nowrap - width: 20% - -webkit-overflow-scrolling: touch + .index-column, .documentation-column + overflow-y: scroll + overflow-x: hidden + min-height: 600px - .right - left: 28em - bottom: 10em - position: fixed - overflow-y: scroll - overflow-x: hidden - right: 10em - top: 5em - //width: 80% - -webkit-overflow-scrolling: touch + > ul + padding: 0px 20px 20px 20px - .specialList - list-style-type: none \ No newline at end of file + + .documentation-column + + .specialList + list-style-type: none diff --git a/app/templates/docs/components.jade b/app/templates/docs/components.jade index ceb0b5d72..0e546da7e 100644 --- a/app/templates/docs/components.jade +++ b/app/templates/docs/components.jade @@ -2,22 +2,22 @@ extends /templates/base block content - div.main - div.left - ul - for component in components - li= component.get('name') - ul - each doc in component.attributes.propertyDocumentation - a(href="##{component.get('name')}#{doc.name}") - li - | #{doc.name} - - div.right - ul - for component in components - each doc in component.attributes.propertyDocumentation - li(id="#{component.get('name')}#{doc.name}") - | #{doc.name} - ul.specialList - li=doc.description + .row + .col-xs-3.index-column.nano + ul.nav.nav-list.list-group.nano-content + for component in components + li= component.get('name') + ul + each doc in component.attributes.propertyDocumentation + a(href="##{component.get('name')}#{doc.name}") + li + | #{doc.name} + .col-xs-9.documentation-column.nano + ul.nano-content + for component in components + each doc in component.attributes.propertyDocumentation + li(id="#{component.get('name')}#{doc.name}") + | #{doc.name} + ul.specialList + li=doc.description + \ No newline at end of file From 8700da65707133e50274c9905ecc4d0fc406c5e4 Mon Sep 17 00:00:00 2001 From: nemoyatpeace Date: Thu, 10 Jul 2014 09:19:59 +0800 Subject: [PATCH 6/8] Update play_view.coffee Added my level to the page. --- app/views/play_view.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/views/play_view.coffee b/app/views/play_view.coffee index 4dea0a4f6..4d9d84fef 100644 --- a/app/views/play_view.coffee +++ b/app/views/play_view.coffee @@ -255,6 +255,13 @@ module.exports = class PlayView extends View image: '/file/db/level/52740644904ac0411700067c/rescue_mission_icon.png' description: 'Fetch the wizards teleporting into the area - by Nathan Gossett' } + { + name: "Let's go Fly a Kite" + difficulty: 3 + id: 'lets-go-fly-a-kite' + image: '/file/db/level/526711d9add4f8965f000002/hunter_triplets_icon.png' + description: 'There is a horde of ogres marching on your village. Stay out of reach and use your bow to take them out! - by Danny Whittaker' + } ] context.campaigns = [ From 9ee373428f3c5bcae8466360c19e2d6c0ec387e0 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Thu, 10 Jul 2014 08:31:34 -0700 Subject: [PATCH 7/8] Fixed some schema issues related to snippets and code languages. --- app/lib/surface/CocoSprite.coffee | 2 +- app/schemas/models/level_component.coffee | 12 ++++++++---- app/schemas/schemas.coffee | 10 +++++++--- app/views/play/level/tome/doc_formatter.coffee | 1 - 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/lib/surface/CocoSprite.coffee b/app/lib/surface/CocoSprite.coffee index 1f18a4f6b..24c5dc67b 100644 --- a/app/lib/surface/CocoSprite.coffee +++ b/app/lib/surface/CocoSprite.coffee @@ -698,7 +698,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass AudioPlayer.playInterfaceSound 'coin_1', 0.25 if @thang.actionActivated and (action = @thang.getActionName()) isnt 'say' @playSound action, withDelay, volume - if @thang.sayMessage and withDelay # don't play sayMessages while scrubbing, annoying + if @thang.sayMessage and withDelay and not @thang.silent # don't play sayMessages while scrubbing, annoying offsetFrames = Math.abs(@thang.sayStartTime - @thang.world.age) / @thang.world.dt if offsetFrames <= 2 # or (not withDelay and offsetFrames < 30) sound = AudioPlayer.soundForDialogue @thang.sayMessage, @thangType.get 'soundTriggers' diff --git a/app/schemas/models/level_component.coffee b/app/schemas/models/level_component.coffee index a974d6dc7..738e954ce 100644 --- a/app/schemas/models/level_component.coffee +++ b/app/schemas/models/level_component.coffee @@ -27,27 +27,29 @@ PropertyDocumentationSchema = c.object { type: c.shortString(title: 'Type', description: 'Intended type of the property.') description: oneOf: [ - {title: 'Description', type: 'string', description: 'Description of the property.', maxLength: 1000, format: 'markdown'} { type: 'object', title: 'Language Descriptions', description: 'Property descriptions by code language.', additionalProperties: {type: 'string', description: 'Description of the property.', maxLength: 1000, format: 'markdown'} format: 'code-languages-object' + default: {javascript: ''} } + {title: 'Description', type: 'string', description: 'Description of the property.', maxLength: 1000, format: 'markdown'} ] args: c.array {title: 'Arguments', description: 'If this property has type "function", then provide documentation for any function arguments.'}, c.FunctionArgumentSchema owner: {title: 'Owner', type: 'string', description: 'Owner of the property, like "this" or "Math".'} example: oneOf: [ - {title: 'Example', type: 'string', description: 'An optional example code block.', format: 'javascript'} { type: 'object', title: 'Language Examples', description: 'Examples by code language.', additionalProperties: {type: 'string', description: 'An example code block.', format: 'code'} format: 'code-languages-object' + default: {javascript: ''} } + {title: 'Example', type: 'string', description: 'An optional example code block.', format: 'javascript'} ] snippets: {type: 'object', title: 'Snippets', description: 'List of snippets for the respective programming languages', additionalProperties: c.codeSnippet, format: 'code-languages-object'} returns: c.object { @@ -59,25 +61,27 @@ PropertyDocumentationSchema = c.object { type: c.shortString(title: 'Type', description: 'Type of the return value') example: oneOf: [ - c.shortString(title: 'Example', description: 'Example return value') { type: 'object', title: 'Language Examples', description: 'Example return values by code language.', additionalProperties: c.shortString(description: 'Example return value.', format: 'code') format: 'code-languages-object' + default: {javascript: ''} } + c.shortString(title: 'Example', description: 'Example return value') ] description: oneOf: [ - {title: 'Description', type: 'string', description: 'Description of the return value.', maxLength: 1000} { type: 'object', title: 'Language Descriptions', description: 'Example return values by code language.', additionalProperties: {type: 'string', description: 'Description of the return value.', maxLength: 1000} format: 'code-languages-object' + default: {javascript: ''} } + {title: 'Description', type: 'string', description: 'Description of the return value.', maxLength: 1000} ] DependencySchema = c.object { diff --git a/app/schemas/schemas.coffee b/app/schemas/schemas.coffee index 7b8775b68..65045a2e7 100644 --- a/app/schemas/schemas.coffee +++ b/app/schemas/schemas.coffee @@ -163,30 +163,34 @@ me.FunctionArgumentSchema = me.object { type: me.shortString(title: 'Type', description: 'Intended type of the argument.') example: oneOf: [ - me.shortString(title: 'Example', description: 'Example value for the argument.') { type: 'object', title: 'Language Examples', description: 'Examples by code language.', additionalProperties: me.shortString(description: 'Example value for the argument.') + format: 'code-languages-object' + default: {javascript: ''} } + me.shortString(title: 'Example', description: 'Example value for the argument.') ] description: oneOf: [ - {title: 'Description', type: 'string', description: 'Description of the argument.', maxLength: 1000} { type: 'object', title: 'Language Descriptions', description: 'Example argument descriptions by code language.', additionalProperties: {type: 'string', description: 'Description of the argument.', maxLength: 1000} + format: 'code-languages-object' + default: {javascript: ''} } + {title: 'Description', type: 'string', description: 'Description of the argument.', maxLength: 1000} ] 'default': title: 'Default' description: 'Default value of the argument. (Your code should set this.)' 'default': null -me.codeSnippet = +me.codeSnippet = me.object {description: 'A language-specific code snippet'}, code: {type: 'string', title: 'Snippet', default: '', description: 'Code snippet. Use ${1:defaultValue} syntax to add flexible arguments'} tab: {type: 'string', title: 'Tab Trigger', description: 'Tab completion text. Will be expanded to the snippet if typed and hit tab.'} diff --git a/app/views/play/level/tome/doc_formatter.coffee b/app/views/play/level/tome/doc_formatter.coffee index d159d08e4..dab9a0ee8 100644 --- a/app/views/play/level/tome/doc_formatter.coffee +++ b/app/views/play/level/tome/doc_formatter.coffee @@ -93,7 +93,6 @@ module.exports = class DocFormatter obj[prop] = null formatPopover: -> - console.log "gotta do the popover", @doc content = popoverTemplate doc: @doc, language: @options.language, value: @formatValue(), marked: marked, argumentExamples: (arg.example or arg.default or arg.name for arg in @doc.args ? []) owner = if @doc.owner is 'this' then @options.thang else window[@doc.owner] content = content.replace /#{spriteName}/g, @options.thang.type ? @options.thang.spriteName # Prefer type, and excluded the quotes we'd get with @formatValue From 2eeb7ec5aa584aec93d1b8e226ca6e4ceb3599f2 Mon Sep 17 00:00:00 2001 From: Michael Schmatz Date: Thu, 10 Jul 2014 10:42:17 -0700 Subject: [PATCH 8/8] Make random games come from all levels --- server/queues/scoring.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/queues/scoring.coffee b/server/queues/scoring.coffee index 4a57234c1..3d67ef25a 100644 --- a/server/queues/scoring.coffee +++ b/server/queues/scoring.coffee @@ -125,11 +125,12 @@ module.exports.getTwoGames = (req, res) -> #if userIsAnonymous req then return errors.unauthorized(res, 'You need to be logged in to get games.') humansGameID = req.body.humansGameID ogresGameID = req.body.ogresGameID - + ladderGameIDs = ['greed','criss-cross','brawlwood','dungeon-arena','gold-rush'] + levelID = _.sample ladderGameIDs unless ogresGameID and humansGameID #fetch random games here queryParams = - 'levelID': 'greed' + 'levelID': levelID 'submitted': true 'team': 'humans' selection = 'team totalScore transpiledCode submittedCodeLanguage teamSpells levelID creatorName creator submitDate' @@ -140,7 +141,7 @@ module.exports.getTwoGames = (req, res) -> return res.end() humanSkipCount = Math.floor(Math.random() * numberOfHumans) ogreCountParams = - 'levelID': 'greed' + 'levelID': levelID 'submitted': true 'team': 'ogres' LevelSession.count ogreCountParams, (err, numberOfOgres) => @@ -161,7 +162,7 @@ module.exports.getTwoGames = (req, res) -> if err? then return errors.serverError(res, "Couldn't select a random session! #{err}") randomSession = randomSession[0] queryParams = - 'levelID': 'greed' + 'levelID': levelID 'submitted': true 'team': 'ogres' query = LevelSession