Re: Re: Modifying the YUI Rich Text Editor buttons

Posted by David McIntyre on
URL: https://discuss.orbeon.com/Modifying-the-YUI-Rich-Text-Editor-buttons-tp998305p999591.html

I made a change along these lines a while ago.  In xforms.js, replace the declaration of yuiRTE with something like

            // Create RTE object, using a default config unless YUI_RTE_CUSTOM_CONFIG is defined
            var config = {
                // Don't set width/height (done in CSS)
            };
            var yui_config_type_check = typeof YUI_RTE_CUSTOM_CONFIG;
            if (yui_config_type_check != 'undefined') {
                config = YUI_RTE_CUSTOM_CONFIG;
            }
           
            var yuiRTE = new YAHOO.widget.Editor(control, config);


and then include some suitable javascript declaration of the variable YUI_RTE_CUSTOM_CONFIG.  However, I seem to recall that this involved some other tweaks to arrange that xforms.js gets loaded with defer="defer" so that the variable is available to be checked.


Alessandro Vernet wrote:
Ethan,

For this, you will only need to change the code in xforms.js. Like you
said, that file is in a jar file, so you'll want to extract it, and
put the extracted file, which you will modify, in your resources,
under the same path, so it overrides the one in the jar file. You'll
find more on JavaScript development for Orbeon Forms here:

http://wiki.orbeon.com/forms/doc/contributor-guide/javascript-development

Then in xforms.js search for rteConfig, and you'll find the place
where the RTE toolbar is initialized. As you'll see, this has not been
designed for extensibility ;), so let us know if you have suggestions
on how to make the RTE more easily configurable.

Alex

On Monday, January 4, 2010, Ethan Gruber [hidden email] wrote:
  
Hello,

I'd like to modify the YUI RTE code to add plugins for a new set of buttons, which should be possible according to here: http://developer.yahoo.com/yui/editor/#toolbar .  Has anyone sucessfully done this before?  Where do I get started?  I assume the js is contained in a jar file.

Thanks,
Ethan

    

  

--
Orion Signature

Dave McIntyre Development Team Lead
[hidden email]
P: +64 9 638 0600
M: +64 21 212 8087
F: +64 9 638 0699
S: <a href="callto:dave.mcintyre">dave.mcintyre
www.orionhealth.com


This e-mail and any attachments are intended only for the person to whom it is addressed and may contain privileged, proprietary, or other data protected from disclosure under applicable law. If you are not the addressee or the person responsible for delivering this to the addressee you are hereby notified that reading, copying or distributing this transmission is prohibited. If you have received this e-mail in error, please telephone us immediately and remove all copies of it from your system. Thank you for your co-operation.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4746 (20100105) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws