diff --git a/.editorconfig b/.editorconfig index 052e5ee7..c6c37106 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,7 @@ root = true [*] charset = utf-8 end_of_line = lf -indent_size = 4 +indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index daeba5f9..3f4e088b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *~ node_modules +./idea .DS_Store diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..4e83c1ac --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1436553156830 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 00000000..ca792ae9 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,18 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start', 'server.js' ] +2 info using npm@1.4.28 +3 info using node@v0.10.37 +4 verbose node symlink /usr/bin/node +5 error Error: ENOENT, open '/home/mannuel/labs.themwebs/react-tutorial/node_modules/server.js/package.json' +6 error If you need help, you may report this *entire* log, +6 error including the npm and node versions, at: +6 error +7 error System Linux 3.13.0-57-generic +8 error command "/usr/bin/node" "/usr/bin/npm" "start" "server.js" +9 error cwd /home/mannuel/labs.themwebs/react-tutorial +10 error node -v v0.10.37 +11 error npm -v 1.4.28 +12 error path /home/mannuel/labs.themwebs/react-tutorial/node_modules/server.js/package.json +13 error code ENOENT +14 error errno 34 +15 verbose exit [ 34, true ] diff --git a/public/index.html b/public/index.html index c6220169..5621e4c8 100644 --- a/public/index.html +++ b/public/index.html @@ -11,6 +11,6 @@
- + diff --git a/public/scripts/tutorial1.jsx b/public/scripts/tutorial1.jsx new file mode 100644 index 00000000..7517b1a0 --- /dev/null +++ b/public/scripts/tutorial1.jsx @@ -0,0 +1,63 @@ + +var data = [ + { author: "Mannuel Ferreira", text: "This is not bad at all"}, + { author: "Denton Pretorius", text: "Yeah I agree"} +]; + +var CommentList = React.createClass({ + render: function () { + var commentNodes = this.props.data.map(function (comment){ + return ( + + {comment.text} + + ); + }); + return ( +
+ {commentNodes} +
+ ) + } +}); + +var CommentForm = React.createClass({ + render: function () { + return ( +
+ Hello, world! I am a CommentForm. +
+ ); + } +}); + +var Comment = React.createClass({ + render: function () { + var rawMarkup = marked(this.props.children.toString(), {sanitize: true}) + return ( +
+

+ {this.props.author} +

+ +
+ ); + } +}); + +var CommentBox = React.createClass({ + render: function () { + return ( +
+

Comments

+ + +
+ ); + } +}); + +React.render( + , + document.getElementById('content') +); diff --git a/public/scripts/tutorial2.jsx b/public/scripts/tutorial2.jsx new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/public/scripts/tutorial2.jsx @@ -0,0 +1 @@ +