From c82cf035de174bb253d078bd8be87988c1fd1415 Mon Sep 17 00:00:00 2001 From: Mark Finger Date: Tue, 15 Sep 2015 15:49:32 +1000 Subject: [PATCH 01/61] Removed the self-mounting components example Re #46 --- examples/self_mounting_components/.gitignore | 1 - examples/self_mounting_components/README.md | 32 -------- .../self_mounting_components/app/Comment.jsx | 14 ---- .../app/CommentBox.css | 11 --- .../app/CommentBox.jsx | 44 ----------- .../app/CommentForm.jsx | 37 --------- .../app/CommentList.jsx | 20 ----- examples/self_mounting_components/example.py | 78 ------------------- .../example.webpack.js | 76 ------------------ examples/self_mounting_components/mount.js | 12 --- .../self_mounting_components/package.json | 28 ------- .../self_mounting_components/requirements.txt | 5 -- examples/self_mounting_components/server.js | 40 ---------- .../templates/index.html | 16 ---- 14 files changed, 414 deletions(-) delete mode 100644 examples/self_mounting_components/.gitignore delete mode 100644 examples/self_mounting_components/README.md delete mode 100644 examples/self_mounting_components/app/Comment.jsx delete mode 100644 examples/self_mounting_components/app/CommentBox.css delete mode 100644 examples/self_mounting_components/app/CommentBox.jsx delete mode 100644 examples/self_mounting_components/app/CommentForm.jsx delete mode 100644 examples/self_mounting_components/app/CommentList.jsx delete mode 100644 examples/self_mounting_components/example.py delete mode 100644 examples/self_mounting_components/example.webpack.js delete mode 100644 examples/self_mounting_components/mount.js delete mode 100644 examples/self_mounting_components/package.json delete mode 100644 examples/self_mounting_components/requirements.txt delete mode 100644 examples/self_mounting_components/server.js delete mode 100644 examples/self_mounting_components/templates/index.html diff --git a/examples/self_mounting_components/.gitignore b/examples/self_mounting_components/.gitignore deleted file mode 100644 index ecdef5b..0000000 --- a/examples/self_mounting_components/.gitignore +++ /dev/null @@ -1 +0,0 @@ -static \ No newline at end of file diff --git a/examples/self_mounting_components/README.md b/examples/self_mounting_components/README.md deleted file mode 100644 index 1696ce5..0000000 --- a/examples/self_mounting_components/README.md +++ /dev/null @@ -1,32 +0,0 @@ -Running the example -=================== - -Install the dependencies - -``` -pip install -r requirements.txt -npm install -``` - -Start the webpack-build server - -``` -npm run webpack-build -``` - -Start the python server - -``` -python example.py -``` - -And visit [http://127.0.0.1:5000](http://127.0.0.1:5000) - ----------------------- - -With `DEBUG = True`, the render server is unneeded. In production you would also want to start -the render server. - -``` -node server.js -```` \ No newline at end of file diff --git a/examples/self_mounting_components/app/Comment.jsx b/examples/self_mounting_components/app/Comment.jsx deleted file mode 100644 index 023ca5a..0000000 --- a/examples/self_mounting_components/app/Comment.jsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -class Comment extends React.Component { - render() { - return ( -
-

{this.props.name}

- {this.props.text} -
- ); - } -} - -export default Comment; \ No newline at end of file diff --git a/examples/self_mounting_components/app/CommentBox.css b/examples/self_mounting_components/app/CommentBox.css deleted file mode 100644 index b975ce2..0000000 --- a/examples/self_mounting_components/app/CommentBox.css +++ /dev/null @@ -1,11 +0,0 @@ -h2 { - border-bottom: 1px solid #eee; -} - -form label { - display: block; -} - -form button { - margin-left: 5px; -} \ No newline at end of file diff --git a/examples/self_mounting_components/app/CommentBox.jsx b/examples/self_mounting_components/app/CommentBox.jsx deleted file mode 100644 index 3a961a2..0000000 --- a/examples/self_mounting_components/app/CommentBox.jsx +++ /dev/null @@ -1,44 +0,0 @@ -// CSS dependencies -import 'bootstrap/dist/css/bootstrap.css'; -import './CommentBox.css'; - -import React from 'react'; -import CommentList from './CommentList.jsx'; -import CommentForm from './CommentForm.jsx'; -import $ from 'jquery'; - -class CommentBox extends React.Component { - constructor(props) { - super(props); - - this.state = {comments: props.comments}; - } - submitComment(name, text) { - $.ajax({ - url: this.props.url, - method: 'post', - data: { - name, - text - }, - success: (obj) => { - this.setState({ - comments: obj.comments - }); - }, - error: (err) => { - console.error(err); - } - }); - } - render() { - return ( -
- - -
- ); - } -} - -export default CommentBox; \ No newline at end of file diff --git a/examples/self_mounting_components/app/CommentForm.jsx b/examples/self_mounting_components/app/CommentForm.jsx deleted file mode 100644 index 1b719b9..0000000 --- a/examples/self_mounting_components/app/CommentForm.jsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; - -class CommentForm extends React.Component { - handleSubmit(event) { - event.preventDefault(); - - var name = this.refs.name.getDOMNode().value.trim(); - var text = this.refs.text.getDOMNode().value.trim(); - - this.props.submitComment(name, text); - } - render() { - return ( -
-

Submit a comment

-
- -
-
-