core.addons.webapp.LocalStorage Class
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
Parameters:
-
opts
ObjectAn object containing configurations required by the Core derived class.
-
el
HTMLElementThe node element included in the class composition.
-
Item Index
Methods
Properties
Methods
clearProxyHandler
-
method
Core method for clearing proxied function methods.
Parameters:
-
method
StringThe string equivalent of the defined method to clear.
configureSQL
-
dbname
-
version
-
desc
-
size
Method for configuring WebSQL, this includes database creation and all other meta information required on creation
Parameters:
-
dbname
StringThe name of the database to create
-
version
StringThe version of the database to create
-
desc
StringThe description of the database to create
-
size
NumberThe size of the database to create, uses bytes. (ie. 10241024 [intended mb size])
construct
-
options
Core method initialization. This is called automatically on core sub classes.
Parameters:
-
options
ObjectThe object passed on the constructor of a core based class.
createTable
-
tablename
-
structure
Method for creating tables on WebSQL
Parameters:
-
tablename
StringThe table name to use upon creation
-
structure
StringThe columns to use when creating table
delayedConstruct
-
options
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
ObjectThe object passed on the constructor of a core based class.
dispose
-
removeNode
Core method for destroying/cleaning up objects.
Parameters:
-
removeNode
BooleanIf true and there is a node attached in the class (el property) that element is going to be removed upon disposal.
find
-
selector
Core method for searching sub node elements.
Parameters:
-
selector
StringThe selector used for searching sub nodes.
Returns:
An array of HTMLElements, please note that this is not jQuery selected nodes.
findAll
-
selector
Core method for searching sub node elements within the document context.
Parameters:
-
selector
StringThe selector used for searching sub nodes within the document.
Returns:
An array of HTMLElements, please note that this is not jQuery selected nodes.
getProxyHandler
-
method
Returns a scope bound function and stores it on the proxyHandlers property.
Parameters:
-
method
StringThe string equivalent of the defined method name of the class.
Returns:
The scope bound function defined on the parameter.
insertSql
-
query
Method for inserting data on WebSQL
Parameters:
-
query
StringThe string INSERT query to use upon insertion
retrieveLocal
-
key
Method for retrieving values in local storage.
Parameters:
-
key
StringThe key pair to use when retrieving values
retrieveSession
-
key
Method for retrieving values in session storage.
Parameters:
-
key
StringThe key pair to use when retrieving values
retrieveSql
-
query
Method for retrieving data on WebSQL
Parameters:
-
query
StringThe string SELECT query to use upon retrieval
storeLocal
-
key
-
value
Method for storing key/value pair using local storage.
Parameters:
-
key
StringThe key to use when storing values
-
value
ObjectThe value to store paired with the key parameter
storeSession
-
key
-
value
Method for storing key/value pair using session storage.
Parameters:
-
key
StringThe key to use when storing values
-
value
ObjectThe value to store paired with the key parameter
Properties
node
HTMLElement
The selected HTML element node reference.
proxyHandlers
Object
Property for storing proxied function/methods