new Utils()
- Source:
Classes
Methods
-
<static> extend(deep, target) → {object}
-
This is a slightly modified version of http://api.jquery.com/jQuery.extend/
Parameters:
Name Type Description deepboolean Perform a deep copy?
targetobject The target object to copy to.
- Source:
Returns:
The extended object.
- Type
- object
-
<static> getProperty(obj, prop) → {*}
-
Gets an objects property by string.
Parameters:
Name Type Description objobject The object to traverse.
propstring The property whose value will be returned.
- Source:
Returns:
the value of the property or null if property isn't found .
- Type
- *
-
<static> isPlainObject(obj) → {boolean}
-
This is a slightly modified version of jQuery.isPlainObject. A plain object is an object whose internal class property is [object Object].
Parameters:
Name Type Description objobject The object to inspect.
- Source:
Returns:
- true if the object is plain, otherwise false.
- Type
- boolean
-
<static> mixin(from, to) → {object}
-
Mixes the source object into the destination object, returning the newly modified destination object. Based on original code by @mudcube
Parameters:
Name Type Description fromobject The object to copy (the source object).
toobject The object to copy to (the destination object).
- Source:
Returns:
The modified destination object.
- Type
- object
-
<static> pad(str, len, pad, dir) → {string}
-
Javascript string pad http://www.webtoolkit.info/. pad = the string to pad it out with (defaults to a space) dir = 1 (left), 2 (right), 3 (both)
Parameters:
Name Type Argument Default Description strstring The target string.
lennumber The number of characters to be added.
padnumber The string to pad it out with (defaults to a space).
dirnumber <optional>
3 The direction dir = 1 (left), 2 (right), 3 (both).
- Source:
Returns:
The padded string
- Type
- string
-
<static> parseDimension(size, dimension) → {number}
-
Get a unit dimension from a string.
Parameters:
Name Type Description sizestring | number The size to parse.
dimensionnumber The window dimension to check.
- Source:
Returns:
The parsed dimension.
- Type
- number
-
<static> rotateArray(matrix, direction) → {array}
-
Rotates the given array. Based on the routine from http://jsfiddle.net/MrPolywhirl/NH42z/
Parameters:
Name Type Description matrixarray The array to rotate.
directionnumber | string The amount to rotate. Either a number: 90, -90, 270, -270, 180 or a string: 'rotateLeft', 'rotateRight' or 'rotate180'
- Source:
Returns:
The rotated array
- Type
- array
-
<static> setProperty(obj, prop) → {object}
-
Sets an objects property by string.
Parameters:
Name Type Description objobject The object to traverse
propstring The property whose value will be changed
- Source:
Returns:
The object on which the property was set.
- Type
- object
-
<static> shuffle(array) → {array}
-
A standard Fisher-Yates Array shuffle implementation.
Parameters:
Name Type Description arrayarray The array to shuffle.
- Source:
Returns:
The shuffled array.
- Type
- array
-
<static> transposeArray(array) → {array}
-
Transposes the elements of the given Array.
Parameters:
Name Type Description arrayarray The array to transpose.
- Source:
Returns:
The transposed array.
- Type
- array