Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paqtcom/summernote
https://github.com/paqtcom/summernote
package
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/paqtcom/summernote
- Owner: paqtcom
- License: mit
- Created: 2020-09-11T06:47:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T20:46:42.000Z (11 months ago)
- Last Synced: 2024-11-30T23:15:04.531Z (2 months ago)
- Topics: package
- Language: JavaScript
- Homepage:
- Size: 2.87 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> **⚠ WARNING: No maintenance intended**
> This package is not actively maintained.# Way 2 Summernote
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]
Example implementation:
```
$('.js-wysiwyg').each(function() {
new W2Summernote()
.element($(this))
.init();
});
```## .init()
Attach summernote.
Summernote is a JavaScript library that helps you create WYSIWYG editors online.
## .toolbar()
With the function toolbar you can send an array with the toolbars.
```
[
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['para', ['ul', 'ol', 'paragraph']],
['insert', ['link']],
['misc', ['undo', 'redo']],
['codeview', ['codeview']]
]
```## .element()
Set the element of the textarea to attach the summernote wysiwyg editor.
Default value:
`.js-wysiwyg`## .height()
Set the height of the summernote wysiwyg editor.
Default value:
`300`## .tooltip()
Turn the tooltip on or off.
Default value:
`true`## .get()
Get the HTML contents of the first summernote in the set of matched elements.
## .set()
A string of HTML to set as the content of each matched element.
```
var markupString = 'hello world';new W2Summernote(markupString).set().init();
```## .unset()
Unset summernote.
## Test the package.
To test the package, clone the package to your system.
Than run this command.```
npm run build
```This will copy the test files to the dist, and also build the package files include the dependencies.
When this script is complete without errors, you can open `dist/index.html` in your browser.
Open the dev tools, tab console, and you see all the results of the tests.If you only want to check the eslint rules, just run.
```
npm run lint
```[downloads-image]: https://img.shields.io/npm/dm/way2web-summernote.svg
[npm-url]: https://www.npmjs.com/package/way2web-summernote
[npm-image]: https://img.shields.io/npm/v/way2web-summernote.svg