diff --git a/bower.json b/bower.json index 2f4a054399..0d92dd37c2 100644 --- a/bower.json +++ b/bower.json @@ -24,6 +24,7 @@ "bootstrap": "~3.3.4", "font-awesome": "~4.3.0", "moment": "~2.10.2", - "angular-bootstrap": "~0.13.0" + "angular-bootstrap": "~0.13.0", + "ramda": "~0.13.0" } } diff --git a/controllers/fieldGuide.js b/controllers/fieldGuide.js index a7d00fc97b..f8e35a47de 100644 --- a/controllers/fieldGuide.js +++ b/controllers/fieldGuide.js @@ -9,15 +9,17 @@ exports.returnIndividualFieldGuide = function(req, res, next) { var fieldGuideName = dashedName.replace(/\-/g, ' '); - var completed = req.user.completedFieldGuides; + if (req.user) { + var completed = req.user.completedFieldGuides; - var uncompletedFieldGuides = resources.allFieldGuideIds().filter(function (elem) { - if (completed.indexOf(elem) === -1) { - return elem; - } - }); - req.user.uncompletedFieldGuides = uncompletedFieldGuides; - req.user.save(); + var uncompletedFieldGuides = resources.allFieldGuideIds().filter(function (elem) { + if (completed.indexOf(elem) === -1) { + return elem; + } + }); + req.user.uncompletedFieldGuides = uncompletedFieldGuides; + req.user.save(); + } FieldGuide.find({'name': new RegExp(fieldGuideName, 'i')}, function(err, fieldGuideFromMongo) { if (err) { @@ -59,7 +61,7 @@ exports.showAllFieldGuides = function(req, res) { exports.returnNextFieldGuide = function(req, res, next) { if (!req.user) { - return res.redirect('../field-guide/how-do-i-use-this-guide?'); + return res.redirect('/field-guide/how-do-i-use-this-guide?'); } var displayedFieldGuides = FieldGuide.find({'_id': req.user.uncompletedFieldGuides[0]}); diff --git a/gulpfile.js b/gulpfile.js index 4faab8e3ad..b8568baefc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -57,7 +57,7 @@ gulp.task('sync', ['serve'], function() { logLeval: 'debug', files: ['public/js/lib/*/*.{js, jsx}'], port: 3001, - open: true, + open: false, reloadDelay: reloadDelay }); }); diff --git a/public/css/main.less b/public/css/main.less index 4b632e2dbc..8d8986d47f 100644 --- a/public/css/main.less +++ b/public/css/main.less @@ -729,7 +729,7 @@ div.CodeMirror-scroll { } .test-vertical-center { - margin-top: 15px; + margin-top: 8px; } .cm-s-monokai.CodeMirror { @@ -1073,6 +1073,10 @@ hr { border-radius: 5px; } +.grayed-out-test-output { + color: @gray-light; +} + //uncomment this to see the dimensions of all elements outlined in red //* { // border-color: red; diff --git a/public/js/lib/bonfire/bonfireFramework_v0.1.2.js b/public/js/lib/bonfire/bonfireFramework_v0.1.3.js similarity index 95% rename from public/js/lib/bonfire/bonfireFramework_v0.1.2.js rename to public/js/lib/bonfire/bonfireFramework_v0.1.3.js index 2e68888f53..fb56ced9d0 100644 --- a/public/js/lib/bonfire/bonfireFramework_v0.1.2.js +++ b/public/js/lib/bonfire/bonfireFramework_v0.1.3.js @@ -197,11 +197,11 @@ var createTestDisplay = function() { var testDoc = document.createElement("div"); if (test.err != null) { $(testDoc) - .html("
" + test.text + "
" + test.err + "
") + .html("
" + test.text + "
" + test.err + "
") .prependTo($('#testSuite')) } else { $(testDoc) - .html("
" + test.text + "
") + .html("
" + test.text + "
") .appendTo($('#testSuite')); } }; @@ -209,6 +209,7 @@ var createTestDisplay = function() { var assert = chai.assert; var expect = chai.expect; var should = chai.should(); +chai.config.showDiff = true; var reassembleTest = function(test, data) { var lineNum = test.line; @@ -233,7 +234,7 @@ var runTests = function(err, data) { } } catch(error) { allTestsPassed = false; - arr[ix].err = error.name + ":" + error.message; + arr[ix].err = error.message; } finally { if (!test) { createTestDisplay(); @@ -258,4 +259,4 @@ function showCompletion() { $('.next-bonfire-button').click(); } }); -} \ No newline at end of file +} diff --git a/public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.1.js similarity index 97% rename from public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js rename to public/js/lib/coursewares/coursewaresHCJQFramework_0.1.1.js index 6ab42ee738..f91de93e29 100644 --- a/public/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js +++ b/public/js/lib/coursewares/coursewaresHCJQFramework_0.1.1.js @@ -56,7 +56,7 @@ var allTests = ''; }); })(); -var otherTestsForNow = ""; +var otherTestsForNow = ""; var delay; // Initialize CodeMirror editor with a nice html5 canvas demo. @@ -92,7 +92,7 @@ var postSuccess = function(data) { var postError = function(data) { var testDoc = document.createElement("div"); $(testDoc) - .html("
" + JSON.parse(data) + "
") + .html("
" + JSON.parse(data) + "
") .prependTo($('#testSuite')) }; var goodTests = 0; diff --git a/public/js/lib/coursewares/coursewaresJSFramework.js b/public/js/lib/coursewares/coursewaresJSFramework_0.0.1.js similarity index 95% rename from public/js/lib/coursewares/coursewaresJSFramework.js rename to public/js/lib/coursewares/coursewaresJSFramework_0.0.1.js index a8cdc78bc2..d32e54428e 100644 --- a/public/js/lib/coursewares/coursewaresJSFramework.js +++ b/public/js/lib/coursewares/coursewaresJSFramework_0.0.1.js @@ -182,11 +182,11 @@ var createTestDisplay = function() { if (test.err != null) { console.log('Should be displaying bad tests'); $(testDoc) - .html("
" + test.text + "
" + test.err + "
") + .html("
" + test.text + "
" + test.err + "
") .prependTo($('#testSuite')) } else { $(testDoc) - .html("
" + test.text + "
") + .html("
" + test.text + "
") .appendTo($('#testSuite')); } }; @@ -218,7 +218,7 @@ var runTests = function(err, data) { } } catch(error) { allTestsPassed = false; - arr[ix].err = error.name + ":" + error.message; + arr[ix].err = error.message; } finally { if (!test) { createTestDisplay(); @@ -243,4 +243,4 @@ function showCompletion() { $('#next-courseware-button').click(); } }); -} \ No newline at end of file +} diff --git a/public/js/lib/coursewares/iFrameScripts.js b/public/js/lib/coursewares/iFrameScripts_0.0.1.js similarity index 64% rename from public/js/lib/coursewares/iFrameScripts.js rename to public/js/lib/coursewares/iFrameScripts_0.0.1.js index 86ac7cff28..5856d50b19 100644 --- a/public/js/lib/coursewares/iFrameScripts.js +++ b/public/js/lib/coursewares/iFrameScripts_0.0.1.js @@ -9,11 +9,11 @@ } catch (err) { allTestsGood = false; thisTest = false; - parent.postError(JSON.stringify(tests[i])); + parent.postError(JSON.stringify(err.message.split(':').shift())); } finally { if (thisTest) { - parent.postSuccess(JSON.stringify(tests[i])); + parent.postSuccess(JSON.stringify(tests[i].split(',').pop().replace(/\'/g, '').replace(/\)/, ''))); } } } -})(); \ No newline at end of file +})(); diff --git a/seed_data/coursewares.json b/seed_data/coursewares.json index 20a33ae46a..d1dd9eb3c1 100644 --- a/seed_data/coursewares.json +++ b/seed_data/coursewares.json @@ -29,6 +29,7 @@ "Now check your email and click the link in the email from Slack", "Complete the sign up process, then update your biographical information and upload an image. A picture of your face works best. This is how people will see you in the chat room, so put your best foot forward.", "Now enter the general chat room and introduce yourself to our chat room by typing: \"hello world!\".", + "Note that you're expected to follow our Code of Conduct: http://freecodecamp.com/field-guide/what-is-free-code-camp's-code-of-conduct.", "Tell your fellow campers how you found Free Code Camp. Also tell us why you want to learn to code.", "Keep the chat room open while you work through the other challenges. That way you ask for help if you get stuck on a challenge. You can also socialize when you feel like taking a break.", "You can also access this chat room by clicking the \"Chat\" button in the upper right hand corner." diff --git a/seed_data/field-guides.json b/seed_data/field-guides.json index a4261db3f0..e0761835bc 100644 --- a/seed_data/field-guides.json +++ b/seed_data/field-guides.json @@ -283,17 +283,41 @@ "

", "
    ", "
  1. Atlanta
  2. ", + "
  3. Bandung
  4. ", + "
  5. Berkeley
  6. ", + "
  7. Berlin
  8. ", + "
  9. Cincinnati
  10. ", + "
  11. Denver
  12. ", + "
  13. Dubai
  14. ", + "
  15. Hyderabad
  16. ", + "
  17. Kalamazoo
  18. ", "
  19. Karachi
  20. ", + "
  21. London
  22. ", "
  23. Los Angeles
  24. ", + "
  25. Manila
  26. ", + "
  27. Miami
  28. ", "
  29. Minneapolis
  30. ", + "
  31. Missoula
  32. ", + "
  33. Nashville
  34. ", + "
  35. New York City
  36. ", + "
  37. Oxford, Alabama
  38. ", "
  39. Paris
  40. ", "
  41. Philadelphia
  42. ", + "
  43. Pittsburgh
  44. ", "
  45. Phoenix
  46. ", + "
  47. Providence
  48. ", + "
  49. Richmond
  50. ", + "
  51. Rio de Janeiro
  52. ", + "
  53. San Bernardino
  54. ", "
  55. San Diego
  56. ", "
  57. San Francisco
  58. ", + "
  59. San Jose
  60. ", "
  61. Scottsdale
  62. ", + "
  63. Seattle
  64. ", + "
  65. Taipei
  66. ", "
  67. Tampa
  68. ", "
  69. Tempe
  70. ", + "
  71. Washington, DC
  72. ", "
", "

", "

If you didn't see your city on this list, you should create your own Facebook group for your city. Please follow these steps:

", @@ -318,7 +342,8 @@ " A screen shot showing you the group description box on the Facebook page.", "
  • Click the \"Upload a photo button. To start out, you'll probably just want to use Free Code Camp's banner (download it here), or a scenic shot of your city. Later you can update this with a picture from one of your city's Free Code Camp events.
  • ", " A screenshot showing the \"Upload a photo\" button.", - "
  • Finally, message @quincylarson in Slack with a link to your city's group page and he'll include it here.
  • ", + "
  • Message @quincylarson in Slack with a link to your city's group page and he'll include it here.
  • ", + "
  • Join our #local-group-leaders channel on Slack, where we share ideas about involving campers in your city.
  • ", " ", " ", "

    If you don't have a Facebook page, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.

    ", @@ -343,10 +368,10 @@ "

    We're happy to do a quick interview for your publication or show. Here's whom you should contact about what, and how to best reach them:

    ", "

    ", "
      ", - "
    1. Want to talk to about Free Code Camp's curriculum or long-term vision? Reach out to Quincy Larson. He's @ossia on Twitter and @quincylarson on Slack.
    2. ", - "
    3. Want to talk about Free Code Camp's open source codebase, infrastructure, or JavaScript in general? Talk to Nathan Leniz. He's @terakilobyte on Twitter and @terakilobyte on Slack.
    4. ", - "
    5. Want to explore our efforts to empower nonprofits with code? Michael D. Johnson eats, sleeps and breathes that. He's @figitalboy on Twitter and @codenonprofit on Slack.
    6. ", - "
    7. Want to get a camper's perspective on our community? Talk with Bianca Mihai (@biancamihai on Slack and @bubuslubu on Twitter) or Suzanne Atkinson (@adventurebear on Slack and @steelcitycoach on Twitter).", + "
    8. Want to talk to about Free Code Camp's curriculum or long-term vision? Reach out to Quincy Larson. He's @ossia on Twitter and @quincylarson on Slack.
    9. ", + "
    10. Want to talk about Free Code Camp's open source codebase, infrastructure, or JavaScript in general? Talk to Nathan Leniz. He's @terakilobyte on Twitter and @terakilobyte on Slack.
    11. ", + "
    12. Want to explore our efforts to empower nonprofits with code? Michael D. Johnson eats, sleeps and breathes that. He's @figitalboy on Twitter and @codenonprofit on Slack.
    13. ", + "
    14. Want to get a camper's perspective on our community? Talk with Bianca Mihai (@biancamihai on Slack and @bubuslubu on Twitter) or Suzanne Atkinson (@adventurebear on Slack and @steelcitycoach on Twitter).", "
    ", "

    ", "

    We strive to be helpful and transparent in everything we do. We'll do what we can to help you share our community with your audience.

    ", @@ -547,6 +572,30 @@ "
    " ] }, + { + "_id": "bd7158d9c451eddfaeb5bdee", + "name": "What is Free Code Camp's Code of Conduct?", + "description": [ + "
    ", + "

    Free Code Camp is friendly place to learn to code. We're committed to keeping it that way.

    ", + "

    All campers are required to agree with the following code of conduct. We'll enforce this code. We're expecting cooperation from all campers in ensuring a friendly environment for everybody.

    ", + "

    In short: be nice to your fellow campers.

    ", + "

    Remember these 3 things and your fellow campers will like you:

    ", + "

    ", + "
      ", + "
    1. Compliment your fellow campers when they do good work. Congratulate them when they accomplish something (like finishing a nonprofit project or getting a job).
    2. ", + "
    3. Critique the work, not the camper doing it.
    4. ", + "
    5. Only argue about something if it's important to the greater discussion.
    6. ", + "
    ", + "

    ", + "

    Free Code Camp should be a harassment-free experience for everyone, regardless of gender, gender identity and expression, age, sexual orientation, disability, physical appearance, body size, race, national origin, or religion (or lack thereof).

    ", + "

    We do not tolerate harassment of campers in any form, anywhere on Free Code Camp's online media (Slack, Twitch, etc.) or during pair programming. Harassment includes sexual language and imagery, deliberate intimidation, stalking, unwelcome sexual attention, libel, and any malicious hacking or social engineering.

    ", + "

    If a camper engages in harassing behavior, our team will take any action we deem appropriate, up to and including banning them from Free Code Camp.

    ", + "

    We want everyone to feel safe and respected. If you are being harassed or notice that someone else is being harassed, say something! Message @quincylarson, @terakilobyte and @codenonprofit in Slack (preferably with a screen shot of the offending language) so we can take fast action.

    ", + "

    If you have questions about this code of conduct, email us at team@freecodecamp.com.

    ", + "
    " + ] + }, { "_id": "bd7158d9c451eddfaeb5bdef", "name": "What is Free Code Camp's Privacy Policy?", diff --git a/views/bonfire/show.jade b/views/bonfire/show.jade index f2284d53a3..9a28e530c2 100644 --- a/views/bonfire/show.jade +++ b/views/bonfire/show.jade @@ -15,8 +15,6 @@ block content script(type='text/javascript', src='/js/lib/codemirror/mode/javascript/javascript.js') script(type='text/javascript', src='/js/lib/jailed/jailed.js') script(type='text/javascript', src='/js/lib/bonfire/bonfireInit.js') - script(type='text/javascript', src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.13.0/ramda.min.js") - .row .col-xs-12.col-sm-12.col-md-4.bonfire-top @@ -106,7 +104,7 @@ block content form.code .form-group.codeMirrorView textarea#codeEditor(autofocus=true, style='display: none;') - script(src='/js/lib/bonfire/bonfireFramework_v0.1.2.js') + script(src='/js/lib/bonfire/bonfireFramework_v0.1.3.js') diff --git a/views/coursewares/showHTML.jade b/views/coursewares/showHTML.jade index 840056724d..6349650804 100644 --- a/views/coursewares/showHTML.jade +++ b/views/coursewares/showHTML.jade @@ -82,4 +82,4 @@ block content .animated.zoomInDown.delay-half span.completion-icon.ion-checkmark-circled.text-primary a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress - script(src="/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js") + script(src="/js/lib/coursewares/coursewaresHCJQFramework_0.1.1.js") diff --git a/views/coursewares/showJS.jade b/views/coursewares/showJS.jade index 3e33ee4a4b..b55d8ad4d9 100644 --- a/views/coursewares/showJS.jade +++ b/views/coursewares/showJS.jade @@ -56,7 +56,7 @@ block content form.code .form-group.codeMirrorView textarea#codeEditor(autofocus=true, style='display: none;') - script(src='/js/lib/coursewares/coursewaresJSFramework.js') + script(src='/js/lib/coursewares/coursewaresJSFramework_0.0.1.js') #complete-courseware-dialog.modal(tabindex='-1') .modal-dialog.animated.zoomIn.fast-animation .modal-content diff --git a/views/partials/field-guide.jade b/views/partials/field-guide.jade index 5c08d39896..e4d70b01d1 100644 --- a/views/partials/field-guide.jade +++ b/views/partials/field-guide.jade @@ -30,9 +30,10 @@ h3 } else { $(div).html("
    " + "" + - "
    " + + "" + + "
    " + "
    " + "
    "); } diff --git a/views/partials/universal-head.jade b/views/partials/universal-head.jade index 673c6fe58a..cfc3fc7b81 100644 --- a/views/partials/universal-head.jade +++ b/views/partials/universal-head.jade @@ -25,7 +25,7 @@ script(src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstra script. if (typeof($.fn.modal) === 'undefined') { document.write('