yui-debug.js revision 7610ea6bb4900ac3e259a4f299f9317f77f76971
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @module yui
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith(function() {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith add = function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return function(){};
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith remove = function() {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return function(){};
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith globalListener = function() {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith// @TODO: this needs to be created at build time from module metadata
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith// reduce to one or the other
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * The YUI global namespace object. If YUI is already defined, the
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * existing YUI object will not be overwritten so that defined
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * namespaces are preserved.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @class YUI
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @constructor
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @uses Event.Target
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param o Optional configuration object. Options:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>------------------------------------------------------------------------</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>Global:</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>------------------------------------------------------------------------</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>debug: Turn debug statements on or off</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>useBrowserConsole:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Log to the browser console if debug is on and the console is available</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>logInclude:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A hash of log sources that should be logged. If specified, only log messages from these sources will be logged.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>logExclude:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A hash of log sources that should be not be logged. If specified, all sources are logged if not on this list.</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>injected: set to true if the yui seed file was dynamically loaded in
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * order to bootstrap components relying on the window load event and onDOMReady.</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>throwFail:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * If throwFail is set, Y.fail will generate or re-throw a JS error. Otherwise the failure is logged.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * The target window/frame</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A list of modules that defines the YUI core (overrides the default)</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>dateFormat: default date format</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>locale: default locale</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>------------------------------------------------------------------------</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>For event and get:</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>------------------------------------------------------------------------</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>pollInterval: The default poll interval</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>windowResizeDelay: The time between browser events to wait before firing.</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>-------------------------------------------------------------------------</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>For loader:</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>-------------------------------------------------------------------------</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>base: The base dir</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>secureBase: The secure base dir (not implemented)</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>comboBase: The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>root: The root path to prepend to module names for the combo service. Ex: 2.5.2/build/</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>filter:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A filter to apply to result urls. This filter will modify the default
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * path for all modules. The default path for the YUI library is the
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * minified version of the files (e.g., event-min.js). The filter property
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * can be a predefined filter or a custom filter. The valid predefined
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * filters are:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <dt>DEBUG</dt>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <dd>Selects the debug versions of the library (e.g., event-debug.js).
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * This option will automatically include the Logger widget</dd>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <dt>RAW</dt>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * You can also define a custom filter, which must be an object literal
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * containing a search expression and a replace string:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * myFilter: {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * 'searchExp': "-min\\.js",
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * 'replaceStr': "-debug.js"
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>filters: per-component filter specification. If specified for a given component, this overrides the filter config</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>combine:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Use the YUI combo service to reduce the number of http connections required to load your dependencies</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>ignore:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A list of modules that should never be dynamically loaded</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>force:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A list of modules that should always be loaded when required, even if already present on the page</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>insertBefore:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Node or id for a node that should be used as the insertion point for new nodes</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>charset:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * charset for dynamic nodes</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>timeout:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * number of milliseconds before a timeout occurs when dynamically loading nodes. in not set, there is no timeout</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>context:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * execution context for all callbacks</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>onSuccess:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * callback for the 'success' event</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>onFailure:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * callback for the 'failure' event</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>onCSS: callback for the 'CSSComplete' event. When loading YUI components with CSS
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * the CSS is loaded first, then the script. This provides a moment you can tie into to improve
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * the presentation of the page while the script is loading.</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>onTimeout:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * callback for the 'timeout' event</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>onProgress:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * callback executed each time a script or css file is loaded</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * <li>modules:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * A list of module definitions. See Loader.addModule for the supported module metadata</li>
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith /*global YUI*/
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // Make a function, disallow direct instantiation
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith YUI = function(o) {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith var Y = this;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // Allow instantiation without the new operator
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith if (!(Y instanceof YUI)) {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return new YUI(o);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // set up the core environment
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // bind the specified additional modules for this instance
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith// The prototype contains the functions that are required to allow the external
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith// modules to be registered and for the instance to be initialized.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Initialize this YUI instance
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param o config options
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith _init: function(o) {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith o = o || {};
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // find targeted window/frame
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @TODO create facades
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith var v = '@VERSION@', Y = this;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith o.useBrowserConsole = ('useBrowserConsole' in o) ? o.useBrowserConsole : true;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith o.throwFail = ('throwFail' in o) ? o.throwFail : true;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // add a reference to o for anything that needs it
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // before _setup is called.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @todo expand the new module metadata
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Env._guidp = ('yui_' + this.version + '-' + Y.Env._yidx + '-' + _startTime).replace(/\./g, '_');
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // this.log(this.id + ') init ');
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Finishes the instance setup. Attaches whatever modules were defined
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * when the yui modules was registered.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @method _setup
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith _setup: function(o) {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @TODO eval the need to copy the config
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Executes a method on a YUI instance with
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * the specified id if the specified method is whitelisted.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @method applyTo
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param id {string} the YUI instance id
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param method {string} the name of the method to exectute.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Ex: 'Object.keys'
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param args {Array} the arguments to apply to the method
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @return {object} the return value from the applied method or null
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return null;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return null;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Register a module
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @method add
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param name {string} module name
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param fn {Function} entry point into the module that
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * is used to bind module to the YUI instance
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param version {string} version string
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param details optional config data:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * requires - features that should be present before loading
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * optional - optional features that should be present if load optional defined
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * use - features that should be attached automatically
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * skinnable -
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * omit - features that should not be loaded if this module is present
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @return {YUI} the YUI instance
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // this.log('Adding a new component ' + name);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @todo expand this to include version mapping
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @todo allow requires/supersedes
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @todo may want to restore the build property
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // @todo fire moduleAvailable event
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return this; // chain support
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // this.log('attaching ' + name, 'info', 'yui');
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Bind a module to a YUI instance
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param modules* {string} 1-n modules to bind (uses arguments array)
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @param *callback {function} callback function executed when
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * the instance has the required functionality. If included, it
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * must be the last parameter.
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Implement versioning? loader can load different versions?
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Should sub-modules/plugins be normal modules, or do
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * we add syntax for specifying these?
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('dragdrop')
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('dragdrop:2.4.0'); // specific version
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('dragdrop:2.4.0-'); // at least this version
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('dragdrop:2.4.0-2.9999.9999'); // version range
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('*'); // use all available modules
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('lang+dump+substitute'); // use lang and some plugins
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI().use('lang+*'); // use lang and all known plugins
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * @return {YUI} the YUI instance
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith use: function() {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return this;
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith var Y = this,
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith k, i, l, missing = [],
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith f = function(name) {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // only attach a module once
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log(name + ' already used', 'info', 'yui');
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('USING ' + name, 'info', 'yui');
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // CSS files don't register themselves, see if it has been loaded
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.log('module not found: ' + name, 'info', 'yui');
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // probably css
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('module not found BUT HAS BEEN LOADED: ' + name, 'info', 'yui');
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // make sure requirements are attached
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('using module\'s requirements: ' + name, 'info', 'yui');
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // add this module to full list of things to attach
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('adding to requires list: ' + name);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('Use complete');
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // process queued use requests as long until done
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // or dynamic load happens again.
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith this._loading = false;
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith while (this._useQueue && this._useQueue.size() && !this._loading) {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log(Y.id + ': use called: ' + a + ' :: ' + callback);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // The last argument supplied to use can be a load complete callback
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // YUI().use('*'); // bind everything available
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith for (k in mods) {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('Use *: ' + a);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // Y.log('loader before: ' + a.join(','));
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // use loader to expand dependencies and sort the
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith // requirements if it is available.
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith this._useQueue = this._useQueue || new Y.Queue();
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // Y.log('loader after: ' + a.join(','));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // process each requirement and any additional requirements
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // the module metadata specifies
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // Y.log('all reqs: ' + r + ' --- missing: ' + missing + ', l: ' + l + ', ' + r[0]);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // dynamic load
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.log('Attempting to dynamically load the missing modules ' + missing, 'info', 'yui');
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith return Y; // chain support var yui = YUI().use('dragdrop');
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Returns the namespace specified and creates it if it doesn't exist
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI.namespace("property.package");
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI.namespace("YAHOO.property.package");
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Either of the above would create YUI.property, then
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI.property.package (YAHOO is scrubbed out, this is
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * to remain compatible with YUI2)
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * Be careful when naming packages. Reserved words may work in some browsers
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * and not others. For instance, the following will fail in Safari:
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith * YUI.namespace("really.long.nested.namespace");
namespace: function() {
var a=arguments, o=null, i, j, d;
log: function() {
if (!uid) {
if (!readOnly) {
uid = null;
return uid;
YUI[i] = p[i];
var instance = Y,
if (c.debug) {
if (src) {
bail = true;
bail = true;
if (!bail) {
if (c.useBrowserConsole) {
console[f](m);
if (!_published) {
emitFacade: true
_published = true;
var L = Y.Lang,
TYPES = {
TRIMREGEX = /^\s+|\s+$/g,
L.isArray = function(o) {
L.isBoolean = function(o) {
return typeof o === BOOLEAN;
L.isFunction = function(o) {
L.isDate = function(o) {
L.isNull = function(o) {
L.isNumber = function(o) {
L.isString = function(o) {
return typeof o === STRING;
L.isUndefined = function(o) {
return typeof o === UNDEFINED;
L.trim = function(s){
L.isValue = function(o) {
var t = L.type(o);
case NUMBER:
return isFinite(o);
case NULL:
case UNDEFINED:
L.type = function (o) {
a.push(o[i]);
Y.Array = YArray;
if (L.isObject(o)) {
if (L.isArray(o)) {
f.call(o || Y, a[i], i, a);
function(a, val) {
function(a, val) {
if (a[i] === val) {
var l = a.length, i;
if (f.call(o, a[i], i, a)) {
var L = Y.Lang,
_iefix = function(r, s) {
Y.merge = function() {
Y.mix(o, a[i], true);
* @param merge {boolean} merge objects instead of overwriting/ignoring
if (mode) {
switch (mode) {
p = wl[i];
Y.mix(r[p], s[p]);
} else if (arr) {
r.push(s[p]);
} else if (arr) {
r.push(s[i]);
_iefix(r, s);
F.prototype = o;
if (count) {
out++;
if (o.hasOwnProperty(i)) {
return out;
O.keys = function(o) {
return _extract(o);
O.values = function(o) {
O.size = function(o) {
O.hasKey = function(o, k) {
O.hasValue = function(o, v) {
O.owns = function(o, k) {
return (o.hasOwnProperty(k));
f.call(s, o[i], i, o);
return UNDEFINED;
Y.UA = function() {
* http://en.wikipedia.org/wiki/Safari_(web_browser)#Version_history
mobile: null,
secure: false,
os: null
if (ua) {
var L = Y.Lang,
m = o[fn];
if (!L.isArray(d)) {
d = [data];
m.apply(o, d);
id: r,
cancel: function() {
if (this.interval) {
clearInterval(r);
clearTimeout(r);
// var min = ['yui-base', 'log', 'lang', 'array', 'core'], core, C = Y.config;
if (C.core) {
function Queue() {
this._init();
_init : function () {
this._q = [];
next : function () {
add : function () {
size : function () {
L = Y.Lang,
Y.Get = function() {
var queues={},
purging=false,
for (i in attr) {
if (attributes) {
if (attributes) {
n = q.nodes;
l = n.length;
if (q.insertBefore) {
h = s.parentNode;
h.removeChild(n[i]);
q.nodes = [];
purge: function() {
if (q && q.onEnd) {
if (q.timer) {
if (q.onFailure) {
if (q.timer) {
q.finished = true;
if (q.aborted) {
if (q.onSuccess) {
if (q.onTimeout) {
if (q.timer) {
if (q.aborted) {
if (loaded) {
if (q.varName) {
if (q.varName) {
w = q.win;
d = w.document;
if (!url) {
if (q.timeout) {
if (q.insertBefore) {
h.appendChild(n);
_autoPurge = function() {
if (purging) {
purging = true;
for (i in queues) {
q = queues[i];
delete queues[i];
purging = false;
_autoPurge();
finished: false,
nodes: []
n.onreadystatechange = function() {
n.onreadystatechange = null;
n.onload = function() {
n.onerror = function(e) {
abort: function(o) {
q.aborted = true;
* ["http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo-min.js",
* "http://yui.yahooapis.com/2.5.2/build/event/event-min.js"], {
* // o.purge(); // optionally remove the script nodes immediately
* ["http://yui.yahooapis.com/2.3.1/build/menu/assets/skins/sam/menu.css",
* "http://yui.yahooapis.com/2.3.1/build/logger/assets/skins/sam/logger.css"], {
* insertBefore: 'custom-styles' // nodes will be inserted before the specified node
* The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo?</li>
* minified version of the files (e.g., event-min.js). The filter property
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
* 'replaceStr': "-debug.js"
* <li>filters: per-component filter specification. If specified for a given component, this overrides the filter config</li>
* Use the YUI combo service to reduce the number of http connections required to load your dependencies</li>
* A list of modules that should always be loaded when required, even if already present on the page</li>
* number of milliseconds before a timeout occurs when dynamically loading nodes. in not set, there is no timeout</li>
// http://yui.yahooapis.com/combo?2.5.2/build/yahoo/yahoo-min.js&2.5.2/build/dom/dom-min.js&2.5.2/build/event/event-min.js&2.5.2/build/autocomplete/autocomplete-min.js"
META = {
skin: {
modules: {
dom: {
submodules: {
selector: {
plugins: {
node: {
submodules: {
plugins: {
anim: {
submodules: {
attribute: {
base: {
submodules: {
cache: {
compat: {
collection: {
console: {
skinnable: true,
plugins: {
skinnable: true
cookie: {
submodules: {
submodules: {
datatype:{
submodules: {
dd:{
submodules: {
dump: {
event: {
get: {
history: {
imageloader: {
io:{
submodules: {
json: {
submodules: {
loader: {
skinnable: true
oop: {
overlay: {
skinnable: true
plugin: {
profiler: {
queue: {
submodules: {
plugins: {
slider: {
skinnable: true
stylesheet: {
substitute: {
widget: {
plugins: {
skinnable: true
skinnable: true
yui: {
test: {
L = Y.Lang,
Y.Loader = function(o) {
this._internalCallback = null;
this._useYahooListener = false;
this.onSuccess = null;
this.onFailure = null;
this.onCSS = null;
this.onProgress = null;
this.onTimeout = null;
this.context = Y;
this.data = null;
this.insertBefore = null;
this.charset = null;
this.cssAttributes = null;
this.jsAttributes = null;
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
* @default http://yui.yahooapis.com/combo?
this.ignoreRegistered = false;
this.ignore = null;
this.force = null;
this.allowRollup = true;
* minified version of the files (e.g., event-min.js). The filter property
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* <dd>Selects the non-minified version of the library (e.g., event.js).</dd>
* 'replaceStr': "-debug.js"
this.filter = null;
this.filters = {};
this.required = {};
this.moduleInfo = {};
for (i in defaults) {
this._internal = true;
this._internal = false;
this.rollups = null;
this.loadOptional = false;
this.sorted = [];
this.attaching = null;
this.dirty = true;
this.inserted = {};
this.skipped = {};
this._config(o);
FILTER_DEFS: {
RAW: {
DEBUG: {
_config: function(o) {
var i, j, val, f;
if (o.hasOwnProperty(i)) {
val = o[i];
for (j in val) {
this[i] = val;
f = this.filter;
if (L.isString(f)) {
f = f.toUpperCase();
this.filterName = f;
if (mod) {
if (mod) {
this.addModule({
return name;
* <dt>after:</dt> <dd>array of modules the components which, if present, should be sorted above this one</dd>
* <dt>fullpath:</dt> <dd>If fullpath is specified, this is used instead of the configured base + path</dd>
if (!o || !o.name) {
if (!o.type) {
if (subs) {
sup = [];
for (i in subs) {
s = subs[i];
this.addModule(s, i);
if (o.skinnable) {
if (plugins) {
for (i in plugins) {
if (o.skinnable) {
this.dirty = true;
this.dirty = true;
if (!mod) {
d.push(r[i]);
m = this.getModule(r[i]);
d.push(r[i]);
m = this.getModule(r[i]);
if (o && this.loadOptional) {
d.push(o[i]);
if (m[ckey]) {
return m[ckey];
s = m.supersedes;
done = {};
me = this;
add(s[i]);
m[SUPER] = o;
return m[ckey];
calculate: function(o) {
if (o || this.dirty) {
this._config(o);
this._setup();
this._explode();
this._rollup();
this._reduce();
this._sort();
this.dirty = false;
_setup: function() {
if (m && m.skinnable) {
if (o && o[name]) {
if (!this.ignoreRegistered) {
if (this.ignore) {
if (l.hasOwnProperty(j)) {
if (this.force) {
if (this.force[i] in l) {
delete l[this.force[i]];
_explode: function() {
if (mod) {
if (expound) {
if (r.hasOwnProperty(i)) {
_rollup: function() {
for (i in info) {
m = this.getModule(i);
if (m && m.rollup) {
rollups[i] = m;
rolled = false;
for (i in rollups) {
if (!r[i] && !this.loaded[i]) {
m = this.getModule(i);
s = m.supersedes || [];
roll = false;
if (!m.rollup) {
if (this.loaded[s[j]]) {
roll = false;
if (roll) {
if (roll) {
rolled = true;
this.getRequires(m);
if (!rolled) {
_reduce: function() {
var i, j, s, m, r=this.required;
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
s = m && m.supersedes;
_attach: function() {
if (this.attaching) {
_finish: function() {
this._continue();
_onSuccess: function() {
this._attach();
for (i in skipped) {
delete this.inserted[i];
this.skipped = {};
f = this.onSuccess;
success: true
this._finish();
_onFailure: function(o) {
this._attach();
var f = this.onFailure;
success: false
this._finish();
_onTimeout: function() {
this._attach();
var f = this.onTimeout;
success: false
this._finish();
_sort: function() {
p, l, a, b, j, k, moved,
if (ss) {
l = s.length;
moved = false;
if (requires(a, s[k])) {
moved = true;
if (moved) {
if (!moved) {
this.sorted = s;
if (source) {
this.calculate(o);
if (!type) {
var self = this;
this._internalCallback = function() {
this._loading = true;
this._combineComplete = {};
this.loadNext();
_continue: function() {
this._continue();
if (!this._loading) {
callback=function(o) {
this.inserted[c[i]] = true;
onsuccess=function(o) {
this._combining = [];
s=this.sorted;
m = this.getModule(s[i]);
autopurge: false,
if (mname) {
if (this.onProgress) {
s=this.sorted;
if (s[i] in this.inserted) {
if (s[i] === this._loading) {
m = this.getModule(s[i]);
this.inserted[s[i]] = true;
this.skipped[s[i]] = true;
this._loading = s[i];
data: s[i],
autopurge: false,
this._loading = null;
if (fn) {
this._internalCallback = null;
this._onSuccess();
var f = this.filter,
if (hasFilter) {