API Docs for: 3.5.1
Show:

config Class

Defined in: yui/js/yui.js:1316
Module: yui-base
Parent Module: yui

The config object contains all of the configuration options for the YUI instance. This object is supplied by the implementer when instantiating a YUI instance. Some properties have default values if they are not supplied by the implementer. This should not be updated directly because some values are cached. Use applyConfig() to update the config object on a YUI instance that has already been configured.

Methods

useNativeES5

()

Defined in yui/js/yui.js:1821

Available since 3.5.0

Whether or not YUI should use native ES5 functionality when available for features like Y.Array.each(), Y.Object(), etc. When false, YUI will always use its own fallback implementations instead of relying on ES5 functionality, even when it's available.

Properties

2in3

String

Defined in yui/js/yui.js:1751

Available since 3.1.0

The 2in3 project is a deployment of the various versions of YUI 2 deployed as first-class YUI 3 modules. Eventually, the wrapper for the modules will change (but the underlying YUI 2 code will be the same), and you can select a particular version of the wrapper modules via this config.

Default: 4

aliases

Object

Defined in yui/js/yui.js:1652

Aliases are dynamic groups of modules that can be used as shortcuts.

 YUI({
     aliases: {
         davglass: [ 'node', 'yql', 'dd' ],
         mine: [ 'davglass', 'autocomplete']
     }
 }).use('mine', function(Y) {
     //Node, YQL, DD & AutoComplete available here..
 });

base

String

Defined in yui/js/yui.js:1466

Base directory for dynamic loading

bootstrap

Boolean

Defined in yui/js/yui.js:1329

Allows the YUI seed file to fetch the loader component and library metadata to dynamically load additional dependencies.

Default: true

cacheUse

Boolean deprecated

Defined in yui/js/yui.js:1812

Deprecated: no longer used

Available since 3.3.0

Cache serviced use() requests.

Default: true

combine

Boolean

Defined in yui/js/yui.js:1557

Use the YUI combo service to reduce the number of http connections required to load your dependencies. Turning this off will disable combo handling for YUI and all module groups configured with a combo service.

For dynamic loading.

Default: true if 'base' is not supplied, false if it is.

comboBase

String

Defined in yui/js/yui.js:1479

The YUI combo service base dir. Ex: http://yui.yahooapis.com/combo? For dynamic loading.

core

Array

Defined in yui/js/yui.js:1406

A list of modules that defines the YUI core (overrides the default list).

Default: [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]

cssAttributes

String

Defined in yui/js/yui.js:1600

Object literal containing attributes to add to dynamically loaded link nodes.

dateFormat

String deprecated

Defined in yui/js/yui.js:1427

Deprecated: use configuration in `DataType.Date.format()` instead.

The default date format

debug

Boolean

Defined in yui/js/yui.js:1338

Turns on writing Ylog messages to the browser console.

Default: true

doc

Document

Defined in yui/js/yui.js:1398

The document associated with the 'win' configuration.

Default: the document hosting YUI

errorFn

Function

Defined in yui/js/yui.js:1772

Available since 3.2.0

A callback to execute when Y.error is called. It receives the error message and an javascript error object if Y.error was executed because a javascript error was caught. The function is executed in the YUI instance context. Returning true from this function will stop the Error from being thrown.

fetchCSS

Boolean | String

Defined in yui/js/yui.js:1722

Specifies whether or not YUI().use(...) will attempt to load CSS resources at all. Any truthy value will cause CSS dependencies to load when fetching script. The special value 'force' will cause CSS dependencies to be loaded even if no script is needed.

Default: true

filter

String | Object

Defined in yui/js/yui.js:1494

A filter to apply to result urls. This filter will modify the default path for all modules. The default path for the YUI library is the minified version of the files (e.g., event-min.js). The filter property can be a predefined filter or a custom filter. The valid predefined filters are:

DEBUG
Selects the debug versions of the library (e.g., event-debug.js). This option will automatically include the Logger widget
RAW
Selects the non-minified version of the library (e.g., event.js).

You can also define a custom filter, which must be an object literal containing a search expression and a replace string:

 myFilter: {
     'searchExp': "-min\\.js",
     'replaceStr': "-debug.js"
 }

For dynamic loading.

filters

Unknown

Defined in yui/js/yui.js:1548

Hash of per-component filter specification. If specified for a given component, this overrides the filter config.

For dynamic loading.

force

String[]

Defined in yui/js/yui.js:1577

A list of modules that should always be loaded when required, even if already present on the page.

groups

Object

Defined in yui/js/yui.js:1669

A hash of module group definitions. It for each group you can specify a list of modules and the base path and combo spec to use when dynamically loading the modules.

 groups: {
     yui2: {
         // specify whether or not this group has a combo service
         combine: true,

         // The comboSeperator to use with this group's combo handler
         comboSep: ';',

         // The maxURLLength for this server
         maxURLLength: 500,

         // the base path for non-combo paths
         base: 'http://yui.yahooapis.com/2.8.0r4/build/',

         // the path to the combo service
         comboBase: 'http://yui.yahooapis.com/combo?',

         // a fragment to prepend to the path attribute when
         // when building combo urls
         root: '2.8.0r4/build/',

         // the module definitions
         modules:  {
             yui2_yde: {
                 path: "yahoo-dom-event/yahoo-dom-event.js"
             },
             yui2_anim: {
                 path: "animation/animation.js",
                 requires: ['yui2_yde']
             }
         }
     }
 }

ignore

String[]

Defined in yui/js/yui.js:1570

A list of modules that should never be dynamically loaded

injected

Boolean

Defined in yui/js/yui.js:1371

Set to true if the yui seed file was dynamically loaded in order to bootstrap components relying on the window load event and the domready custom event.

Default: false

insertBefore

String

Defined in yui/js/yui.js:1585

Node or id for a node that should be used as the insertion point for new nodes. For dynamic loading.

jsAttributes

String

Defined in yui/js/yui.js:1593

Object literal containing attributes to add to dynamically loaded script nodes.

lang

String | String[]

Defined in yui/js/yui.js:1414

A list of languages in order of preference. This list is matched against the list of available languages in modules that the YUI instance uses to determine the best possible localization of language sensitive modules. Languages are represented using BCP 47 language tags, such as "en-GB" for English as used in the United Kingdom, or "zh-Hans-CN" for simplified Chinese as used in China. The list can be provided as a comma-separated list or as an array.

loaderPath

String

Defined in yui/js/yui.js:1712

The loader 'path' attribute to the loader itself. This is combined with the 'base' attribute to dynamically load the loader component when boostrapping with the get utility alone.

Default: loader/loader-min.js

loadErrorFn

Function

Defined in yui/js/yui.js:1784

Available since 3.3.0

A callback to execute when the loader fails to load one or more resource. This could be because of a script load failure. It can also fail if a javascript module fails to register itself, but only when the 'requireRegistration' is true. If this function is defined, the use() callback will only be called when the loader succeeds, otherwise it always executes unless there was a javascript error when attaching a module.

locale

String deprecated

Defined in yui/js/yui.js:1434

Deprecated: use `config.lang` instead.

The default locale

logExclude

Object

Defined in yui/js/yui.js:1363

A hash of log sources that should be not be logged. If specified, all sources are logged if not on this list.

logFn

Function

Defined in yui/js/yui.js:1763

Available since 3.1.0

Alternative console log function for use in environments without a supported native console. The function is executed in the YUI instance context.

logInclude

Object

Defined in yui/js/yui.js:1355

A hash of log sources that should be logged. If specified, only log messages from these sources will be logged.

modules

Object

Defined in yui/js/yui.js:1625

A hash of module definitions to add to the list of YUI components. These components can then be dynamically loaded side by side with YUI via the use() method. This is a hash, the key is the module name, and the value is an object literal specifying the metdata for the module. See Loader.addModule for the supported module metadata fields. Also see groups, which provides a way to configure the base and combo spec for a set of modules.

 modules: {
     mymod1: {
         requires: ['node'],
         fullpath: '/mymod1/mymod1.js'
     },
     mymod2: {
         requires: ['mymod1'],
         fullpath: '/mymod2/mymod2.js'
     },
     mymod3: '/js/mymod3.js',
     mycssmod: '/css/mycssmod.css'
 }

onCSS

Function

Defined in yui/js/yui.js:1614

Callback for the 'CSSComplete' event. When dynamically loading YUI components with CSS, this property fires when the CSS is finished loading but script loading is still ongoing. This provides an opportunity to enhance the presentation of a loading page a little bit before the entire loading process is done.

pollInterval

Int

Defined in yui/js/yui.js:1441

The default interval when polling in milliseconds.

Default: 20

purgethreshold

Int

Defined in yui/js/yui.js:1448

The number of dynamic nodes to insert by default before automatically removing them. This applies to script nodes because removing the node will not make the evaluated script unavailable. Dynamic CSS is not auto purged, because removing a linked style sheet will also remove the style definitions.

Default: 20

requireRegistration

Boolean

Defined in yui/js/yui.js:1799

Available since 3.3.0

When set to true, the YUI loader will expect that all modules it is responsible for loading will be first-class YUI modules that register themselves with the YUI global. If this is set to true, loader will fail if the module registration fails to happen after the script is loaded.

Default: false

root

String

Defined in yui/js/yui.js:1486

The root path to prepend to module path for the combo service. Ex: 3.0.0b1/build/ For dynamic loading.

skin

Unknown

Defined in yui/js/yui.js:1521

The skin config let's you configure application level skin customizations. It contains the following attributes which can be specified to override the defaults:

 // The default skin, which is automatically applied if not
 // overriden by a component-specific skin definition.
 // Change this in to apply a different skin globally
 defaultSkin: 'sam',

 // This is combined with the loader base property to get
 // the default root directory for a skin.
 base: 'assets/skins/',

 // Any component-specific overrides can be specified here,
 // making it possible to load different skins for different
 // components.  It is possible to load more than one skin
 // for a given component as well.
 overrides: {
     slider: ['capsule', 'round']
 }

For dynamic loading.

throwFail

Boolean

Defined in yui/js/yui.js:1381

If throwFail is set, Y.error will generate or re-throw a JS Error. Otherwise the failure is logged.

Default: true

timeout

Int

Defined in yui/js/yui.js:1607

Number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout.

useBrowserConsole

Boolean

Defined in yui/js/yui.js:1346

Log to the browser console if debug is on and the browser has a supported console.

Default: true

useHistoryHTML5

Boolean

Provided by the history-html5 module.

Defined in history/js/history-html5.js:143

Available since 3.2.0

If true, the Y.History alias will always point to Y.HistoryHTML5 when the history-html5 module is loaded, even if the current browser doesn't support HTML5 history.

If false, the Y.History alias will always point to Y.HistoryHash when the history-hash module is loaded, even if the current browser supports HTML5 history.

If neither true nor false, the Y.History alias will point to the best available history adapter that the browser supports. This is the default behavior.

win

Window

Defined in yui/js/yui.js:1390

The window/frame that this instance should operate in.

Default: the window hosting YUI

windowResizeDelay

Int

Defined in yui/js/yui.js:1459

The default interval when polling in milliseconds.

Default: 40

yui2

String

Defined in yui/js/yui.js:1740

Available since 3.1.0

The default YUI 2 version to build yui2 module urls. This is for intrinsic YUI 2 support via the 2in3 project. Also see the '2in3' config for pulling different revisions of the wrapped YUI 2 modules.

Default: 2.9.0