API Docs for:
Show:

YUI Class

Module: gallery-delay

Item Index

Methods

delay

(
  • callbackFunction
  • delayAmount
)
Function

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:

  • callbackFunction Function

    The function to delay.

  • delayAmount Number

    The approximate amount of time to delay in milliseconds.

Returns:

gravatarUrl

(
  • options
  • callbackFunction
  • contextObject
)

Create a gravatar image url.

Parameters:

  • options Object

    An 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/
    email
    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 Function

    This 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
)
YUI

A little helper function for when you want to load more modules into an existing Y instance.

Parameters:

  • modules String multiple

    1-n modules to bind (uses arguments array).

  • *callback Function

    callback 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:

YUI: the YUI instance.

soon

(
  • callback
)
Object

Provided by the gallery-soon module.

Defined in yui3-gallery/src/gallery-soon/js/soon.js:47

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:

Returns:

Object:
cancel
If the cancel method is called before the callback function, the callback function won't be called.