I'm currently using the TinyMCE Styleselect menu to add CSS classes into the WordPress editor. This has worked OK for me so far and is great if you only have a few classes that you want to use. When I have added more classes however, the styleselect dropdown becomes a little un-user friendly as you have to scroll through the options which can also make the page scroll also.
The solution I want to implement involves a button in the tinymce toolbar that when clicked will open a popup window, from which you can select a class to apply to the selected text in the editor.
I know how to add custom buttons to tinymce and create the popup window but how do I make the buttons that add the class actually apply the class to the the selection?
Anybody any ideas of the code I need to use to do this or a tutorial detailing the above would be great.