README
Classes
Objects
Functions
- worker(func) ⇒
Worker
Cookie
Kind: global class
Summary: serializes, deserializes, and reads browser cookies.
- Cookie
- .serialize(value, [params]) ⇒
string
- .deserialize(value) ⇒
*
- .read(value) ⇒
Object
- .serialize(value, [params]) ⇒
string
Cookie.serialize(value, [params]) ⇒ Kind: static method of Cookie
Access: public
Param | Type | Description |
---|---|---|
value | Object |
Data to be serialized |
[params] | Object |
Cookie parameters |
[params.name] | string |
Cookie name |
[params.expires] | Date |
Cookie expiry date |
[params.path] | string |
Cookie path |
[params.domain] | string |
Cookie domain |
[params.secure] | boolean |
Sets cookie to 'secure' when true |
*
Cookie.deserialize(value) ⇒ Kind: static method of Cookie
Access: public
Param | Type |
---|---|
value | string |
Object
Cookie.read(value) ⇒ Kind: static method of Cookie
Summary: Read data stored in a cookie
Access: public
Param | Type | Description |
---|---|---|
value | string |
Browser cookie to read. |
Dto
Kind: global class
Summary: A powerful data object that can parse and serialize JavaScript
data into multiple formats: JSON, Query String, Form Data, JWT, base64.
- Dto
- instance
- .value ⇒
*
|Object
- .name ⇒
string
- .name
- .read([key]) ⇒
*
- .remove(key) ⇒
Dto
- .write(key, value) ⇒
Dto
- .update(value) ⇒
Dto
- .clear() ⇒
Dto
- .encode([stripPadding], [unsafe]) ⇒
string
|undefined
- .toFormData() ⇒
FormData
- .toJson() ⇒
string
- .toQueryString() ⇒
string
- .value ⇒
- static
- instance
*
| Object
dto.value ⇒ Kind: instance property of Dto
Access: public
string
dto.name ⇒ Kind: instance property of Dto
Access: public
dto.name
Kind: instance property of Dto
Access: public
Param | Type |
---|---|
value | string |
*
dto.read([key]) ⇒ Kind: instance method of Dto
Summary: Return value for key or all values if not passed.
Access: public
Param | Type |
---|---|
[key] | string | number |
Dto
dto.remove(key) ⇒ Kind: instance method of Dto
Summary: Remove value at key
Access: public
Param | Type |
---|---|
key | string | function |
Dto
dto.write(key, value) ⇒ Kind: instance method of Dto
Summary: Write value to key
Access: public
Param |
---|
key |
value |
Dto
dto.update(value) ⇒ Kind: instance method of Dto
Summary: Update data with passed data
Access: public
Param |
---|
value |
Dto
dto.clear() ⇒ Kind: instance method of Dto
Summary: Clears all data from this Dto. It does not
remove this Dto from persistent storage.
Access: public
string
| undefined
dto.encode([stripPadding], [unsafe]) ⇒ Kind: instance method of Dto
Summary: Returns a base64 encoded string containg the value
of of this Dto.
Access: public
Param | Type | Default | Description |
---|---|---|---|
[stripPadding] | boolean |
false |
Will strip base64 padding when true. |
[unsafe] | boolean |
false |
Will escape special characters when encoding preventing erroneous errors in some cases, but making the value unsafe for transfer and decoding outside of Dto as special characters will have to be unescaped after decoding. |
FormData
dto.toFormData() ⇒ Kind: instance method of Dto
Summary: Returns Dto as FormData
Access: public
string
dto.toJson() ⇒ Kind: instance method of Dto
Summary: Returns Dto as JSON
Access: public
string
dto.toQueryString() ⇒ Kind: instance method of Dto
Summary: Returns Dto as query string
Access: public
Dto
Dto.decode(value, [name]) ⇒ Kind: static method of Dto
Summary: Returns a new Dto having value of the passed base64 encoded string.
Access: public
Param | Type | Description |
---|---|---|
value | string |
Initial value for the returned Dto. |
[name] | string |
Name for the returned Dto. |
Dto
Dto.parseFormData(value) ⇒ Kind: static method of Dto
Summary: Parse a Dto from FormData
Access: public
Param |
---|
value |
Dto
Dto.parseJson(value) ⇒ Kind: static method of Dto
Summary: Parse a Dto from JSON data
Access: public
Param |
---|
value |
any
Dto.parseJwt(value) ⇒ Kind: static method of Dto
Summary: Parse a Dto from a JWT
Access: public
Param |
---|
value |
Dto
Dto.parseQueryString(value) ⇒ Kind: static method of Dto
Summary: Parse a Dto from a query string
Access: public
Param |
---|
value |
Device
Kind: global class
Summary: Device abstraction
string
Device.orientation ⇒ Kind: static property of Device
Summary: Returns the current Device orientation which can be
tested against the available Device orientation
constants to determine the orientation of the device.
Access: public
string
Device.landscapePrimary ⇒ Kind: static property of Device
Summary: Constant to test if device is oriented in landscape.
Access: public
string
Device.landscapeSecondary ⇒ Kind: static property of Device
Summary: Constant to test if device is oriented in landscape.
Access: public
string
Device.portraitPrimary ⇒ Kind: static property of Device
Summary: Constant to test if device is oriented in portrait.
Access: public
string
Device.portraitSecondary ⇒ Kind: static property of Device
Summary: Constant to test if device is oriented in portrait
and upside-down.
Access: public
boolean
Device.isMobile ⇒ Kind: static property of Device
Summary: Returns true if device is mobile.
Access: public
Document
Kind: global class
Summary: Document abstraction
- Document
- .scrollbarWidth ⇒
number
- .isScrollPrevented ⇒
boolean
- .scroll ⇒
Scroll
- .preventScroll()
- .resumeScroll()
- .onPreventScroll(method)
- .onResumeScroll(method)
- .on(event, key, method, options) ⇒
Object
- .onKeyPress(key, method, options) ⇒
Object
- .onKeyDown(key, method, options) ⇒
Object
- .onKeyUp(key, method, options) ⇒
Object
- .scrollbarWidth ⇒
number
Document.scrollbarWidth ⇒ Kind: static property of Document
Summary: Width of the scrollbar
Access: public
boolean
Document.isScrollPrevented ⇒ Kind: static property of Document
Summary: Returns true if document scrolling is prevented
Access: public
Scroll
Document.scroll ⇒ Kind: static property of Document
Summary: Gets the Document Scroll instance that can be queried
to determine scroll direction: left, right, up, down.
Access: public
Document.preventScroll()
Kind: static method of Document
Summary: Prevents document from being scrollable
Access: public
Document.resumeScroll()
Kind: static method of Document
Summary: Resumes scrollability for document after being
rendered unscrollable.
Access: public
Document.onPreventScroll(method)
Kind: static method of Document
Summary: Adds a method to call when scroll is prevented.
Access: public
Param | Type |
---|---|
method | function |
Document.onResumeScroll(method)
Kind: static method of Document
Summary: Adds a method to call when scroll is resumed.
Access: public
Param | Type |
---|---|
method | function |
Object
Document.on(event, key, method, options) ⇒ Kind: static method of Document
Summary: Subscribes to keyboard event
Returns: Object
- - method to call to
unsubscribe target listener from keyboard.
Access: public
Param | Type |
---|---|
event | |
key | Key |
method | function |
options | Object |
Object
Document.onKeyPress(key, method, options) ⇒ Kind: static method of Document
Summary: Subscribes to keyboard keypress event
Returns: Object
- - method to call to
unsubscribe target listener from keyboard.
Access: public
Param | Type |
---|---|
key | Key |
method | function |
options | Object |
Object
Document.onKeyDown(key, method, options) ⇒ Kind: static method of Document
Summary: Subscribes to keyboard keydown event
Returns: Object
- - method to call to
unsubscribe target listener from keyboard.
Access: public
Param | Type |
---|---|
key | Key |
method | function |
options | Object |
Object
Document.onKeyUp(key, method, options) ⇒ Kind: static method of Document
Summary: Subscribes to keyboard keyup event
Returns: Object
- - method to call to
unsubscribe target listener from keyboard.
Access: public
Param | Type |
---|---|
key | Key |
method | function |
options | Object |
Event
Kind: global class
Summary: Event abstraction
boolean
Event.mute(event) ⇒ Kind: static method of Event
Summary: Hard stops any further activity from passed event.
Access: public
Param | Type | Description |
---|---|---|
event | Event |
Event to hard stop. |
Key
Kind: global class
Summary: Keyboard Key abstraction
new Key(MDNKeyIdentifier, [MSKeyIdentifier])
Param | Type | Description |
---|---|---|
MDNKeyIdentifier | String |
The MDN Key Identifier https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values |
[MSKeyIdentifier] | String |
The Microsoft Key Identifier for those keys that have browser specific implementations for MS https://msdn.microsoft.com/en-us/ie/gg305568(v=vs.94) |
Key
key.alt ⇒ Kind: instance property of Key
Summary: Returns Key with alt.
Returns: Key
- - Key with alt
Access: public
Key
key.ctrl ⇒ Kind: instance property of Key
Summary: Returns Key with ctrl.
Returns: Key
- - Key with ctrl
Access: public
Key
key.meta ⇒ Kind: instance property of Key
Summary: Returns Key with meta.
Returns: Key
- - Key with meta
Access: public
Key
key.shift ⇒ Kind: instance property of Key
Summary: Returns Key with shift.
Returns: Key
- - this Key with shift
Access: public
boolean
key.equals(other) ⇒ Kind: instance method of Key
Summary: Returns true if this Key equals other.
Access: public
Param | Type |
---|---|
other | Key |
boolean
key.didFire(event) ⇒ Kind: instance method of Key
Summary: Returns true if this Key did fire event.
Access: public
Param | Type |
---|---|
event | KeyboardEvent |
Key
Key.press ⇒ Kind: static property of Key
Summary: Returns a Key action keypress.
Access: public
Key
Key.down ⇒ Kind: static property of Key
Summary: Returns a Key action keydown.
Access: public
Key
Key.up ⇒ Kind: static property of Key
Summary: Returns a Key action keyup.
Access: public
Key
Key.any ⇒ Kind: static property of Key
Summary: Returns a Key that will equal any other Key.
Access: public
Key
Key.esc ⇒ Kind: static property of Key
Summary: Returns Key, Esacpe.
Access: public
Key
Key.enter ⇒ Kind: static property of Key
Summary: Returns Key, Enter.
Access: public
Key
Key.space ⇒ Kind: static property of Key
Summary: Returns Key, Space.
Access: public
Key
Key.tab ⇒ Kind: static property of Key
Summary: Returns Key, Tab.
Access: public
Key
Key.left ⇒ Kind: static property of Key
Summary: Returns Key, Left Arrow.
Access: public
Key
Key.right ⇒ Kind: static property of Key
Summary: Returns Key, Right Arrow.
Access: public
Keyboard
Kind: global class
Summary: a global keyboard abstraction
Swipe
Kind: global class
Summary: Encapsulates touch event management.
- Swipe
- new Swipe(element, tolerance)
- .onLeft(method) ⇒
this
- .onRight(method) ⇒
this
- .onMove(method) ⇒
this
- .destroy() ⇒
this
new Swipe(element, tolerance)
Param | Type | Description |
---|---|---|
element | Element |
Element that will listen for swipe events. |
tolerance | number |
The distance in pixels a swipe must travel to trigger a swipe event. |
this
swipe.onLeft(method) ⇒ Kind: instance method of Swipe
Summary: Subscribes method to be called when user swipes left.
Access: public
Param | Type |
---|---|
method | function |
this
swipe.onRight(method) ⇒ Kind: instance method of Swipe
Summary: Subscribes method to be called when user swipes right.
Access: public
Param | Type |
---|---|
method | function |
this
swipe.onMove(method) ⇒ Kind: instance method of Swipe
Summary: Subscribes method to be called when user swipes.
Access: public
Param | Type |
---|---|
method | function |
this
swipe.destroy() ⇒ Kind: instance method of Swipe
Summary: Clean up all potential memory leaks.
Access: public
Store
Kind: global class
Summary: Global persistent data store.
- Store
- .connected
- .connect()
- .disconnect()
- .read(name) ⇒
Promise.<*>
- .write(name, data) ⇒
Promise.<*>
- .remove(name) ⇒
Promise.<*>
- .delete(name) ⇒
Promise.<*>
- .save() ⇒
Promise.<*>
- .estimate() ⇒
Promise.<*>
- .saved() ⇒
Promise.<*>
Store.connected
Kind: static property of Store
Summary: Returns true when Store is connected to data store.
Access: public
Store.connect()
Kind: static method of Store
Summary: Connect Store to data store.
Access: public
Store.disconnect()
Kind: static method of Store
Summary: Disconnect Store from data store.
Access: public
Promise.<*>
Store.read(name) ⇒ Kind: static method of Store
Summary: Read data from collection with name.
Access: public
Param | Type | Description |
---|---|---|
name | string |
Name of target collection. |
Promise.<*>
Store.write(name, data) ⇒ Kind: static method of Store
Summary: Write data to the collection with name.
Access: public
Param | Type | Description |
---|---|---|
name | string |
Name of target collection. |
data | * |
Data to write to collection |
Promise.<*>
Store.remove(name) ⇒ Kind: static method of Store
Summary: Remove collection with name.
Access: public
Param | Type | Description |
---|---|---|
name | string |
Name of target collection. |
Promise.<*>
Store.delete(name) ⇒ Kind: static method of Store
Summary: Delete collection with name.
Access: public
Param | Type | Description |
---|---|---|
name | string |
Name of target collection. |
Promise.<*>
Store.save() ⇒ Kind: static method of Store
Summary: Save Store (Requires secure connection, i.e. HTTPS)
Access: public
Promise.<*>
Store.estimate() ⇒ Kind: static method of Store
Summary: Storage estimates.
Access: public
Promise.<*>
Store.saved() ⇒ Kind: static method of Store
Summary: True if the Store is saved.
Access: public
object
form : Kind: global namespace
- form :
object
- .readData(form) ⇒
FormData
- .read(form) ⇒
Object
- .readJson(form) ⇒
string
- .write(form, data)
- .readData(form) ⇒
FormData
form.readData(form) ⇒ Kind: static method of form
Summary: Reads data as FormData from a form.
Param | Type | Description |
---|---|---|
form | HTMLFormElement |
the form to read. |
Object
form.read(form) ⇒ Kind: static method of form
Summary: Reads data as an object of key value pairs
from a form. Where the keys are the names of each
field and the values are the value of these fields.
Param | Type | Description |
---|---|---|
form | HTMLFormElement |
the form to read. |
string
form.readJson(form) ⇒ Kind: static method of form
Summary: Reads data as JSON of key value pairs
from a form. Where the keys are the names of each
field and the values are the value of these fields.
Param | Type | Description |
---|---|---|
form | HTMLFormElement |
the form to read. |
form.write(form, data)
Kind: static method of form
Summary: Write data as an object to a form. Where
the keys are the names of each field and the values
are the value of these fields.
Param | Type | Description |
---|---|---|
form | HTMLFormElement |
the form to write to. |
data | Object |
object
string : Kind: global namespace
- string :
object
string
string.encodeBase64(string, [stripPadding]) ⇒ Kind: static method of string
Summary: Base64 encodes a string.
Param | Type | Description |
---|---|---|
string | string |
string to encode |
[stripPadding] | boolean |
return value will have base64 padding characters stripped when true. |
string
string.exports.decodeBase64(string) ⇒ Kind: static method of string
Summary: Decodes Base64 encoded string.
Param | Type | Description |
---|---|---|
string | string |
string to decode. |
string
string.exports.encodeUtf8(string) ⇒ Kind: static method of string
Summary: UTF8 encodes a string.
Param | Type | Description |
---|---|---|
string | string |
string to encode |
string
string.exports.decodeUtf8(string) ⇒ Kind: static method of string
Summary: Decodes UTF8 encoded string.
Param | Type | Description |
---|---|---|
string | string |
string to decode. |
Worker
worker(func) ⇒ Kind: global function
Summary: Returns a new Worker that runs the logic of the passed function.
Param | Type | Description |
---|---|---|
func | function |
Function containing the logic to be run in the Worker. |