Using inputEx with YUI3
This page describe a way to use inputEx with YUI3. It's kind of hack, so pay attention to the instructions on this page. It is made to be a compatibility layer before the inputEx YUI3 native implementation.
Step 1 - Seed files
First, we obviously need to insert YUI3 seed file to the page, and the js/yui3-loader.js file which declares inputEx modules to YUI3.
Step 2 - two-stage loading
The latest version of inputEx doesn't use YUI2 modules. For this reason, we have to :
- Make the YUI2 instance global (so it's not compatible with sandboxing)
- load YUI2 before requiring any inputEx module (inputEx code is not wrapped in function calls, so the YAHOO global object must be present before loading the files)
That's it ! Note that the module names have changed from the YUI2 loader: it's not inputex-stringfield anymore, but inputex-string instead.
How does it work ?
To achieve this, inputEx's yui3-loader.js declares two additional modules, which :
- make the YUI2 instance global (first stage)
- load inputEx & alias inputEx to Y.inputEx (second stage)
Loading from a local yui2in3 directory
If you want to serve the YUI2 library locally, the classic YUI2 distribution won't work. You will need to download yui2in3 and setup the loader as below :