Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Upgrading, changing, or overwriting the native YUI installation in Liferay is extremely difficult, because of two reasons. One, Liferay 6.0's UI framework (Alloy) runs on YUI 3.2.0. Two, the native portal template instantiates alloy ui onto the global YUI object (YUI.AUI), which is awful, as it makes the YUI framework tightly coupled to the <strong>horrifically implemented AUI</strong>. Your browser calls this AUI reference, on the YUI object, as the page is loading and after the window.onload event. If you try to replace or modify the global YUI object, it screws up Alloy, which Liferay's UI runs on.</p> <p>Since upgrading is out of the question, the next best alternative is to bring in just the new YUI modules you want to use. Also, you could try out Liferay 6.1 CE, which has 3.4.1 built in, but it looks like its still in beta testing.</p> <p>Here's an example of bringing in and using the dom-core module from YUI 3.4.1 and using it in Liferay 6, which runs on YUI 3.2.0. I got the idea from YUI's docs on how to bring YUI 2 modules into 3 (<a href="http://yuilibrary.com/yui/docs/yui/yui-loader-ext.html" rel="nofollow">http://yuilibrary.com/yui/docs/yui/yui-loader-ext.html</a>). To quickly figure out dependencies each module has, you can use YUI's online configurator <a href="http://yuilibrary.com/yui/configurator/" rel="nofollow">http://yuilibrary.com/yui/configurator/</a>.</p> <pre><code>var config = { ignore : ["skin-sam-overlay","skin-sam-widget","skin-sam-widget-stack","skin-sam-tabview"], groups: { yui341: { base: '/js/yui-3.4.1/build/', modules: { yui341_yui_base: { path: 'yui-base/yui-base.js' }, yui341_oop: { path: 'oop/oop.js', requires: ['yui341_yui_base'] }, yui341_features: { path: 'features/features.js', requires: ['yui341_yui_base'] }, yui341_dom_core: { path: 'dom-core/dom-core.js', requires: ['yui341_yui_base','yui341_oop','yui341_features'] } } } } }; YUI(config).use('yui341_dom_core',function(Y){ //YUI 3.4.1 config modules are now accessable through 'use' call console.log(Y.version); //say hello to the newer version (3.4.1) Y.use('dom-core',function(Y){ //Finally have access to native 3.4.1 module console.log(Y.DOM); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload