File tree 16 files changed +642
-797
lines changed
16 files changed +642
-797
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import $ from 'jquery' ;
4
2
import React from 'react' ;
5
3
import CommentBox from './components/CommentBox' ;
6
4
7
- $ ( function ( ) {
5
+ $ ( function onLoad ( ) {
8
6
function render ( ) {
9
7
if ( $ ( '#content' ) . length > 0 ) {
10
8
React . render (
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import alt from '../FluxAlt' ;
4
2
import CommentsManager from '../utils/CommentsManager' ;
5
3
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import alt from '../FluxAlt' ;
4
2
import CommentActions from '../actions/CommentActions' ;
5
3
import CommentsManager from '../utils/CommentsManager' ;
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import marked from 'marked' ;
4
2
import React from 'react' ;
5
3
6
- var Comment = React . createClass ( {
4
+ const Comment = React . createClass ( {
7
5
displayName : 'Comment' ,
8
6
9
7
propTypes : {
@@ -12,7 +10,7 @@ var Comment = React.createClass({
12
10
} ,
13
11
14
12
render ( ) {
15
- var rawMarkup = marked ( this . props . text ) ;
13
+ const rawMarkup = marked ( this . props . text ) ;
16
14
return (
17
15
< div className = 'comment' >
18
16
< h2 className = 'comment-author' >
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import $ from 'jquery' ;
4
2
import React from 'react' ;
5
3
import CommentForm from './CommentForm' ;
@@ -9,7 +7,7 @@ import FormStore from '../stores/FormStore';
9
7
import CommentActions from '../actions/CommentActions' ;
10
8
import FormActions from '../actions/FormActions' ;
11
9
12
- var CommentBox = React . createClass ( {
10
+ const CommentBox = React . createClass ( {
13
11
displayName : 'CommentBox' ,
14
12
15
13
propTypes : {
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import React from 'react/addons' ;
4
2
import Input from 'react-bootstrap/lib/Input' ;
5
3
import Row from 'react-bootstrap/lib/Row' ;
@@ -9,7 +7,7 @@ import NavItem from 'react-bootstrap/lib/NavItem';
9
7
import FormActions from '../actions/FormActions' ;
10
8
import FormStore from '../stores/FormStore' ;
11
9
12
- var CommentForm = React . createClass ( {
10
+ const CommentForm = React . createClass ( {
13
11
displayName : 'CommentForm' ,
14
12
15
13
propTypes : {
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import React from 'react' ;
4
2
import Comment from './Comment' ;
5
3
6
- var CommentList = React . createClass ( {
4
+ const CommentList = React . createClass ( {
7
5
displayName : 'CommentList' ,
8
6
9
7
propTypes : {
10
8
comments : React . PropTypes . array
11
9
} ,
12
10
13
11
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 ) => {
17
14
// `key` is a React-specific concept and is not mandatory for the
18
15
// purpose of this tutorial. if you're curious, see more here:
19
16
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import alt from '../FluxAlt' ;
4
2
import React from 'react/addons' ;
5
3
import CommentActions from '../actions/CommentActions' ;
@@ -15,12 +13,12 @@ class CommentStore {
15
13
} ) ;
16
14
}
17
15
18
- handleFetchComments ( displaySpinner ) {
16
+ handleFetchComments ( ) {
19
17
return false ;
20
18
}
21
19
22
20
handleUpdateComments ( comments ) {
23
- this . comments = comments
21
+ this . comments = comments ;
24
22
this . errorMessage = null ;
25
23
}
26
24
@@ -30,8 +28,7 @@ class CommentStore {
30
28
31
29
handleAddComment ( comment ) {
32
30
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 ] } ) ;
35
32
}
36
33
}
37
34
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import alt from '../FluxAlt' ;
4
2
import FormActions from '../actions/FormActions' ;
5
3
import CommentActions from '../actions/CommentActions' ;
@@ -24,7 +22,7 @@ class FormStore {
24
22
this . comment = comment ;
25
23
}
26
24
27
- handleSubmitComment ( comment ) {
25
+ handleSubmitComment ( ) {
28
26
this . ajaxSending = true ;
29
27
this . comment = emptyComment ;
30
28
}
@@ -35,11 +33,11 @@ class FormStore {
35
33
}
36
34
}
37
35
38
- handleUpdateComments ( comments ) {
36
+ handleUpdateComments ( ) {
39
37
this . ajaxSending = false ;
40
38
}
41
39
42
- handleUpdateCommentsError ( comments ) {
40
+ handleUpdateCommentsError ( ) {
43
41
this . ajaxSending = false ;
44
42
}
45
43
}
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
1
import $ from 'jquery' ;
4
2
5
3
const CommentsManager = {
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ echo ================================================================================
3
+ echo Warnings are OPTIONAL
4
+ echo ================================================================================
5
+
2
6
find . -path ./node_modules -prune -o -name " *.js" -o -name " *.jsx" -exec eslint {} \;
3
7
npm run jscs .
8
+
9
+ echo ================================================================================
10
+ echo Warnings are OPTIONAL
11
+ echo ================================================================================
12
+
You can’t perform that action at this time.
0 commit comments