kis-js/docs/$_.store.html

857 lines
10 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: store</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: store</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="$_.html">$_</a>.</span>
store
</h2>
</header>
<article>
<div class="container-overview">
<div class="description">Wrapper for localstorage / sessionstorage data serialization.
Each method has a boolean parameter, that when set as true switches the method
to use sessionStorage rather than the default localStorage.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="store.js.html">modules/store.js</a>, <a href="store.js.html#line14">line 14</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="clear"><span class="type-signature">(static) </span>clear<span class="signature">(session)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Removes all values from the same domain storage
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>session</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="store.js.html">modules/store.js</a>, <a href="store.js.html#line102">line 102</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="get"><span class="type-signature">(static) </span>get<span class="signature">(key, session)</span><span class="type-signature"> &rarr; {Object}</span></h4>
</dt>
<dd>
<div class="description">
Retrieves and deserializes a value from localstorage,
based on the specified key
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>session</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="store.js.html">modules/store.js</a>, <a href="store.js.html#line24">line 24</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getAll"><span class="type-signature">(static) </span>getAll<span class="signature">(session)</span><span class="type-signature"> &rarr; {Object}</span></h4>
</dt>
<dd>
<div class="description">
Returns an object of all the raw values in storage
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>session</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="store.js.html">modules/store.js</a>, <a href="store.js.html#line72">line 72</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="remove"><span class="type-signature">(static) </span>remove<span class="signature">(key, session)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Removes the specified item from storage
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>session</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="store.js.html">modules/store.js</a>, <a href="store.js.html#line59">line 59</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="set"><span class="type-signature">(static) </span>set<span class="signature">(key, value, session)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Puts a value into localstorage at the specified key,
and JSON-encodes the value if not a string
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">mixed</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>session</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="store.js.html">modules/store.js</a>, <a href="store.js.html#line41">line 41</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Tue Sep 16 2014 16:57:40 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>