Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
430 changes: 257 additions & 173 deletions client/.eslintrc

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions client/assets/javascripts/App.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
'use strict';

import $ from 'jquery';
import React from 'react';
import CommentBox from './components/CommentBox';

$(function() {
$(function onLoad() {
function render() {
if ($('#content').length > 0) {
React.render(
Expand Down
2 changes: 0 additions & 2 deletions client/assets/javascripts/actions/CommentActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import alt from '../FluxAlt';
import CommentsManager from '../utils/CommentsManager';

Expand Down
2 changes: 0 additions & 2 deletions client/assets/javascripts/actions/FormActions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import alt from '../FluxAlt';
import CommentActions from '../actions/CommentActions';
import CommentsManager from '../utils/CommentsManager';
Expand Down
6 changes: 2 additions & 4 deletions client/assets/javascripts/components/Comment.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

import marked from 'marked';
import React from 'react';

var Comment = React.createClass({
const Comment = React.createClass({
displayName: 'Comment',

propTypes: {
Expand All @@ -12,7 +10,7 @@ var Comment = React.createClass({
},

render() {
var rawMarkup = marked(this.props.text);
const rawMarkup = marked(this.props.text);
return (
<div className='comment'>
<h2 className='comment-author'>
Expand Down
4 changes: 1 addition & 3 deletions client/assets/javascripts/components/CommentBox.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import $ from 'jquery';
import React from 'react';
import CommentForm from './CommentForm';
Expand All @@ -9,7 +7,7 @@ import FormStore from '../stores/FormStore';
import CommentActions from '../actions/CommentActions';
import FormActions from '../actions/FormActions';

var CommentBox = React.createClass({
const CommentBox = React.createClass({
displayName: 'CommentBox',

propTypes: {
Expand Down
4 changes: 1 addition & 3 deletions client/assets/javascripts/components/CommentForm.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import React from 'react/addons';
import Input from 'react-bootstrap/lib/Input';
import Row from 'react-bootstrap/lib/Row';
Expand All @@ -9,7 +7,7 @@ import NavItem from 'react-bootstrap/lib/NavItem';
import FormActions from '../actions/FormActions';
import FormStore from '../stores/FormStore';

var CommentForm = React.createClass({
const CommentForm = React.createClass({
displayName: 'CommentForm',

propTypes: {
Expand Down
9 changes: 3 additions & 6 deletions client/assets/javascripts/components/CommentList.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
'use strict';

import React from 'react';
import Comment from './Comment';

var CommentList = React.createClass({
const CommentList = React.createClass({
displayName: 'CommentList',

propTypes: {
comments: React.PropTypes.array
},

render() {
var reversedData = this.props.comments.slice(0).reverse();
var commentNodes = reversedData.map((comment, index) => {

const reversedData = this.props.comments.slice(0).reverse();
const commentNodes = reversedData.map((comment, index) => {
// `key` is a React-specific concept and is not mandatory for the
// purpose of this tutorial. if you're curious, see more here:
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
Expand Down
9 changes: 3 additions & 6 deletions client/assets/javascripts/stores/CommentStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import alt from '../FluxAlt';
import React from 'react/addons';
import CommentActions from '../actions/CommentActions';
Expand All @@ -15,12 +13,12 @@ class CommentStore {
});
}

handleFetchComments(displaySpinner) {
handleFetchComments() {
return false;
}

handleUpdateComments(comments) {
this.comments = comments
this.comments = comments;
this.errorMessage = null;
}

Expand All @@ -30,8 +28,7 @@ class CommentStore {

handleAddComment(comment) {
const oldComments = this.comments;
var newComments = React.addons.update(oldComments, {$push: [comment]});
this.comments = newComments;
this.comments = React.addons.update(oldComments, {$push: [comment]});
}
}

Expand Down
8 changes: 3 additions & 5 deletions client/assets/javascripts/stores/FormStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import alt from '../FluxAlt';
import FormActions from '../actions/FormActions';
import CommentActions from '../actions/CommentActions';
Expand All @@ -24,7 +22,7 @@ class FormStore {
this.comment = comment;
}

handleSubmitComment(comment) {
handleSubmitComment() {
this.ajaxSending = true;
this.comment = emptyComment;
}
Expand All @@ -35,11 +33,11 @@ class FormStore {
}
}

handleUpdateComments(comments) {
handleUpdateComments() {
this.ajaxSending = false;
}

handleUpdateCommentsError(comments) {
handleUpdateCommentsError() {
this.ajaxSending = false;
}
}
Expand Down
2 changes: 0 additions & 2 deletions client/assets/javascripts/utils/CommentsManager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import $ from 'jquery';

const CommentsManager = {
Expand Down
9 changes: 9 additions & 0 deletions client/bin/lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/bin/sh
echo ================================================================================
echo Warnings are OPTIONAL
echo ================================================================================

find . -path ./node_modules -prune -o -name "*.js" -o -name "*.jsx" -exec eslint {} \;
npm run jscs .

echo ================================================================================
echo Warnings are OPTIONAL
echo ================================================================================

Loading