From 3757f7ac7fb6cd633601df78a2285728f2f3b5bb Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Tue, 10 May 2016 17:26:59 -0500 Subject: [PATCH 01/39] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 34ebddf4..df9cc3e9 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@
- + From 0393748ae4d9e1cac863093a6bafc730c0ba43e5 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 15:20:49 -0500 Subject: [PATCH 03/39] Update index.html --- public/index.html | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 0a451743..3f903233 100644 --- a/public/index.html +++ b/public/index.html @@ -19,7 +19,29 @@ render: function() { return (
- Well Hello there world, I happen to be a comment box. +

Comments

+ + +
+ ); + } +}); + +var CommentList = React.createClass({ + render: function() { + return ( +
+ Hello, world! I am a CommentList. +
+ ); + } +}); + +var CommentForm = React.createClass({ + render: function() { + return ( +
+ Hello, world! I am a CommentForm.
); } From bdedd0b09fda0e8bee1ca914aab57b4ea126e86f Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 15:44:50 -0500 Subject: [PATCH 04/39] Update index.html --- public/index.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/public/index.html b/public/index.html index 3f903233..3bd52e69 100644 --- a/public/index.html +++ b/public/index.html @@ -46,6 +46,20 @@

Comments

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

+ {this.props.author} +

+ {this.props.children} +
+ ); + } +}); + ReactDOM.render( , document.getElementById('content') From d1db8d3eff4ed6d86d1d83718fd1203e826480e8 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 15:52:05 -0500 Subject: [PATCH 05/39] Update index.html --- public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 3bd52e69..2089b2f4 100644 --- a/public/index.html +++ b/public/index.html @@ -31,7 +31,8 @@

Comments

render: function() { return (
- Hello, world! I am a CommentList. + Why did you say that name? + Dude, she's my mom.
); } From c3811741b13c3b64b5152ef3863fed751b0279ea Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 15:53:40 -0500 Subject: [PATCH 06/39] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 2089b2f4..910359ba 100644 --- a/public/index.html +++ b/public/index.html @@ -55,7 +55,7 @@

Comments

{this.props.author}

- {this.props.children} + {marked(this.props.children.toString())} ); } From c47cd80761bf45717db50dba70cf572e93b776a0 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 15:55:10 -0500 Subject: [PATCH 07/39] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 910359ba..9caa0353 100644 --- a/public/index.html +++ b/public/index.html @@ -32,7 +32,7 @@

Comments

return (
Why did you say that name? - Dude, she's my mom. + Dude, she's my *mom*.
); } From 0b63f53e152d4adbec0d33ed65aed2c9f4cbd085 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 15:56:33 -0500 Subject: [PATCH 08/39] Update index.html --- public/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 9caa0353..d809d836 100644 --- a/public/index.html +++ b/public/index.html @@ -49,13 +49,18 @@

Comments

}); var Comment = React.createClass({ + rawMarkup: function() { + var rawMarkup = marked(this.props.children.toString(), {sanitize: true}); + return { __html: rawMarkup }; + }, + render: function() { return (

{this.props.author}

- {marked(this.props.children.toString())} +
); } From 5edb2c922b17f964b18f33a3e85c4fcfd58bcd76 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:00:23 -0500 Subject: [PATCH 09/39] Update index.html Add warning about xss --- public/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index d809d836..a8e11001 100644 --- a/public/index.html +++ b/public/index.html @@ -47,7 +47,11 @@

Comments

); } }); - +/* +Remember: by using this feature you're relying on marked to be secure. +In this case, we pass sanitize: true which tells marked to escape any +HTML markup in the source instead of passing it through unchanged. +*/ var Comment = React.createClass({ rawMarkup: function() { var rawMarkup = marked(this.props.children.toString(), {sanitize: true}); From e6eaa3346ea7efb0fb7acf74c4426e9e819a7e70 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:02:04 -0500 Subject: [PATCH 10/39] Update index.html --- public/index.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index a8e11001..1bd47310 100644 --- a/public/index.html +++ b/public/index.html @@ -15,18 +15,27 @@
From f48fc8fd9b6430fef8ece7a5daecf64829e549d6 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:03:55 -0500 Subject: [PATCH 11/39] Update index.html --- public/index.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 1bd47310..a5b4d10d 100644 --- a/public/index.html +++ b/public/index.html @@ -17,9 +17,13 @@ From 8354306c1ab52817434f8442c759692644965520 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:39:18 -0500 Subject: [PATCH 14/39] Update index.html --- public/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 2a677db0..e6dee48d 100644 --- a/public/index.html +++ b/public/index.html @@ -27,11 +27,14 @@ ]; var CommentBox = React.createClass({ + getInitialState: function() { + return {data: []}; + }, render: function() { return (

Comments

- +
); From 044bb8d23100f3df178ee779ce3e182dadbde031 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:49:22 -0500 Subject: [PATCH 15/39] Update index.html --- public/index.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index e6dee48d..bc31f9b6 100644 --- a/public/index.html +++ b/public/index.html @@ -30,6 +30,19 @@ getInitialState: function() { return {data: []}; }, + componentDidMount: function() { + $.ajax({ + url: this.props.url, + dataType: 'json', + cache: false, + success: function(data) { + this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); + }.bind(this) + }); + }, render: function() { return (
@@ -98,7 +111,7 @@

*/ ReactDOM.render( , - document.getElementById('content') + $('#content'); ); From 792ca3d3ef3b1ba942692ea86d864d288232f178 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:51:54 -0500 Subject: [PATCH 16/39] Update index.html --- public/index.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index bc31f9b6..a065834f 100644 --- a/public/index.html +++ b/public/index.html @@ -27,10 +27,7 @@ ]; var CommentBox = React.createClass({ - getInitialState: function() { - return {data: []}; - }, - componentDidMount: function() { + loadCommentsFromServer: function() { $.ajax({ url: this.props.url, dataType: 'json', @@ -43,6 +40,13 @@ }.bind(this) }); }, + getInitialState: function() { + return {data: []}; + }, + componentDidMount: function() { + this.loadCommentsFromServer(); + setInterval(this.loadCommentsFromServer, this.props.pollInterval); + }, render: function() { return (
From 26aca2e06a713e6c46c339f5f627f2d0063e9456 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:52:30 -0500 Subject: [PATCH 17/39] Update index.html oops, forgot poll interval on the render --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index a065834f..caad621d 100644 --- a/public/index.html +++ b/public/index.html @@ -114,7 +114,7 @@

// static comment data from JSON above */ ReactDOM.render( - , + , $('#content'); ); From 3d13d63059b587cf4327e23f0d7b7e3449bf7462 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:54:56 -0500 Subject: [PATCH 18/39] Update index.html experiment --- public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index caad621d..d7e26f97 100644 --- a/public/index.html +++ b/public/index.html @@ -115,7 +115,8 @@

*/ ReactDOM.render( , - $('#content'); + // $('#content'); + document.getElementById('content') ); From 94528a8ad8d72e52b5c928b5784b4dc9ca7a285e Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:56:50 -0500 Subject: [PATCH 19/39] Update comments.json --- comments.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/comments.json b/comments.json index 7bef77ad..76591582 100644 --- a/comments.json +++ b/comments.json @@ -9,4 +9,9 @@ "author": "Paul O’Shannessy", "text": "React is *great*!" } + { + "id": 1530070400000, + "author": "Herb McGlerb", + "text": "React is *great*!" + } ] From c51ba67f7926bab4731c6cf088cf46ad3851df18 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:58:10 -0500 Subject: [PATCH 20/39] Update comments.json Wow, one comma broke it. --- comments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comments.json b/comments.json index 76591582..17f80b4c 100644 --- a/comments.json +++ b/comments.json @@ -8,7 +8,7 @@ "id": 1420070400000, "author": "Paul O’Shannessy", "text": "React is *great*!" - } + }, { "id": 1530070400000, "author": "Herb McGlerb", From 642e1c2b176c82199dbad4e91568b5c0ba3c95b4 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 16:59:38 -0500 Subject: [PATCH 21/39] Update index.html --- public/index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index d7e26f97..bcda507e 100644 --- a/public/index.html +++ b/public/index.html @@ -78,9 +78,11 @@

Comments

var CommentForm = React.createClass({ render: function() { return ( -
- Hello, world! I am a CommentForm. -
+
+ + + +
); } }); From dd6e170e4ea9421b7e3d2f831fc1097aa4754782 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:09:51 -0500 Subject: [PATCH 22/39] Update index.html --- public/index.html | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index bcda507e..6bbcdc0f 100644 --- a/public/index.html +++ b/public/index.html @@ -76,11 +76,30 @@

Comments

}); var CommentForm = React.createClass({ + getInitialState: function() { + return {author: '', text: ''}; + }, + handleAuthorChange: function(e) { + this.setState({author: e.target.value}); + }, + handleTextChange: function(e) { + this.setState({text: e.target.value}); + }, render: function() { return (
- - + +
); From a0fdb6d1a528c21e505d11f0832f81988c9e461e Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:12:32 -0500 Subject: [PATCH 23/39] Update index.html it's gettin hot in hrrrrr --- public/index.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 6bbcdc0f..6eddcf5b 100644 --- a/public/index.html +++ b/public/index.html @@ -85,9 +85,19 @@

Comments

handleTextChange: function(e) { this.setState({text: e.target.value}); }, + handleSubmit: function(e) { + e.preventDefault(); + var author = this.state.author.trim(); + var text = this.state.text.trim(); + if (!text || !author) { + return; + } + // TODO: send request to the server + this.setState({author: '', text: ''}); + }, render: function() { return ( -
+ Date: Wed, 11 May 2016 17:18:30 -0500 Subject: [PATCH 24/39] Update index.html phew! --- public/index.html | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 6eddcf5b..1288fe43 100644 --- a/public/index.html +++ b/public/index.html @@ -40,6 +40,20 @@ }.bind(this) }); }, + handleCommentSubmit: function(comment) { + $.ajax({ + url: this.props.url, + dataType: 'json', + type: 'POST', + data: comment, + success: function(data) { + this.setState({data: data}); + }.bind(this), + error: function(xhr, status, err) { + console.error(this.props.url, status, err.toString()); + }.bind(this) + }); + }, getInitialState: function() { return {data: []}; }, @@ -52,7 +66,7 @@

Comments

- +
); } @@ -92,8 +106,8 @@

Comments

if (!text || !author) { return; } - // TODO: send request to the server - this.setState({author: '', text: ''}); + this.props.onCommentSubmit({author: author, text: text}); + // this.setState({author: '', text: ''}); }, render: function() { return ( @@ -109,6 +123,7 @@

Comments

placeholder="Say something..." value={this.state.text} onChange={this.handleTextChange} + />
From 4fa9f5029f73f2296834392a6f0a2099d22e8e41 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:21:13 -0500 Subject: [PATCH 25/39] Version 2 with 'optimistic' enhancement --- public/index2.html | 169 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 public/index2.html diff --git a/public/index2.html b/public/index2.html new file mode 100644 index 00000000..1288fe43 --- /dev/null +++ b/public/index2.html @@ -0,0 +1,169 @@ + + + + + React Tutorial + + + + + + + + + +
+ + + + From b1ee7feb0a32869fce35b562ac564cde8a24f720 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:22:55 -0500 Subject: [PATCH 26/39] Update index2.html --- public/index2.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/index2.html b/public/index2.html index 1288fe43..7e034ee7 100644 --- a/public/index2.html +++ b/public/index2.html @@ -41,6 +41,13 @@ }); }, handleCommentSubmit: function(comment) { + var comments = this.state.data; + // Optimistically set an id on the new comment. It will be replaced by an + // id generated by the server. In a production application you would likely + // not use Date.now() for this and would have a more robust system in place. + comment.id = Date.now(); + var newComments = comments.concat([comment]); + this.setState({data: newComments}); $.ajax({ url: this.props.url, dataType: 'json', @@ -50,6 +57,7 @@ this.setState({data: data}); }.bind(this), error: function(xhr, status, err) { + this.setState({data: comments}); /* optimist */ console.error(this.props.url, status, err.toString()); }.bind(this) }); From 60f6f17c62423639f172d00d69f698ed8fb2b8c6 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:30:57 -0500 Subject: [PATCH 27/39] Update index2.html --- public/index2.html | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/public/index2.html b/public/index2.html index 7e034ee7..070aa1a1 100644 --- a/public/index2.html +++ b/public/index2.html @@ -15,17 +15,7 @@
From 5e0d98e626d5eb1a92d2ada2f4a6cf877134154a Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:33:59 -0500 Subject: [PATCH 28/39] Update index2.html --- public/index2.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index2.html b/public/index2.html index 070aa1a1..bdc6fa48 100644 --- a/public/index2.html +++ b/public/index2.html @@ -159,8 +159,8 @@

*/ ReactDOM.render( , - $('#content'); - // document.getElementById('content') + //$('#content'); + document.getElementById('content') ); From 8eccb210d834bec34b23c40cfc77d344c382a283 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:39:41 -0500 Subject: [PATCH 29/39] Update index2.html --- public/index2.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/index2.html b/public/index2.html index bdc6fa48..182d60a4 100644 --- a/public/index2.html +++ b/public/index2.html @@ -15,7 +15,12 @@
From 366fe2fcccdf0336023f62b428d393401185d5da Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:43:31 -0500 Subject: [PATCH 31/39] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 8db4e51a..caa4c223 100644 --- a/public/index.html +++ b/public/index.html @@ -165,7 +165,7 @@

document.getElementById('content') ); -var justMe = navigator.appCodeName; +var justMe = navigator.appCodeName + navigator.appName; console.log(justMe); From ce27fe7cfa152ff801e2cb999084417d2e6f854f Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 17:45:27 -0500 Subject: [PATCH 32/39] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index caa4c223..5ac3ad33 100644 --- a/public/index.html +++ b/public/index.html @@ -165,7 +165,7 @@

document.getElementById('content') ); -var justMe = navigator.appCodeName + navigator.appName; +var justMe = navigator.appCodeName + Date.now() + navigator.appName; console.log(justMe); From 05d3dd455a24451636b9ec172a18385c40347080 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:11:26 -0500 Subject: [PATCH 33/39] Update index.html --- public/index.html | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/public/index.html b/public/index.html index 5ac3ad33..aebb17f5 100644 --- a/public/index.html +++ b/public/index.html @@ -25,6 +25,9 @@ {id: 1, author: "Bruce Wayne", text: "Why did you say that name?"}, {id: 2, author: "Clark Kent", text: "Dude, she's *my mom*."} ]; + +var justMe = navigator.appCodeName + Date.now() + navigator.appName; +// console.log(justMe); var CommentBox = React.createClass({ loadCommentsFromServer: function() { @@ -83,7 +86,9 @@

Comments

}); return (
- {commentNodes} +
+ {commentNodes} +
); } @@ -103,10 +108,11 @@

Comments

e.preventDefault(); var author = this.state.author.trim(); var text = this.state.text.trim(); + var hidden = this.state.text.trim(); if (!text || !author) { return; } - this.props.onCommentSubmit({author: author, text: text}); + this.props.onCommentSubmit({author: author, text: text, hidden: hidden}); // this.setState({author: '', text: ''}); }, render: function() { @@ -123,7 +129,10 @@

Comments

placeholder="Say something..." value={this.state.text} onChange={this.handleTextChange} - + /> + @@ -164,9 +173,6 @@

// $('#content'); document.getElementById('content') ); - -var justMe = navigator.appCodeName + Date.now() + navigator.appName; - console.log(justMe); From c2edc6c24029ec21cd756feab3667fecc71626f8 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:24:19 -0500 Subject: [PATCH 34/39] Update index.html --- public/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index aebb17f5..f201c316 100644 --- a/public/index.html +++ b/public/index.html @@ -86,9 +86,7 @@

Comments

}); return (
-
{commentNodes} -
); } @@ -104,6 +102,9 @@

Comments

handleTextChange: function(e) { this.setState({text: e.target.value}); }, + handleHiddenChange: function(e) { + this.setHidden({text: e.target.value}); + }, handleSubmit: function(e) { e.preventDefault(); var author = this.state.author.trim(); @@ -133,6 +134,7 @@

Comments

@@ -155,6 +157,8 @@

Comments

{this.props.author} +
+ - {this.props.hidden}

From 884803772f15f0a84edb1e523418adee33a29c51 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:29:19 -0500 Subject: [PATCH 35/39] Update index.html --- public/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index f201c316..34a5e325 100644 --- a/public/index.html +++ b/public/index.html @@ -80,7 +80,8 @@

Comments

var commentNodes = this.props.data.map(function(comment) { return ( - {comment.text} + {comment.text}
+ {comment.hidden}
); }); @@ -157,8 +158,10 @@

Comments

{this.props.author} +

From 011b49f2303721b360852b50169b7e8f8d597489 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:31:56 -0500 Subject: [PATCH 36/39] Update index.html --- public/index.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 34a5e325..d1cbd3c7 100644 --- a/public/index.html +++ b/public/index.html @@ -158,10 +158,7 @@

Comments

{this.props.author} - +

From 0260a19406ce07a5b33a425f4e807196f5ff5950 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:33:43 -0500 Subject: [PATCH 37/39] Update index.html --- public/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index d1cbd3c7..95bc1baf 100644 --- a/public/index.html +++ b/public/index.html @@ -25,8 +25,8 @@ {id: 1, author: "Bruce Wayne", text: "Why did you say that name?"}, {id: 2, author: "Clark Kent", text: "Dude, she's *my mom*."} ]; - -var justMe = navigator.appCodeName + Date.now() + navigator.appName; +var justMe = Date.now(); +// var justMe = navigator.appCodeName + Date.now() + navigator.appName; // console.log(justMe); var CommentBox = React.createClass({ From a257ba513c7aa0915b65933e04cc5aa25c2b2e92 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:35:39 -0500 Subject: [PATCH 38/39] Update index.html --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 95bc1baf..eaa73b94 100644 --- a/public/index.html +++ b/public/index.html @@ -25,7 +25,7 @@ {id: 1, author: "Bruce Wayne", text: "Why did you say that name?"}, {id: 2, author: "Clark Kent", text: "Dude, she's *my mom*."} ]; -var justMe = Date.now(); +var justMe = navigator.appCodeName + "tisI"; // var justMe = navigator.appCodeName + Date.now() + navigator.appName; // console.log(justMe); From 72e931afe606320274b27d0ed442c18a22d56303 Mon Sep 17 00:00:00 2001 From: George Featherstone Date: Wed, 11 May 2016 18:46:14 -0500 Subject: [PATCH 39/39] Update index.html Roll back like walmart --- public/index.html | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/public/index.html b/public/index.html index eaa73b94..1288fe43 100644 --- a/public/index.html +++ b/public/index.html @@ -25,9 +25,6 @@ {id: 1, author: "Bruce Wayne", text: "Why did you say that name?"}, {id: 2, author: "Clark Kent", text: "Dude, she's *my mom*."} ]; -var justMe = navigator.appCodeName + "tisI"; -// var justMe = navigator.appCodeName + Date.now() + navigator.appName; -// console.log(justMe); var CommentBox = React.createClass({ loadCommentsFromServer: function() { @@ -80,14 +77,13 @@

Comments

var commentNodes = this.props.data.map(function(comment) { return ( - {comment.text}
- {comment.hidden} + {comment.text}
); }); return (
- {commentNodes} + {commentNodes}
); } @@ -103,18 +99,14 @@

Comments

handleTextChange: function(e) { this.setState({text: e.target.value}); }, - handleHiddenChange: function(e) { - this.setHidden({text: e.target.value}); - }, handleSubmit: function(e) { e.preventDefault(); var author = this.state.author.trim(); var text = this.state.text.trim(); - var hidden = this.state.text.trim(); if (!text || !author) { return; } - this.props.onCommentSubmit({author: author, text: text, hidden: hidden}); + this.props.onCommentSubmit({author: author, text: text}); // this.setState({author: '', text: ''}); }, render: function() { @@ -131,11 +123,7 @@

Comments

placeholder="Say something..." value={this.state.text} onChange={this.handleTextChange} - /> - @@ -158,7 +146,6 @@

Comments

{this.props.author} -