[wp-hackers] tinyMCE in 3.1

Stas Sușcov stas at nerd.ro
Wed Mar 9 17:42:43 UTC 2011


Hi,
I have some questions about tinyMCE in WordPress 3.1.

Can you provide an example block of code on how to integrate tinyMCE
with media upload with custom textareas using WordPress api?

If prior to 3.1 I was able to manipulate `edCanvas` global value and
achieve any kind of integration, the new 3.1 js is totally "broken".

Lets start with some code review....

https://github.com/dxw/wordpress/blob/v3.1/wp-admin/js/media-upload.dev.js#L65
Why WordPress asks me to have a tinyMCE instance on an element with
`#content` ? Can we make some checks before ensuring a `#content`
element exists?

https://github.com/dxw/wordpress/blob/v3.1/wp-admin/js/media-upload.dev.js#L5
Why `ed` is not `edCanvas`, because of previous line and this one, even
if I will "init" new `tinyMCE.editors` I will never gonna be able to
`send_to_editor()` until I will `tinyMCE.editors.content.destroy()` that
`#content` instance.

I would love to get some explanations, because with the current code,
it's impossible to integrate the so famous tinyMCE with a plugin. More
important, even if I will be able to integrate tinyMCE with my own
textarea, it will `tinyMCE.triggerSave()` with an error, which will lead
to unsynced textareas, this way loosing data on ajax saving.

Thanks in advance.



More information about the wp-hackers mailing list