forked from zenoamaro/react-quill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1d7ce87
Showing
22 changed files
with
1,212 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*~ | ||
~* | ||
*.tmp | ||
*.orig | ||
*.bak | ||
*.log | ||
/tmp | ||
/node_modules |
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,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 | ||
} |
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 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "0.11" | ||
- "0.10" | ||
- "0.8" | ||
|
||
before_install: | ||
- npm install -g npm |
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,6 @@ | ||
Changelog | ||
========= | ||
|
||
v0.0.1 | ||
------ | ||
- Initial version. |
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,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. |
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,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 |
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,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. |
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 @@ | ||
<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> |
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,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 | ||
); |
Oops, something went wrong.