Skip to content

Commit 3c436ba

Browse files
committed
1 parent f6536dc commit 3c436ba

16 files changed

+642
-797
lines changed

Diff for: client/.eslintrc

+257-173
Large diffs are not rendered by default.

Diff for: client/assets/javascripts/App.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
'use strict';
2-
31
import $ from 'jquery';
42
import React from 'react';
53
import CommentBox from './components/CommentBox';
64

7-
$(function() {
5+
$(function onLoad() {
86
function render() {
97
if ($('#content').length > 0) {
108
React.render(

Diff for: client/assets/javascripts/actions/CommentActions.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import alt from '../FluxAlt';
42
import CommentsManager from '../utils/CommentsManager';
53

Diff for: client/assets/javascripts/actions/FormActions.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import alt from '../FluxAlt';
42
import CommentActions from '../actions/CommentActions';
53
import CommentsManager from '../utils/CommentsManager';

Diff for: client/assets/javascripts/components/Comment.jsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
'use strict';
2-
31
import marked from 'marked';
42
import React from 'react';
53

6-
var Comment = React.createClass({
4+
const Comment = React.createClass({
75
displayName: 'Comment',
86

97
propTypes: {
@@ -12,7 +10,7 @@ var Comment = React.createClass({
1210
},
1311

1412
render() {
15-
var rawMarkup = marked(this.props.text);
13+
const rawMarkup = marked(this.props.text);
1614
return (
1715
<div className='comment'>
1816
<h2 className='comment-author'>

Diff for: client/assets/javascripts/components/CommentBox.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import $ from 'jquery';
42
import React from 'react';
53
import CommentForm from './CommentForm';
@@ -9,7 +7,7 @@ import FormStore from '../stores/FormStore';
97
import CommentActions from '../actions/CommentActions';
108
import FormActions from '../actions/FormActions';
119

12-
var CommentBox = React.createClass({
10+
const CommentBox = React.createClass({
1311
displayName: 'CommentBox',
1412

1513
propTypes: {

Diff for: client/assets/javascripts/components/CommentForm.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import React from 'react/addons';
42
import Input from 'react-bootstrap/lib/Input';
53
import Row from 'react-bootstrap/lib/Row';
@@ -9,7 +7,7 @@ import NavItem from 'react-bootstrap/lib/NavItem';
97
import FormActions from '../actions/FormActions';
108
import FormStore from '../stores/FormStore';
119

12-
var CommentForm = React.createClass({
10+
const CommentForm = React.createClass({
1311
displayName: 'CommentForm',
1412

1513
propTypes: {

Diff for: client/assets/javascripts/components/CommentList.jsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
'use strict';
2-
31
import React from 'react';
42
import Comment from './Comment';
53

6-
var CommentList = React.createClass({
4+
const CommentList = React.createClass({
75
displayName: 'CommentList',
86

97
propTypes: {
108
comments: React.PropTypes.array
119
},
1210

1311
render() {
14-
var reversedData = this.props.comments.slice(0).reverse();
15-
var commentNodes = reversedData.map((comment, index) => {
16-
12+
const reversedData = this.props.comments.slice(0).reverse();
13+
const commentNodes = reversedData.map((comment, index) => {
1714
// `key` is a React-specific concept and is not mandatory for the
1815
// purpose of this tutorial. if you're curious, see more here:
1916
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children

Diff for: client/assets/javascripts/stores/CommentStore.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import alt from '../FluxAlt';
42
import React from 'react/addons';
53
import CommentActions from '../actions/CommentActions';
@@ -15,12 +13,12 @@ class CommentStore {
1513
});
1614
}
1715

18-
handleFetchComments(displaySpinner) {
16+
handleFetchComments() {
1917
return false;
2018
}
2119

2220
handleUpdateComments(comments) {
23-
this.comments = comments
21+
this.comments = comments;
2422
this.errorMessage = null;
2523
}
2624

@@ -30,8 +28,7 @@ class CommentStore {
3028

3129
handleAddComment(comment) {
3230
const oldComments = this.comments;
33-
var newComments = React.addons.update(oldComments, {$push: [comment]});
34-
this.comments = newComments;
31+
this.comments = React.addons.update(oldComments, {$push: [comment]});
3532
}
3633
}
3734

Diff for: client/assets/javascripts/stores/FormStore.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import alt from '../FluxAlt';
42
import FormActions from '../actions/FormActions';
53
import CommentActions from '../actions/CommentActions';
@@ -24,7 +22,7 @@ class FormStore {
2422
this.comment = comment;
2523
}
2624

27-
handleSubmitComment(comment) {
25+
handleSubmitComment() {
2826
this.ajaxSending = true;
2927
this.comment = emptyComment;
3028
}
@@ -35,11 +33,11 @@ class FormStore {
3533
}
3634
}
3735

38-
handleUpdateComments(comments) {
36+
handleUpdateComments() {
3937
this.ajaxSending = false;
4038
}
4139

42-
handleUpdateCommentsError(comments) {
40+
handleUpdateCommentsError() {
4341
this.ajaxSending = false;
4442
}
4543
}

Diff for: client/assets/javascripts/utils/CommentsManager.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import $ from 'jquery';
42

53
const CommentsManager = {

Diff for: client/bin/lint

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
#!/bin/sh
2+
echo ================================================================================
3+
echo Warnings are OPTIONAL
4+
echo ================================================================================
5+
26
find . -path ./node_modules -prune -o -name "*.js" -o -name "*.jsx" -exec eslint {} \;
37
npm run jscs .
8+
9+
echo ================================================================================
10+
echo Warnings are OPTIONAL
11+
echo ================================================================================
12+

0 commit comments

Comments
 (0)