[wp-hackers] Buttonsnap updates?

John Vanderbeck jwvanderbeck at gmail.com
Wed Apr 12 10:21:27 GMT 2006


Hey all,

This is my first post to the the list, and my apologies if this isn't list
material.  I tend to just lurk on the list and grab bits of useful
information :)  However I know others use this library as well, and since
this its a singleton this would affect anyone else who uses it in thier
plugin.

Recently I was using buttonsnap to add buttons for my plugin, jPortfolio (
http://www.jwvanderbeck.com/wordpress-plugins/jportfolio/), and ran  into a
bug in the library that prevents the AJAX Filter based button from working
properly under Firefox when using the "basic" editor, not the visual rich
editor.  Upon further research I found that the code was using a javascript
method for getting the selection that is not supported on all browsers
(There is to my knowledge no standard method for getting the selection).  My
research showed the method used mainly only worked on IE based browsers, and
possibly Opera, but not Mozilla based browsers.

I dug around a bit, and rewrote the code to use a combination of methods to
try and get the selection from the browser and now have code that works, as
far as I can tell throguh some quick testing, on all major browsers.  It
worked for me under IE 6, FireFox (Latest), and Opera (Latest).  Since it
works under FireFox it SHOULD also work under Mozilla but I did not test
that.

I was wondering what I would need to do to get this code change rolled into
buttonsnap in some form?  Since this is a singleton class it really needs to
be updated for everyone that uses it or else problems may develop.

Thank you for your time :)

--
- John Vanderbeck
- http://www.jwvanderbeck.com


More information about the wp-hackers mailing list