[Yanel-dev] Suppress Yanel Toolbar for TinyMCE calls
Michael Wechner
michael.wechner at wyona.com
Tue May 25 14:09:46 CEST 2010
Guillaume Déflache wrote:
>>
>> 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
> + // }
yes, whereas I have added it now as comment/TODO
>
>
>> 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
that's a backwards compatibility question ;-)
> - 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
you mean move this "if" code into a separate method?
>
> 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.
can you give an example?
Thanks
Michi
>
>>
>> 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