YUI~oop Class
The following methods are added to the YUI instance
Item Index
Methods
aggregate
-
r -
s -
ov -
wl
Applies object properties from the supplier to the receiver. If the target has the property, and the property is an object, the target object will be augmented with the supplier's value. If the property is an array, the suppliers value will be appended to the target.
Parameters:
-
rFunctionthe object to receive the augmentation.
-
sFunctionthe object that supplies the properties to augment.
-
ovBooleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wlStringa whitelist. If supplied, only properties in this list will be applied to the receiver.
Returns:
aggregate
-
r -
s -
ov -
wl
Applies object properties from the supplier to the receiver. If the target has the property, and the property is an object, the target object will be augmented with the supplier's value. If the property is an array, the suppliers value will be appended to the target.
Parameters:
-
rFunctionthe object to receive the augmentation.
-
sFunctionthe object that supplies the properties to augment.
-
ovBooleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wlStringa whitelist. If supplied, only properties in this list will be applied to the receiver.
Returns:
augment
-
r -
s -
ov -
wl -
args
Applies prototype properties from the supplier to the receiver. The receiver can be a constructor or an instance.
Parameters:
-
rFunctionthe object to receive the augmentation.
-
sFunctionthe object that supplies the properties to augment.
-
ovBooleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wlStringa whitelist. If supplied, only properties in this list will be applied to the receiver.
-
argsArray | Anyarg or arguments to apply to the supplier constructor when initializing.
Returns:
augment
-
r -
s -
ov -
wl -
args
Applies prototype properties from the supplier to the receiver. The receiver can be a constructor or an instance.
Parameters:
-
rFunctionthe object to receive the augmentation.
-
sFunctionthe object that supplies the properties to augment.
-
ovBooleanif true, properties already on the receiver will be overwritten if found on the supplier.
-
wlStringa whitelist. If supplied, only properties in this list will be applied to the receiver.
-
argsArray | Anyarg or arguments to apply to the supplier constructor when initializing.
Returns:
bind
-
f -
c -
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the beginning of the arguments collection the supplied to the function.
Parameters:
-
fFunction | Stringthe function to bind, or a function name to execute on the context object.
-
cObjectthe execution context.
-
argsAny multiple0..n arguments to include before the arguments the function is executed with.
Returns:
bind
-
f -
c -
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the beginning of the arguments collection the supplied to the function.
Parameters:
-
fFunction | Stringthe function to bind, or a function name to execute on the context object.
-
cObjectthe execution context.
-
argsAny multiple0..n arguments to include before the arguments the function is executed with.
Returns:
clone
-
o -
safe -
f -
c -
owner -
cloned
Deep obj/array copy. Function clones are actually wrappers around the original function. Array-like objects are treated as arrays. Primitives are returned untouched. Optionally, a function can be provided to handle other data types, filter keys, validate values, etc.
Parameters:
-
oObjectwhat to clone.
-
safeBooleanif true, objects will not have prototype items from the source. If false, they will. In this case, the original is initially protected, but the clone is not completely immune from changes to the source object prototype. Also, cloned prototype items that are deleted from the clone will result in the value of the source prototype being exposed. If operating on a non-safe clone, items should be nulled out rather than deleted.
-
fFunctionoptional function to apply to each item in a collection; it will be executed prior to applying the value to the new object. Return false to prevent the copy.
-
cObjectoptional execution context for f.
-
ownerObjectOwner object passed when clone is iterating an object. Used to set up context for cloned functions.
-
clonedObjecthash of previously cloned objects to avoid multiple clones.
Returns:
clone
-
o -
safe -
f -
c -
owner -
cloned
Deep obj/array copy. Function clones are actually wrappers around the original function. Array-like objects are treated as arrays. Primitives are returned untouched. Optionally, a function can be provided to handle other data types, filter keys, validate values, etc.
Parameters:
-
oObjectwhat to clone.
-
safeBooleanif true, objects will not have prototype items from the source. If false, they will. In this case, the original is initially protected, but the clone is not completely immune from changes to the source object prototype. Also, cloned prototype items that are deleted from the clone will result in the value of the source prototype being exposed. If operating on a non-safe clone, items should be nulled out rather than deleted.
-
fFunctionoptional function to apply to each item in a collection; it will be executed prior to applying the value to the new object. Return false to prevent the copy.
-
cObjectoptional execution context for f.
-
ownerObjectOwner object passed when clone is iterating an object. Used to set up context for cloned functions.
-
clonedObjecthash of previously cloned objects to avoid multiple clones.
Returns:
each
-
o -
f -
c -
proto
Executes the supplied function for each item in a collection. Supports arrays, objects, and Y.NodeLists
Parameters:
-
oObjectthe object to iterate.
-
fFunctionthe function to execute. This function receives the value, key, and object as parameters.
-
cObjectthe execution context for the function.
-
protoBooleanif true, prototype properties are iterated on objects.
Returns:
each
-
o -
f -
c -
proto
Executes the supplied function for each item in a collection. Supports arrays, objects, and Y.NodeLists
Parameters:
-
oObjectthe object to iterate.
-
fFunctionthe function to execute. This function receives the value, key, and object as parameters.
-
cObjectthe execution context for the function.
-
protoBooleanif true, prototype properties are iterated on objects.
Returns:
extend
-
r -
s -
px -
sx
Utility to set up the prototype, constructor and superclass properties to support an inheritance strategy that can chain constructors and methods. Static members will not be inherited.
Parameters:
-
rFunctionthe object to modify.
-
sFunctionthe object to inherit.
-
pxObjectprototype properties to add/override.
-
sxObjectstatic properties to add/override.
Returns:
extend
-
r -
s -
px -
sx
Utility to set up the prototype, constructor and superclass properties to support an inheritance strategy that can chain constructors and methods. Static members will not be inherited.
Parameters:
-
rFunctionthe object to modify.
-
sFunctionthe object to inherit.
-
pxObjectprototype properties to add/override.
-
sxObjectstatic properties to add/override.
Returns:
rbind
-
f -
c -
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the end of the arguments the function is executed with.
Parameters:
-
fFunction | Stringthe function to bind, or a function name to execute on the context object.
-
cObjectthe execution context.
-
argsAny multiple0..n arguments to append to the end of arguments collection supplied to the function.
Returns:
rbind
-
f -
c -
args
Returns a function that will execute the supplied function in the supplied object's context, optionally adding any additional supplied parameters to the end of the arguments the function is executed with.
Parameters:
-
fFunction | Stringthe function to bind, or a function name to execute on the context object.
-
cObjectthe execution context.
-
argsAny multiple0..n arguments to append to the end of arguments collection supplied to the function.
Returns:
some
-
o -
f -
c -
proto
Executes the supplied function for each item in a collection. The operation stops if the function returns true. Supports arrays, objects, and Y.NodeLists.
Parameters:
-
oObjectthe object to iterate.
-
fFunctionthe function to execute. This function receives the value, key, and object as parameters.
-
cObjectthe execution context for the function.
-
protoBooleanif true, prototype properties are iterated on objects.
Returns:
some
-
o -
f -
c -
proto
Executes the supplied function for each item in a collection. The operation stops if the function returns true. Supports arrays, objects, and Y.NodeLists.
Parameters:
-
oObjectthe object to iterate.
-
fFunctionthe function to execute. This function receives the value, key, and object as parameters.
-
cObjectthe execution context for the function.
-
protoBooleanif true, prototype properties are iterated on objects.
