[Yanel-dev] Suppress Yanel Toolbar for TinyMCE calls

Guillaume Déflache guillaume.deflache at wyona.com
Fri May 21 09:30:55 CEST 2010


Hi!

Michael Wechner schrieb:
> Michael Wechner wrote:
>> Michael Wechner wrote:
>>> Hi
>>>
>>> TinyMCE sends various requests to the server, for example if one 
>>> wants to edit a link within a text
>>>
>>> /yanel/globus/app/javascripts/tiny_mce_3_3_5_1/themes/advanced/link.htm
>>>
>>> The problem now is that if the Yanel toolbar is activated, then Yanel 
>>> will treat this as a regular HTML page
>>> and hence will add the toolbar.
>>>
>>> According to
>>>
>>> http://yanel.org/en/documentation/yanel-toolbar.html
>>>
>>> one can suppress the toolbar by adding a query string, but I guess 
>>> this would mean one has to customize
>>> the out-of-the-box TinyMCE version, which is not that nice.
>>>
>>> Any idea how to best solve this?
> 
> it seems to me that it would be best to solve this via a check on the 
> resource configuration:
> 
> src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java
> 
>             if (yanelUI.isToolbarEnabled(request)) {
> +                // if (res.getResConfiguration("toolbar

You mean something like:
+                // if 
("suppress".equals(res.getResConfiguration("yanel.toolbar"))) {
+                //     //TODO hide toolbar for this request only
+                // }


>                 if (mimeType != null && mimeType.indexOf("html") > 0) {
> -                    // TODO: What about other query strings or frames 
> or TinyMCE?
> -                    if (request.getParameter(YANEL_RESOURCE_USECASE) == 
> null) {
> +                    // TODO: What about other query strings or frames 
> or TinyMCE (e.g. link.htm)?
> +                    if (request.getParameter(YANEL_RESOURCE_USECASE) == 
> null) { // INFO: In the case of a yanel resource usecase do NOT add the 
> toolbar
>                         if (toolbarMasterSwitch.equals("on")) {
> 
> WDYT?

I think it would be nice provided:
- we have a documentation page with states that:
   - "yanel.toolbar" is a "global RC property" and explain it
   - all RC properties names that start with "yanel.*" are reserved names
- maybe we refactor the code a little bit here to avoid the deeply 
nested conditionals: perhaps make a "possiblyEmbedToolbar" function that 
only returns early in all the cases where toolbar does not get embedded

If this somehow does not work, we could instead honor a "yanel.toolbar" 
request attribute which can be set from the resource-type's Java code.

> 
> Cheers
> 
> Michi
>>
>> Somehow related is the following article:
>>
>> http://www.tyssendesign.com.au/articles/removing-unwanted-fields-tinymce-image-link-popups/ 

Looks like an interesting read if we want to unclutter / simplify 
/constrain TinyMCE screens further indeed.

HTH,
    Guillaume


More information about the Yanel-development mailing list