Prototype Class
Adds method prototypes to predefined classes to enhance their functionality.
Item Index
Methods
_initArrayPrototype
()
Array
private
Add extra functions to the Array object. Adds the following:
Array.remove()- prototype for removing items from arrayArray.append(arr)- Add all the elements of the given array to this array.Array.isEmpty()- Returns true if the length of the array is 0.Array.last()- Returns true if the length of the array is 0.Array.contains(obj)- Returns true if this Array contains the given objectArray.flatter(arr)- Array Flatten object extention: http://tech.karbassi.com/2009/12/17/pure-javascript-flatten-array/Array.max()- Returns the max value in the arrayArray.min()- Returns the min value in the array
Returns:
The array
_initEsriPrototype
()
Array
private
Add extra functions to the EsriExtent object. Adds the following:
EsriExtent.clone()-EsriExtent.widht()-EsriExtent.height()-EsriExtent.xyAspectFactor()- Returns the ratio of this Extent's width to this Extent's heightEsriExtent.centerX()-EsriExtent.centerY()-EsriExtent.center()-EsriExtent.pan()-
Returns:
The array
_initJQueryprototype
()
Array
private
Add extra jQuery functions. Adds the following:
$.findInputLabel()- Returns labels corresponding to the set of input controls.$.isOverflowed()- Detects if the given span is overflowing with text
Returns:
The array
_initObjectPrototype
()
Array
private
Add extra functions to the Object object. Adds the following:
Object.create(o)- Takes an old object as a parameter and returns an empty new object that inherits from the old one
Returns:
The array
_initStringPrototype
()
Array
private
Add extra functions to the String object. Adds the following:
String.format()- format the string replacing the placeholders with provided valuesString.replaceAll(search, replace)- replaces all instances
Returns:
The array
addProtytype
-
obj -
name -
fcn
Attempt to add the given fcn as a prototype to the given obj under the given name. Outputs a warning message to the console if a prototype of the same name already exists.
AddStaticFcn
-
obj -
name -
fcn
Attempt to add the given fcn as a static function to the given class under the given name. Outputs a warning message to the console if a function of the same name already exists.
