Skip to content

Commit

Permalink
first import
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Dec 14, 2015
0 parents commit a7337c2
Show file tree
Hide file tree
Showing 25 changed files with 1,455 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"presets": ["es2015", "stage-0", "react"]
}
5 changes: 5 additions & 0 deletions .bowerrc
@@ -0,0 +1,5 @@
{
"scripts": {
"postinstall": "npm run rename-css-bower-dependencies"
}
}
6 changes: 6 additions & 0 deletions .editorconfig
@@ -0,0 +1,6 @@
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
48 changes: 48 additions & 0 deletions .eslintrc
@@ -0,0 +1,48 @@
{
// I want to use babel-eslint for parsing!
"parser": "babel-eslint",

"env": {
"browser": true,
"node": true,
"jasmine": true
},

// To give you an idea how to override rule options:
"rules": {
"quotes": [2, "single"],
"strict": [2, "never"],
"eol-last": [0],
"no-mixed-requires": [0],
"no-underscore-dangle": [0],
"no-use-before-define": [2, "nofunc"],

"no-alert": 0,

// react
"react/display-name": 0,
"react/jsx-boolean-value": 1,
"react/jsx-quotes": 1,
"react/jsx-no-undef": 1,
"react/jsx-sort-props": 0,
"react/jsx-sort-prop-types": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 0,
"react/no-unknown-property": 1,
"react/prop-types": 0,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 1
},

"ecmaFeatures": {
"jsx": true
},

"plugins": [
"react"
]
}
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
node_modules
bower_components
.DS_Store
*.log
27 changes: 27 additions & 0 deletions README.md
@@ -0,0 +1,27 @@
# react calendar timeline

Get the AMD module located at `react-calendar-timeline.js` and include it in your project.

Here is a sample integration:

```js
require.config({
paths: {
'react': 'vendor/bower_components/react/react',
'ReactCalendarTimeline': 'react-calendar-timeline'
}
});

require(['react', 'ReactCalendarTimeline'], function(React, ReactCalendarTimeline) {

React.render(React.createElement(ReactCalendarTimeline), document.getElementById('widget-container'));

});
```

## Development

* Development server `npm start`.
* Continuously run tests on file changes `npm run watch-test`;
* Run tests: `npm test`;
* Build `npm run build`;
19 changes: 19 additions & 0 deletions bower.json
@@ -0,0 +1,19 @@
{
"name": "react-calendar-timeline",
"version": "0.1.0",
"license": "MIT",
"author": "",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"spec",
"test",
"tests"
],
"moduleType": [
"amd",
"globals"
]
}
48 changes: 48 additions & 0 deletions index.html
@@ -0,0 +1,48 @@
<html>
<head>
<title>react calendar timeline Demo</title>
</head>
<body>
<div id="main"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.js"></script>
<script src="react-calendar-timeline.js"></script>
<script>
var groups = [
{
id: '1',
title: "First"
},
{
id: '2',
title: "Second"
},
{
id: '3',
title: "Third"
}
];

var items = [
{
id: '1000',
group: '1',
title: "First Item",
start: moment("2014-09-24T10:00:00Z").toDate(),
end: moment("2014-09-25T10:00:00Z").toDate()
},
{
id: '1001',
group: '3',
title: "Second Item",
start: moment("2014-09-24T12:00:00Z").toDate(),
end: moment("2014-09-24T16:00:00Z").toDate()
}
];

/* jshint undef:false */
ReactDOM.render(React.createElement(ReactCalendarTimeline['default'], {groups: groups, items: items}), document.getElementById('main'));
</script>
</body>
</html>
44 changes: 44 additions & 0 deletions karma.conf.js
@@ -0,0 +1,44 @@
module.exports = function(config) {
config.set({
basePath: '.',

frameworks: ['jasmine'],
browsers: ['PhantomJS'],

files: [
// shim to workaroud PhantomJS 1.x lack of `bind` support
// see: https://github.com/ariya/phantomjs/issues/10522
'node_modules/es5-shim/es5-shim.js',

// React is an external dependency of the component
'node_modules/react/dist/react-with-addons.js',

'spec/spec-helper.js',
'spec/**/*.spec.*',
{ pattern: 'lib/**/*', watched: true, included: false }
],

preprocessors: {
// add webpack as preprocessor
'spec/**/*.spec.*': ['webpack', 'sourcemap']
},

webpack: loadWebpackConfig(),

webpackServer: {
noInfo: true
},

singleRun: true
});
};


/**
Loads configuration while ensuring sounce-map is enabled
*/
function loadWebpackConfig () {
var webpackConfig = require('./webpack.config.js');
webpackConfig.devtool = 'inline-source-map';
return webpackConfig;
}

0 comments on commit a7337c2

Please sign in to comment.