core.addons.webapp.LocalStorage - core

#

API Docs for: 0.0.2
Show: Inherited Protected Private Deprecated

# core.addons.webapp.LocalStorage Class

Extends core.Core
Defined in: `addons/webapp/LocalStorage.js:4`
Module: addons

Singleton.
The main class that implements local storage functionalities on a web application. This class wraps multiple storage mechanisms for storing information on the client side.
This class supports the following:

- SessionStorage
- LocalStorage
- WebSQL

## Constructor

### `core.addons.webapp.LocalStorage`

(

- `opts`

)

Defined in `addons/webapp/LocalStorage.js:4`

#### Parameters:

- `opts` Object

  An object containing configurations required by the Core derived class.

  - `el` HTMLElement

    The node element included in the class composition.

- Index
- Methods
- Properties

## Item Index

### Methods

- clearProxyHandler
- configureSQL
- construct
- createTable
- delayedConstruct
- dispose
- find
- findAll
- getProxyHandler
- insertSql
- retrieveLocal
- retrieveSession
- retrieveSql
- storeLocal
- storeSession

### Properties

- node
- proxyHandlers

## Methods

### `clearProxyHandler`

(

- `method`

)

Inherited from core.Core: `src/core.js:716`

Core method for clearing proxied function methods.

#### Parameters:

- `method` String

  The string equivalent of the defined method to clear.

### `configureSQL`

(

- `dbname`
- `version`
- `desc`
- `size`

)

Defined in `addons/webapp/LocalStorage.js:127`

Method for configuring WebSQL, this includes database creation and all other meta information required on creation

#### Parameters:

- `dbname` String

  The name of the database to create

- `version` String

  The version of the database to create

- `desc` String

  The description of the database to create

- `size` Number

  The size of the database to create, uses bytes. (ie. 10241024 [intended mb size])

### `construct`

(

- `options`

)

Inherited from core.Core: `src/core.js:732`

Core method initialization. This is called automatically on core sub classes.

#### Parameters:

- `options` Object

  The object passed on the constructor of a core based class.

### `createTable`

(

- `tablename`
- `structure`

)

Defined in `addons/webapp/LocalStorage.js:87`

Method for creating tables on WebSQL

#### Parameters:

- `tablename` String

  The table name to use upon creation

- `structure` String

  The columns to use when creating table

### `delayedConstruct`

(

- `options`

)

Inherited from core.Core: `src/core.js:740`

Core method initialization. This is called automatically on core sub classes. Adds delay when being called automatically, this allows time to setup all the other classes and manage the sequence of instantiations.

#### Parameters:

- `options` Object

  The object passed on the constructor of a core based class.

### `dispose`

(

- `removeNode`

)

Inherited from core.Core: `src/core.js:749`

Core method for destroying/cleaning up objects.

#### Parameters:

- `removeNode` Boolean

  If true and there is a node attached in the class (el property) that element is going to be removed upon disposal.

### `find`

(

- `selector`

)
NodeList

Inherited from core.Core: `src/core.js:770`

Core method for searching sub node elements.

#### Parameters:

- `selector` String

  The selector used for searching sub nodes.

#### Returns:

NodeList:

An array of HTMLElements, please note that this is not jQuery selected nodes.

### `findAll`

(

- `selector`

)
NodeList

Inherited from core.Core: `src/core.js:785`

Core method for searching sub node elements within the document context.

#### Parameters:

- `selector` String

  The selector used for searching sub nodes within the document.

#### Returns:

NodeList:

An array of HTMLElements, please note that this is not jQuery selected nodes.

### `getProxyHandler`

(

- `method`

)
Function

Inherited from core.Core: `src/core.js:695`

Returns a scope bound function and stores it on the proxyHandlers property.

#### Parameters:

- `method` String

  The string equivalent of the defined method name of the class.

#### Returns:

Function:

The scope bound function defined on the parameter.

### `insertSql`

(

- `query`

)

Defined in `addons/webapp/LocalStorage.js:103`

Method for inserting data on WebSQL

#### Parameters:

- `query` String

  The string INSERT query to use upon insertion

### `retrieveLocal`

(

- `key`

)

Defined in `addons/webapp/LocalStorage.js:50`

Method for retrieving values in local storage.

#### Parameters:

- `key` String

  The key pair to use when retrieving values

### `retrieveSession`

(

- `key`

)

Defined in `addons/webapp/LocalStorage.js:75`

Method for retrieving values in session storage.

#### Parameters:

- `key` String

  The key pair to use when retrieving values

### `retrieveSql`

(

- `query`

)

Defined in `addons/webapp/LocalStorage.js:115`

Method for retrieving data on WebSQL

#### Parameters:

- `query` String

  The string SELECT query to use upon retrieval

### `storeLocal`

(

- `key`
- `value`

)

Defined in `addons/webapp/LocalStorage.js:37`

Method for storing key/value pair using local storage.

#### Parameters:

- `key` String

  The key to use when storing values

- `value` Object

  The value to store paired with the key parameter

### `storeSession`

(

- `key`
- `value`

)

Defined in `addons/webapp/LocalStorage.js:63`

Method for storing key/value pair using session storage.

#### Parameters:

- `key` String

  The key to use when storing values

- `value` Object

  The value to store paired with the key parameter

## Properties

### `node`

HTMLElement

Inherited from core.Core: `src/core.js:641`

The selected HTML element node reference.

### `proxyHandlers`

Object

Inherited from core.Core: `src/core.js:658`

Property for storing proxied function/methods