YUI Class
Item Index
Methods
Methods
delay
-
callbackFunction
-
delayAmount
Pass in a callback function and the amount of time to delay. Y.delay will return a function that will wait an amount of time, then call your callback function. The arguments and execution context of this function will be passed to the callback function. This function returns an object with a cancel method which will prevent the execution of the callback function once the delay timer has begun. If the amount of time to delay is less than 0, the original callback function is returned. If the amount of time to delay is 0 and the gallery-soon module is available, the delay will be as small as possible but your callback function will be guaranteed to be called in a future turn of the javascript event loop.
Parameters:
Returns:
gravatarUrl
-
options
-
callbackFunction
-
contextObject
Create a gravatar image url.
Parameters:
-
options
ObjectAn object with the following optional properties:
- defaultImage
- This could be a string url to an image to use when there is no matching gravatar image or it could be one of the following values: '404', 'mm', 'identicon', 'monsterid', 'wavatar', or 'retro' Refer to gravatar's documentation: http://en.gravatar.com/site/implement/images/
- The user's e-mail address.
- force
- If this is a truthy value, it will force the default image to load even if there is a matching gravatar image.
- rating
- The maximum image rating that is allowed to load. It could be one of the following values: 'g', 'pg', 'r', 'x' Defaults to 'g'. Refer to gravatar's documentation: http://en.gravatar.com/site/implement/images/
- secure
- If this is a truthy value, the url will use the secure https protocol.
- size
- An integer representing the height and width of the image in pixels. Values from 1 to 512 inclusive are supported. Gravatar images are square.
-
callbackFunction
FunctionThis function receives the gravatar url as its only parameter.
-
contextObject
Object(optional) An object to provide as the execution context for the callback function.
lazyLoad
-
modules
-
*callback
A little helper function for when you want to load more modules into an existing Y instance.
Parameters:
-
modules
String multiple1-n modules to bind (uses arguments array).
-
*callback
Functioncallback function executed when the instance has the required functionality. If included, it must be the last parameter. This function receives two arguments:
- errors
- This will be an array of error objects if something went wrong. This will be null if everything is okay.
- attached
- This is an object. This object's keys are the names of modules that were attached to this YUI instance during this load. (Virtual rollups aren't listed here.)
Returns:
soon
-
callback
Y.soon accepts a callback function. The callback function will be called once, as soon as possible, in a future turn of the JavaScript event loop. If the function requires a specific execution context or arguments, wrap it with Y.bind. Y.soon returns an object with a cancel method. If the cancel method is called before the callback function, the callback function won't be called.
based on setImmediate.js. https://github.com/NobleJS/setImmediate
Copyright (c) 2011 Barnesandnoble.com, llc and Donavon West
https://github.com/NobleJS/setImmediate/blob/master/MIT-LICENSE.txt
Parameters:
-
callback
Functionfunction
Returns:
- cancel
- If the cancel method is called before the callback function, the callback function won't be called.