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:
-
optsObjectAn object containing configurations required by the Core derived class.
-
elHTMLElementThe node element included in the class composition.
-
Item Index
Methods
Properties
Methods
clearProxyHandler
-
method
Core method for clearing proxied function methods.
Parameters:
-
methodStringThe 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:
-
dbnameStringThe name of the database to create
-
versionStringThe version of the database to create
-
descStringThe description of the database to create
-
sizeNumberThe 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:
-
optionsObjectThe object passed on the constructor of a core based class.
createTable
-
tablename -
structure
Method for creating tables on WebSQL
Parameters:
-
tablenameStringThe table name to use upon creation
-
structureStringThe 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:
-
optionsObjectThe object passed on the constructor of a core based class.
dispose
-
removeNode
Core method for destroying/cleaning up objects.
Parameters:
-
removeNodeBooleanIf 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:
-
selectorStringThe 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:
-
selectorStringThe 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:
-
methodStringThe 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:
-
queryStringThe string INSERT query to use upon insertion
retrieveLocal
-
key
Method for retrieving values in local storage.
Parameters:
-
keyStringThe key pair to use when retrieving values
retrieveSession
-
key
Method for retrieving values in session storage.
Parameters:
-
keyStringThe key pair to use when retrieving values
retrieveSql
-
query
Method for retrieving data on WebSQL
Parameters:
-
queryStringThe string SELECT query to use upon retrieval
storeLocal
-
key -
value
Method for storing key/value pair using local storage.
Parameters:
-
keyStringThe key to use when storing values
-
valueObjectThe value to store paired with the key parameter
storeSession
-
key -
value
Method for storing key/value pair using session storage.
Parameters:
-
keyStringThe key to use when storing values
-
valueObjectThe 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
