[wp-hackers] Re: [wp-testers] CSS in WYSIWYG
ringmaster at midnightcircus.com
Fri Dec 16 14:00:44 GMT 2005
Andy Skelton wrote:
> On 12/15/05, Isaac Wedin <isaac at wedin.org> wrote:
>>I'd *love* to see some hooks for TinyMCE in the plugin API. I've gotten
>>the images popup tool in my plugin (Photopress) to more-or-less work by
>>including tiny_mce_popup.js and using tinyMCE.insertimage(). I'd like to
>>see a simple way to add a button to the TinyMCE toolbar, and a way to
>>specify a CSS class for inserted images.
> That's clever work! There's a filter for the toolbar icons in
> tiny_mce_gzip.php: mce_buttons.
Following is the URL to my buttonsnap library for adding buttons to the
WordPress 2.0 editors. It adds buttons to both the RTE and the textarea
(regardless of user settings) by adding a single include and one line of
php for each button.
There are three possibilities for the action of added buttons:
* You can directly replace the selected text in the editor with a fixed
* You can directly replace the selected text in the editor with a value
returned from a WordPress plugin hook.
Read that last one again.
Here's an example:
buttonsnap_ajaxbutton($button_image_url3, 'Ajax Button', 'my_hook');
return '<del datetime="' . date('Y-m-d H:i:s') . '">' . $selectedtext .
compatible with *both* editors.
I'm interested in comments or updates.
More information about the wp-hackers