diff --git a/.gitignore b/.gitignore index 815f6fb..760716c 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ node_modules .DS_Store .lock-wscript .service-credentials +.env bower_components diff --git a/.nvmrc b/.nvmrc index 743ad4a..fae6e3d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -iojs-v1.2.0 +4.2.1 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..d55d63d --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Code School + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 79a1a3c..b9db4db 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,79 @@ # JavaScript.com -This is the repo for the JavaScript.com website. +With the help of community members contributing content to the site, +JavaScript.com aims to keep developers up to date on news, frameworks, and libraries. +In addition, we aim to be a gateway for those wanting to learn JavaScript. -## Installing NVM +# Roadmap +JavaScript.com was the product of a hack day and there's a lot of room for +improvement. Check out the current [roadmap](https://github.com/codeschool/JavaScript.com/milestones/v2). -Install NVM (`$ brew install nvm` and follow instructions) +### Contributions +We'd love for you to contribute! For the time being, we will be placing a strong +emphasis on getting the code base up to standards before adding new features. + +### Deployments +We have two main branches, `master` and `production`. All PR's will be merged +into `master` which is then merged into `production`. The `production` branch is +the code that is currenly deployed. + +At the moment, `master` is ahead of `production` while we streamline our deploy +process. Please bear with us for the timing being! + + +# Getting Started +#### Installing NVM +Install NVM (`brew install nvm` and follow instructions) ```bash -nvm install iojs-v1.2.0 -nvm use iojs-v1.2.0 +nvm install 4.2.1 npm install -g gulp npm install ``` -This app authenticates with GitHub, so you'll need to create a GitHub Application and set ENVs for `GH_CLIENT_ID` and `GH_CLIENT_SECRET`. - -## Running +#### Building Assets -Run the application with `$ npm start`. You can also set the environment variables at start time. Here's an example: +To build assets locally, you'll need to install Bower dependencies and run these Gulp tasks: ```bash -$ GH_CLIENT_ID=myid GH_CLIENT_SECRET=mysecret npm start +bower install +gulp sass +gulp javascript ``` +Remember to re-run these tasks after pulling or changing branches. + +#### Setup Github Application +This app authenticates with GitHub, so you'll need to create a +[GitHub Application](https://github.com/settings/applications/new). + +Set the **Homepage URL** to `http://localhost:3000` and + +the **Authorization callback URL** to `http://localhost:3000/sessions/auth/github/callback/` -For debugging all the things, run `DEBUG=* npm start`. -## Database -Whenever you do the initial `npm install` a db called `javascriptcom` is created -for you. In the event that you need to drop that database and recreate it, don't -forget to either run `npm install` again or `createdb javascriptcom` +#### Environment Variables +We use [dotenv](https://github.com/motdotla/dotenv) to keep ourselves sane with +the various environment variables. -NPM will run new migrations whenever you `npm start`. In order for it to work, -you'll need to set the `DATABASE_URL` ENV to pg://localhost:5432/javascriptcom. -Migrations are already run for you after the initial `npm install` +Copy `example.env` to `.env` and then fill in the variables. The only ones +that are critical locally are Github variables for sign in. For everything else, +you can setup test accounts if you'd like. -To create new migrations see the node-pg-migraton -[documentation](https://github.com/theoephraim/node-pg-migrate). +#### Database Setup +Download and install [MongoDB](https://www.mongodb.org/downloads) + +When you run `npm start`, mongod will be forked as a background process. No need +to create the database either. You're all set. + +After you're done, make sure you run `npm stop` to shut down mongod. + +## Running the application + +Run the application with `$ npm start`. -After setting your database up run `gulp seeds` to seed your database. ## Development If you add any runtime dependencies, you must run `npm shrinkwrap` and commit changes to `npm-shrinkwrap.json`. -### Building Assets - -To build assets locally, you'll need to install Bower dependencies and run these Gulp tasks: -```bash -$ bower install -$ gulp sass -$ gulp javascript -``` - -Remember to re-run these tasks after pulling or changing branches. diff --git a/bower.json b/bower.json index b53fe3f..aaf3142 100644 --- a/bower.json +++ b/bower.json @@ -15,7 +15,7 @@ "tests" ], "dependencies": { - "abecedary": "~0.0.5", + "abecedary": "./client/vendors/abecedary.zip", "angular": "1.4.0-beta.6", "angular-animate": "1.4.0-beta.6", "angular-cookies": "1.4.0-beta.6", diff --git a/client/javascripts/components/modules/createComment.js b/client/javascripts/components/modules/createComment.js index e276187..9b21b31 100644 --- a/client/javascripts/components/modules/createComment.js +++ b/client/javascripts/components/modules/createComment.js @@ -75,18 +75,17 @@ JS.Modules.CreateComment = (function() { var _buildComment = function(data) { var comment = ''; - comment+= - '
' + data.comment.body + '
' + + '' + data.doc.comments[0].body + '
' + '