This a simple ember component that wraps Wysihtml.js library. A working demo can be found at here.
Simply run ember install ember-wysihtml
at your ember project root folder.
Or npm install ember-wysihtml --save && ember g ember-wysihtml
.
On a template:
On a controller/component:
myToolbar: [
{ command: 'bold', title: 'Ctrl+B', iconClass: 'fa fa-bold', iconAlt:'Bold'},
{ command: 'italic', title: 'Ctrl+I', iconClass: 'fa fa-italic', iconAlt:'Italic' },
{ command: 'underline', title: 'Ctrl+U', iconClass: 'fa fa-underline', iconAlt:'Underline' }
]
A toolbar is an Array
of objects defined like this:
myToolbar: [
...
{
command: 'someValidCommand', // data-wysihtml5-command
commandValue: someValue // data-wysihtml5-command-value
commandValueBlank: true // data-wysihtml5-command-blank-value (boolean)
action: 'someValidAction', // data-wysihtml5-action
title: 'A title',
iconClass: 'my-icon-class',
iconAlt:'Alt if iconClass not used'
},
...
]
Check valid command and actions at https://github.com/Voog/wysihtml/blob/master/examples/advanced.html
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.