FW: [wp-hackers] Buttonsnap for WordPress 2.1 ?

Per Søderlind per at soderlind.no
Fri Jan 12 01:13:17 GMT 2007


Attached you'll find Owens comments

../Per

Owen Winkler wrote:
> 
> Per Søderlind wrote:
> > FYI, in case you haven't seen it :)
> 
> Sheesh...
> 
> >
> > http://trac.wordpress.org/ticket/3563
> >
> > Anyone want to update and integrate?
> 
> It shouldn't be done this way.
> 
> Buttonsnap provides really simple PHP-based functions to add new
> buttons
> (that also can react via ajax), but then it inserts javascript into the
> page that looks for certain elements in the TinyMCE toolbar after which
> it can insert new, synthetic buttons.
> 
> Being that there is a way to add TinyMCE extensions via javascript
> already in the TinyMCE source, someone should write a TinyMCE plugin
> that takes its cues from PHP via some functions that are more easily
> called in a plugin.  The difficulty with the existing code is that
> TinyMCE plugins are much harder to write than WP plugins. This should
> be
> approached by correctly thinking about how a plugin author would like
> to
> add buttons to the toolbar rather than forcing them to sink the TinyMCE
> hook and supply a whole javascript module from within their plugin.
> 
> The matter with the buttonsnap code is not just that the TinyMCE
> toolbar
> HTML is a moving target for the insertion script, but also that the
> buttons are being inserted via a total hack.
> 
> If I was rewriting this for core, I might keep the PHP function calls,
> but toss the javascript part entirely for a TinyMCE plugin that was
> somehow linked to those functions.
> 
> Anyway, seeing as I'm not subscribed to the wp-hackers list at the
> moment (something completely to do with the s/n ratio there), I
> wouldn't
> mind if you could relay this message to the list.  Or keep the
> knowledge
> to yourself.  I'm sure someone will discover how kludgey my buttonsnap
> plugin is in short order.  ;)
> 
> Thanks for passing this on, Per.
> 
> Owen




More information about the wp-hackers mailing list