Skip to content

Commit 56c5020

Browse files
author
Minh Tran
committed
React 0.14.x
1 parent 612fe1b commit 56c5020

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+7499
-680
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"stage": 0,
3+
"optional": []
4+
}

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "example/bower_components"
2+
"directory": "example/app/bower_components"
33
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,28 @@
2424
"rules": {
2525
"strict": 0,
2626
"curly": 0,
27-
"quotes": [2, "single"],
27+
"quotes": [2, "single", "avoid-escape"],
28+
"semi": 2,
2829
"no-underscore-dangle": 0,
30+
"no-unused-vars": [2, {"args": "all"}],
2931
"camelcase": [2, {"properties": "never"}],
3032
"new-cap": 0,
31-
"react/jsx-boolean-value": 2,
32-
"react/jsx-quotes": 2,
33+
"accessor-pairs": 0,
34+
"brace-style": [2, "1tbs"],
35+
"consistent-return": 2,
36+
"dot-location": [2, "property"],
37+
"dot-notation": 2,
38+
"eol-last": 2,
39+
"indent": [2, 2, {"SwitchCase": 1}],
40+
"no-bitwise": 0,
41+
"no-multi-spaces": 2,
42+
"no-shadow": 2,
43+
"no-unused-expressions": 2,
44+
"space-after-keywords": 2,
45+
"space-before-blocks": 2,
46+
"jsx-quotes": [1, "prefer-single"],
47+
"react/display-name": 0,
48+
"react/jsx-boolean-value": [2, "always"],
3349
"react/jsx-no-undef": 2,
3450
"react/jsx-sort-props": 0,
3551
"react/jsx-sort-prop-types": 0,
@@ -38,11 +54,12 @@
3854
"react/no-did-mount-set-state": 2,
3955
"react/no-did-update-set-state": 2,
4056
"react/no-multi-comp": 2,
41-
"react/no-unknown-property": 1,
57+
"react/no-unknown-property": 2,
4258
"react/prop-types": 1,
4359
"react/react-in-jsx-scope": 2,
4460
"react/self-closing-comp": 2,
45-
"react/wrap-multilines": 0
61+
"react/sort-comp": 0,
62+
"react/wrap-multilines": [2, {"declaration": false, "assignment": false}]
4663
},
4764
"globals": {
4865
"inject": false,

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.idea
2-
.tmp
3-
dist
4-
example/bower_components
52
node_modules
3+
bower_components
4+
example/dist

.npmignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
.idea
2-
.tmp
3-
dist
4-
.bowerrc
5-
bower.json
2+
example

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ npm install --save react-progress-bar-plus
1717
```js
1818
var ProgressBar = require('react-progress-bar-plus');
1919

20-
var percent = 0;
21-
2220
<ProgressBar percent={10}/>
2321
```
2422

@@ -40,7 +38,7 @@ require('react-progress-bar-plus/lib/progress-bar.css');
4038
| Name | Type | Default | Description |
4139
|------|------|---------|-------------|
4240
| percent | number | -1 | Progress percent |
43-
| onTop | bool | false | Progrees bar will ontop & height 100% |
41+
| onTop | bool | false | Progress bar will ontop & height 100% |
4442
| autoIncrement | bool | false | if `true` percent will auto increment `Math.random() + 1 - Math.random()`% in `intervalTime` ms. |
4543
| intervalTime | number | 200 | Interval time for auto increment. |
4644

bower.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "react-progress-bar-plus",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Progress bar component for ReactJS.",
5-
"main": "lib/ProgressBar.js",
5+
"main": "lib/index.js",
66
"keywords": [
77
"react-component",
88
"react",
@@ -19,7 +19,8 @@
1919
"test",
2020
"tests"
2121
],
22+
"dependencies": {},
2223
"devDependencies": {
2324
"bootstrap-customize": "~3.3.4"
2425
}
25-
}
26+
}

example/app.js renamed to example/app/app.js

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
1-
var React = require('react');
1+
import 'babel-core/polyfill';
2+
import React from 'react';
3+
import ReactDOM from 'react-dom';
4+
import Header from './components/Header.js';
5+
import Footer from './components/Footer.js';
6+
import ProgressBar from 'react-progress-bar-plus';
27

3-
require('./bower_components/bootstrap-customize/css/bootstrap.css');
4-
require('../src/progress-bar.scss');
5-
require('./assets/styles/app.scss');
8+
import './bower_components/bootstrap-customize/css/bootstrap.css';
9+
import 'react-progress-bar-plus/src/progress-bar.scss';
10+
import './assets/styles/app.scss';
611

7-
var Header = require('./components/Header');
8-
var Footer = require('./components/Footer');
9-
var ProgressBar = require('../src/ProgressBar');
12+
class App extends React.Component {
13+
state = {
14+
percent: -1,
15+
autoIncrement: false,
16+
intervalTime: 200
17+
};
1018

11-
var App = React.createClass({
12-
getInitialState: function () {
13-
return {
14-
percent: -1,
15-
autoIncrement: false,
16-
intervalTime: 200
17-
};
18-
},
19-
setPercent: function (percent) {
20-
return function () {
19+
setPercent = (percent) => {
20+
return () => {
2121
this.setState({
2222
percent: percent
2323
});
24-
}.bind(this);
25-
},
26-
startWithAutoIncrement: function () {
24+
};
25+
};
26+
27+
startWithAutoIncrement = () => {
2728
this.setState({
2829
percent: 0,
2930
autoIncrement: true,
3031
intervalTime: (Math.random() * 1000)
3132
});
32-
},
33-
render: function () {
33+
};
34+
35+
render() {
3436
return (
35-
<div className={'layout-page'}>
37+
<div className='layout-page'>
3638
<Header/>
37-
<main className={'layout-main'}>
38-
<div className={'container'}>
39+
<main className='layout-main'>
40+
<div className='container'>
3941
<ProgressBar percent={this.state.percent}
4042
autoIncrement={this.state.autoIncrement}
4143
intervalTime={this.state.intervalTime}/>
@@ -86,7 +88,14 @@ var App = React.createClass({
8688
</div>
8789
);
8890
}
89-
});
91+
}
9092

91-
React.render(<App />, document.body);
93+
function run() {
94+
ReactDOM.render(<App />, document.getElementById('app'));
95+
}
9296

97+
if (window.addEventListener) {
98+
window.addEventListener('DOMContentLoaded', run);
99+
} else {
100+
window.attachEvent('onload', run);
101+
}
File renamed without changes.

0 commit comments

Comments
 (0)