Class Index | File Index

Classes


Namespace lib

Holds methods and properties necessary throughout the entire application.
Defined in: lib.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
lib
Method Summary
Method Attributes Method Name and Description
<static>  
lib.extend(overwrite, destination, source)
This function extends objects.
Namespace Detail
lib
Method Detail
<static> lib.extend(overwrite, destination, source)
This function extends objects.
var obj1 = {a: 'a1', b: 'b1', d: 'd1'},
    obj2 = {a: 'a2', b: 'b2', c: 'c2'};

lib.extend(obj1, obj2);

// Now obj1.c == 'c2', while obj1.a, obj1.b
// and obj1.d remain the same.

// If lib.extend(true, obj1, obj2) is
// called, then obj1.a, obj1.b, obj1.c
// become all the same as in obj2.
var obj1 = {a: 'a1', b: 'b1', extend: lib.extend};
obj1.extend({c: 'c1', d: 'd1'});

// In this case the destination object which is to be extend is
// obj1.
Parameters:
{Boolean} overwrite Optional, Default: false
If the first argument is a boolean, then it will be considered as a boolean flag for overwriting (or not) any existing methods and properties in the destination object. Thus, any method and property from the source object will take over those in the destination. The argument is optional, and if it's omitted, then no method/property will be overwritten.
{Object} destination Optional, Default: this
The second argument is the optional destination object: the object which will be extended. By default, the this object will be extended.
{Object} source
The third argument must provide list of methods and properties which will be added to the destination object.

Documentation generated by JsDoc Toolkit 2.1.0 on Wed Apr 22 2009 15:41:21 GMT+0300 (EEST)