designcreateplay/NodeBB — pull request #1409 by miksago (2014-04-19 14:18:05+00:00)
Title: Composer: Implement formatting bar dispatch table

This should reduce the complexity of the code, but it's still got quite some way to go. In the future, the formatting bar should actually use data-action attributes, instead of classnames for figuring out which action to take, which would be nicer. I'm also going to attempt merging the `wrapSelectionInTextareaWith` and `insertIntoTextarea` function, which will further simplify the code.

I've also taken then liberty to make ALL the formatting buttons use the dispatch table, rather than some being hooked up with their own click events.

BONUS POINTS: This may enable plugins to later hook in, and add extra buttons to the formatting bar. How cool is that?