├── .gitignore
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
├── src
├── App.css
├── App.js
├── App.test.js
├── data
│ └── posts.json
├── index.css
├── index.js
├── learn
│ ├── ConstLetVar.js
│ ├── FormsAndInputs.js
│ ├── ImgDropAndCrop.js
│ ├── LifeCycle.js
│ ├── ParentWrapper.js
│ ├── ResuableUtils.js
│ ├── Timer.js
│ └── custom-image-crop.css
├── logo.svg
├── posts
│ ├── PostDetail.js
│ ├── PostList.js
│ └── PostSorting.js
├── registerServiceWorker.js
├── routingComps
│ ├── AppExample.js
│ ├── DynamicRouteComp.js
│ ├── NotFound.js
│ └── StaticRouteComp.js
└── thirdParty
│ ├── ReactMarkdownExample.js
│ └── ReactYouTubeExample.js
├── try-reactjs.sublime-project
└── try-reactjs.sublime-workspace
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Coding For Entrepreneurs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Should I update this course?
3 |
4 | Yes? Show your support by starring this repo! ⭐️
5 |
6 | [](https://github.com/codingforentrepreneurs/Try-Reactjs)
7 |
8 | When I wrote this, there were 94 stars. I'll check back soon to see if we need a revamp. Your star could make the difference!
9 |
10 | [View Stargazers](https://github.com/codingforentrepreneurs/Try-Reactjs/stargazers)
11 |
12 |
13 | ## Try Reactjs
14 | Learn Reactjs bit by bit and subscribe to get everything on [joincfe.com/youtube/](http://joincfe.com/youtube/)
15 |
16 | Do you need a particular topic covered? Be sure to [subscribe](http://joincfe.com/youtube/) and leave a comment on any video on the [playlist](https://kirr.co/e0nybk)
17 |
18 | ### Links
19 | - [All Code](https://kirr.co/cgl4ih)
20 | - [Try React Playlist](https://kirr.co/e0nybk)
21 | - [Setup React](https://kirr.co/1m68l5)
22 | - This repo https://github.com/codingforentrepreneurs/Try-Reactjs
23 | - 2021 version [here](https://github.com/codingforentrepreneurs/Try-React.js) and [here](https://www.codingforentrepreneurs.com/projects/try-reactjs-2021)
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "try-reactjs",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.4.1",
7 | "react-dom": "^16.4.1",
8 | "react-dropzone": "^4.2.12",
9 | "react-image-crop": "^4.0.1",
10 | "react-markdown": "^3.3.3",
11 | "react-router": "^4.3.1",
12 | "react-router-dom": "^4.3.1",
13 | "react-youtube": "^7.6.0",
14 | "whatwg-fetch": "^2.0.4"
15 | },
16 | "devDependencies": {
17 | "react-scripts": "1.1.4"
18 | },
19 | "scripts": {
20 | "start": "react-scripts start",
21 | "build": "react-scripts build",
22 | "test": "react-scripts test --env=jsdom",
23 | "eject": "react-scripts eject"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codingforentrepreneurs/Try-Reactjs/3fee07a2b4662418256919a2611eeaaad377de63/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
22 | React App
23 |
24 |
25 |
26 | You need to enable JavaScript to run this app.
27 |
28 |
29 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | animation: App-logo-spin infinite 20s linear;
7 | height: 80px;
8 | }
9 |
10 | .App-header {
11 | background-color: #222;
12 | height: 150px;
13 | padding: 20px;
14 | color: white;
15 | }
16 |
17 | .App-title {
18 | font-size: 1.5em;
19 | }
20 |
21 | .App-intro {
22 | font-size: large;
23 | }
24 |
25 | @keyframes App-logo-spin {
26 | from { transform: rotate(0deg); }
27 | to { transform: rotate(360deg); }
28 | }
29 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | // import PostSorting from './posts/PostSorting'
3 | import './App.css'
4 |
5 | import ImgDropAndCrop from './learn/ImgDropAndCrop'
6 |
7 | class App extends Component {
8 | render () {
9 | return (
10 |
13 | )
14 | }
15 | }
16 |
17 | export default App
18 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div');
7 | ReactDOM.render( , div);
8 | ReactDOM.unmountComponentAtNode(div);
9 | });
10 |
--------------------------------------------------------------------------------
/src/data/posts.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": 1,
4 | "title": "Hello World",
5 | "content": "Try Reactjs is awesome. Can't wait to learn more",
6 | "date": "12-04-2017",
7 | "slug": "hello-world"
8 | },
9 | {
10 | "id": 2,
11 | "title": "Setup React",
12 | "content": "Setting up react is easy. Learn more about it!",
13 | "date": "1-28-2018",
14 | "slug": "setup-react"
15 | }
16 | ]
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | }
6 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 | import registerServiceWorker from './registerServiceWorker';
6 |
7 | ReactDOM.render( , document.getElementById('root'));
8 | registerServiceWorker();
9 |
--------------------------------------------------------------------------------
/src/learn/ConstLetVar.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | class ConstLetVar extends Component {
4 | constructor (props) {
5 | super(props)
6 | let someVar = 'hello there'
7 | if (someVar == 'hello there') {
8 | someVar = 'Hello there again.'
9 | }
10 |
11 | // var someVar2 = 'method'
12 |
13 | console.log(someVar)
14 | }
15 | render () {
16 | // someVar = 'Hello there again.'
17 | console.log(someVar2)
18 | return (
19 | Hello World
20 | )
21 | }
22 | }
23 |
24 | export default ConstLetVar
25 |
--------------------------------------------------------------------------------
/src/learn/FormsAndInputs.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | function MyTextInput(props){
4 | function handleChange(event){
5 | if (props.onChange) props.onChange(event)
6 | }
7 | return (
8 |
9 |
10 |
11 | )
12 | }
13 |
14 | class MyInputBlock extends Component {
15 | constructor(props){
16 | super(props)
17 | this.textInput = null
18 | this.setTextInputRef = element => {
19 | this.textInput = element
20 | }
21 | this.focusTextInput = () => {
22 | if (this.textInput) this.textInput.focus()
23 | }
24 |
25 | }
26 |
27 | handleChange = (event) =>{
28 | if (this.props.onChange) this.props.onChange(event)
29 | }
30 | componentDidMount(){
31 | this.focusTextInput()
32 | }
33 |
34 | render() {
35 | return (
36 |
40 | )
41 | }
42 | }
43 |
44 | class FormsAndInputs extends Component {
45 | constructor(props){
46 | super(props)
47 | this.state = {
48 | myFullName: '',
49 | myContent: '',
50 | email: ''
51 | }
52 | this.inputFullNameRef = React.createRef()
53 | this.inputEmailRef = React.createRef()
54 | }
55 |
56 |
57 | handleSubmit = (event) => {
58 | event.preventDefault()
59 | const data = this.state
60 | // console.log(this.inputFullNameRef.current.value)
61 | console.log("Final data is", data)
62 | }
63 |
64 | handleInputChange = (event) => {
65 | event.preventDefault()
66 | // console.log(event)
67 | // console.log(event.target.name)
68 | // console.log(event.target.value)
69 | this.setState({
70 | [event.target.name]: event.target.value
71 | })
72 | }
73 |
74 | handleFocusClick = (event) => {
75 | event.preventDefault()
76 | this.inputEmailRef.current.focus()
77 | }
78 | handleClearClick = (event) => {
79 | event.preventDefault()
80 | this.inputFullNameRef.current.value = ''
81 | this.setState({
82 | myFullName: ''
83 | })
84 | }
85 | // componentDidMount(){
86 | // this.inputFullNameRef.current.focus()
87 | // }
88 | render () {
89 | const {myFullName} = this.state
90 | const {email} = this.state
91 | return (
92 |
93 |
Forms and Inputs
94 |
Full name is: {myFullName}
95 |
102 |
103 | )
104 | }
105 | }
106 |
107 | export default FormsAndInputs
108 |
109 | //
110 | //
111 |
--------------------------------------------------------------------------------
/src/learn/ImgDropAndCrop.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import Dropzone from 'react-dropzone'
4 | import ReactCrop from 'react-image-crop'
5 | import './custom-image-crop.css';
6 |
7 | import {base64StringtoFile,
8 | downloadBase64File,
9 | extractImageFileExtensionFromBase64,
10 | image64toCanvasRef} from './ResuableUtils'
11 |
12 | const imageMaxSize = 1000000000 // bytes
13 | const acceptedFileTypes = 'image/x-png, image/png, image/jpg, image/jpeg, image/gif'
14 | const acceptedFileTypesArray = acceptedFileTypes.split(",").map((item) => {return item.trim()})
15 | class ImgDropAndCrop extends Component {
16 | constructor(props){
17 | super(props)
18 | this.imagePreviewCanvasRef = React.createRef()
19 | this.fileInputRef = React.createRef()
20 | this.state = {
21 | imgSrc: null,
22 | imgSrcExt: null,
23 | crop: {
24 | aspect: 1/1
25 | }
26 | }
27 | }
28 |
29 | verifyFile = (files) => {
30 | if (files && files.length > 0){
31 | const currentFile = files[0]
32 | const currentFileType = currentFile.type
33 | const currentFileSize = currentFile.size
34 | if(currentFileSize > imageMaxSize) {
35 | alert("This file is not allowed. " + currentFileSize + " bytes is too large")
36 | return false
37 | }
38 | if (!acceptedFileTypesArray.includes(currentFileType)){
39 | alert("This file is not allowed. Only images are allowed.")
40 | return false
41 | }
42 | return true
43 | }
44 | }
45 |
46 | handleOnDrop = (files, rejectedFiles) => {
47 | if (rejectedFiles && rejectedFiles.length > 0){
48 | this.verifyFile(rejectedFiles)
49 | }
50 |
51 |
52 | if (files && files.length > 0){
53 | const isVerified = this.verifyFile(files)
54 | if (isVerified){
55 | // imageBase64Data
56 | const currentFile = files[0]
57 | const myFileItemReader = new FileReader()
58 | myFileItemReader.addEventListener("load", ()=>{
59 | // console.log(myFileItemReader.result)
60 | const myResult = myFileItemReader.result
61 | this.setState({
62 | imgSrc: myResult,
63 | imgSrcExt: extractImageFileExtensionFromBase64(myResult)
64 | })
65 | }, false)
66 |
67 | myFileItemReader.readAsDataURL(currentFile)
68 |
69 | }
70 | }
71 | }
72 |
73 |
74 | handleImageLoaded = (image) => {
75 | //console.log(image)
76 | }
77 | handleOnCropChange = (crop) => {
78 | this.setState({crop:crop})
79 | }
80 | handleOnCropComplete = (crop, pixelCrop) =>{
81 | //console.log(crop, pixelCrop)
82 |
83 | const canvasRef = this.imagePreviewCanvasRef.current
84 | const {imgSrc} = this.state
85 | image64toCanvasRef(canvasRef, imgSrc, pixelCrop)
86 | }
87 | handleDownloadClick = (event) => {
88 | event.preventDefault()
89 | const {imgSrc} = this.state
90 | if (imgSrc) {
91 | const canvasRef = this.imagePreviewCanvasRef.current
92 |
93 | const {imgSrcExt} = this.state
94 | const imageData64 = canvasRef.toDataURL('image/' + imgSrcExt)
95 |
96 |
97 | const myFilename = "previewFile." + imgSrcExt
98 |
99 | // file to be uploaded
100 | const myNewCroppedFile = base64StringtoFile(imageData64, myFilename)
101 | console.log(myNewCroppedFile)
102 | // download file
103 | downloadBase64File(imageData64, myFilename)
104 | this.handleClearToDefault()
105 | }
106 |
107 |
108 | }
109 |
110 | handleClearToDefault = event =>{
111 | if (event) event.preventDefault()
112 | const canvas = this.imagePreviewCanvasRef.current
113 | const ctx = canvas.getContext('2d');
114 | ctx.clearRect(0, 0, canvas.width, canvas.height)
115 |
116 | this.setState({
117 | imgSrc: null,
118 | imgSrcExt: null,
119 | crop: {
120 | aspect: 1/1
121 | }
122 |
123 | })
124 | this.fileInputRef.current.value = null
125 | }
126 |
127 | handleFileSelect = event => {
128 | // console.log(event)
129 | const files = event.target.files
130 | if (files && files.length > 0){
131 | const isVerified = this.verifyFile(files)
132 | if (isVerified){
133 | // imageBase64Data
134 | const currentFile = files[0]
135 | const myFileItemReader = new FileReader()
136 | myFileItemReader.addEventListener("load", ()=>{
137 | // console.log(myFileItemReader.result)
138 | const myResult = myFileItemReader.result
139 | this.setState({
140 | imgSrc: myResult,
141 | imgSrcExt: extractImageFileExtensionFromBase64(myResult)
142 | })
143 | }, false)
144 |
145 | myFileItemReader.readAsDataURL(currentFile)
146 |
147 | }
148 | }
149 | }
150 | render () {
151 | const {imgSrc} = this.state
152 | return (
153 |
154 |
Drop and Crop
155 |
156 |
157 | {imgSrc !== null ?
158 |
159 |
160 |
161 |
167 |
168 |
169 | Preview Canvas Crop
170 |
171 | Download
172 | Clear
173 |
174 |
175 | :
176 |
177 |
Drop image here or click to upload
178 | }
179 |
180 |
181 | )
182 | }
183 | }
184 |
185 | export default ImgDropAndCrop
186 |
--------------------------------------------------------------------------------
/src/learn/LifeCycle.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | class LifeCycle extends Component {
4 | constructor (props) {
5 | super(props)
6 | this.state = {
7 | loading: true
8 | }
9 | }
10 | // componentWillMount()
11 |
12 | render () {
13 | const {loading} = this.state
14 | return {loading === true ? 'Hello World' : 'False'}
15 | }
16 |
17 | componentDidMount () {
18 | // async / api code
19 | this.setState({
20 | loading: false
21 | })
22 | }
23 |
24 | // componentWillUnmount () {
25 | // // unsubscribe from observables
26 | // // clear intervals
27 | // // log events
28 | // }
29 | }
30 |
31 | export default LifeCycle
32 |
--------------------------------------------------------------------------------
/src/learn/ParentWrapper.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react'
2 |
3 | // class ParentWrapper extends Component {
4 | // render () {
5 | // const {alertType} = this.props
6 | // return {this.props.children}
7 | // }
8 | // }
9 |
10 | function AlertBox (props) {
11 | return {props.children}
12 | }
13 |
14 | function WelcomeHereDialog () {
15 | return Some new content
16 | }
17 |
18 | class SubItem extends Component {
19 | render () {
20 | return Some new content
21 | }
22 | }
23 |
24 | export {AlertBox, SubItem}
25 | export default WelcomeHereDialog
26 |
--------------------------------------------------------------------------------
/src/learn/ResuableUtils.js:
--------------------------------------------------------------------------------
1 | // A few JavaScript Functions for Images and Files
2 | // Author: Justin Mitchel
3 | // Source: https://kirr.co/ndywes
4 |
5 | // Convert a Base64-encoded string to a File object
6 | export function base64StringtoFile (base64String, filename) {
7 | var arr = base64String.split(','), mime = arr[0].match(/:(.*?);/)[1],
8 | bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n)
9 | while (n--) {
10 | u8arr[n] = bstr.charCodeAt(n)
11 | }
12 | return new File([u8arr], filename, {type: mime})
13 | }
14 |
15 | // Download a Base64-encoded file
16 |
17 | export function downloadBase64File (base64Data, filename) {
18 | var element = document.createElement('a')
19 | element.setAttribute('href', base64Data)
20 | element.setAttribute('download', filename)
21 | element.style.display = 'none'
22 | document.body.appendChild(element)
23 | element.click()
24 | document.body.removeChild(element)
25 | }
26 |
27 | // Extract an Base64 Image's File Extension
28 | export function extractImageFileExtensionFromBase64 (base64Data) {
29 | return base64Data.substring('data:image/'.length, base64Data.indexOf(';base64'))
30 | }
31 |
32 | // Base64 Image to Canvas with a Crop
33 | export function image64toCanvasRef (canvasRef, image64, pixelCrop) {
34 | const canvas = canvasRef // document.createElement('canvas');
35 | canvas.width = pixelCrop.width
36 | canvas.height = pixelCrop.height
37 | const ctx = canvas.getContext('2d')
38 | const image = new Image()
39 | image.src = image64
40 | image.onload = function () {
41 | ctx.drawImage(
42 | image,
43 | pixelCrop.x,
44 | pixelCrop.y,
45 | pixelCrop.width,
46 | pixelCrop.height,
47 | 0,
48 | 0,
49 | pixelCrop.width,
50 | pixelCrop.height
51 | )
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/learn/Timer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | class Timer extends Component {
4 | constructor (props) {
5 | super(props)
6 | this.state = {
7 | count: 1
8 | }
9 | }
10 |
11 | render () {
12 | const {count} = this.state
13 | return (
14 |
15 |
Current Count: {count}
16 |
17 | )
18 | }
19 | // setInterval
20 | // clearInterval
21 | componentDidMount () {
22 | const {startCount} = this.props
23 | this.setState({
24 | count: startCount
25 | })
26 | this.doIntervalChange()
27 | }
28 |
29 | doIntervalChange = () => {
30 | this.myInterval = setInterval(() => {
31 | this.setState(prevState => ({
32 | count: prevState.count - 1
33 | }))
34 | }, 1000)
35 | }
36 |
37 | componentWillUnmount () {
38 | clearInterval(this.myInterval)
39 | }
40 | }
41 |
42 | export default Timer
43 |
--------------------------------------------------------------------------------
/src/learn/custom-image-crop.css:
--------------------------------------------------------------------------------
1 | .ReactCrop {
2 | position: relative;
3 | display: inline-block;
4 | cursor: crosshair;
5 | overflow: hidden;
6 | max-width: 100%;
7 | background-color: #000; }
8 | .ReactCrop:focus {
9 | outline: none; }
10 | .ReactCrop--disabled {
11 | cursor: inherit; }
12 | .ReactCrop__image {
13 | display: block;
14 | max-width: 100%;
15 | max-height: -webkit-stretch;
16 | max-height: -moz-available;
17 | max-height: stretch; }
18 | .ReactCrop--crop-invisible .ReactCrop__image {
19 | opacity: 0.5; }
20 | .ReactCrop__crop-selection {
21 | position: absolute;
22 | top: 0;
23 | left: 0;
24 | transform: translate3d(0, 0, 0);
25 | box-sizing: border-box;
26 | cursor: move;
27 | box-shadow: 0 0 0 9999em rgba(0, 0, 0, 0.5);
28 | border: 1px solid;
29 | border-image-source: url("data:image/gif;base64,R0lGODlhCgAKAJECAAAAAP///////wAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OEI5RDc5MTFDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OEI5RDc5MTBDNkE2MTFFM0JCMDZEODI2QTI4MzJBOTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjAyODAxMTc0MDcyMDY4MTE4MDgzQzNDMjA5MzREQ0ZDIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEBQoAAgAsAAAAAAoACgAAAhWEERkn7W3ei7KlagMWF/dKgYeyGAUAIfkEBQoAAgAsAAAAAAoACgAAAg+UYwLJ7RnQm7QmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYgLJHdiinNSAVfOEKoUCACH5BAUKAAIALAAAAAAKAAoAAAIRVISAdusPo3RAzYtjaMIaUQAAIfkEBQoAAgAsAAAAAAoACgAAAg+MDiem7Q8bSLFaG5il6xQAIfkEBQoAAgAsAAAAAAoACgAAAg+UYRLJ7QnQm7SmsCyVKhUAIfkEBQoAAgAsAAAAAAoACgAAAhCUYBLJDdiinNSEVfOEKoECACH5BAUKAAIALAAAAAAKAAoAAAIRFISBdusPo3RBzYsjaMIaUQAAOw==");
30 | border-image-slice: 1;
31 | border-image-repeat: repeat; }
32 | .ReactCrop--disabled .ReactCrop__crop-selection {
33 | cursor: inherit; }
34 | .ReactCrop__drag-handle {
35 | position: absolute;
36 | width: 9px;
37 | height: 9px;
38 | background-color: rgba(0, 0, 0, 0.2);
39 | border: 1px solid rgba(255, 255, 255, 0.7);
40 | box-sizing: border-box;
41 | outline: 1px solid transparent; }
42 | .ReactCrop .ord-nw {
43 | top: 0;
44 | left: 0;
45 | margin-top: -5px;
46 | margin-left: -5px;
47 | cursor: nw-resize; }
48 | .ReactCrop .ord-n {
49 | top: 0;
50 | left: 50%;
51 | margin-top: -5px;
52 | margin-left: -5px;
53 | cursor: n-resize; }
54 | .ReactCrop .ord-ne {
55 | top: 0;
56 | right: 0;
57 | margin-top: -5px;
58 | margin-right: -5px;
59 | cursor: ne-resize; }
60 | .ReactCrop .ord-e {
61 | top: 50%;
62 | right: 0;
63 | margin-top: -5px;
64 | margin-right: -5px;
65 | cursor: e-resize; }
66 | .ReactCrop .ord-se {
67 | bottom: 0;
68 | right: 0;
69 | margin-bottom: -5px;
70 | margin-right: -5px;
71 | cursor: se-resize; }
72 | .ReactCrop .ord-s {
73 | bottom: 0;
74 | left: 50%;
75 | margin-bottom: -5px;
76 | margin-left: -5px;
77 | cursor: s-resize; }
78 | .ReactCrop .ord-sw {
79 | bottom: 0;
80 | left: 0;
81 | margin-bottom: -5px;
82 | margin-left: -5px;
83 | cursor: sw-resize; }
84 | .ReactCrop .ord-w {
85 | top: 50%;
86 | left: 0;
87 | margin-top: -5px;
88 | margin-left: -5px;
89 | cursor: w-resize; }
90 | .ReactCrop__disabled .ReactCrop__drag-handle {
91 | cursor: inherit; }
92 | .ReactCrop__drag-bar {
93 | position: absolute; }
94 | .ReactCrop__drag-bar.ord-n {
95 | top: 0;
96 | left: 0;
97 | width: 100%;
98 | height: 6px;
99 | margin-top: -3px; }
100 | .ReactCrop__drag-bar.ord-e {
101 | right: 0;
102 | top: 0;
103 | width: 6px;
104 | height: 100%;
105 | margin-right: -3px; }
106 | .ReactCrop__drag-bar.ord-s {
107 | bottom: 0;
108 | left: 0;
109 | width: 100%;
110 | height: 6px;
111 | margin-bottom: -3px; }
112 | .ReactCrop__drag-bar.ord-w {
113 | top: 0;
114 | left: 0;
115 | width: 6px;
116 | height: 100%;
117 | margin-left: -3px; }
118 | .ReactCrop--new-crop .ReactCrop__drag-bar,
119 | .ReactCrop--new-crop .ReactCrop__drag-handle,
120 | .ReactCrop--fixed-aspect .ReactCrop__drag-bar {
121 | display: none; }
122 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-n,
123 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-e,
124 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-s,
125 | .ReactCrop--fixed-aspect .ReactCrop__drag-handle.ord-w {
126 | display: none; }
127 | @media (max-width: 768px), (pointer: coarse) {
128 | .ReactCrop__drag-handle {
129 | width: 17px;
130 | height: 17px; }
131 | .ReactCrop .ord-nw {
132 | margin-top: -9px;
133 | margin-left: -9px; }
134 | .ReactCrop .ord-n {
135 | margin-top: -9px;
136 | margin-left: -9px; }
137 | .ReactCrop .ord-ne {
138 | margin-top: -9px;
139 | margin-right: -9px; }
140 | .ReactCrop .ord-e {
141 | margin-top: -9px;
142 | margin-right: -9px; }
143 | .ReactCrop .ord-se {
144 | margin-bottom: -9px;
145 | margin-right: -9px; }
146 | .ReactCrop .ord-s {
147 | margin-bottom: -9px;
148 | margin-left: -9px; }
149 | .ReactCrop .ord-sw {
150 | margin-bottom: -9px;
151 | margin-left: -9px; }
152 | .ReactCrop .ord-w {
153 | margin-top: -9px;
154 | margin-left: -9px; }
155 | .ReactCrop__drag-bar.ord-n {
156 | height: 14px;
157 | margin-top: -7px; }
158 | .ReactCrop__drag-bar.ord-e {
159 | width: 14px;
160 | margin-right: -7px; }
161 | .ReactCrop__drag-bar.ord-s {
162 | height: 14px;
163 | margin-bottom: -7px; }
164 | .ReactCrop__drag-bar.ord-w {
165 | width: 14px;
166 | margin-left: -7px; }
167 |
168 | }
169 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/posts/PostDetail.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | class PostDetail extends Component {
4 | constructor (props) {
5 | super(props)
6 | // this.titleWasClicked = this.titleWasClicked.bind(this)
7 | this.toggleContent = this.toggleContent.bind(this)
8 | this.handleRemoveContentButton = this.handleRemoveContentButton.bind(this)
9 | this.state = {
10 | showContent: true,
11 | postItem: null
12 | }
13 | }
14 | handleRemoveContentButton (event) {
15 | if (this.props.didHandleRemove) {
16 | this.props.didHandleRemove(this.props.post)
17 | }
18 | }
19 | titleWasClicked = (event) => {
20 | event.preventDefault()
21 | const {dataCallback} = this.props
22 | // console.log(dataCallback)
23 | let newPostItem = this.props.post
24 | newPostItem['title'] = 'This is my awesome new title'
25 | this.setState({
26 | postItem: newPostItem
27 | })
28 | if (dataCallback !== undefined) {
29 | dataCallback(newPostItem)
30 | }
31 | //
32 | }
33 |
34 | toggleContent (event) {
35 | event.preventDefault()
36 | this.setState({
37 | showContent: !this.state.showContent
38 | })
39 | }
40 |
41 | setPostStateOnProps () {
42 | const {post} = this.props
43 | this.setState({
44 | postItem: post
45 | })
46 | }
47 | componentDidUpdate (prevProps, prevState, snapshop) {
48 | if (this.props !== prevProps) {
49 | this.setPostStateOnProps()
50 | }
51 | }
52 | componentDidMount () {
53 | this.setPostStateOnProps()
54 | }
55 | render () {
56 | const {postItem} = this.state
57 | const {showContent} = this.state
58 | return (
59 |
60 | {postItem !== null
61 | ?
62 |
{postItem.title}
63 | {postItem.date}
64 |
65 | {showContent === true ?
{postItem.content}
: ''}
66 |
Toggle Content Display
67 |
Remove Content
68 |
69 | : ''}
70 |
71 | )
72 | }
73 | }
74 |
75 | export default PostDetail
76 |
--------------------------------------------------------------------------------
/src/posts/PostList.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import PostData from '../data/posts.json'
3 |
4 | import PostDetail from './PostDetail'
5 |
6 | class PostList extends Component {
7 | constructor (props) {
8 | super(props)
9 | this.handleDataCallback = this.handleDataCallback.bind(this)
10 | this.handlePostRemove = this.handlePostRemove.bind(this)
11 | this.state = {
12 | postList: []
13 | }
14 | }
15 |
16 | updateBackend (currentPostList) {
17 | console.log('Updating..')
18 | this.setState({
19 | postItem: currentPostList
20 | })
21 | }
22 | handlePostRemove (postItem) {
23 | let currentPostList = this.state.postList
24 | currentPostList.pop(postItem)
25 |
26 | this.updateBackend(currentPostList)
27 | }
28 |
29 | handleDataCallback (postItem) {
30 | // alert(txtMsg)
31 | // console.log(postItem)
32 | let currentPostList = this.state.postList
33 | currentPostList.push(postItem)
34 | this.setState({
35 | postItem: currentPostList
36 | })
37 | }
38 | componentDidMount () {
39 | this.setState({
40 | postList: PostData
41 | })
42 | }
43 | render () {
44 | const {postList} = this.state
45 | return (
46 |
47 |
Hello There
48 | {postList.map((item, index) => {
49 | return
54 | })}
55 |
56 | )
57 | }
58 | }
59 |
60 | export default PostList
61 |
--------------------------------------------------------------------------------
/src/posts/PostSorting.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import PostData from '../data/posts.json'
3 |
4 | import PostDetail from './PostDetail'
5 |
6 | class PostSorting extends Component {
7 | constructor (props) {
8 | super(props)
9 | this.toggleListReverse = this.toggleListReverse.bind(this)
10 | this.toggleSortDate = this.toggleSortDate.bind(this)
11 | this.state = {
12 | postList: [],
13 | isOldestFirst: true
14 | }
15 | }
16 |
17 | sortByDate () {
18 | const {postList} = this.state
19 | let newPostList = postList
20 | if (this.state.isOldestFirst) {
21 | newPostList = postList.sort((a, b) => a.date > b.date)
22 | } else {
23 | newPostList = postList.sort((a, b) => a.date < b.date)
24 | }
25 | this.setState({
26 | isOldestFirst: !this.state.isOldestFirst,
27 | postList: newPostList
28 | })
29 | }
30 |
31 | toggleSortDate (event) {
32 | this.sortByDate()
33 | }
34 | toggleListReverse (event) {
35 | const {postList} = this.state
36 | let newPostList = postList.reverse()
37 | this.setState({
38 | postList: newPostList
39 | })
40 | }
41 | componentDidMount () {
42 | const postList = PostData
43 | this.setState({
44 | isOldestFirst: true,
45 | postList: postList
46 | })
47 | }
48 | render () {
49 | const {postList} = this.state
50 | return (
51 |
52 |
Hello There
53 |
Reverse Order
54 |
Order by date
55 | {postList.map((item, index) => {
56 | return
61 | })}
62 |
63 | )
64 | }
65 | }
66 |
67 | export default PostSorting
68 |
--------------------------------------------------------------------------------
/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === 'localhost' ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === '[::1]' ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener('load', () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (isLocalhost) {
36 | // This is running on localhost. Lets check if a service worker still exists or not.
37 | checkValidServiceWorker(swUrl);
38 |
39 | // Add some additional logging to localhost, pointing developers to the
40 | // service worker/PWA documentation.
41 | navigator.serviceWorker.ready.then(() => {
42 | console.log(
43 | 'This web app is being served cache-first by a service ' +
44 | 'worker. To learn more, visit https://goo.gl/SC7cgQ'
45 | );
46 | });
47 | } else {
48 | // Is not local host. Just register service worker
49 | registerValidSW(swUrl);
50 | }
51 | });
52 | }
53 | }
54 |
55 | function registerValidSW(swUrl) {
56 | navigator.serviceWorker
57 | .register(swUrl)
58 | .then(registration => {
59 | registration.onupdatefound = () => {
60 | const installingWorker = registration.installing;
61 | installingWorker.onstatechange = () => {
62 | if (installingWorker.state === 'installed') {
63 | if (navigator.serviceWorker.controller) {
64 | // At this point, the old content will have been purged and
65 | // the fresh content will have been added to the cache.
66 | // It's the perfect time to display a "New content is
67 | // available; please refresh." message in your web app.
68 | console.log('New content is available; please refresh.');
69 | } else {
70 | // At this point, everything has been precached.
71 | // It's the perfect time to display a
72 | // "Content is cached for offline use." message.
73 | console.log('Content is cached for offline use.');
74 | }
75 | }
76 | };
77 | };
78 | })
79 | .catch(error => {
80 | console.error('Error during service worker registration:', error);
81 | });
82 | }
83 |
84 | function checkValidServiceWorker(swUrl) {
85 | // Check if the service worker can be found. If it can't reload the page.
86 | fetch(swUrl)
87 | .then(response => {
88 | // Ensure service worker exists, and that we really are getting a JS file.
89 | if (
90 | response.status === 404 ||
91 | response.headers.get('content-type').indexOf('javascript') === -1
92 | ) {
93 | // No service worker found. Probably a different app. Reload the page.
94 | navigator.serviceWorker.ready.then(registration => {
95 | registration.unregister().then(() => {
96 | window.location.reload();
97 | });
98 | });
99 | } else {
100 | // Service worker found. Proceed as normal.
101 | registerValidSW(swUrl);
102 | }
103 | })
104 | .catch(() => {
105 | console.log(
106 | 'No internet connection found. App is running in offline mode.'
107 | );
108 | });
109 | }
110 |
111 | export function unregister() {
112 | if ('serviceWorker' in navigator) {
113 | navigator.serviceWorker.ready.then(registration => {
114 | registration.unregister();
115 | });
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/src/routingComps/AppExample.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import {BrowserRouter, Route, Switch, Redirect} from 'react-router-dom'
4 |
5 | import DynamicRouteComp from '../routingComps/DynamicRouteComp'
6 | import StaticRouteComp from '../routingComps/StaticRouteComp'
7 | import NotFound from '../routingComps/NotFound'
8 |
9 | class AppRoutingExample extends Component {
10 | render () {
11 | const loggedIn = true
12 | const supportsHistory = 'pushState' in window.history
13 | return (
14 |
15 |
16 | Navbar
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | (
26 | loggedIn === true ? (
27 |
28 | ) : (
29 |
30 | )
31 | )} />
32 |
33 |
34 |
35 |
36 | )
37 | }
38 | }
39 |
40 | export default AppRoutingExample
41 |
--------------------------------------------------------------------------------
/src/routingComps/DynamicRouteComp.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { Link } from 'react-router-dom'
4 |
5 | class DynamicRouteComp extends Component {
6 | componentDidMount () {
7 | const { slug } = this.props.match.params
8 |
9 | // this.performLookup(slug) //grabing data from your api
10 |
11 | // const { history } = this.props
12 | // const supportsHistory = 'pushState' in window.history
13 | // if (supportsHistory) {
14 | // history.pushState(null, '/not-found')
15 | // } else {
16 | // window.location = '/dashboard'
17 | // }
18 | }
19 |
20 | render () {
21 | const { slug } = this.props.match.params
22 | return (
23 |
24 |
{slug} that changes based on route
25 | Static Page
26 |
27 | )
28 | }
29 | }
30 |
31 | export default DynamicRouteComp
32 |
--------------------------------------------------------------------------------
/src/routingComps/NotFound.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | class NotFound extends Component {
4 | render () {
5 | return (
6 | 404 error. Page Not Found
7 | )
8 | }
9 | }
10 |
11 | export default NotFound
12 |
--------------------------------------------------------------------------------
/src/routingComps/StaticRouteComp.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { Link } from 'react-router-dom'
4 |
5 | class StaticRouteComp extends Component {
6 | render () {
7 | return (
8 |
9 |
Content that doesn't change based on route.
10 | Dynamic Page
11 |
12 |
13 | )
14 | }
15 | }
16 |
17 | export default StaticRouteComp
18 |
--------------------------------------------------------------------------------
/src/thirdParty/ReactMarkdownExample.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import ReactMarkdown from 'react-markdown'
3 |
4 | class ReactMarkdownExample extends Component {
5 | render () {
6 | const {input} = this.props
7 | const disallowed = ['image']
8 | return (
9 |
10 | )
11 | }
12 | }
13 |
14 | export default ReactMarkdownExample
15 |
--------------------------------------------------------------------------------
/src/thirdParty/ReactYouTubeExample.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import YouTube from 'react-youtube'
3 |
4 | // https://www.youtube.com/watch?v=-_pgcFQ0l64
5 | // https://youtu.be/-_pgcFQ0l64
6 | // https://www.youtube.com/watch?v=-_pgcFQ0l64&list=PLEsfXFp6DpzQbwYDx1zgcKJ4tzyWFaESK
7 | class ReactYouTubeExample extends Component {
8 | videoOnReady (event) {
9 | // access to player in all event handlers via event.target
10 | // event.target.playVideoAt(50) // 50 seconds
11 | const player = event.target
12 | this.setState({
13 | playerObj: player
14 | })
15 | player.seekTo(50)
16 | console.log(event.target)
17 | }
18 | videoOnPlay (event) {
19 | // access to player in all event handlers via event.target
20 | // event.target.playVideoAt(50) // 50 seconds
21 | const player = event.target
22 | /// console.log(player.getCurrentTime())
23 | }
24 | videoStateChange (event) {
25 | const player = event.target
26 | console.log(player.getCurrentTime())
27 | }
28 |
29 | componentWillUnmount () {
30 | const {playerObj} = this.state
31 | console.log(player.getCurrentTime())
32 | }
33 | render () {
34 | const opts = {
35 | height: '390',
36 | width: '640',
37 | playerVars: { // https://developers.google.com/youtube/player_parameters
38 | autoplay: 1
39 | }
40 | }
41 | const {videoId} = this.props
42 | return (
43 |
50 | )
51 | }
52 | }
53 |
54 | export default ReactYouTubeExample
55 |
--------------------------------------------------------------------------------
/try-reactjs.sublime-project:
--------------------------------------------------------------------------------
1 | {
2 | "folders":
3 | [
4 | {
5 | "path": "."
6 | }
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/try-reactjs.sublime-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "auto_complete":
3 | {
4 | "selected_items":
5 | [
6 | [
7 | "posts",
8 | "Posts"
9 | ],
10 | [
11 | "get_or",
12 | "get_or_new"
13 | ],
14 | [
15 | "other",
16 | "other_username"
17 | ],
18 | [
19 | "get",
20 | "get_thread"
21 | ],
22 | [
23 | "msg",
24 | "msgData"
25 | ],
26 | [
27 | "mes",
28 | "message_data"
29 | ],
30 | [
31 | "room",
32 | "room_group_name"
33 | ],
34 | [
35 | "chan",
36 | "channel_layer"
37 | ],
38 | [
39 | "roo",
40 | "room_group_name"
41 | ],
42 | [
43 | "tex",
44 | "text_data"
45 | ],
46 | [
47 | "message",
48 | "messageText"
49 | ],
50 | [
51 | "BA",
52 | "BASE_DIR"
53 | ],
54 | [
55 | "POst",
56 | "PostManager"
57 | ],
58 | [
59 | "get_",
60 | "get_recent_status"
61 | ],
62 | [
63 | "Stat",
64 | "Status"
65 | ],
66 | [
67 | "ser",
68 | "serializer_class"
69 | ],
70 | [
71 | "file",
72 | "file_data"
73 | ],
74 | [
75 | "us",
76 | "username"
77 | ],
78 | [
79 | "valid",
80 | "validated_data"
81 | ],
82 | [
83 | "pass",
84 | "password2"
85 | ],
86 | [
87 | "User",
88 | "UserRegisterSerializer"
89 | ],
90 | [
91 | "se",
92 | "serializers"
93 | ],
94 | [
95 | "pas",
96 | "password2"
97 | ],
98 | [
99 | "aut",
100 | "authenticated"
101 | ],
102 | [
103 | "res",
104 | "rest_framework"
105 | ],
106 | [
107 | "t",
108 | "timezone"
109 | ],
110 | [
111 | "jw",
112 | "jwt_response_payload_handler"
113 | ],
114 | [
115 | "json",
116 | "json_str"
117 | ],
118 | [
119 | "b",
120 | "b64encode"
121 | ],
122 | [
123 | "per",
124 | "permissions"
125 | ],
126 | [
127 | "au",
128 | "authentication_classes"
129 | ],
130 | [
131 | "cont",
132 | "Content-Type"
133 | ],
134 | [
135 | "pos",
136 | "post_data"
137 | ],
138 | [
139 | "post",
140 | "post_method"
141 | ],
142 | [
143 | "content",
144 | "content-type"
145 | ],
146 | [
147 | "po",
148 | "post_data"
149 | ],
150 | [
151 | "img",
152 | "image_path"
153 | ],
154 | [
155 | "do",
156 | "do_img"
157 | ],
158 | [
159 | "bod",
160 | "body_"
161 | ],
162 | [
163 | "query",
164 | "query_get"
165 | ],
166 | [
167 | "quer",
168 | "query_body"
169 | ],
170 | [
171 | "gene",
172 | "generics"
173 | ],
174 | [
175 | "sa",
176 | "serializer"
177 | ],
178 | [
179 | "s",
180 | "serializers"
181 | ],
182 | [
183 | "clea",
184 | "cleaned_data"
185 | ],
186 | [
187 | "St",
188 | "StatusForm"
189 | ],
190 | [
191 | "staut",
192 | "StatusForm"
193 | ],
194 | [
195 | "passed",
196 | "passed_id"
197 | ],
198 | [
199 | "de",
200 | "deleted_"
201 | ],
202 | [
203 | "sav",
204 | "saved_data"
205 | ],
206 | [
207 | "is",
208 | "is_json"
209 | ],
210 | [
211 | "form",
212 | "form_data"
213 | ],
214 | [
215 | "err",
216 | "error_data"
217 | ],
218 | [
219 | "Updat",
220 | "UpdateModel"
221 | ],
222 | [
223 | "Up",
224 | "UpdateModel"
225 | ],
226 | [
227 | "Mo",
228 | "UpdateModelForm"
229 | ],
230 | [
231 | "crf",
232 | "csrf_exempt"
233 | ],
234 | [
235 | "new",
236 | "new_data"
237 | ],
238 | [
239 | "st",
240 | "status_code"
241 | ],
242 | [
243 | "lis",
244 | "list_values"
245 | ],
246 | [
247 | "js",
248 | "json"
249 | ],
250 | [
251 | "render",
252 | "render_to_json_response"
253 | ],
254 | [
255 | "con",
256 | "context"
257 | ],
258 | [
259 | "re",
260 | "render"
261 | ],
262 | [
263 | "Char",
264 | "ChargeManager"
265 | ],
266 | [
267 | "stri",
268 | "stripe_charge"
269 | ],
270 | [
271 | "strip",
272 | "stripe_charge"
273 | ],
274 | [
275 | "card",
276 | "card_obj"
277 | ],
278 | [
279 | "or",
280 | "other_ids"
281 | ],
282 | [
283 | "sess",
284 | "session_key"
285 | ],
286 | [
287 | "Login",
288 | "LoginForm"
289 | ],
290 | [
291 | "full",
292 | "full_name"
293 | ],
294 | [
295 | "is_",
296 | "is_staff"
297 | ],
298 | [
299 | "user",
300 | "user_obj"
301 | ],
302 | [
303 | "auto_",
304 | "auto_now_add"
305 | ],
306 | [
307 | "add",
308 | "address_line_2"
309 | ],
310 | [
311 | "line",
312 | "line1"
313 | ],
314 | [
315 | "ship",
316 | "shipping_address"
317 | ],
318 | [
319 | "bil",
320 | "billing_address_id"
321 | ],
322 | [
323 | "Bil",
324 | "BillingProfile"
325 | ],
326 | [
327 | "Bill",
328 | "BillingProfileManager"
329 | ],
330 | [
331 | "obj",
332 | "order_obj"
333 | ],
334 | [
335 | "order",
336 | "order_obj"
337 | ],
338 | [
339 | "billing",
340 | "billing_profile"
341 | ],
342 | [
343 | "car",
344 | "cart_removal_qs"
345 | ],
346 | [
347 | "gues",
348 | "guest_email_id"
349 | ],
350 | [
351 | "cl",
352 | "cleaned_data"
353 | ],
354 | [
355 | "bill",
356 | "billing_profile"
357 | ],
358 | [
359 | "next",
360 | "next_post"
361 | ],
362 | [
363 | "nu",
364 | "num1"
365 | ],
366 | [
367 | "cart",
368 | "cart_obj"
369 | ],
370 | [
371 | "ran",
372 | "random_string_generator"
373 | ],
374 | [
375 | "pr",
376 | "product_id"
377 | ],
378 | [
379 | "Pr",
380 | "ProductDetailSlugView"
381 | ],
382 | [
383 | "prd",
384 | "product_id"
385 | ],
386 | [
387 | "Car",
388 | "CartManager"
389 | ],
390 | [
391 | "tag",
392 | "tag_set"
393 | ],
394 | [
395 | "drop",
396 | "dropdown-menu"
397 | ],
398 | [
399 | "nav",
400 | "navbar"
401 | ],
402 | [
403 | "fea",
404 | "featured"
405 | ],
406 | [
407 | "conta",
408 | "contact_form"
409 | ],
410 | [
411 | "mar",
412 | "margin-bottom"
413 | ],
414 | [
415 | "en",
416 | "environ"
417 | ],
418 | [
419 | "image",
420 | "image_path"
421 | ],
422 | [
423 | "in",
424 | "instanceof\tkeyword"
425 | ],
426 | [
427 | "Vid",
428 | "VideoManager"
429 | ],
430 | [
431 | "Vide",
432 | "VideoQuerySet"
433 | ],
434 | [
435 | "q",
436 | "query"
437 | ],
438 | [
439 | "u",
440 | "unique_slug_generator"
441 | ],
442 | [
443 | "col-",
444 | "col-sm-12"
445 | ],
446 | [
447 | "h",
448 | "homeImageList\tproperty"
449 | ],
450 | [
451 | "r",
452 | "routeSub\tproperty"
453 | ],
454 | [
455 | "Av",
456 | "ActivatedRoute\talias"
457 | ],
458 | [
459 | "p",
460 | "push\tmethod"
461 | ],
462 | [
463 | "max",
464 | "max-height"
465 | ],
466 | [
467 | "margin-",
468 | "margin-bottom"
469 | ],
470 | [
471 | "min",
472 | "min-height"
473 | ],
474 | [
475 | "by",
476 | "bypassSecurityTrustResourceUrl\tmethod"
477 | ],
478 | [
479 | "Pip",
480 | "PipeTransform\talias"
481 | ],
482 | [
483 | "imp",
484 | "implements\tkeyword"
485 | ],
486 | [
487 | "cons",
488 | "console\tvar"
489 | ],
490 | [
491 | "rou",
492 | "RouterModule\talias"
493 | ],
494 | [
495 | "Rou",
496 | "RouterModule\talias"
497 | ],
498 | [
499 | "fu",
500 | "function\tkeyword"
501 | ],
502 | [
503 | "bas",
504 | "basil3\tlet"
505 | ],
506 | [
507 | "login",
508 | "loginUrl"
509 | ],
510 | [
511 | "lo",
512 | "login"
513 | ],
514 | [
515 | "data",
516 | "dataId"
517 | ]
518 | ]
519 | },
520 | "buffers":
521 | [
522 | {
523 | "file": "package.json",
524 | "settings":
525 | {
526 | "buffer_size": 405,
527 | "line_ending": "Unix"
528 | }
529 | }
530 | ],
531 | "build_system": "",
532 | "build_system_choices":
533 | [
534 | ],
535 | "build_varint": "",
536 | "command_palette":
537 | {
538 | "height": 87.0,
539 | "last_filter": "",
540 | "selected_items":
541 | [
542 | [
543 | "set",
544 | "Set Syntax: TypeScriptReact"
545 | ],
546 | [
547 | "mark",
548 | "Markdown Preview: Preview in Browser"
549 | ],
550 | [
551 | "instal",
552 | "Package Control: Install Package"
553 | ],
554 | [
555 | "ins",
556 | "Package Control: Install Package"
557 | ],
558 | [
559 | "pack",
560 | "Package Control: Install Package"
561 | ],
562 | [
563 | "mar",
564 | "Markdown Preview: Preview in Browser"
565 | ],
566 | [
567 | "markd",
568 | "Markdown Preview: Preview in Browser"
569 | ],
570 | [
571 | "markdown",
572 | "Markdown Preview: Preview in Browser"
573 | ],
574 | [
575 | "",
576 | "Convert Case: Lower Case"
577 | ],
578 | [
579 | "package",
580 | "Package Control: List Packages"
581 | ],
582 | [
583 | "install",
584 | "Package Control: Install Package"
585 | ]
586 | ],
587 | "width": 485.0
588 | },
589 | "console":
590 | {
591 | "height": 125.0,
592 | "history":
593 | [
594 | ]
595 | },
596 | "distraction_free":
597 | {
598 | "menu_visible": true,
599 | "show_minimap": false,
600 | "show_open_files": false,
601 | "show_tabs": false,
602 | "side_bar_visible": false,
603 | "status_bar_visible": false
604 | },
605 | "expanded_folders":
606 | [
607 | "/Users/cfe/Dev/try-reactjs"
608 | ],
609 | "file_history":
610 | [
611 | "/Users/cfe/Dev/channels/src/chat/consumers.py",
612 | "/Users/cfe/Dev/channels/src/cfehome/asgi.py",
613 | "/Users/cfe/Dev/channels/src/cfehome/asgi_production.py",
614 | "/Users/cfe/Dev/channels/src/cfehome/settings.py",
615 | "/Users/cfe/Dev/channels/src/cfehome/production.py",
616 | "/Users/cfe/Dev/channels/src/cfehome/settings/__init__.py",
617 | "/Users/cfe/Dev/channels/src/.gitignore",
618 | "/Users/cfe/Dev/channels/src/cfehome/settings/base.py",
619 | "/Users/cfe/Dev/channels/src/cfehome/settings/local.py",
620 | "/Users/cfe/Dev/channels/src/cfehome/settings/production.py",
621 | "/Users/cfe/Dev/channels/src/templates/js.html",
622 | "/Users/cfe/Dev/channels/src/chat/templates/chat/thread.html",
623 | "/Users/cfe/Dev/channels/readme.md",
624 | "/Users/cfe/Dev/channels/src/cfehome/wsgi.py",
625 | "/Users/cfe/Dev/channels/src/manage.py",
626 | "/Users/cfe/Dev/channels/src/Procfile",
627 | "/Volumes/CFE_2018/CFE Projects/Current/Chat x Channels/Blog/Django-Channels-To-Production.md",
628 | "/Users/cfe/Dev/channels/src/cfehome/routing.py",
629 | "/Users/cfe/Dev/channels/src/templates/base.html",
630 | "/Users/cfe/Dev/channels/src/chat/utils.py",
631 | "/Users/cfe/Dev/channels/src/chat/models.py",
632 | "/Users/cfe/Dev/channels/src/chat/views.py",
633 | "/Users/cfe/Dev/channels/src/cfehome/asgi2.py",
634 | "/Users/cfe/Dev/channels/src/chat/js-tests/console.tests.js",
635 | "/Users/cfe/Dev/channels/src/chat/forms.py",
636 | "/Users/cfe/Dev/channels/src/templates/home.html",
637 | "/Users/cfe/Dev/channels/.gitignore",
638 | "/Users/cfe/Dev/channels/parse_git_log.py",
639 | "/Users/cfe/Dev/channels/src/templates/css.html",
640 | "/Users/cfe/Dev/channels/src/chat/templates/chat/inbox.html",
641 | "/Users/cfe/Dev/channels/src/chat/urls.py",
642 | "/Users/cfe/Dev/channels/src/cfehome/urls.py",
643 | "/Users/cfe/Dev/channels/src/chat/admin.py",
644 | "/Users/cfe/Dev/cfehome/src/search/views.py",
645 | "/Users/cfe/Dev/cfehome/src/courses/models.py",
646 | "/Users/cfe/Dev/cfehome/src/cfehome/urls.py",
647 | "/Users/cfe/Dev/cfehome/src/profiles/admin.py",
648 | "/Users/cfe/Dev/cfehome/src/blog/models.py",
649 | "/Users/cfe/Dev/cfehome/src/blog/admin.py",
650 | "/Users/cfe/Dev/cfehome/src/templates/base.html",
651 | "/Users/cfe/Dev/cfehome/src/profiles/models.py",
652 | "/Users/cfe/Dev/cfehome/src/cfehome/settings/base.py",
653 | "/Users/cfe/Dev/cfehome/src/cfehome/settings/local.py",
654 | "/Users/cfe/Dev/cfehome/src/cfehome/settings/production.py",
655 | "/Users/cfe/Dev/cfehome/src/courses/admin.py",
656 | "/Users/cfe/Dev/cfehome/src/search/templates/search/view.html",
657 | "/Users/cfe/Dropbox/CFE Projects/tests/client/cfe-rest-client/package.json",
658 | "/Users/cfe/Dropbox/CFE Projects/tests/src/cfeapi/settings.py",
659 | "/Users/cfe/Dropbox/CFE Projects/tests/client/cfe-rest-client/src/app/status-create/status-create.component.html",
660 | "/Users/cfe/Dropbox/CFE Projects/tests/client/cfe-rest-client/src/app/status-create/status-create.component.ts",
661 | "/Users/cfe/Dropbox/CFE Projects/tests/client/cfe-rest-client/src/app/app-routing.module.ts",
662 | "/Users/cfe/Dropbox/CFE Projects/tests/client/cfe-rest-client/src/app/status-detail/status-detail.component.ts",
663 | "/Volumes/CFE/CFE Projects/Current/Rest API/Sections/3 - Django Rest Framework API/Tests/test_rest_api.py",
664 | "/Users/cfe/Dev/restapi/src/accounts/api/permissions.py",
665 | "/Users/cfe/Dev/restapi/src/status/api/views.py",
666 | "/Users/cfe/Dev/restapi/src/status/api/serializers.py",
667 | "/Users/cfe/Dev/restapi/src/status/api/urls.py",
668 | "/Users/cfe/Dev/restapi/src/status/models.py",
669 | "/Users/cfe/Dev/restapi/scripts/cfe_rest_framework_api.py",
670 | "/Users/cfe/Dev/restapi/src/accounts/api/views.py",
671 | "/Users/cfe/Dev/restapi/src/accounts/api/serializers.py",
672 | "/Users/cfe/Dev/restapi/src/accounts/api/user/__init__.py",
673 | "/Users/cfe/Dev/restapi/src/accounts/api/user/urls.py",
674 | "/Users/cfe/Dev/restapi/src/accounts/api/user/serializers.py",
675 | "/Users/cfe/Dev/restapi/src/accounts/api/urls.py",
676 | "/Users/cfe/Dev/restapi/src/cfeapi/urls.py",
677 | "/Users/cfe/Dev/restapi/src/accounts/api/user/views.py",
678 | "/Users/cfe/Dev/restapi/src/cfeapi/restconf/pagination.py",
679 | "/Users/cfe/Dev/restapi/src/accounts/api/urls_user.py",
680 | "/Users/cfe/Dev/restapi/README.md",
681 | "/Users/cfe/Dev/restapi/parsed_log.md",
682 | "/Users/cfe/Dev/restapi/src/cfeapi/settings.py",
683 | "/Users/cfe/Dev/restapi/src/accounts/api/__init__.py",
684 | "/Users/cfe/Dev/restapi/src/accounts/api/utils.py",
685 | "/Users/cfe/Dev/restapi/src/cfeapi/restconf/__init__.py",
686 | "/Users/cfe/Dev/restapi/scripts/cfe_pure_api.py",
687 | "/Users/cfe/Dev/restapi/.gitignore",
688 | "/Users/cfe/Dev/restapi/static-server/media-root/status/readme.txt",
689 | "/Users/cfe/Dev/restapi/src/updates/api/views.py",
690 | "/Users/cfe/Dev/restapi/src/status/api/shell_examples.py",
691 | "/Users/cfe/Dev/restapi/src/status/forms.py",
692 | "/Users/cfe/Dev/restapi/src/status/admin.py",
693 | "/Users/cfe/Dev/restapi/src/status/api/__init__.py",
694 | "/Users/cfe/Dev/restapi/src/updates/views.py",
695 | "/Users/cfe/Dev/restapi/src/status/serializers.py",
696 | "/Users/cfe/Dev/restapi/src/updates/models.py",
697 | "/Users/cfe/Dev/restapi/src/updates/forms.py",
698 | "/Users/cfe/Dev/restapi/LICENSE",
699 | "/Users/cfe/Dev/restapi/src/updates/api/utils.py",
700 | "/Users/cfe/Dev/restapi/src/updates/api/urls.py",
701 | "/Users/cfe/Dev/restapi/src/updates/api/mixins.py",
702 | "/Users/cfe/Dev/restapi/src/cfeapi/mixins.py",
703 | "/Users/cfe/Dev/restapi/lib/python3.6/site-packages/django/http/response.py",
704 | "/Users/cfe/Dev/restapi/scripts/api_detail.py",
705 | "/Users/cfe/Dev/restapi/src/updates/admin.py",
706 | "/Users/cfe/Dev/restapi/src/updates/api/__init__.py",
707 | "/Users/cfe/Documents/notes_delete.js",
708 | "/Users/cfe/Dropbox/CFE Projects/Blog/Articles/Custom-Analytics-with-Django.md",
709 | "/Users/cfe/Desktop/notes_delete/stripe_notes.py",
710 | "/Users/cfe/Desktop/notes_delete/code.py",
711 | "/Users/cfe/Dev/ecommerce/src/accounts/forms.py",
712 | "/Users/cfe/Dev/ecommerce/src/accounts/admin.py",
713 | "/Users/cfe/Dev/ecommerce/src/ecommerce/urls.py",
714 | "/Users/cfe/Dev/ecommerce/src/ecommerce/settings.py",
715 | "/Users/cfe/Dev/ecommerce/src/accounts/models.py",
716 | "/Users/cfe/Dev/ecommerce/src/accounts/views.py",
717 | "/Users/cfe/Dev/ecommerce/README.md",
718 | "/Users/cfe/Dev/ecommerce/parsed_log.md",
719 | "/Users/cfe/Dev/ecommerce/notes/checkout_process.md",
720 | "/Users/cfe/Dev/ecommerce/src/ecommerce/utils.py",
721 | "/Users/cfe/Dev/ecommerce/src/addresses/admin.py",
722 | "/Users/cfe/Dev/ecommerce/src/addresses/forms.py",
723 | "/Users/cfe/Dev/ecommerce/src/addresses/models.py",
724 | "/Users/cfe/Dev/ecommerce/src/billing/models.py",
725 | "/Users/cfe/Dev/ecommerce/src/addresses/templates/addresses/form.html",
726 | "/Users/cfe/Dev/ecommerce/src/addresses/views.py",
727 | "/Users/cfe/Dev/ecommerce/src/orders/models.py",
728 | "/Users/cfe/Dev/ecommerce/src/addresses/templates/addresses/prev_addresses.html",
729 | "/Users/cfe/Dev/ecommerce/src/carts/templates/carts/checkout.html",
730 | "/Users/cfe/Dev/ecommerce/src/carts/templates/carts/checkout-done.html",
731 | "/Users/cfe/Dev/ecommerce/src/carts/urls.py",
732 | "/Users/cfe/Dev/ecommerce/parse_git_log.py",
733 | "/Users/cfe/Dev/ecommerce/src/carts/views.py",
734 | "/Users/cfe/Dev/ecommerce/src/billing/admin.py",
735 | "/Users/cfe/Dev/ecommerce/src/accounts/templates/accounts/snippets/form.html",
736 | "/Users/cfe/Dev/ecommerce/src/ecommerce/views.py",
737 | "/Users/cfe/Dev/ecommerce/src/templates/base/navbar.html",
738 | "/Users/cfe/Dev/ecommerce/src/ecommerce/forms.py"
739 | ],
740 | "find":
741 | {
742 | "height": 45.0
743 | },
744 | "find_in_files":
745 | {
746 | "height": 132.0,
747 | "where_history":
748 | [
749 | ]
750 | },
751 | "find_state":
752 | {
753 | "case_sensitive": false,
754 | "find_history":
755 | [
756 | ],
757 | "highlight": false,
758 | "in_selection": false,
759 | "preserve_case": false,
760 | "regex": false,
761 | "replace_history":
762 | [
763 | ],
764 | "reverse": false,
765 | "show_context": false,
766 | "use_buffer2": false,
767 | "whole_word": false,
768 | "wrap": true
769 | },
770 | "groups":
771 | [
772 | {
773 | "selected": 0,
774 | "sheets":
775 | [
776 | {
777 | "buffer": 0,
778 | "file": "package.json",
779 | "semi_transient": false,
780 | "settings":
781 | {
782 | "buffer_size": 405,
783 | "regions":
784 | {
785 | },
786 | "selection":
787 | [
788 | [
789 | 292,
790 | 287
791 | ]
792 | ],
793 | "settings":
794 | {
795 | "syntax": "Packages/JavaScript/JSON.sublime-syntax",
796 | "tab_size": 2,
797 | "translate_tabs_to_spaces": true
798 | },
799 | "translation.x": 0.0,
800 | "translation.y": 0.0,
801 | "zoom_level": 1.0
802 | },
803 | "stack_index": 0,
804 | "type": "text"
805 | }
806 | ]
807 | }
808 | ],
809 | "incremental_find":
810 | {
811 | "height": 45.0
812 | },
813 | "input":
814 | {
815 | "height": 57.0
816 | },
817 | "layout":
818 | {
819 | "cells":
820 | [
821 | [
822 | 0,
823 | 0,
824 | 1,
825 | 1
826 | ]
827 | ],
828 | "cols":
829 | [
830 | 0.0,
831 | 1.0
832 | ],
833 | "rows":
834 | [
835 | 0.0,
836 | 1.0
837 | ]
838 | },
839 | "menu_visible": true,
840 | "output.doc":
841 | {
842 | "height": 0.0
843 | },
844 | "output.find_results":
845 | {
846 | "height": 508.0
847 | },
848 | "pinned_build_system": "",
849 | "project": "try-reactjs.sublime-project",
850 | "replace":
851 | {
852 | "height": 86.0
853 | },
854 | "save_all_on_build": true,
855 | "select_file":
856 | {
857 | "height": 0.0,
858 | "last_filter": "",
859 | "selected_items":
860 | [
861 | [
862 | "email",
863 | "templates/team/email_instructions.html"
864 | ]
865 | ],
866 | "width": 0.0
867 | },
868 | "select_project":
869 | {
870 | "height": 0.0,
871 | "last_filter": "",
872 | "selected_items":
873 | [
874 | ],
875 | "width": 0.0
876 | },
877 | "select_symbol":
878 | {
879 | "height": 0.0,
880 | "last_filter": "",
881 | "selected_items":
882 | [
883 | ],
884 | "width": 0.0
885 | },
886 | "selected_group": 0,
887 | "settings":
888 | {
889 | },
890 | "show_minimap": false,
891 | "show_open_files": true,
892 | "show_tabs": true,
893 | "side_bar_visible": true,
894 | "side_bar_width": 241.0,
895 | "status_bar_visible": true,
896 | "template_settings":
897 | {
898 | }
899 | }
900 |
--------------------------------------------------------------------------------