bergie / hallo

Simple rich text editor (contentEditable) for jQuery UI
http://hallojs.org/
MIT License
2.43k stars 314 forks source link

How to make custom Hallo.js plugin/button call a js function (toggle a modal)? #180

Closed Gabrinthei closed 11 years ago

Gabrinthei commented 11 years ago

I need to have a simple custom button in the Hallo toolbar that will toggle a modal to open. I'm sure that it's something fairly simple to do, but there is not a lot of documentation for Hallo yet, and my knowledge of how all this work is not the best yet.

I've been able to create a basic plugin, by using the template given, but can not figure out how to have it call a js function to toggle the modal.

Any help is greatly appreciated. Thank you!

bergie commented 11 years ago

Take a look at the plugin example in https://github.com/bergie/hallo#writing-plugins

Also, the Link plugin is probably a good example, as it opens a dialog: https://github.com/bergie/hallo/blob/master/src/plugins/link.coffee

Gabrinthei commented 11 years ago

Wonderful, thank you! I was able to figure it out with that Link plugin example. Thanks again!