Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
zenoamaro committed Nov 7, 2014
0 parents commit 1d7ce87
Show file tree
Hide file tree
Showing 22 changed files with 1,212 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*~
~*
*.tmp
*.orig
*.bak
*.log
/tmp
/node_modules
28 changes: 28 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"browser": true,
"node": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": true,
"freeze": true,
"immed": true,
"latedef": false,
"noarg": true,
"newcap": false,
"noempty": true,
"nonbsp": true,
"nonew": true,
"quotmark": "single",
"undef": true,
"unused": false,
"strict": true,
"maxdepth": 2,
"maxparams": 3,
"maxcomplexity": 5,
"maxlen": 80,
"eqnull": true,
"lastsemic": true,
"laxbreak": true
}
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js

node_js:
- "0.11"
- "0.10"
- "0.8"

before_install:
- npm install -g npm
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changelog
=========

v0.0.1
------
- Initial version.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014, zenoamaro <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
LINT=./node_modules/.bin/jshint
LINT_FLAGS=
TEST=./node_modules/.bin/mocha
SPEC_FLAGS=-R spec
COVERAGE_FLAGS=-R mocha-text-cov

usage:
@echo lint: lints the source
@echo spec: runs the test specs
@echo coverage: runs the code coverage test
@echo test: lint, spec and coverage threshold test
@echo build: builds the minified version
@echo clean: removes the build artifacts

lint:
@$(LINT) $(LINT_FLAGS) $(SOURCE)

spec:
@$(TEST) $(SPEC_FLAGS) test/index

coverage:
@$(TEST) $(COVERAGE_FLAGS) test/index

test:
@make lint
@make spec SPEC_FLAGS="-R dot"
@make coverage COVERAGE_FLAGS="-R travis-cov"

build:
@webpack --config webpack.dev.js
@webpack --config webpack.prod.js

watch:
@webpack --watch --config webpack.dev.js

clean:
@if [ -d dist ]; then rm -r dist; fi

.PHONY: usage test spec coverage lint build clean
73 changes: 73 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
React-Quill ![](https://travis-ci.org/zenoamaro/react-quill.svg?branch=master)
==============================================================================

A [Quill] component for [React].

[Quill]: http://quilljs.com
[React]: http://facebook.github.io/react/

**Warning**: The project is still in alpha stage. Use with caution.

1. [Quick start](#quick-start)
2. [Usage guide](#usage-guide)
3. [API reference](#api-reference)
4. [Building and testing](#building-and-testing)
5. [Changelog](#changelog)
6. [License](#license)


Quick start
-----------
~~~~html
<ReactQuill value="..."/>
~~~~


Usage guide
-----------
To be done.


API reference
-------------
To be done.


Building and testing
--------------------
You can run the automated test suite:

$ npm test

And build a minificated version of the source:

$ npm run build

More tasks are available on the [Makefile](Makefile):

lint: lints the source
spec: runs the test specs
coverage: runs the code coverage test
test: lint, spec and coverage threshold test
build: builds the minified version


Changelog
---------
#### v0.1.0
- Initial version.

[Full changelog](CHANGELOG.md)


License
-------
The MIT License (MIT)

Copyright (c) 2014, zenoamaro <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 9 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<head>
<link rel="stylesheet" href="../node_modules/quilljs/dist/quill.snow.css">
</head>
<body>
<script src="../node_modules/quilljs/dist/quill.js"></script>
<script src="../node_modules/react/dist/react-with-addons.js"></script>
<script src="../dist/react-quill.js"></script>
<script src="index.js"></script>
</body>
45 changes: 45 additions & 0 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* global React */
/* global ReactQuill */
'use strict';

var Editor = React.createClass({

getInitialState: function() {
return {
value: '<h1>It works!</h1>'
};
},

onTextareaChange: function(event) {
var value = event.target.value;
this.setState({ value:value });
},

onEditorChange: function(value) {
this.setState({ value:value });
},

render: function() {
return (
React.DOM.div({},
React.DOM.textarea({
value: this.state.value,
onChange: this.onTextareaChange
}),
this.transferPropsTo(
ReactQuill({
theme: 'snow',
defaultValue: this.state.value,
onChange: this.onEditorChange
})
)
)
);
}

});

React.renderComponent(
Editor(),
document.body
);
Loading

0 comments on commit 1d7ce87

Please sign in to comment.