-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from WarFox/feature/word-count-plus
The big rewrite in React and Redux 💥 💪 💪✈️
- Loading branch information
Showing
24 changed files
with
7,362 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
{ | ||
"private": true, | ||
"author": "Deepu Mohan Puthrote", | ||
"engines": { | ||
"node": ">= 0.12", | ||
"npm": ">= 2.1" | ||
}, | ||
"scripts": { | ||
"build": "gulp" | ||
}, | ||
"devDependencies": { | ||
"babelify": "^6.2.0", | ||
"browserify": "^11.0.0", | ||
"del": "^1.2.0", | ||
"gulp": "^3.9.0", | ||
"gulp-clean-css": "^2.3.2", | ||
"gulp-plumber": "^1.0.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-uglify": "1.2.0", | ||
"gulp-util": "^3.0.6", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0" | ||
} | ||
"name": "word-count-plus", | ||
"version": "2.0.0", | ||
"author": "Deepu Mohan Puthrote", | ||
"homepage": "https://deepumohan.com/projects/word-count-plus", | ||
"private": true, | ||
"dependencies": { | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"react-redux": "^5.0.7", | ||
"react-scripts": "1.1.0", | ||
"recharts": "^1.0.0-beta.10", | ||
"redux": "^3.7.2", | ||
"redux-logger": "^3.0.6" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Copy & Paste, Word & Character counter using Javascript, JQuery</title> | ||
<meta charset="utf-8" /> | ||
<meta name="description" content="Copy & Paste Words and Character counter using Javascript, JQuery" /> | ||
<meta name="keywords" content="Javascript,JQuery,Word Count,Counter,Character counter,Character count,Word Counter,Deepu,Mohan,Puthrote,Deepu Mohan, Deepu Puthrote, Mohan Puthrote, Deepu Mohan Puthrote" /> | ||
<meta name="author" content="Deepu Mohan Puthrote" /> | ||
<meta name="copyright" content="Deepu Mohan Puthrote" /> | ||
<meta name="classification" content="public" /> | ||
<meta name="resource-type" content="document" /> | ||
<html lang="en"> | ||
|
||
<link href="css/style.min.css" rel="stylesheet" type="text/css"/> | ||
<head> | ||
<title>Copy & Paste, Word & Character counter and Statistics app React and Redux</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#000000"> | ||
<meta name="description" content="Copy & Paste Words and Character counter using Javascript, React" /> | ||
<meta name="keywords" content="Javascript,React,Word Count,Counter,Character counter,Character count,Word Counter,Deepu,Mohan,Puthrote,Deepu Mohan, Deepu Puthrote, Mohan Puthrote, Deepu Mohan Puthrote" /> | ||
<meta name="author" content="Deepu Mohan Puthrote" /> | ||
<meta name="copyright" content="Deepu Mohan Puthrote" /> | ||
<meta name="classification" content="public" /> | ||
<meta name="resource-type" content="document" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is added to the | ||
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | ||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
</head> | ||
|
||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div id="root"></div> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.3.0/dist/semantic.min.css" /> | ||
</body> | ||
|
||
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js"></script> | ||
<script type="text/javascript" src="js/script.min.js"></script> | ||
</head> | ||
<body> | ||
<h1>Word Counter using Javascript, jQuery</h1> | ||
<div class="sleek"> | ||
<h1>Paste or type your text to the textbox below to get the word and character count</h1> | ||
<div class="sleek-body"> | ||
<ul> | ||
<li> | ||
<div class="result"><h2><span id="wordCount">0</span></h2></div> | ||
<div class="desc"><h2>Words</h2></div> | ||
</li> | ||
<li> | ||
<div class="result"><h2><span id="totalChars">0</span></h2></div> | ||
<div class="desc"><h2>Characters<br/>(including trails)</h2></div> | ||
</li> | ||
<li> | ||
<div class="result"><h2><span id="charCount">0</span></h2></div> | ||
<div class="desc"><h2>Characters<br/>(excluding trails)</h2></div> | ||
</li> | ||
<li> | ||
<div class="result"><h2><span id="charCountNoSpace">0</span></h2></div> | ||
<div class="desc"><h2>Characters<br/>(excluding all spaces)</h2></div> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div id="container"> | ||
<textarea id='text'></textarea> | ||
</div> | ||
<br/> | ||
<footer> | ||
<ul> | ||
<li> | ||
<a href="http://www.w3.org/html/logo/"> | ||
<img src="images/HTML5_Badge_32.png" width="32" height="32" alt="HTML5 Powered" title="HTML5 Powered"/> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/WarFox/word-count/"> | ||
<img src="images/github.png" alt="Word count @ github" title="Word Count @ github"/> | ||
</a> | ||
</li> | ||
</ul> | ||
</footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"short_name": "Word Count Plus", | ||
"name": "Word Count and Statistics app", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "64x64 32x32 24x24 16x16", | ||
"type": "image/x-icon" | ||
} | ||
], | ||
"start_url": "./index.html", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React from "react"; | ||
import { | ||
Footer, | ||
Header, | ||
TextArea, | ||
TinyLineChart, | ||
DisplayStatistic | ||
} from "./components"; | ||
import { connect } from "react-redux"; | ||
|
||
class App extends React.Component { | ||
render() { | ||
const { counts } = this.props; | ||
|
||
return ( | ||
<div className="ui container"> | ||
<Header /> | ||
|
||
<div className="ui mini statistics"> | ||
<DisplayStatistic value={counts.wordCount}>Words</DisplayStatistic> | ||
<DisplayStatistic value={counts.totalChars}> | ||
Chars <br />(including trails) | ||
</DisplayStatistic> | ||
<DisplayStatistic value={counts.charCount}> | ||
Chars <br />(excluding trails) | ||
</DisplayStatistic> | ||
<DisplayStatistic value={counts.charCountNoSpace}> | ||
Chars <br />(no spaces) | ||
</DisplayStatistic> | ||
<DisplayStatistic value={counts.alphabetsCount}> | ||
Alpbahets | ||
</DisplayStatistic> | ||
<DisplayStatistic value={counts.numbersCount}> | ||
Numbers | ||
</DisplayStatistic> | ||
<DisplayStatistic value={counts.nonAlphaNumeric}> | ||
Non AlphaNumeric | ||
</DisplayStatistic> | ||
<DisplayStatistic value={280 - counts.charCount}> | ||
Tweet - 280 max | ||
</DisplayStatistic> | ||
</div> | ||
|
||
<TinyLineChart | ||
width={1100} | ||
height={100} | ||
data={counts.chartData} | ||
dataKey="word" | ||
/> | ||
|
||
<div className="ui divider" /> | ||
<TextArea /> | ||
<div className="ui divider" /> | ||
<Footer /> | ||
|
||
<ul className="ui list"> | ||
<li className="item">Word density</li> | ||
<li className="item">Average word length</li> | ||
<li className="item">Longest word</li> | ||
</ul> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = state => { | ||
return state; | ||
}; | ||
|
||
export default connect(mapStateToProps)(App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<App />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
export const refrestCount = (text, changeType) => { | ||
return { | ||
type: "REFRESH_COUNT", | ||
text, | ||
changeType | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
const DisplayStatistic = ({value, children}) => { | ||
return ( | ||
<div className="statistic"> | ||
<div className="value">{value}</div> | ||
<div className="label">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DisplayStatistic; |
Oops, something went wrong.