Forum OpenACS Q&A: Re: Ajaxhelper, YUI and xowiki

Collapse
Posted by Gustaf Neumann on
if you build on the xowiki-includelet infrastructure, i would recommend to use the same mechanism that the other 50+ includelet classes in xowiki use, namely require_YUI_CSS and require_YUI_JS. These functions allow you to use either locally installed versions (per default from the ajaxhelper package) for internet-free execution, or to use versions from the Yahoo content distribution network (yui.yahooapis.com). This is controlled via the ajaxhelper switch (it does not use the package - such as the ajaxhelper loader etc - just the files).

The require_YUI* methods provide an xowiki-specific configuration for all YUI needs in xowiki and friends. These functions control as well the YUI version numbers. The preconfigured version is YUI 2.7.0. In general, i would not recommend to mix YUI versions. Not all newer YUI versions are fully upward compatible, i had to step back e.g. from 2.8.* to 2.7.0 due to changes in drag and drop. If you use multiple YUI components from different YUI versions on a single page, you are probably asking for troubles.

Collapse
Posted by Richard Hamilton on
Right! Ok, thank you.

According to the YUI3 docs, YUI3 is completely encapsulated (they say sandboxed) so that it can co-exist safely with other instances of YUI3 and various YUI2 versions. However, I am in no hurry to create additional problems for myself! :-)

I think I will thrash this through using YUI2 and worry about migrating to YUI3 later.

R.