Yahoo! UI Library

YAHOO Global 

Yahoo! UI Library > yahoo > YAHOO

static Class YAHOO

The YAHOO global namespace object

Methods

augment

static void augment ( r , s , arguments )
Applies all prototype properties in the supplier to the receiver if the receiver does not have these properties yet. Optionally, one or more methods/properties can be specified (as additional parameters). This option will overwrite the property if receiver has it already.
Parameters:
r <Function> the object to receive the augmentation
s <Function> the object that supplies the properties to augment
arguments <String*> zero or more properties methods to augment the receiver with. If none specified, everything in the supplier will be used unless it would overwrite an existing property in the receiver
Returns: void

extend

static void extend ( subc , superc , overrides )
Utility to set up the prototype, constructor and superclass properties to support an inheritance strategy that can chain constructors and methods.
Parameters:
subc <Function> the object to modify
superc <Function> the object to inherit
overrides <Object> additional properties/methods to add to the subclass prototype. These will override the matching items obtained from the superclass if present.
Returns: void

log

static Boolean log ( msg , cat , src )
Uses YAHOO.widget.Logger to output a log message, if the widget is available.
Parameters:
msg <String> The message to log.
cat <String> The log category for the message. Default categories are "info", "warn", "error", time". Custom categories can be used as well. (opt)
src <String> The source of the the message (opt)
Returns: Boolean
True if the log operation was successful.

namespace

static Object namespace ( arguments )
Returns the namespace specified and creates it if it doesn't exist
YAHOO.namespace("property.package");
YAHOO.namespace("YAHOO.property.package");
Either of the above would create YAHOO.property, then YAHOO.property.package Be careful when naming packages. Reserved words may work in some browsers and not others. For instance, the following will fail in Safari:
YAHOO.namespace("really.long.nested.namespace");
This fails because "long" is a future reserved word in ECMAScript
Parameters:
arguments <String*> 1-n namespaces to create
Returns: Object
A reference to the last namespace object created


Copyright © 2006 Yahoo! Inc. All rights reserved.