orionframework v0.8.66
Source & Licensing
The sources for this package are in the https://github.com/theorionframework/orionframework-ts repo.
Instructions on how to build can be found at scripts/release.sh
License: MIT
Classes
Members
Objects
Functions
Tip: 1000 ms = 1 second.
Arrays
Kind: global class
****: 1.0
- Arrays
- new Arrays()
- .EMPTY
- .copy(array) ⇒ Array
- .range(from, to, callback) ⇒ Array
- .toArray(value) ⇒
- .contains(array, value, caseSensitive) ⇒ Boolean
- .containsAll(list, items, caseSensitive)
- .unique(array, field) ⇒ Array
- .last(the) ⇒ Object
- .remove(array, value)
- .removeAt(array, index)
- .addAll(array, values)
- .clear(array)
- .removeAll(array, values)
- .addAt(array, item, index)
- .moveAt(array, from, to)
- .moveAll(elements, index) ⇒ Array
- .isEmpty(value) ⇒
- .getLength(value) ⇒ Number
- .isLast(array, value) ⇒ Boolean
- .toMultiValueObject(items) ⇒
- .toPropertyArray(array, property) ⇒
- .sort(array, sorts, parser) ⇒ Array
- .sum(arguments) ⇒ Array
- .substract(arguments) ⇒ Array
new Arrays()
Array utility class
Arrays.EMPTY
An empty array
Kind: static property of Arrays
Arrays.copy(array) ⇒ Array
Copy the entire given array into a new one and return it.
Kind: static method of Arrays
Returns: Array - the copied array instance.
Param | Type | Description |
---|---|---|
array | Array | the array being copied |
Arrays.range(from, to, callback) ⇒ Array
Create a range between two numbers (including both) and return it as an array.
Kind: static method of Arrays
Returns: Array - the generated range
Param | Type | Description |
---|---|---|
from | Number | the initial number |
to | Number | the final number |
callback | function | function invoked for each item in the range so the result returned can be formatted instead of simply used as is. |
Arrays.toArray(value) ⇒
Validate the given value against an Array instance. If so, return as is, otherwise, wrap its content as an array.
Kind: static method of Arrays
Returns: value as an array
Param | Description |
---|---|
value | the value being converted |
Arrays.contains(array, value, caseSensitive) ⇒ Boolean
Check rather the given array contains the given value
Kind: static method of Arrays
Returns: Boolean - true if present, false otherwise
Param | Type | Description |
---|---|---|
array | the array being verified | |
value | the value being checked | |
caseSensitive | Boolean | flag indicating if case-sensitive comparison should be applied. (Defaults to true) |
Arrays.containsAll(list, items, caseSensitive)
Check if the given Array contains all the items within second array
Kind: static method of Arrays
Param | Type | Description |
---|---|---|
list | Array | the list being verified |
items | Array | the items that should exists within the first list |
caseSensitive | Boolean | flag indicating if case-sensitive comparison should be applied. (Defaults to true) |
Arrays.unique(array, field) ⇒ Array
Filter the content of the given array into a second array without any duplicate values.
Kind: static method of Arrays
Returns: Array - filtered array
Param | Type | Description |
---|---|---|
array | Array | the array being filtered/transformed |
field | String | the field name (may be in E4J format, for more, see #orion.utils.E4J) |
Arrays.last(the) ⇒ Object
Retrieve the last item in this array
Kind: static method of Arrays
Returns: Object - the last item of the given array
Param | Type | Description |
---|---|---|
the | Array | array we are retrieving the last item from |
Arrays.remove(array, value)
Remove the given item from the given array
Kind: static method of Arrays
Param | Description |
---|---|
array | the array being manipulated |
value | the value being removed |
Arrays.removeAt(array, index)
Remove an item represented by the given index
Kind: static method of Arrays
Param | Description |
---|---|
array | the array being manipulated |
index | the index representing the element being removed |
Arrays.addAll(array, values)
Add all given elements into the given array
Kind: static method of Arrays
Param | Type | Description |
---|---|---|
array | Array | the array we are adding to |
values | Array | the values being added |
Arrays.clear(array)
Remove all elements from the given array that are present in the second array. However, if a second array is not informed, then the first array is cleared.
Kind: static method of Arrays
Param | Type | Description |
---|---|---|
array | Array | the array being cleared |
Arrays.removeAll(array, values)
Remove all elements from the given array that are present in the second array.
Kind: static method of Arrays
Param | Type | Description |
---|---|---|
array | Array | the array being |
values | Array |
Arrays.addAt(array, item, index)
Add an item to the given array within the given position
Kind: static method of Arrays
Param | Description |
---|---|
array | the array being manipulated |
item | the item being added |
index | the position of the item being added |
Arrays.moveAt(array, from, to)
Move an item from one index position to another index position
Kind: static method of Arrays
Param | Description |
---|---|
array | the array being manipulated |
from | the current index position |
to | the new index position |
Arrays.moveAll(elements, index) ⇒ Array
Move the given single element to a new position on this collection. *
Kind: static method of Arrays
Returns: Array - the updated array with the moved items
Param | Type | Description |
---|---|---|
elements | Array | the elements being moved |
index | int | the new index for the moved element |
Arrays.isEmpty(value) ⇒
Check if the given array is null, undefined or empty.
Kind: static method of Arrays
Returns: true if currently empty, false
otherwise.
Param | Description |
---|---|
value | the array being checked |
Arrays.getLength(value) ⇒ Number
Safe Array's length retrieval with fall back to 0 if not defined/null.
Kind: static method of Arrays
Returns: Number - array's length
Param | Description |
---|---|
value | the array being checked |
Arrays.isLast(array, value) ⇒ Boolean
Compares if the given value is the last item of the given array
Kind: static method of Arrays
Returns: Boolean - true if so, false otherwise
Param | Type | Description |
---|---|---|
array | Array | the array used being compared |
value | Object | the value being compared |
Arrays.toMultiValueObject(items) ⇒
Convert the given array of objects into an Object. This object will contain the same common properties from the objects in the given list. Each value will contain instead a array from each object of the given list.
would be converted into:
This method is useful for converting a list of objects to a compatible multi-value object used to submit to a remote server via AJAX (similar to multi-value field forms).
Kind: static method of Arrays
Returns: object containing all properties as array
Param | Description |
---|---|
items | the list of objects to be converted |
Arrays.toPropertyArray(array, property) ⇒
Convert an array of hash objects to an array of properties. We extract the property name from each hash object in the given array returning them as part of a new array on the same order of the original one.
I.E.:
Kind: static method of Arrays
Returns: array of properties from each hash object in the given array
Param | Description |
---|---|
array | of hash objects |
property | the property name |
Arrays.sort(array, sorts, parser) ⇒ Array
Sort the given array by the given property in the given direction.
Kind: static method of Arrays
Returns: Array - sorted array (same instance of the given one)
Param | Type | Description | |
---|---|---|---|
array | Array | the array we want to sort | |
sorts | Array | the list of hash objects for the sorted fields. Each object may contain { field : "name", order : "asc | desc", valueFunction : ...} where. property - {String or Function}: the property name we are sorting by. When not defined, use the value directly defined in the array. You're also allowed to pass a function that accepts one parameter and returns the value used to sort by. I.E.: function(a){ return a.state.country.name } enabling you to navigate through multiple objects. asc - {String} : the order in which sorting should happen. valueFunction - {Function} : The function used to extra items being sorted. |
parser | function | function used to parse the extracted value before we can run the comparison |
Arrays.sum(arguments) ⇒ Array
Concatenate all the given arrays into a new single Array. Arguments that are not arrays are just appended as is.
Kind: static method of Arrays
Returns: Array - array containing all subtracted sub-entries.
Param | Description |
---|---|
arguments | 0...x |
Arrays.substract(arguments) ⇒ Array
Subtract all sequence values from the first array passed as an argument and returned it as a new array.
Kind: static method of Arrays
Returns: Array - array containing all added sub-entries.
Param | Description |
---|---|
arguments | 0...x |
Browser
Kind: global class
new Browser()
Browser related components and utilities
Browser.user
Information about the currently logged user on the application.
Kind: static property of Browser
Browser.support
Browser support
Kind: static property of Browser
support.touch
Indicate if the browser supports touch events
Kind: static property of support
support.mobile
Indicate if the browser is running on a mobile device
Kind: static property of support
support.ipad
Indicate if the browser is running on a iPad device
Kind: static property of support
support.iphone
Indicate if the browser is running on a iPhone device
Kind: static property of support
support.ipod
Indicate if the browser is running on a iPod device
Kind: static property of support
Browser.hash : object
Browser history utilities functions.
The default location.hash provides access to the hash URL but this component gives you the ability to know when the hash URL has changed via event "hash" dispatched within any jQuery component. It also give you the ability to update the hash value without dispatching a change event or even enable/disable the hash URL update for a certain period (during load time for example while you parse the hash URL and load your internal components to restore their state).
Kind: static namespace of Browser
- .hash : object
hash.delay
The time delay in milliseconds used to verify if the browser's hash URL has changed
Kind: static property of hash
hash.enabled
Flag that indicates if hash is currently enabled. By setting this flag to false, the hash value can't be updated via update() method.
Kind: static property of hash
hash.get() ⇒
Retrieve the hash value from the location.hre. Remove the '#' symbol from the value if defined.
Kind: static method of hash
Returns: hash value
hash.handler()
Handler invoked when by time to time to verify if the hash variable has changed. If so, dispatch a hash event
Kind: static method of hash
Browser.openUrl(url, data, method, target, encType, charsetName)
Open the given URL on the browser passing the given parameter using the given HTTP method. If a target is not defined, opens a new window otherwise uses given client to open the URL.
This method simulates a form submit, so the URL is the form action, the data are the fields the form holds, the target is the submit target window and the method is the HTTP method (post, get, etc.).
Kind: static method of Browser
Param | Type | Description |
---|---|---|
url | the URL you want the new window to open | |
data | the parameters you want to send across | |
method | the HTTP method (get or post). Default is "get". | |
target | the target you want the | |
encType | String | the form's enctype (as in multipart/form-data String if pushing multipart documents). Defaults to application/x-www-form-urlencoded |
charsetName | String | the charset encoding used. Defaults to browser's encoding |
Dates
Kind: global class
- Dates
- new Dates()
- new Dates()
- .LOCALE_PREFIX : String
- .DEFAULT_FORMAT : String
- .YEAR : String
- .DATE : String
- .TIME : String
- .DATETIME : String
- .getDate(year, month, day, defaultValue) ⇒ Date
- .getDateTime(date, time) ⇒ Date
- .isSameDay(d1, d2) ⇒ Boolean
- .getDays(year, month) ⇒ Number
- .addDays(date, days)
- .now() ⇒ Number
- .getDaysBetween(left, right) ⇒ Number
- .addFormat(name, format, locale)
new Dates()
Currency utilities
new Dates()
Date utilities
Dates.LOCALE_PREFIX : String
Prefix path used for storing locale messages
Kind: static property of Dates
Default: "com.orion.utils.Dates"
Dates.DEFAULT_FORMAT : String
The default formatter mask.
Kind: static property of Dates
Default: "date"
Dates.YEAR : String
The mask name used for formatting year
Kind: static property of Dates
Default: "year"
Dates.DATE : String
The mask name used for formatting date
Kind: static property of Dates
Default: "date"
Dates.TIME : String
The mask name used for formatting time.
Kind: static property of Dates
Default: "time"
Dates.DATETIME : String
The mask for the default year format to the bound locale
Kind: static property of Dates
Default: "datetime"
Dates.getDate(year, month, day, defaultValue) ⇒ Date
Create a new date to match the given year, month and day from String values. If the given values do not match a proper date, then the default value is returned instead.
Kind: static method of Dates
Returns: Date - the created date if the parameters valid or defaultValue
instead
Param | Type | Description |
---|---|---|
year | String | the year (required) |
month | String | the month (required) |
day | String | the day (fall back to 1 if not defined) |
defaultValue | Date | the default value returned if the given parameters do not match a valid date |
Dates.getDateTime(date, time) ⇒ Date
Translate the date and time properties of both given Date values to a single merged one.
Kind: static method of Dates
Returns: Date - new date holding both date and time properties for the given
date objects
Param | Type | Description |
---|---|---|
date | Date | the date object we are keeping the date properties |
time | Date | the date object we are keeping the time properties |
Dates.isSameDay(d1, d2) ⇒ Boolean
Check if both given dates match the same exact year, month and date
Kind: static method of Dates
Returns: Boolean - true if both match, false otherwise
Param | Type | Description |
---|---|---|
d1 | Date | the first date for the comparison |
d2 | Date | the second date for the comparison |
Dates.getDays(year, month) ⇒ Number
Retrieve the number of days within the given month of the given year
Kind: static method of Dates
Returns: Number - number of days of the month within the given year
Param | Type | Description |
---|---|---|
year | Number | the year |
month | Number | the month |
Dates.addDays(date, days)
Add the given number of days to the given date
Kind: static method of Dates
Param | Type | Description |
---|---|---|
date | Date | the date being processed |
days | Number | the number of days being added to the given date |
Dates.now() ⇒ Number
Retrieve the current timestamp in milliseconds
Kind: static method of Dates
Returns: Number - current timestamp
Dates.getDaysBetween(left, right) ⇒ Number
Retrieve the number of days passed between the two given dates
Kind: static method of Dates
Returns: Number - number of days
Param | Type | Description |
---|---|---|
left | Date | the first date being calculated |
right | Date | the second date being calculated |
Dates.addFormat(name, format, locale)
Register a new format name (or replace if already exists) for the given locale
Kind: static method of Dates
Param | Type | Description |
---|---|---|
name | String | the format name used while using Dates#format() with a format name instead of a format pattern |
format | String | the format pattern being registered |
locale | String | the locale in which this format is registered |
Cursor
Kind: global class
- Cursor
- new Cursor()
- new Cursor()
- .y
- .x
- .touch
- .eventStart : String
- .eventEnd
- .eventMove
- .eventTarget(element) ⇒
- .hover(element) ⇒
- .getLocal(element) ⇒ Object
- .getX(event, local) ⇒ Number
- .getY(event, local) ⇒ Number
- .diff(x, y) ⇒ Object
- .diffY(y) ⇒ Number
- .diffX(x) ⇒ Number
- .moved(x, y) ⇒ Boolean
- .update(event)
new Cursor()
Cursor/Mouse/Touch utilities
new Cursor()
Effect utilities and tricks
Cursor.y
Current y coordinate of the cursor in the screen.
Kind: static property of Cursor
Cursor.x
Current x coordinate of the cursor in the screen.
Kind: static property of Cursor
Cursor.touch
Indicate if the browser supports touch events
Kind: static property of Cursor
Cursor.eventStart : String
Event name used to define when touch has started
Kind: static property of Cursor
Cursor.eventEnd
Event name used to define when touch has ended
Kind: static property of Cursor
Cursor.eventMove
Event name used to define when mouse/finger is moving
Kind: static property of Cursor
Cursor.eventTarget(element) ⇒
Translate the given element to its target area depending on touch support or not.
Kind: static method of Cursor
Returns: if touch support, returns the given element, if not, return the root
document allowing touch to be used outside the element
Param | Description |
---|---|
element | the element dispatching the event |
Cursor.hover(element) ⇒
Check if the cursor (touch or mouse) is currently over the given element
Kind: static method of Cursor
Returns: true if cursor is currently over, false otherwise
Param | Description |
---|---|
element | the jQuery object of the element we are checking against |
Cursor.getLocal(element) ⇒ Object
Translate the current global cursor's position to the offset coordinates of the cursor within the given element, as in the position of the cursor in the given element itself.
Kind: static method of Cursor
Returns: Object - hash containing both x and y position of the cursor within
the given element.
Param | Type | Description |
---|---|---|
element | jQuery | the jQuery element we want the local cursor's position |
Cursor.getX(event, local) ⇒ Number
Retrieve the local/global X coordinate for the given mouse event. If using touch devices, use the first touch item instead
Kind: static method of Cursor
Returns: Number - the x coordinate
Param | Type | Description |
---|---|---|
event | jQuery.Event | the event being containing the position |
local | Boolean | flag that indicate if we want the local or global coordinates. Defaults to false returning global position |
Cursor.getY(event, local) ⇒ Number
Retrieve the local/global Y coordinate for the given mouse event. If using touch devices, use the first touch item instead
Kind: static method of Cursor
Returns: Number - the x coordinate
Param | Type | Description |
---|---|---|
event | jQuery.Event | the event being containing the position |
local | Boolean | flag that indicate if we want the local or global coordinates. Defaults to false returning global position |
Cursor.diff(x, y) ⇒ Object
Calculate the difference between the the current cursor's position and the given position (AKA current.x - position.x, ...).
Kind: static method of Cursor
Returns: Object - hash containing the position difference between the given
position and the current position (may contain negative values)
Param | Type | Description |
---|---|---|
x | Number | the previous X position |
y | Number | the previous Y position |
Cursor.diffY(y) ⇒ Number
Calculate the difference between the current cursor's Y to the given Y coordinate
Kind: static method of Cursor
Returns: Number - the difference between current cursor's Y and given Y
coordinate
Param | Type | Description |
---|---|---|
y | Number | the previous Y position |
Cursor.diffX(x) ⇒ Number
Calculate the difference between the current cursor's X to the given X coordinate
Kind: static method of Cursor
Returns: Number - the difference between current cursor's X and given X
coordinate
Param | Type | Description |
---|---|---|
x | Number | the previous X position |
Cursor.moved(x, y) ⇒ Boolean
Check if the cursor once pointed to the given position has moved relative to the current cursor's position.
Kind: static method of Cursor
Returns: Boolean - true if the cursor is no longer i the same position as the
given one, false otherwise
Param | Type | Description |
---|---|---|
x | Number | the previous X position |
y | Number | the previous Y position |
Cursor.update(event)
Perform an update on both x and y positions of the cursor based on the given mouse event. This method is rarely necessary to be called manually, unless you need a very accurate position of the mouse for touch devices as the default mechanism involves touchstart on the document and that is only propagated after touchstart has been dispatched within a target element, therefore a VERY small gap where the coordinates may not be accurate enough.
Kind: static method of Cursor
Param | Type | Description |
---|---|---|
event | jQuery.Event | the event used to update the coordinates |
Dates
Kind: global class
- Dates
- new Dates()
- new Dates()
- .LOCALE_PREFIX : String
- .DEFAULT_FORMAT : String
- .YEAR : String
- .DATE : String
- .TIME : String
- .DATETIME : String
- .getDate(year, month, day, defaultValue) ⇒ Date
- .getDateTime(date, time) ⇒ Date
- .isSameDay(d1, d2) ⇒ Boolean
- .getDays(year, month) ⇒ Number
- .addDays(date, days)
- .now() ⇒ Number
- .getDaysBetween(left, right) ⇒ Number
- .addFormat(name, format, locale)
new Dates()
Currency utilities
new Dates()
Date utilities
Dates.LOCALE_PREFIX : String
Prefix path used for storing locale messages
Kind: static property of Dates
Default: "com.orion.utils.Dates"
Dates.DEFAULT_FORMAT : String
The default formatter mask.
Kind: static property of Dates
Default: "date"
Dates.YEAR : String
The mask name used for formatting year
Kind: static property of Dates
Default: "year"
Dates.DATE : String
The mask name used for formatting date
Kind: static property of Dates
Default: "date"
Dates.TIME : String
The mask name used for formatting time.
Kind: static property of Dates
Default: "time"
Dates.DATETIME : String
The mask for the default year format to the bound locale
Kind: static property of Dates
Default: "datetime"
Dates.getDate(year, month, day, defaultValue) ⇒ Date
Create a new date to match the given year, month and day from String values. If the given values do not match a proper date, then the default value is returned instead.
Kind: static method of Dates
Returns: Date - the created date if the parameters valid or defaultValue
instead
Param | Type | Description |
---|---|---|
year | String | the year (required) |
month | String | the month (required) |
day | String | the day (fall back to 1 if not defined) |
defaultValue | Date | the default value returned if the given parameters do not match a valid date |
Dates.getDateTime(date, time) ⇒ Date
Translate the date and time properties of both given Date values to a single merged one.
Kind: static method of Dates
Returns: Date - new date holding both date and time properties for the given
date objects
Param | Type | Description |
---|---|---|
date | Date | the date object we are keeping the date properties |
time | Date | the date object we are keeping the time properties |
Dates.isSameDay(d1, d2) ⇒ Boolean
Check if both given dates match the same exact year, month and date
Kind: static method of Dates
Returns: Boolean - true if both match, false otherwise
Param | Type | Description |
---|---|---|
d1 | Date | the first date for the comparison |
d2 | Date | the second date for the comparison |
Dates.getDays(year, month) ⇒ Number
Retrieve the number of days within the given month of the given year
Kind: static method of Dates
Returns: Number - number of days of the month within the given year
Param | Type | Description |
---|---|---|
year | Number | the year |
month | Number | the month |
Dates.addDays(date, days)
Add the given number of days to the given date
Kind: static method of Dates
Param | Type | Description |
---|---|---|
date | Date | the date being processed |
days | Number | the number of days being added to the given date |
Dates.now() ⇒ Number
Retrieve the current timestamp in milliseconds
Kind: static method of Dates
Returns: Number - current timestamp
Dates.getDaysBetween(left, right) ⇒ Number
Retrieve the number of days passed between the two given dates
Kind: static method of Dates
Returns: Number - number of days
Param | Type | Description |
---|---|---|
left | Date | the first date being calculated |
right | Date | the second date being calculated |
Dates.addFormat(name, format, locale)
Register a new format name (or replace if already exists) for the given locale
Kind: static method of Dates
Param | Type | Description |
---|---|---|
name | String | the format name used while using Dates#format() with a format name instead of a format pattern |
format | String | the format pattern being registered |
locale | String | the locale in which this format is registered |
E4J
Kind: global class
- E4J
- new E4J()
- .write ⇒ Boolean
- .read(source, expression) ⇒ Object
- .extend(target, object)
new E4J()
E4J
E4J.write ⇒ Boolean
Write the given value under the given source object within the given expression.
Kind: static property of E4J
Returns: Boolean - true if written the given value, false otherwise
Param | Type | Description |
---|---|---|
source | Object | the object we are writing to |
expression | String | the expression pointing to the property we are writing to |
value | Object | the value being set |
initialize | Boolean | flag indicating if we should create objects necessary to satisfy the existence of the objects pointed by the expression to write the given value |
E4J.read(source, expression) ⇒ Object
Extract the value for the given expression. Similar to E4X on XML (XPath) where you can use . to navigate through the objects.
Note that the syntax also applies for proper setters/getter convention where your source object could be a class and the properties could be wrapped around getters and setter methods.
Kind: static method of E4J
Returns: Object - value found within the given expression
Param | Type | Description |
---|---|---|
source | Object | the object we are reading from |
expression | String | the expression we are evaluating |
E4J.extend(target, object)
Extend each given property of the given object into the given target but instead of simply copying its value to, use E4J expressions to write the values. This means that if you have a property name defined as "application.label" then it will write on the target object as object.application.label=....
Kind: static method of E4J
Param | Type | Description |
---|---|---|
target | Object | the object receiving the copied properties |
object | Object | the object being copied |
Events
Kind: global class
- Events
- new Events()
- .stop(event) ⇒ Boolean
new Events()
Event utility class
Events.stop(event) ⇒ Boolean
Stops both immediate and regular propagation for the given event. This is a utility useful to cancel an event execution by simply calling and returning it inside of a handler
Kind: static method of Events
Returns: Boolean - false, always false
Param | Type | Description |
---|---|---|
event | Object | the event object |
Cursor
Kind: global class
- Cursor
- new Cursor()
- new Cursor()
- .y
- .x
- .touch
- .eventStart : String
- .eventEnd
- .eventMove
- .eventTarget(element) ⇒
- .hover(element) ⇒
- .getLocal(element) ⇒ Object
- .getX(event, local) ⇒ Number
- .getY(event, local) ⇒ Number
- .diff(x, y) ⇒ Object
- .diffY(y) ⇒ Number
- .diffX(x) ⇒ Number
- .moved(x, y) ⇒ Boolean
- .update(event)
new Cursor()
Cursor/Mouse/Touch utilities
new Cursor()
Effect utilities and tricks
Cursor.y
Current y coordinate of the cursor in the screen.
Kind: static property of Cursor
Cursor.x
Current x coordinate of the cursor in the screen.
Kind: static property of Cursor
Cursor.touch
Indicate if the browser supports touch events
Kind: static property of Cursor
Cursor.eventStart : String
Event name used to define when touch has started
Kind: static property of Cursor
Cursor.eventEnd
Event name used to define when touch has ended
Kind: static property of Cursor
Cursor.eventMove
Event name used to define when mouse/finger is moving
Kind: static property of Cursor
Cursor.eventTarget(element) ⇒
Translate the given element to its target area depending on touch support or not.
Kind: static method of Cursor
Returns: if touch support, returns the given element, if not, return the root
document allowing touch to be used outside the element
Param | Description |
---|---|
element | the element dispatching the event |
Cursor.hover(element) ⇒
Check if the cursor (touch or mouse) is currently over the given element
Kind: static method of Cursor
Returns: true if cursor is currently over, false otherwise
Param | Description |
---|---|
element | the jQuery object of the element we are checking against |
Cursor.getLocal(element) ⇒ Object
Translate the current global cursor's position to the offset coordinates of the cursor within the given element, as in the position of the cursor in the given element itself.
Kind: static method of Cursor
Returns: Object - hash containing both x and y position of the cursor within
the given element.
Param | Type | Description |
---|---|---|
element | jQuery | the jQuery element we want the local cursor's position |
Cursor.getX(event, local) ⇒ Number
Retrieve the local/global X coordinate for the given mouse event. If using touch devices, use the first touch item instead
Kind: static method of Cursor
Returns: Number - the x coordinate
Param | Type | Description |
---|---|---|
event | jQuery.Event | the event being containing the position |
local | Boolean | flag that indicate if we want the local or global coordinates. Defaults to false returning global position |
Cursor.getY(event, local) ⇒ Number
Retrieve the local/global Y coordinate for the given mouse event. If using touch devices, use the first touch item instead
Kind: static method of Cursor
Returns: Number - the x coordinate
Param | Type | Description |
---|---|---|
event | jQuery.Event | the event being containing the position |
local | Boolean | flag that indicate if we want the local or global coordinates. Defaults to false returning global position |
Cursor.diff(x, y) ⇒ Object
Calculate the difference between the the current cursor's position and the given position (AKA current.x - position.x, ...).
Kind: static method of Cursor
Returns: Object - hash containing the position difference between the given
position and the current position (may contain negative values)
Param | Type | Description |
---|---|---|
x | Number | the previous X position |
y | Number | the previous Y position |
Cursor.diffY(y) ⇒ Number
Calculate the difference between the current cursor's Y to the given Y coordinate
Kind: static method of Cursor
Returns: Number - the difference between current cursor's Y and given Y
coordinate
Param | Type | Description |
---|---|---|
y | Number | the previous Y position |
Cursor.diffX(x) ⇒ Number
Calculate the difference between the current cursor's X to the given X coordinate
Kind: static method of Cursor
Returns: Number - the difference between current cursor's X and given X
coordinate
Param | Type | Description |
---|---|---|
x | Number | the previous X position |
Cursor.moved(x, y) ⇒ Boolean
Check if the cursor once pointed to the given position has moved relative to the current cursor's position.
Kind: static method of Cursor
Returns: Boolean - true if the cursor is no longer i the same position as the
given one, false otherwise
Param | Type | Description |
---|---|---|
x | Number | the previous X position |
y | Number | the previous Y position |
Cursor.update(event)
Perform an update on both x and y positions of the cursor based on the given mouse event. This method is rarely necessary to be called manually, unless you need a very accurate position of the mouse for touch devices as the default mechanism involves touchstart on the document and that is only propagated after touchstart has been dispatched within a target element, therefore a VERY small gap where the coordinates may not be accurate enough.
Kind: static method of Cursor
Param | Type | Description |
---|---|---|
event | jQuery.Event | the event used to update the coordinates |
GUID
Kind: global class
new GUID()
GUID helper class
GUID.prefix
Prefix prepended between each generated GUID
Kind: static property of GUID
GUID.get(item) ⇒
Look up for the GUID of the given item by checking for a property named GUID declared directly within the given item. If not defined, a new GUID is assigned and returned.
Kind: static method of GUID
Returns: GUID from the given item
Param | Description |
---|---|
item | the item we want the GUID from |
HTML
Kind: global class
new HTML()
HTML utility class
HTML.DIV
Markup for a plain div tag
Kind: static property of HTML
HTML.escape ⇒ String
Escape the given value making it ready for HTML
Kind: static property of HTML
Returns: String - HTML escaped String
Param | Type | Description |
---|---|---|
value | String | the value to be escaped |
HTML.is() ⇒
Check if the given string content represents a HTML code.
Kind: static method of HTML
Returns: true if the given value represents one of the HTML tags
Value: the string value we are checking on
HTML.get(markup) ⇒ jQuery
Transform the given HTML (STring) mark-up into a HTML element
Kind: static method of HTML
Returns: jQuery - HTML element
Param | Type | Description |
---|---|---|
markup | String | the HTML mark-up |
HTML.getElement(object) ⇒
Transform the given object into a jQuery HTML Element node set.
Kind: static method of HTML
Returns: jQuery stack
Param | Description |
---|---|
object | the object being transformed |
HTML.join(hash, arguments) ⇒ String
Join all given arguments together without any space or special characters.
You can always pass a set of infinite arguments as plain String which then are simply joined instead.
Kind: static method of HTML
Returns: String - joined HTML mark-up
Param | Type | Description |
---|---|---|
hash | Object | used as a HTML template |
arguments | Arguments | (0..x) list of arguments being joined |
HTML.getForm(encType, charsetName) ⇒
Create a form with mapped for the given URL, method, target type and encoding type including a hidden field for every single value in the given data parameter.
Kind: static method of HTML
Returns: new form instance
Param | Type | Description |
---|---|---|
encType | String | the form's enctype (as in multipart/form-data String if pushing multipart documents). Defaults to application/x-www-form-urlencoded |
charsetName | String | the charset encoding used. Defaults to browser's encoding |
LocalStorage
Kind: global class
- LocalStorage
- new LocalStorage()
- .linkToUser : Boolean
- .set(name, value)
- .contains() ⇒ Boolean
- .remove(the)
- .getType() ⇒ String
- .setType(type)
- .isCookie() ⇒ Boolean
new LocalStorage()
API that wrappers localStorage falling back to regular browser cookies when the same is not available.
LocalStorage.linkToUser : Boolean
Flag that indicates if stored data should be automatically linked to logged user, whenever possible.
Kind: static property of LocalStorage
Default: true
LocalStorage.set(name, value)
Set/update the given value under the given name. The same can now be retrieved via LocalStorage#get()
Kind: static method of LocalStorage
Param | Type | Description |
---|---|---|
name | String | the name of the property |
value | Any | the data to be stored |
LocalStorage.contains() ⇒ Boolean
Verify if the local storage has a property of the given name
Kind: static method of LocalStorage
Returns: Boolean - true if exists, false otherwise
LocalStorage.remove(the)
Discard the content of stored under the given property name
Kind: static method of LocalStorage
Param | Type | Description |
---|---|---|
the | String | name of the property being discarded |
LocalStorage.getType() ⇒ String
Look up for the storage type currently being used.
Kind: static method of LocalStorage
Returns: String - either "local" if using localStorage or
cookie if localStorage is not available.
LocalStorage.setType(type)
Alter the storage type utilizing from now-on the given storage type discarding the previous storage being used.
Kind: static method of LocalStorage
Param | Type | Description |
---|---|---|
type | String | the new storage type to be used |
LocalStorage.isCookie() ⇒ Boolean
Verify if currently using a local storage type
Kind: static method of LocalStorage
Returns: Boolean - true if currently using cookies a local storage, false
otherwise
Numbers
Kind: global class
- Numbers
- new Numbers()
- .ceilDecimal(value) ⇒ Number
- .is(value) ⇒ Boolean
new Numbers()
Static class used as a place-holder for Number based utility methods.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago