onaluf / fate

Flexible Angular Text Editor
MIT License
37 stars 14 forks source link

How can I add an image and color button? #88

Closed hdogrusoyler closed 3 years ago

onaluf commented 3 years ago

Adding color is easy since there is an exe corresponding to it (foreColor, see https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand). So you can check the example in the README. (https://github.com/onaluf/fate#custom-ui-button).

For the image you can have a look at https://github.com/onaluf/fate/tree/master/src/app/fate-link-dropdown which will show you how to insert some custom code with a dialog. Here instead of adding a link you can add an image after showing a drop down to pick the file. You will have to either handle the upload to somewhere or use dataurls.

Tell me if you manage with those... otherwise tell we what isn't clear and I'll try to improve the documentation.

hdogrusoyler commented 3 years ago

Are there more detailed examples?