Forum OpenACS Development: Re: Supporting tinymce in xowiki

Collapse
Posted by Dave Bauer on
I have a request from a client to make the entire config object for TinyMCE available as a parameter.

I think it makes sense to modify the Xinha support to work in a similar way, instead of having a parameter for each seperate attribute of the config object. Right now Xinha config has two parameters, for plugins and toolbar buttons.

The basic structure would be a tcl list in array format of the attribute name and value.

I decided on a list after noticing that the current xinha support allows overriding the config with a parameter passed to the ad_form element delcaration. This way it would be possible to override the default config attributes on an individual basis for one richtext element by specifying a list of attribute names and values for that element. Then when the richtext widget is created it will be posible to loop through the default config and replace any overridden attributes with the element specific ones.

I should have an implementation of this by the beginning of next week, for review.

If anyone has a better idea please share. This seemed like the most flexible way to handle it that supports the current richtext requirements and allows more general support for TinyMCE and Xinha.

Collapse
Posted by Dave Bauer on
Hey everyone,

I got Tinymce 2.1.3 working on HEAD (can merge into 5.4 if people want).

BUT

Because tinymce requires a little different style of configuration, I really want to put the entire config object in a parameter, instead of just the plugins.

I can reuse the XinhaDefaultPlugins parameter and just stick the config into that.

Alternatively I cna adda new paremter

RichtextConfig or someting along those lines.

For now we have a reasonable deafault setup that seems to work ok.

I am checking in the code to HEAD using XinhaDefaultPlugins as the parameter for now.

Collapse
Posted by Gustaf Neumann on
If people want to switch between Xinha and tinymce, it looks as a bad idea to use the same parameter with different content for Xinha and TinyMCE. How about introducing a parameter TinyMCE_Config?
Collapse
Posted by Don Baccus on
I agree with Gustaf.
Collapse
Posted by Emmanuelle Raffenne on
Hi Dave,

I had a look at TinyMCE and I liked it a lot, nice work!. I had to tweak it a bit to make the "openacs" theme work on HEAD (committed) but couldn't make the oacsimage and oacslink plugins work. It will need some HTML strict cleanup too.

Tinymce on HEAD is version 2.1.3, the last one available is 3.1.1. I think we should upgrade, I can help with that. Right now, only english is available but if we upgrade, we'll be able to provide all the available languages (http://services.moxiecode.com/i18n/). The downside is that the API has changed in version 3.x so we'd have to adapt the oacs plugins and openacs theme, but it won't require too much effort I guess.

I agree that new parameter(s) should be created to hold the tinymce configuration. It may be worth to separate the different section of the configuration into different parameters (see http://wiki.moxiecode.com/index.php/TinyMCE:Configuration for reference): one parameter for the theme configuration, one for plugins, and one for general stuff. One might want to use the openacs theme but not the oacs plugins, in this case, the default would be kept for the theme parameters and the user would have to edit the plugins one only.