[wp-testers] CSS in WYSIWYG

Isaac Wedin isaac at wedin.org
Thu Dec 15 17:19:06 GMT 2005


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.

Isaac

On Wed, 2005-12-14 at 16:36 -0600, Andy Skelton wrote:
> On 12/14/05, Owen Winkler <ringmaster at midnightcircus.com> wrote:
> > "editor_image_classes"?  Are you thinking to limit the dropdown to
> > applying classes to only images or would there be an additional filter
> > to supply classes for paragraphs or new spans or whatever else might be
> > selected?
> 
> The existing UI I referenced was in the image popup, nowhere else.
> Adding classes within the editor itself is not existing functionality
> and this coder isn't even thinking about doing it. I want it to be
> possible to do what you suggest from a plugin. Strictly speaking, one
> should even be able to add a plugin to TinyMCE without dropping
> anything in the tinymce/plugins folder.
> 
> How? Well, I just thought of a way. We already have filters to modify
> the tinymce plugin list and three rows of icons. We're already
> processing the JS through a WP instance in tiny_mce_gzip.php. A few
> new hooks here and there would enable a plugin OR theme coder to
> include their own tinymce plugin JS. Something like this:
> 
> add_action('post_tinymce', 'my_plugin_js');
> function my_plugin_js() { ?>
> // javascript goes here
> // strings wrapped in <?php _e('...') ?> for translation
> <?php }
> 
> What fun! I'll see about a patch to make this possible. And because JS
> functions can be redeclared, if I just put the action hook below all
> of the stock js you'll have total control over your RTE from a plugin
> or theme. Be very careful! :-)
> 
> > I foresee a future in which theme authors ask each other, "Which
> > functions.php are you using?"
> 
> Now THAT is cool. "I took the CSS parser and the dropdown plugin from
> redalt and used the admin page generator from somewhere else and..."
> 
> Andy
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
> 
-- 
Isaac Wedin <isaac at wedin.org>



More information about the wp-testers mailing list