Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
3.99k stars 612 forks source link

Sugestion to include colors. #55

Closed angelieri closed 9 years ago

angelieri commented 10 years ago

Great component! Adding some color and baground color would be awesome!

ericalli commented 9 years ago

+1! Would love to have this feature as well.

Alex-D commented 9 years ago

Hi!

I've created a new plugin named "Colors" which do that :)

The plugin is here:

https://github.com/Alex-D/Trumbowyg/tree/1.1.6/dist/plugins/colors

Example of use:

https://github.com/Alex-D/Trumbowyg/blob/1.1.6/index.html#L181

You just need to add foreColor and/or backColor to add this plugin.

Don't forget to include the JS and the CSS of the plugin, and get the entire ui folder to keep icons on these buttons.

angelieri commented 9 years ago

Great Alex, thanks. Although I'm getting this error: Uncaught TypeError: Cannot set property '_foreColorffffff' of undefined

Alex-D commented 9 years ago

Arf. I see why. I push a patch this evening. Thanks for report.

Alex-D commented 9 years ago

I've pushed the v1.1.7 that fix this small bug. You can see a demo in the examples/plugins folder.

angelieri commented 9 years ago

GREAT! It is working. I added in PT.JS these configs. foreColor:"Cor do texto",backColor:"Cor de fundo"

Thanks Alex.

hakim89 commented 8 years ago

can you advice on where to put the two svg files (fore-color.svg, back-color.svg) for the color plugin. I have the main icons.svg set in svgPath but I am not able to load the colors svg files. I tried to put the ui folder relative to the trumbowyg.colors.css file and to the JS files but both did not wrok

Alex-D commented 8 years ago

They are included in icons.svg