From 34dd42a7cab9ec783cc60c9dd61d86e54199b15f Mon Sep 17 00:00:00 2001 From: Tom Steinbrecher Date: Mon, 6 Jan 2014 00:41:31 -0500 Subject: [PATCH 1/5] Refactored contribute pages, each class has it's own page. Better fix to issue 13 and solution to 14 --- app/styles/contribute.sass | 41 --- app/templates/contribute.jade | 591 +++++++++++++++++----------------- 2 files changed, 296 insertions(+), 336 deletions(-) diff --git a/app/styles/contribute.sass b/app/styles/contribute.sass index 615022a47..e69de29bb 100644 --- a/app/styles/contribute.sass +++ b/app/styles/contribute.sass @@ -1,41 +0,0 @@ -#contribute-view - - #homepage_screenshot - margin: 20px 0px - .signature - text-align: right - - a - cursor: pointer - - .class_image - float: left - width: 150px - margin: 10px 10px 20px 20px - padding-top: 65px - - #contribute-nav - float: left - max-width: 20% - width: 250px - box-sizing: border-box - margin-left: 20px - - li - float: none - width: 100% - - #contribute-main - margin-left: 25% - padding: 40px - box-sizing: border-box - - h3 - padding-top: 70px - - .well - padding: 5px 5px 5px 30px - - .saved-notification - display: none - float: right diff --git a/app/templates/contribute.jade b/app/templates/contribute.jade index 91a16995e..31c4e63f9 100644 --- a/app/templates/contribute.jade +++ b/app/templates/contribute.jade @@ -2,325 +2,326 @@ extends /templates/base block content - ul.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="#archmage") Archmage (Coder) - li - a(href="#artisan") Artisan (Level Builder) - li - a(href="#adventurer") Adventurer (Level Playtester) - li - a(href="#scribe") Scribe (Article Editor) - li - a(href="#diplomat") Diplomat (Translator) - li - a(href="#ambassador") Ambassador (Support) - li - a(href="#counselor") Counselor (Expert/Teacher) + div.contribute_class - hr - p Thanks to our lovely contributors: (work in progress; let us know who you are!) - li Turkish - Nazım Gediz Aydındoğmuş - li Brazilian Portuguese - Gutenberg Barros, Kieizroe, Matthew Burt - li Portugal Portuguese - Matthew Burt - li German - Dirk, Anon - li Thai - Kamolchanok Jittrepit - li Greek - Stergios - li Latin American Spanish - Jesús Ruppel, Matthew Burt, Mariano Luzza - li Spain Spanish - Matthew Burt, Anon - li French - Xeonarno, Anon - li Hungarian - Anon - li Japanese - g1itch - li Chinese - spacepope - li Polish - Anon - li Danish - Anon - li Slovak - Anon - li Artisans - Sootn, Aftermath, mcdavid1991 - li Scribes - Ryan Faidley - li Adventurers - Kieizroe, (...) - li Archmages - David Golds, Zach Martin, Tom Steinbrecher, Mischa Lewis-Norelle, Sébastien Moratinos + ul.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="#archmage") Archmage (Coder) + li + a(href="#artisan") Artisan (Level Builder) + li + a(href="#adventurer") Adventurer (Level Playtester) + li + a(href="#scribe") Scribe (Article Editor) + li + a(href="#diplomat") Diplomat (Translator) + li + a(href="#ambassador") Ambassador (Support) + li + a(href="#counselor") Counselor (Expert/Teacher) - div#contribute-main - div#intro + div#contribute-main.class_main + div#intro - h2 Contributing + h2 Contributing - #homepage_screenshot - img(src="/images/pages/contribute/contribute_header.png", alt="") + #homepage_screenshot + img(src="/images/pages/contribute/contribute_header.png", alt="") - p - strong We have high hopes for CodeCombat. - | 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, - a(href="https://github.com/codecombat/codecombat") CodeCombat is totally open source - | , and we aim to provide as many ways as possible for you to take part and - | make this project as much yours as ours. - p We hope you'll join our party! - p.signature - Nick, George, Scott, Michael, and Jeremy - hr + p + strong We have high hopes for CodeCombat. + | 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, + a(href="https://github.com/codecombat/codecombat") CodeCombat is totally open source + | , and we aim to provide as many ways as possible for you to take part and + | make this project as much yours as ours. + p We hope you'll join our party! + p.signature - Nick, George, Scott, Michael, and Jeremy + hr - if me.attributes.anonymous - div#sign-up.alert.alert-info - strong Hey there! - | To subscribe for class emails, you'll need to - a(data-toggle="coco-modal", data-target="modal/signup") create an account - | first . + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . - #archmage - .class_image - img(src="/images/pages/contribute/archmage.png", alt="") + #archmage + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/archmage.png", alt="") - h3 Archmage (Coder) - p One of the best parts about building games is they synthesize so many different things. - | Graphics, sound, real-time networking, social networking, and of course many of the - | more common aspects of programming, from low-level database management, - | and server administration to user facing design and interface building. - | There's a lot to do, and if you're an experienced programmer with a hankering - | to really dive into the nitty-gritty of CodeCombat, this class might be for you. - | We would love to have your help building the best programming game ever. + h3.header-scrolling-fix Archmage (Coder) + p One of the best parts about building games is they synthesize so many different things. + | Graphics, sound, real-time networking, social networking, and of course many of the + | more common aspects of programming, from low-level database management, + | and server administration to user facing design and interface building. + | There's a lot to do, and if you're an experienced programmer with a hankering + | to really dive into the nitty-gritty of CodeCombat, this class might be for you. + | We would love to have your help building the best programming game ever. + + h4 Class Attributes + ul + li Knowledge in + a(href="http://coffeescript.org/") CoffeeScript + | , or a desire to learn. Most of our code is in this language. + | If you're a fan of Ruby or Python, you'll feel right at home. + | It's just JavaScript, but with a nicer syntax. + li Some experience in programming and personal initiative. + | We'll help you get oriented, but we can't spend much time training you. + + h4 How To Join + + p + | Anyone can help out! Just check out our + a(title='GitHub', href="https://github.com/codecombat/codecombat", tabindex=-1) GitHub + | to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email. + | Want to chat about what to do or how to get more deeply involved? + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Email us + | , or find us in our + a(href="http://www.hipchat.com/g3plnOKqa") public HipChat room + | and we'll go from there! + + a(href="/contribute/archmage") + h3 Learn More About Becoming A Powerful Archmage + + label.checkbox(for="developer").well + input(type='checkbox', name="developer", id="developer") + | Get emails on new coding opportunities and announcements. + .saved-notification ✓ Saved + + + #artisan + + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/artisan.png", alt="") + + h3.header-scrolling-fix Artisan (Level Builder) + p We must construct additional levels! + | People be clamoring for more content, and we can only build so many ourselves. + | Right now your workstation is level one; our level editor is barely + | usable even by its creators, so be wary. + | If you have visions of campaigns spanning for-loops to + a(href="http://stackoverflow.com/questions/758088/seeking-contrived-example-code-continuations/758105#758105") Mondo Bizzaro + | to then this class might be for you. + + h4 Class Attributes + ul + li Any experience in building content like this would be nice, such as using + | Blizzard's level editors. But not required! + li A hankering to do a whole lot of testing and iteration. + | To make good levels, you need to take it to others and watch them play it, + | and be prepared to find a lot of things to fix. + li For the time being, endurance en par with an Adventurer. + | Our Level Editor is super preliminary and frustrating to use. You have been warned! + + h4 How To Join + p The Level Editor is live! Go forth and fiddle with it. + | Right now for the sake of security, you can't make Components (the most powerful part of level building) + | but be in touch with us and we'll see if we can make what you need. + | See the + a(href="https://docs.google.com/document/d/117tMcL95T1KY8BDisr0iGi5Frb2ZvBJTC0us5hyQkJY/edit?usp=sharing") preliminary documentation + | for more info, and please comment on it so we can make the whole system better. + + a(href="/contribute/artisan") + h3 Learn More About Becoming A Creative Artisan + + label.checkbox(for="level_creator").well + input(type='checkbox', name="level_creator", id="level_creator") + | Get emails on level editor updates and announcements. + .saved-notification ✓ Saved + + + #adventurer + + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/adventurer.png", alt="") + + h3.header-scrolling-fix Adventurer (Level Playtester) + p Let's be clear about your role: you are the tank. You're going to take heavy damage. + | We need people to try out brand-new levels and help identify how to make things better. + | The pain will be enormous; making good games is a long process and no one gets + | it right the first time. + | If you can endure and have a high constitution score, then this class might be for you. + + h4 Class Attributes + ul + li A thirst for learning. You want to learn how to code and we want to teach you how to code. + | You'll probably be doing most of the teaching in this case, though. + li Charismatic. Be gentle but articulate about what needs improving, and offer suggestions + | on how to improve. + + h4 How To Join + p Either get together with (or recruit!) an Artisan and work with them, or + | check the box below to receive emails when there are new levels to test. + | We'll also be posting about levels to review on our networks like + a(href="http://discourse.codecombat.com/category/adventurer") our forum + | , + a(href="https://www.facebook.com/codecombat") Facebook + | , + a(href="http://www.reddit.com/r/CodeCombat/") Reddit + | , + a(href="https://twitter.com/CodeCombat") Twitter + | , and + a(href="https://plus.google.com/115285980638641924488/posts") Google+ + | , so if you prefer to be notified those ways, sign up there! + + a(href="/contribute/adventurer") + h3 Learn More About Becoming A Brave Adventurer + + label.checkbox(for="tester").well + input(type='checkbox', name="tester", id="tester") + | Get emails when there are new levels to test. + .saved-notification ✓ Saved - h4 Class Attributes - ul - li Knowledge in - a(href="http://coffeescript.org/") CoffeeScript - | , or a desire to learn. Most of our code is in this language. - | If you're a fan of Ruby or Python, you'll feel right at home. - | It's just JavaScript, but with a nicer syntax. - li Some experience in programming and personal initiative. - | We'll help you get oriented, but we can't spend much time training you. - - h4 How To Join - - p - | Anyone can help out! Just check out our - a(title='GitHub', href="https://github.com/codecombat/codecombat", tabindex=-1) GitHub - | to get started, and check the box below to mark yourself as a brave Archmage and get the latest news by email. - | Want to chat about what to do or how to get more deeply involved? - a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Email us - | , or find us in our - a(href="http://www.hipchat.com/g3plnOKqa") public HipChat room - | and we'll go from there! - - label.checkbox(for="developer").well - input(type='checkbox', name="developer", id="developer") - | Get emails on new coding opportunities and announcements. - .saved-notification ✓ Saved - - - #artisan - - .class_image - img(src="/images/pages/contribute/artisan.png", alt="") - - h3 Artisan (Level Builder) - p We must construct additional levels! - | People be clamoring for more content, and we can only build so many ourselves. - | Right now your workstation is level one; our level editor is barely - | usable even by its creators, so be wary. - | If you have visions of campaigns spanning for-loops to - a(href="http://stackoverflow.com/questions/758088/seeking-contrived-example-code-continuations/758105#758105") Mondo Bizzaro - | to then this class might be for you. - h4 Class Attributes - ul - li Any experience in building content like this would be nice, such as using - | Blizzard's level editors. But not required! - li A hankering to do a whole lot of testing and iteration. - | To make good levels, you need to take it to others and watch them play it, - | and be prepared to find a lot of things to fix. - li For the time being, endurance en par with an Adventurer. - | Our Level Editor is super preliminary and frustrating to use. You have been warned! + #scribe + + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/scribe.png", alt="") + + h3.header-scrolling-fix Scribe (Article Editor) + p CodeCombat isn't just going to be a bunch of levels. + | It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into. + | That way rather than each Artisan having to describe in detail what a comparison operator is, they + | can simply link their level to the Article describing them that is already written for the player's edification. + | Something along the lines of what the + a(href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide") Mozilla Developer Network + | has built. If your idea of fun is articulating the concepts of programming in Markdown form, + | then this class might be for you. - h4 How To Join - p The Level Editor is live! Go forth and fiddle with it. - | Right now for the sake of security, you can't make Components (the most powerful part of level building) - | but be in touch with us and we'll see if we can make what you need. - | See the - a(href="https://docs.google.com/document/d/117tMcL95T1KY8BDisr0iGi5Frb2ZvBJTC0us5hyQkJY/edit?usp=sharing") preliminary documentation - | for more info, and please comment on it so we can make the whole system better. + h4 Class Attributes + ul + li Skill in words is pretty much all you need. + | Not only grammar and spelling, but able to convey complicated ideas to others. + + h4 How To Join + p + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , tell us a little about yourself, your experience with programming and + | what sort of things you'd like to write about. We'll go from there! - label.checkbox(for="level_creator").well - input(type='checkbox', name="level_creator", id="level_creator") - | Get emails on level editor updates and announcements. - .saved-notification ✓ Saved + a(href="/contribute/scribe") + h3 Learn More About Becoming A Diligent Scribe + + label.checkbox(for="article_editor").well + input(type='checkbox', name="article_editor", id="article_editor") + | Get emails about article writing announcements. + .saved-notification ✓ Saved - #adventurer - .class_image - img(src="/images/pages/contribute/adventurer.png", alt="") + #diplomat - h3 Adventurer (Level Playtester) - p Let's be clear about your role: you are the tank. You're going to take heavy damage. - | We need people to try out brand-new levels and help identify how to make things better. - | The pain will be enormous; making good games is a long process and no one gets - | it right the first time. - | If you can endure and have a high constitution score, then this class might be for you. - - h4 Class Attributes - ul - li A thirst for learning. You want to learn how to code and we want to teach you how to code. - | You'll probably be doing most of the teaching in this case, though. - li Charismatic. Be gentle but articulate about what needs improving, and offer suggestions - | on how to improve. + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/diplomat.png", alt="") + + h3.header-scrolling-fix Diplomat (Translator) + p So, if there's one thing we learned from the + a(href="blog.codecombat.com/post/64658141307/codecombat-in-y-combinator") launch in October + | , it's that there + | is sizeable interest in CodeCombat in other countries, particularly Brazil! + | We're building a corps of translators eager to turn one set of words into + | another set of words to get CodeCombat as accessible across the world as possible. + | If you like getting sneak peeks at upcoming content and getting these levels to + | your fellow nationals ASAP, then this class might be for you. - h4 How To Join - p Either get together with (or recruit!) an Artisan and work with them, or - | check the box below to receive emails when there are new levels to test. - | We'll also be posting about levels to review on our networks like - a(href="http://discourse.codecombat.com/category/adventurer") our forum - | , - a(href="https://www.facebook.com/codecombat") Facebook - | , - a(href="http://www.reddit.com/r/CodeCombat/") Reddit - | , - a(href="https://twitter.com/CodeCombat") Twitter - | , and - a(href="https://plus.google.com/115285980638641924488/posts") Google+ - | , so if you prefer to be notified those ways, sign up there! + h4 Class Attributes + ul + li Fluency in English and the language you would like to translate to. + | When conveying complicated ideas, it's important to have a strong grasp in both! + + h4 How to Join + p We've started a lot of initial translations at + a(href="https://docs.google.com/a/codecombat.com/spreadsheet/ccc?key=0AjsR1nOoMQ4MdFBqS1NqUmRTVG1hbEMxWTZEd1JrNXc&usp=drive_web#gid=0") this Google Doc + | , so check it out and add things for your language. Also, check this box below to + | keep up-to-date on new internationalization developments! - label.checkbox(for="tester").well - input(type='checkbox', name="tester", id="tester") - | Get emails when there are new levels to test. - .saved-notification ✓ Saved - - - #scribe + a(href="/contribute/diplomat") + h3 Learn More About Becoming A Great Diplomat - .class_image - img(src="/images/pages/contribute/scribe.png", alt="") - - h3 Scribe (Article Editor) - p CodeCombat isn't just going to be a bunch of levels. - | It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into. - | That way rather than each Artisan having to describe in detail what a comparison operator is, they - | can simply link their level to the Article describing them that is already written for the player's edification. - | Something along the lines of what the - a(href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide") Mozilla Developer Network - | has built. If your idea of fun is articulating the concepts of programming in Markdown form, - | then this class might be for you. - - h4 Class Attributes - ul - li Skill in words is pretty much all you need. - | Not only grammar and spelling, but able to convey complicated ideas to others. + label.checkbox(for="translator").well + input(type='checkbox', name="translator", id="translator") + | Get emails about i18n developments and levels to translate. + .saved-notification ✓ Saved - h4 How To Join - p - a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us - | , tell us a little about yourself, your experience with programming and - | what sort of things you'd like to write about. We'll go from there! - - label.checkbox(for="article_editor").well - input(type='checkbox', name="article_editor", id="article_editor") - | Get emails about article writing announcements. - .saved-notification ✓ Saved - - - - #diplomat - - .class_image - img(src="/images/pages/contribute/diplomat.png", alt="") - - h3 Diplomat (Translator) - p So, if there's one thing we learned from the - a(href="blog.codecombat.com/post/64658141307/codecombat-in-y-combinator") launch in October - | , it's that there - | is sizeable interest in CodeCombat in other countries, particularly Brazil! - | We're building a corps of translators eager to turn one set of words into - | another set of words to get CodeCombat as accessible across the world as possible. - | If you like getting sneak peeks at upcoming content and getting these levels to - | your fellow nationals ASAP, then this class might be for you. - - h4 Class Attributes - ul - li Fluency in English and the language you would like to translate to. - | When conveying complicated ideas, it's important to have a strong grasp in both! - - h4 How to Join - p We've started a lot of initial translations at - a(href="https://docs.google.com/a/codecombat.com/spreadsheet/ccc?key=0AjsR1nOoMQ4MdFBqS1NqUmRTVG1hbEMxWTZEd1JrNXc&usp=drive_web#gid=0") this Google Doc - | , so check it out and add things for your language. Also, check this box below to - | keep up-to-date on new internationalization developments! - - label.checkbox(for="translator").well - input(type='checkbox', name="translator", id="translator") - | Get emails about i18n developments and levels to translate. - .saved-notification ✓ Saved - - #ambassador + #ambassador - .class_image - img(src="/images/pages/contribute/ambassador.png", alt="") + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/ambassador.png", alt="") - h3 Ambassador (Support) - p This is a community we're building, and you are the connections. - | We've got Olark chats, emails, and social networks with lots of people to talk with - | and help get acquainted with the game and learn from. - | If you want to help people get involved and have fun, and get a good feel of the pulse of - | CodeCombat and where we're going, then this class might be for you. - - h4 Class Attributes - ul - li Communication skills. Be able to identify the problems players are having - | and help them solve them. Also, keep the rest of us informed about what - | players are saying, what they like and don't like and want more of! - - h4 How to Join - p - a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us - | , tell us a little about yourself, what you've done and what you'd - | be interested in doing. We'll go from there! - - p - strong Note - | : One of our top priorities is to build multiplayer where players having difficulty - | solving levels can summon higher level wizards to help them. - | This will be a great way for ambassadors to do their thing. We'll keep you posted! + h3.header-scrolling-fix Ambassador (Support) + p This is a community we're building, and you are the connections. + | We've got Olark chats, emails, and social networks with lots of people to talk with + | and help get acquainted with the game and learn from. + | If you want to help people get involved and have fun, and get a good feel of the pulse of + | CodeCombat and where we're going, then this class might be for you. + + h4 Class Attributes + ul + li Communication skills. Be able to identify the problems players are having + | and help them solve them. Also, keep the rest of us informed about what + | players are saying, what they like and don't like and want more of! + + h4 How to Join + p + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , tell us a little about yourself, what you've done and what you'd + | be interested in doing. We'll go from there! + + p + strong Note + | : One of our top priorities is to build multiplayer where players having difficulty + | solving levels can summon higher level wizards to help them. + | This will be a great way for ambassadors to do their thing. We'll keep you posted! - label.checkbox(for="support").well - input(type='checkbox', name="support", id="support") - | Get emails on support updates and multiplayer developments. - .saved-notification ✓ Saved - - - #counselor + a(href="/contribute/ambassador") + h3 Learn More About Becoming A Helpful Ambassador - .class_image - img(src="/images/pages/contribute/counselor.png", alt="") + label.checkbox(for="support").well + input(type='checkbox', name="support", id="support") + | Get emails on support updates and multiplayer developments. + .saved-notification ✓ Saved + + + #counselor - h3 Counselor (Expert) - p Do you have life experience? - | A different perspective on things that can help us decide how to shape CodeCombat? - | Of all these roles, this will probably take the least time, but - | individually you may make the most difference. - | We're on the lookout for wisened sages, particularly in areas like: teaching, - | game development, open source project management, technical recruiting, entrepreneurship, - | or design. - - p Or really anything that is relevant to the development of CodeCombat. - | If you have knowledge and want to share it to help grow this project, then - | this class might be for you. - - h4 Class Attributes - ul - li Experience, in any of the areas above or something you think might be helpful. - li A little bit of free time! - - h4 How to Join - p - a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us - | , 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). + .class_image.header-scrolling-fix + img(src="/images/pages/contribute/counselor.png", alt="") - div.clearfix \ No newline at end of file + h3.header-scrolling-fix Counselor (Expert) + p Do you have life experience? + | A different perspective on things that can help us decide how to shape CodeCombat? + | Of all these roles, this will probably take the least time, but + | individually you may make the most difference. + | We're on the lookout for wisened sages, particularly in areas like: teaching, + | game development, open source project management, technical recruiting, entrepreneurship, + | or design. + + p Or really anything that is relevant to the development of CodeCombat. + | If you have knowledge and want to share it to help grow this project, then + | this class might be for you. + + h4 Class Attributes + ul + li Experience, in any of the areas above or something you think might be helpful. + li A little bit of free time! + + h4 How to Join + p + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , 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). + + a(href="/contribute/counselor") + h3 Learn More About Becoming A Valuable Counselor + + div.clearfix \ No newline at end of file From 75894d11602fe8984e908dd7bb2e851788047288 Mon Sep 17 00:00:00 2001 From: Tom Steinbrecher Date: Mon, 6 Jan 2014 00:56:32 -0500 Subject: [PATCH 2/5] Issues 13 and 14. Contributor pages, and fixed the scrolling bug better than before --- app/styles/contribute_classes.sass | 41 ++++++++++ app/templates/contribute/adventurer.jade | 78 ++++++++++++++++++ app/templates/contribute/ambassador.jade | 69 ++++++++++++++++ app/templates/contribute/archmage.jade | 89 +++++++++++++++++++++ app/templates/contribute/artisan.jade | 79 ++++++++++++++++++ app/templates/contribute/counselor.jade | 55 +++++++++++++ app/templates/contribute/diplmoat.jade | 71 ++++++++++++++++ app/templates/contribute/diplomat.jade | 84 +++++++++++++++++++ app/templates/contribute/scribe.jade | 70 ++++++++++++++++ app/views/contribute/adventurer_view.coffee | 34 ++++++++ app/views/contribute/ambassador_view.coffee | 34 ++++++++ app/views/contribute/archmage_view.coffee | 34 ++++++++ app/views/contribute/artisan_view.coffee | 34 ++++++++ app/views/contribute/counselor_view.coffee | 7 ++ app/views/contribute/diplomat_view.coffee | 34 ++++++++ app/views/contribute/scribe_view.coffee | 34 ++++++++ 16 files changed, 847 insertions(+) create mode 100644 app/styles/contribute_classes.sass create mode 100644 app/templates/contribute/adventurer.jade create mode 100644 app/templates/contribute/ambassador.jade create mode 100644 app/templates/contribute/archmage.jade create mode 100644 app/templates/contribute/artisan.jade create mode 100644 app/templates/contribute/counselor.jade create mode 100644 app/templates/contribute/diplmoat.jade create mode 100644 app/templates/contribute/diplomat.jade create mode 100644 app/templates/contribute/scribe.jade create mode 100644 app/views/contribute/adventurer_view.coffee create mode 100644 app/views/contribute/ambassador_view.coffee create mode 100644 app/views/contribute/archmage_view.coffee create mode 100644 app/views/contribute/artisan_view.coffee create mode 100644 app/views/contribute/counselor_view.coffee create mode 100644 app/views/contribute/diplomat_view.coffee create mode 100644 app/views/contribute/scribe_view.coffee diff --git a/app/styles/contribute_classes.sass b/app/styles/contribute_classes.sass new file mode 100644 index 000000000..ea3b2d689 --- /dev/null +++ b/app/styles/contribute_classes.sass @@ -0,0 +1,41 @@ +.contribute_class + + #homepage_screenshot + margin: 20px 0px + .signature + text-align: right + + a + cursor: pointer + + .class_image + float: left + width: 150px + margin: 10px 10px 20px 20px + + #contribute-nav + float: left + max-width: 20% + width: 250px + box-sizing: border-box + margin-left: 20px + padding-top: 40px + + li + float: none + width: 100% + + .class_main + margin-left: 25% + padding: 40px + box-sizing: border-box + + .header-scrolling-fix + padding-top: 65px !important + + .well + padding: 5px 5px 5px 30px + + .saved-notification + display: none + float: right \ No newline at end of file diff --git a/app/templates/contribute/adventurer.jade b/app/templates/contribute/adventurer.jade new file mode 100644 index 000000000..7f9d8bbb2 --- /dev/null +++ b/app/templates/contribute/adventurer.jade @@ -0,0 +1,78 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#adventurer-main + + .class_image + img(src="/images/pages/contribute/adventurer.png", alt="") + + h2 Adventurer (Level Playtester) + p Let's be clear about your role: you are the tank. You're going to take heavy damage. + | We need people to try out brand-new levels and help identify how to make things better. + | The pain will be enormous; making good games is a long process and no one gets + | it right the first time. + | If you can endure and have a high constitution score, then this class might be for you. + + h4 Class Attributes + ul + li A thirst for learning. You want to learn how to code and we want to teach you how to code. + | You'll probably be doing most of the teaching in this case, though. + li Charismatic. Be gentle but articulate about what needs improving, and offer suggestions + | on how to improve. + + h4 How To Join + p Either get together with (or recruit!) an Artisan and work with them, or + | check the box below to receive emails when there are new levels to test. + | We'll also be posting about levels to review on our networks like + a(href="http://discourse.codecombat.com/category/adventurer") our forum + | , + a(href="https://www.facebook.com/codecombat") Facebook + | , + a(href="http://www.reddit.com/r/CodeCombat/") Reddit + | , + a(href="https://twitter.com/CodeCombat") Twitter + | , and + a(href="https://plus.google.com/115285980638641924488/posts") Google+ + | , so if you prefer to be notified those ways, sign up there! + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="tester").well + input(type='checkbox', name="tester", id="tester") + | Get emails when there are new levels to test. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + #Contributors + h3 Our Brave Adventurers: + ul.adventurers + li Kieizroe + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/ambassador.jade b/app/templates/contribute/ambassador.jade new file mode 100644 index 000000000..711e5d74d --- /dev/null +++ b/app/templates/contribute/ambassador.jade @@ -0,0 +1,69 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#ambassador-main + + .class_image + img(src="/images/pages/contribute/ambassador.png", alt="") + + h2 Ambassador (Support) + p This is a community we're building, and you are the connections. + | We've got Olark chats, emails, and social networks with lots of people to talk with + | and help get acquainted with the game and learn from. + | If you want to help people get involved and have fun, and get a good feel of the pulse of + | CodeCombat and where we're going, then this class might be for you. + + h4 Class Attributes + ul + li Communication skills. Be able to identify the problems players are having + | and help them solve them. Also, keep the rest of us informed about what + | players are saying, what they like and don't like and want more of! + + h4 How to Join + p + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , tell us a little about yourself, what you've done and what you'd + | be interested in doing. We'll go from there! + + p + strong Note + | : One of our top priorities is to build multiplayer where players having difficulty + | solving levels can summon higher level wizards to help them. + | This will be a great way for ambassadors to do their thing. We'll keep you posted! + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="support").well + input(type='checkbox', name="support", id="support") + | Get emails on support updates and multiplayer developments. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/archmage.jade b/app/templates/contribute/archmage.jade new file mode 100644 index 000000000..b5039b1b7 --- /dev/null +++ b/app/templates/contribute/archmage.jade @@ -0,0 +1,89 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#archmage-main + + .class_image + img(src="/images/pages/contribute/archmage.png", alt="") + + h2 Archmage (Coder) + p One of the best parts about building games is they synthesize so many different things. + | Graphics, sound, real-time networking, social networking, and of course many of the + | more common aspects of programming, from low-level database management, + | and server administration to user facing design and interface building. + | There's a lot to do, and if you're an experienced programmer with a hankering + | to really dive into the nitty-gritty of CodeCombat, this class might be for you. + + p Right now we have open-sourced two of our tools on the project: + a(href="https://github.com/codecombat/aether") Aether + | and + a(href="https://github.com/codecombat/treema") Treema + | . We are also open sourcing everything momentarily, so stay tuned for access to the main repo! + | We would love to have your help building out the best programming game ever. + + h4 Class Attributes + ul + li Knowledge in + a(href="http://coffeescript.org/") CoffeeScript + | , or a desire to learn. Most of our code is in this language. + | If you're a fan of Ruby or Python, you'll feel right at home. + | It's just JavaScript, but with a nicer syntax. + li Some experience in programming and personal initiative. + | We'll help you get oriented, but we can't spend much time training you. + + h4 How To Join + + p + | Anyone can help out! Just check out our + a(title='GitHub', tabindex=-1) GitHub + | to get started, and check the box below to mark yourself as a brave Archmage. + | Want to chat about what to do or how to get more deeply involved? + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , tell us a little about yourself, what you've done and what you'd + | be interested in working on. We'll go from there! + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="developer").well + input(type='checkbox', name="developer", id="developer") + | Get emails on new coding opportunities and announcements. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + #Contributors + h3 Our Magical Archmages: + ul.archmages + li David Golds + li Zach Martin + li Tom Steinbrecher + li Mischa Lewis-Norelle + li Sébastien Moratinos + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/artisan.jade b/app/templates/contribute/artisan.jade new file mode 100644 index 000000000..8dca0ea36 --- /dev/null +++ b/app/templates/contribute/artisan.jade @@ -0,0 +1,79 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#artisan-main + + .class_image + img(src="/images/pages/contribute/artisan.png", alt="") + + h2 Artisan (Level Builder) + p We must construct additional levels! + | People be clamoring for more content, and we can only build so many ourselves. + | Right now your workstation is level one; our level editor is barely + | usable even by its creators, so be wary. + | If you have visions of campaigns spanning for-loops to + a(href="http://stackoverflow.com/questions/758088/seeking-contrived-example-code-continuations/758105#758105") Mondo Bizzaro + | to then this class might be for you. + + h4 Class Attributes + ul + li Any experience in building content like this would be nice, such as using + | Blizzard's level editors. But not required! + li A hankering to do a whole lot of testing and iteration. + | To make good levels, you need to take it to others and watch them play it, + | and be prepared to find a lot of things to fix. + li For the time being, endurance en par with an Adventurer. + | Our Level Editor is super preliminary and frustrating to use. You have been warned! + + h4 How To Join + p The Level Editor is live! Go forth and fiddle with it. + | Right now for the sake of security, you can't make Components (the most powerful part of level building) + | but be in touch with us and we'll see if we can make what you need. + | See the + a(href="https://docs.google.com/document/d/117tMcL95T1KY8BDisr0iGi5Frb2ZvBJTC0us5hyQkJY/edit?usp=sharing") preliminary documentation + | for more info, and please comment on it so we can make the whole system better. + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="level_creator").well + input(type='checkbox', name="level_creator", id="level_creator") + | Get emails on level editor updates and announcements. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + #Contributors + h3 Our Creative Artisans: + ul.artisans + li Sootn + li Zach Martin + li Aftermath + li mcdavid1991 + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/counselor.jade b/app/templates/contribute/counselor.jade new file mode 100644 index 000000000..d85b756aa --- /dev/null +++ b/app/templates/contribute/counselor.jade @@ -0,0 +1,55 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#sounselor-main + + .class_image + img(src="/images/pages/contribute/counselor.png", alt="") + + h2 Counselor (Expert) + p Do you have life experience? + | A different perspective on things that can help us decide how to shape CodeCombat? + | Of all these roles, this will probably take the least time, but + | individually you may make the most difference. + | We're on the lookout for wisened sages, particularly in areas like: teaching, + | game development, open source project management, technical recruiting, entrepreneurship, + | or design. + + p Or really anything that is relevant to the development of CodeCombat. + | If you have knowledge and want to share it to help grow this project, then + | this class might be for you. + + h4 Class Attributes + ul + li Experience, in any of the areas above or something you think might be helpful. + li A little bit of free time! + + h4 How to Join + p + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , 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). + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/diplmoat.jade b/app/templates/contribute/diplmoat.jade new file mode 100644 index 000000000..98f85a25e --- /dev/null +++ b/app/templates/contribute/diplmoat.jade @@ -0,0 +1,71 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#diplomat-main + + .class_image + img(src="/images/pages/contribute/diplomat.png", alt="") + + h3 Diplomat (Translator) + p So, if there's one thing we learned from the + a(href="blog.codecombat.com/post/64658141307/codecombat-in-y-combinator") launch in October + | , it's that there + | is sizeable interest in CodeCombat in other countries, particularly Brazil! + | We're building a corps of translators eager to turn one set of words into + | another set of words to get CodeCombat as accessible across the world as possible. + | If you like getting sneak peeks at upcoming content and getting these levels to + | your fellow nationals ASAP, then this class might be for you. + + h4 Class Attributes + ul + li Fluency in English and the language you would like to translate to. + | When conveying complicated ideas, it's important to have a strong grasp in both! + + h4 How to Join + p We've started a lot of initial translations at + a(href="https://docs.google.com/a/codecombat.com/spreadsheet/ccc?key=0AjsR1nOoMQ4MdFBqS1NqUmRTVG1hbEMxWTZEd1JrNXc&usp=drive_web#gid=0") this Google Doc + | , so check it out and add things for your language. Also, check this box below to + | keep up-to-date on new internationalization developments! + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="translator").well + input(type='checkbox', name="translator", id="translator") + | Get emails about i18n developments and levels to translate. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + #Contributors + h3 Our Magical Archmages: + ul.archmages + li David Golds + li Zach Martin + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/diplomat.jade b/app/templates/contribute/diplomat.jade new file mode 100644 index 000000000..e4a8985c9 --- /dev/null +++ b/app/templates/contribute/diplomat.jade @@ -0,0 +1,84 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#diplomat-main + + .class_image + img(src="/images/pages/contribute/diplomat.png", alt="") + + h2 Diplomat (Translator) + p So, if there's one thing we learned from the + a(href="blog.codecombat.com/post/64658141307/codecombat-in-y-combinator") launch in October + | , it's that there + | is sizeable interest in CodeCombat in other countries, particularly Brazil! + | We're building a corps of translators eager to turn one set of words into + | another set of words to get CodeCombat as accessible across the world as possible. + | If you like getting sneak peeks at upcoming content and getting these levels to + | your fellow nationals ASAP, then this class might be for you. + + h4 Class Attributes + ul + li Fluency in English and the language you would like to translate to. + | When conveying complicated ideas, it's important to have a strong grasp in both! + + h4 How to Join + p We've started a lot of initial translations at + a(href="https://docs.google.com/a/codecombat.com/spreadsheet/ccc?key=0AjsR1nOoMQ4MdFBqS1NqUmRTVG1hbEMxWTZEd1JrNXc&usp=drive_web#gid=0") this Google Doc + | , so check it out and add things for your language. Also, check this box below to + | keep up-to-date on new internationalization developments! + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="translator").well + input(type='checkbox', name="translator", id="translator") + | Get emails about i18n developments and levels to translate. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + #Contributors + h3 Our Translating Diplomats: + ul.diplomats + li Turkish - Nazım Gediz Aydındoğmuş + li Brazilian Portuguese - Gutenberg Barros, Kieizroe, Matthew Burt + li Portugal Portuguese - Matthew Burt + li German - Dirk, Anon + li Thai - Kamolchanok Jittrepit + li Greek - Stergios + li Latin American Spanish - Jesús Ruppel, Matthew Burt, Mariano Luzza + li Spain Spanish - Matthew Burt, Anon + li French - Xeonarno, Anon + li Hungarian - Anon + li Japanese - g1itch + li Chinese - spacepope + li Polish - Anon + li Danish - Anon + li Slovak - Anon + + div.clearfix \ No newline at end of file diff --git a/app/templates/contribute/scribe.jade b/app/templates/contribute/scribe.jade new file mode 100644 index 000000000..72b9fcd96 --- /dev/null +++ b/app/templates/contribute/scribe.jade @@ -0,0 +1,70 @@ +extends /templates/base + +block content + + div.contribute_class + + ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="//contribute#archmage") Archmage (Coder) + li + a(href="//contribute#artisan") Artisan (Level Builder) + li + a(href="//contribute#adventurer") Adventurer (Level Playtester) + li + a(href="//contribute#scribe") Scribe (Article Editor) + li + a(href="//contribute#diplomat") Diplomat (Translator) + li + a(href="//contribute#ambassador") Ambassador (Support) + li + a(href="//contribute#counselor") Counselor (Expert/Teacher) + + div.class-main#scribe-main + + .class_image + img(src="/images/pages/contribute/scribe.png", alt="") + + h2 Scribe (Article Editor) + p CodeCombat isn't just going to be a bunch of levels. + | It will also include a resource for knowledge, a wiki of programming concepts that levels can hook into. + | That way rather than each Artisan having to describe in detail what a comparison operator is, they + | can simply link their level to the Article describing them that is already written for the player's edification. + | Something along the lines of what the + a(href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide") Mozilla Developer Network + | has built. If your idea of fun is articulating the concepts of programming in Markdown form, + | then this class might be for you. + + h4 Class Attributes + ul + li Skill in words is pretty much all you need. + | Not only grammar and spelling, but able to convey complicated ideas to others. + + h4 How To Join + p + a(title='Contact', tabindex=-1, data-toggle="coco-modal", data-target="modal/contact") Contact us + | , tell us a little about yourself, your experience with programming and + | what sort of things you'd like to write about. We'll go from there! + + if me.attributes.anonymous + div#sign-up.alert.alert-info + strong Hey there! + | To subscribe for class emails, you'll need to + a(data-toggle="coco-modal", data-target="modal/signup") create an account + | first . + + label.checkbox(for="article_editor").well + input(type='checkbox', name="article_editor", id="article_editor") + | Get emails about article writing announcements. + .saved-notification ✓ Saved + + h4 Changes are saved automatically when you toggle checkboxes. + + #Contributors + h3 Our Diligent Scribes: + ul.scribes + li Ryan Faidley + + div.clearfix \ No newline at end of file diff --git a/app/views/contribute/adventurer_view.coffee b/app/views/contribute/adventurer_view.coffee new file mode 100644 index 000000000..6b2744ced --- /dev/null +++ b/app/views/contribute/adventurer_view.coffee @@ -0,0 +1,34 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/adventurer' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "adventurer-view" + template: template + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() diff --git a/app/views/contribute/ambassador_view.coffee b/app/views/contribute/ambassador_view.coffee new file mode 100644 index 000000000..3e9aefffb --- /dev/null +++ b/app/views/contribute/ambassador_view.coffee @@ -0,0 +1,34 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/ambassador' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "ambassador-view" + template: template + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() diff --git a/app/views/contribute/archmage_view.coffee b/app/views/contribute/archmage_view.coffee new file mode 100644 index 000000000..0b3aa480f --- /dev/null +++ b/app/views/contribute/archmage_view.coffee @@ -0,0 +1,34 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/archmage' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "archmage-view" + template: template + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() diff --git a/app/views/contribute/artisan_view.coffee b/app/views/contribute/artisan_view.coffee new file mode 100644 index 000000000..f501824ed --- /dev/null +++ b/app/views/contribute/artisan_view.coffee @@ -0,0 +1,34 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/artisan' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "artisan-view" + template: template + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() diff --git a/app/views/contribute/counselor_view.coffee b/app/views/contribute/counselor_view.coffee new file mode 100644 index 000000000..8e4a9a71d --- /dev/null +++ b/app/views/contribute/counselor_view.coffee @@ -0,0 +1,7 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/counselor' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "counselor-view" + template: template diff --git a/app/views/contribute/diplomat_view.coffee b/app/views/contribute/diplomat_view.coffee new file mode 100644 index 000000000..9430dfb34 --- /dev/null +++ b/app/views/contribute/diplomat_view.coffee @@ -0,0 +1,34 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/diplomat' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "diplomat-view" + template: template + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() diff --git a/app/views/contribute/scribe_view.coffee b/app/views/contribute/scribe_view.coffee new file mode 100644 index 000000000..bc67792a4 --- /dev/null +++ b/app/views/contribute/scribe_view.coffee @@ -0,0 +1,34 @@ +View = require 'views/kinds/RootView' +template = require 'templates/contribute/scribe' +{me} = require('lib/auth') + +module.exports = class ArchmageView extends View + id: "scribe-view" + template: template + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() From fa687c4c3042eaa222ae8187709f0e0b8d023794 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 6 Jan 2014 12:47:50 -0800 Subject: [PATCH 3/5] Increase infinite loop timeout wait slightly to bandage #81. --- app/lib/God.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/God.coffee b/app/lib/God.coffee index f956b16fb..044bd5c32 100644 --- a/app/lib/God.coffee +++ b/app/lib/God.coffee @@ -150,7 +150,8 @@ class Angel @lastID = (if @lastID? then @lastID + 1 else Math.floor(@ids.length * Math.random())) % @ids.length @ids[@lastID] - infiniteLoopIntervalDuration: 5000 # check this often (must be more than the others added) + # https://github.com/codecombat/codecombat/issues/81 -- TODO: we need to wait for worker initialization first + infiniteLoopIntervalDuration: 15000 # check this often (must be more than the others added) infiniteLoopTimeoutDuration: 1500 # wait this long when we check abortTimeoutDuration: 500 # give in-process or dying workers this long to give up constructor: (@god) -> From 60c4b360d5e836350e908496007746540e91edb2 Mon Sep 17 00:00:00 2001 From: Tom Steinbrecher Date: Mon, 6 Jan 2014 17:30:35 -0500 Subject: [PATCH 4/5] Added ContribueClassView, which all contribute pages are now based off of. Moved nav in to contribute_nav.jad, allowing for easier addition of nav to contribute pages. Fixed other small bugs. --- app/styles/contribute.sass | 0 app/styles/contribute_classes.sass | 2 +- app/templates/contribute/adventurer.jade | 18 +--------- app/templates/contribute/ambassador.jade | 18 +--------- app/templates/contribute/archmage.jade | 18 +--------- app/templates/contribute/artisan.jade | 18 +--------- .../{ => contribute}/contribute.jade | 20 ++--------- app/templates/contribute/contribute_nav.jade | 17 ++++++++++ app/templates/contribute/counselor.jade | 18 +--------- app/templates/contribute/diplmoat.jade | 18 +--------- app/templates/contribute/diplomat.jade | 18 +--------- app/templates/contribute/scribe.jade | 18 +--------- app/views/contribute/adventurer_view.coffee | 33 ++---------------- app/views/contribute/ambassador_view.coffee | 31 ++--------------- app/views/contribute/archmage_view.coffee | 34 ++----------------- app/views/contribute/artisan_view.coffee | 33 ++---------------- .../contribute/contribute_class_view.coffee | 31 +++++++++++++++++ app/views/contribute/counselor_view.coffee | 4 +-- app/views/contribute/diplomat_view.coffee | 31 ++--------------- app/views/contribute/scribe_view.coffee | 31 ++--------------- app/views/contribute_view.coffee | 33 +++--------------- app/views/kinds/RootView.coffee | 6 ++-- 22 files changed, 83 insertions(+), 367 deletions(-) delete mode 100644 app/styles/contribute.sass rename app/templates/{ => contribute}/contribute.jade (96%) create mode 100644 app/templates/contribute/contribute_nav.jade create mode 100644 app/views/contribute/contribute_class_view.coffee diff --git a/app/styles/contribute.sass b/app/styles/contribute.sass deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/styles/contribute_classes.sass b/app/styles/contribute_classes.sass index ea3b2d689..c4aead4cb 100644 --- a/app/styles/contribute_classes.sass +++ b/app/styles/contribute_classes.sass @@ -25,7 +25,7 @@ float: none width: 100% - .class_main + .class-main margin-left: 25% padding: 40px box-sizing: border-box diff --git a/app/templates/contribute/adventurer.jade b/app/templates/contribute/adventurer.jade index 7f9d8bbb2..de0cf918e 100644 --- a/app/templates/contribute/adventurer.jade +++ b/app/templates/contribute/adventurer.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#adventurer-main diff --git a/app/templates/contribute/ambassador.jade b/app/templates/contribute/ambassador.jade index 711e5d74d..5983e5bc8 100644 --- a/app/templates/contribute/ambassador.jade +++ b/app/templates/contribute/ambassador.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#ambassador-main diff --git a/app/templates/contribute/archmage.jade b/app/templates/contribute/archmage.jade index b5039b1b7..387cc4087 100644 --- a/app/templates/contribute/archmage.jade +++ b/app/templates/contribute/archmage.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#archmage-main diff --git a/app/templates/contribute/artisan.jade b/app/templates/contribute/artisan.jade index 8dca0ea36..087f46bb6 100644 --- a/app/templates/contribute/artisan.jade +++ b/app/templates/contribute/artisan.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#artisan-main diff --git a/app/templates/contribute.jade b/app/templates/contribute/contribute.jade similarity index 96% rename from app/templates/contribute.jade rename to app/templates/contribute/contribute.jade index 31c4e63f9..23a8e6ea3 100644 --- a/app/templates/contribute.jade +++ b/app/templates/contribute/contribute.jade @@ -4,25 +4,9 @@ block content div.contribute_class - ul.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="#archmage") Archmage (Coder) - li - a(href="#artisan") Artisan (Level Builder) - li - a(href="#adventurer") Adventurer (Level Playtester) - li - a(href="#scribe") Scribe (Article Editor) - li - a(href="#diplomat") Diplomat (Translator) - li - a(href="#ambassador") Ambassador (Support) - li - a(href="#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav - div#contribute-main.class_main + div#contribute-main.class-main div#intro h2 Contributing diff --git a/app/templates/contribute/contribute_nav.jade b/app/templates/contribute/contribute_nav.jade new file mode 100644 index 000000000..434f09e14 --- /dev/null +++ b/app/templates/contribute/contribute_nav.jade @@ -0,0 +1,17 @@ +ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav + li + h3 Character Classes + li + a(href="#archmage") Archmage (Coder) + li + a(href="#artisan") Artisan (Level Builder) + li + a(href="#adventurer") Adventurer (Level Playtester) + li + a(href="#scribe") Scribe (Article Editor) + li + a(href="#diplomat") Diplomat (Translator) + li + a(href="#ambassador") Ambassador (Support) + li + a(href="#counselor") Counselor (Expert/Teacher) \ No newline at end of file diff --git a/app/templates/contribute/counselor.jade b/app/templates/contribute/counselor.jade index d85b756aa..2f9723631 100644 --- a/app/templates/contribute/counselor.jade +++ b/app/templates/contribute/counselor.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#sounselor-main diff --git a/app/templates/contribute/diplmoat.jade b/app/templates/contribute/diplmoat.jade index 98f85a25e..0ece61420 100644 --- a/app/templates/contribute/diplmoat.jade +++ b/app/templates/contribute/diplmoat.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#diplomat-main diff --git a/app/templates/contribute/diplomat.jade b/app/templates/contribute/diplomat.jade index e4a8985c9..c39a96343 100644 --- a/app/templates/contribute/diplomat.jade +++ b/app/templates/contribute/diplomat.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#diplomat-main diff --git a/app/templates/contribute/scribe.jade b/app/templates/contribute/scribe.jade index 72b9fcd96..87de31771 100644 --- a/app/templates/contribute/scribe.jade +++ b/app/templates/contribute/scribe.jade @@ -4,23 +4,7 @@ block content div.contribute_class - ul.contribute_class.affix.nav.nav-list.nav-pills#contribute-nav - li - h3 Character Classes - li - a(href="//contribute#archmage") Archmage (Coder) - li - a(href="//contribute#artisan") Artisan (Level Builder) - li - a(href="//contribute#adventurer") Adventurer (Level Playtester) - li - a(href="//contribute#scribe") Scribe (Article Editor) - li - a(href="//contribute#diplomat") Diplomat (Translator) - li - a(href="//contribute#ambassador") Ambassador (Support) - li - a(href="//contribute#counselor") Counselor (Expert/Teacher) + include /templates/contribute/contribute_nav div.class-main#scribe-main diff --git a/app/views/contribute/adventurer_view.coffee b/app/views/contribute/adventurer_view.coffee index 6b2744ced..cdb711e98 100644 --- a/app/views/contribute/adventurer_view.coffee +++ b/app/views/contribute/adventurer_view.coffee @@ -1,34 +1,7 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/adventurer' {me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class AdventurerView extends ContributeClassView id: "adventurer-view" - template: template - - events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() + template: template \ No newline at end of file diff --git a/app/views/contribute/ambassador_view.coffee b/app/views/contribute/ambassador_view.coffee index 3e9aefffb..669951176 100644 --- a/app/views/contribute/ambassador_view.coffee +++ b/app/views/contribute/ambassador_view.coffee @@ -1,34 +1,7 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/ambassador' {me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class AmbassadorView extends ContributeClassView id: "ambassador-view" template: template - - events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() diff --git a/app/views/contribute/archmage_view.coffee b/app/views/contribute/archmage_view.coffee index 0b3aa480f..b10333e08 100644 --- a/app/views/contribute/archmage_view.coffee +++ b/app/views/contribute/archmage_view.coffee @@ -1,34 +1,6 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/archmage' -{me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class ArchmageView extends ContributeClassView id: "archmage-view" - template: template - - events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() + template: template \ No newline at end of file diff --git a/app/views/contribute/artisan_view.coffee b/app/views/contribute/artisan_view.coffee index f501824ed..1b5ce1d76 100644 --- a/app/views/contribute/artisan_view.coffee +++ b/app/views/contribute/artisan_view.coffee @@ -1,34 +1,7 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/artisan' {me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class ArtisanView extends ContributeClassView id: "artisan-view" - template: template - - events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() + template: template \ No newline at end of file diff --git a/app/views/contribute/contribute_class_view.coffee b/app/views/contribute/contribute_class_view.coffee new file mode 100644 index 000000000..ad05ffd96 --- /dev/null +++ b/app/views/contribute/contribute_class_view.coffee @@ -0,0 +1,31 @@ +View = require 'views/kinds/RootView' +module.exports = class ContributeClassView extends View + + {me} = require('lib/auth') + + events: + 'change input[type="checkbox"]': 'onCheckboxChanged' + + afterRender: -> + super() + checkboxes = @$el.find('input[type="checkbox"]').toArray() + _.forEach checkboxes, (el) -> + el = $(el) + if el.attr('name') in me.get('emailSubscriptions') + el.prop('checked', true) + + onCheckboxChanged: (e) -> + el = $(e.target) + checked = el.prop('checked') + subscription = el.attr('name') + subscriptions = me.get('emailSubscriptions') ? [] + if checked and not (subscription in subscriptions) + subscriptions.push(subscription) + if me.get 'anonymous' + @openModalView new SignupModalView() + if not checked + subscriptions = _.without subscriptions, subscription + el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) + + me.set('emailSubscriptions', subscriptions) + me.save() \ No newline at end of file diff --git a/app/views/contribute/counselor_view.coffee b/app/views/contribute/counselor_view.coffee index 8e4a9a71d..b589c4ed9 100644 --- a/app/views/contribute/counselor_view.coffee +++ b/app/views/contribute/counselor_view.coffee @@ -1,7 +1,7 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/counselor' {me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class CounselorView extends ContributeClassView id: "counselor-view" template: template diff --git a/app/views/contribute/diplomat_view.coffee b/app/views/contribute/diplomat_view.coffee index 9430dfb34..078912bc3 100644 --- a/app/views/contribute/diplomat_view.coffee +++ b/app/views/contribute/diplomat_view.coffee @@ -1,34 +1,7 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/diplomat' {me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class DiplmoatView extends ContributeClassView id: "diplomat-view" template: template - - events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() diff --git a/app/views/contribute/scribe_view.coffee b/app/views/contribute/scribe_view.coffee index bc67792a4..2aedbbb98 100644 --- a/app/views/contribute/scribe_view.coffee +++ b/app/views/contribute/scribe_view.coffee @@ -1,34 +1,7 @@ -View = require 'views/kinds/RootView' +ContributeClassView = require 'views/contribute/contribute_class_view' template = require 'templates/contribute/scribe' {me} = require('lib/auth') -module.exports = class ArchmageView extends View +module.exports = class ScribeView extends ContributeClassView id: "scribe-view" template: template - - events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() diff --git a/app/views/contribute_view.coffee b/app/views/contribute_view.coffee index a5ebeea9c..b7f5bddc1 100644 --- a/app/views/contribute_view.coffee +++ b/app/views/contribute_view.coffee @@ -1,35 +1,10 @@ -View = require 'views/kinds/RootView' -template = require 'templates/contribute' -{me} = require 'lib/auth' +ContributeClassView = require 'views/contribute/contribute_class_view' +template = require 'templates/contribute/contribute' SignupModalView = require 'views/modal/signup_modal' -module.exports = class ContributeView extends View +module.exports = class ContributeView extends ContributeClassView id: "contribute-view" template: template events: - 'change input[type="checkbox"]': 'onCheckboxChanged' - - afterRender: -> - super() - checkboxes = @$el.find('input[type="checkbox"]').toArray() - _.forEach checkboxes, (el) -> - el = $(el) - if el.attr('name') in me.get('emailSubscriptions') - el.prop('checked', true) - - onCheckboxChanged: (e) -> - el = $(e.target) - checked = el.prop('checked') - subscription = el.attr('name') - subscriptions = me.get('emailSubscriptions') ? [] - if checked and not (subscription in subscriptions) - subscriptions.push(subscription) - if me.get 'anonymous' - @openModalView new SignupModalView() - if not checked - subscriptions = _.without subscriptions, subscription - el.parent().find('.saved-notification').finish().show('fast').delay(3000).fadeOut(2000) - - me.set('emailSubscriptions', subscriptions) - me.save() + 'change input[type="checkbox"]': 'onCheckboxChanged' \ No newline at end of file diff --git a/app/views/kinds/RootView.coffee b/app/views/kinds/RootView.coffee index bd16a94fe..97142e27f 100644 --- a/app/views/kinds/RootView.coffee +++ b/app/views/kinds/RootView.coffee @@ -16,7 +16,7 @@ module.exports = class RootView extends CocoView events: "click #logout-button": "logoutAccount" 'change .language-dropdown': 'showDiplomatSuggestionModal' - + shortcuts: 'backspace, delete': 'preventBackspace' # 'backspace': 'preventBackspace' @@ -56,7 +56,7 @@ module.exports = class RootView extends CocoView code2 isnt code and code2.split('-')[0] is code) for code, localeInfo of locale when not (code in genericCodes) or code is preferred $select.append( - $("").val(code).text(localeInfo.nativeDescription)) + $("").attr("value", code).text(localeInfo.nativeDescription)) $select.val(preferred).fancySelect() showDiplomatSuggestionModal: -> @@ -75,4 +75,4 @@ module.exports = class RootView extends CocoView errors = JSON.parse(res.responseText) console.warn "Error saving language:", errors res.success (model, response, options) -> - #console.log "Saved language:", newLang + #console.log "Saved language:", newLang \ No newline at end of file From f53f20a6ad3e6ead023f5fc8dd3fdf182dbe34fa Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 6 Jan 2014 14:53:21 -0800 Subject: [PATCH 5/5] Fixed #86. --- app/views/editor/level/thangs_tab_view.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/editor/level/thangs_tab_view.coffee b/app/views/editor/level/thangs_tab_view.coffee index a85899abe..7b1f10969 100644 --- a/app/views/editor/level/thangs_tab_view.coffee +++ b/app/views/editor/level/thangs_tab_view.coffee @@ -42,6 +42,7 @@ module.exports = class ThangsTabView extends View 'sprite:dragged': 'onSpriteDragged' 'sprite:mouse-up': 'onSpriteMouseUp' 'sprite:double-clicked': 'onSpriteDoubleClicked' + 'surface:stage-mouse-down': 'onStageMouseDown' constructor: (options) -> super options @@ -118,7 +119,13 @@ module.exports = class ThangsTabView extends View @surface?.spriteBoss?.selectSprite null, null onSpriteMouseDown: (e) -> - #console.log "mouse down", e + # Sprite clicks happen after stage clicks, but we need to know whether a sprite is being clicked. + clearTimeout @backgroundAddClickTimeout + + onStageMouseDown: (e) -> + if @addThangSprite + # If we click on the background, we need to add @addThangSprite, but not if onSpriteMouseDown will fire. + @backgroundAddClickTimeout = _.defer => @onExtantThangSelected {} onSpriteDragged: (e) -> return unless @selectedExtantThang and e.thang?.id is @selectedExtantThang?.id