Added session storage option to store module, fixed some unit tests, improved String.trim() polyfill

This commit is contained in:
Timothy Warren 2011-11-03 13:47:11 -04:00
parent a26a04f1a7
commit b13b012a25
17 changed files with 535 additions and 197 deletions

View File

@ -29,7 +29,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -40,8 +40,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>

View File

@ -61,7 +61,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -72,8 +72,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>

View File

@ -32,7 +32,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -43,8 +43,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>

View File

@ -32,7 +32,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -43,8 +43,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>

View File

@ -32,7 +32,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -43,8 +43,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>
@ -110,8 +110,8 @@
<!-- <!--
<div class="module-filter">&nbsp;</div> <div class="module-filter">&nbsp;</div>
--> -->
<b class="icon" title="Wrapper for localstorage data serialization"><a href="../symbols/%24_.store.html">store</a></b> <b class="icon" title="Wrapper for localstorage / sessionstorage data serialization"><a href="../symbols/%24_.store.html">store</a></b>
<span class='description'>Wrapper for localstorage data serialization</span> <span class='description'>Wrapper for localstorage / sessionstorage data serialization</span>
</div> </div>
<div class="sectionItem classProperty"> <div class="sectionItem classProperty">
@ -244,7 +244,7 @@ Dom manipulation module
</div> </div>
<div class="full-description"> <div class="full-description">
Wrapper for localstorage data serialization Wrapper for localstorage / sessionstorage data serialization
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_store.js.html">store.js</a>.</span></p> <p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_store.js.html">store.js</a>.</span></p>

View File

@ -32,7 +32,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -43,8 +43,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>
@ -105,7 +105,7 @@
<!-- <!--
<div class="module-filter">&nbsp;</div> <div class="module-filter">&nbsp;</div>
--> -->
<b class="icon" title="Retrieves and deserializes a value from localstorage, based on the specified key"><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span> <b class="icon" title="Retrieves and deserializes a value from localstorage, based on the specified key"><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span>
<span class='description'>Retrieves and deserializes a value from localstorage, based on the specified key</span> <span class='description'>Retrieves and deserializes a value from localstorage, based on the specified key</span>
</div> </div>
@ -113,7 +113,7 @@
<!-- <!--
<div class="module-filter">&nbsp;</div> <div class="module-filter">&nbsp;</div>
--> -->
<b class="icon" title="Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string"><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span> <b class="icon" title="Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string"><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span>
<span class='description'>Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string</span> <span class='description'>Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string</span>
</div> </div>
@ -121,8 +121,16 @@
<!-- <!--
<div class="module-filter">&nbsp;</div> <div class="module-filter">&nbsp;</div>
--> -->
<b class="icon" title="Removes the specified item from localstorage"><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span> <b class="icon" title="Removes the specified item from storage"><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span>
<span class='description'>Removes the specified item from localstorage</span> <span class='description'>Removes the specified item from storage</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Removes all values from the same domain storage"><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span>
<span class='description'>Removes all values from the same domain storage</span>
</div> </div>
</div> </div>
@ -148,8 +156,8 @@
<div class='sectionItem classMethod '> <div class='sectionItem classMethod '>
<a name=".get"> </a> <a name=".get"> </a>
<div class="itemTitle icon"> <div class="itemTitle icon">
$_.store.get<span class="signature">(<span title="key">string</span>)</span> $_.store.get<span class="signature">(<span title="key">string</span>, <span title="session">bool</span>)</span>
<span class="light" title="returns object">: object</span>
</div> </div>
<div class="full-description"> <div class="full-description">
Retrieves and deserializes a value from localstorage, Retrieves and deserializes a value from localstorage,
@ -178,6 +186,18 @@ based on the specified key
</td> </td>
</tr> </tr>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>bool</b>
</td>
<td class="methodItemDesc">
session
</td>
</tr>
</tbody></table> </tbody></table>
@ -207,7 +227,7 @@ based on the specified key
<div class='sectionItem classMethod '> <div class='sectionItem classMethod '>
<a name=".set"> </a> <a name=".set"> </a>
<div class="itemTitle icon"> <div class="itemTitle icon">
$_.store.set<span class="signature">(<span title="key">string</span>, <span title="value">mixed</span>)</span> $_.store.set<span class="signature">(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span>
</div> </div>
<div class="full-description"> <div class="full-description">
@ -249,21 +269,15 @@ and JSON-encodes the value if not a string
</td> </td>
</tr> </tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr> <tr>
<td class="methodItemType"> <td class="methodItemType">
</td>
<td class="methodItemName">
<b>bool</b>
</td> </td>
<td class="methodItemDesc"> <td class="methodItemDesc">
void session
</td> </td>
</tr> </tr>
@ -271,6 +285,10 @@ and JSON-encodes the value if not a string
</div> </div>
@ -278,11 +296,11 @@ and JSON-encodes the value if not a string
<div class='sectionItem classMethod '> <div class='sectionItem classMethod '>
<a name=".remove"> </a> <a name=".remove"> </a>
<div class="itemTitle icon"> <div class="itemTitle icon">
$_.store.remove<span class="signature">(<span title="key">string</span>)</span> $_.store.remove<span class="signature">(<span title="key">string</span>, <span title="session">bool</span>)</span>
</div> </div>
<div class="full-description"> <div class="full-description">
Removes the specified item from localstorage Removes the specified item from storage
@ -307,21 +325,15 @@ and JSON-encodes the value if not a string
</td> </td>
</tr> </tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr> <tr>
<td class="methodItemType"> <td class="methodItemType">
</td>
<td class="methodItemName">
<b>bool</b>
</td> </td>
<td class="methodItemDesc"> <td class="methodItemDesc">
void session
</td> </td>
</tr> </tr>
@ -329,6 +341,54 @@ and JSON-encodes the value if not a string
</div>
<div class='sectionItem classMethod '>
<a name=".clear"> </a>
<div class="itemTitle icon">
$_.store.clear<span class="signature">(<span title="session">bool</span>)</span>
</div>
<div class="full-description">
Removes all values from the same domain storage
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>bool</b>
</td>
<td class="methodItemDesc">
session
</td>
</tr>
</tbody></table>
</div> </div>

View File

@ -32,7 +32,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -43,8 +43,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>

View File

@ -32,7 +32,7 @@
<div class="section"> <div class="section">
<div title='$_ Constructor function' class='itemName namespace'> <div title='$_ Constructor function' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage / sessionstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'> <div title='DOM Dom manipulation module' class='itemName namespace'>
@ -43,8 +43,8 @@
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'> <div title='Wrapper for localstorage / sessionstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div> <div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from storage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>, <span title="session">bool</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes all values from the same domain storage'><a href="../symbols/%24_.store.html#.clear">clear</a></b><span class='signature'>(<span title="session">bool</span>)</span></div></div></div>
<div class="section"> <div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'> <div title='String and object manipulation utilities' class='itemName namespace'>

View File

@ -7,88 +7,117 @@
.line {border-right: 1px dotted #666; color: #666; font-style: normal;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </style></head><body><pre><span class='line'> 1</span> <span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 2</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 3</span> <span class='line'> 3</span> </span><span class="WHIT">
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="COMM">/** <span class='line'> 4</span> </span><span class="COMM">//No support for localstorage? Bail out early</span><span class="WHIT">
<span class='line'> 5</span> * Wrapper for localstorage data serialization <span class='line'> 5</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">localStorage</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">JSON</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 6</span> * <span class='line'> 6</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 7</span> * @name store <span class='line'> 7</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 8</span> * @namespace <span class='line'> 8</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 9</span> * @memberOf $_ <span class='line'> 9</span> </span><span class="WHIT">
<span class='line'> 10</span> */</span><span class="WHIT"> <span class='line'> 10</span> </span><span class="COMM">//Shortcuts for wrapper</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="COMM">/** <span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sessionStorage</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 13</span> * Retrieves and deserializes a value from localstorage, <span class='line'> 13</span>
<span class='line'> 14</span> * based on the specified key <span class='line'> 14</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 15</span> * <span class='line'> 15</span> * Wrapper for localstorage / sessionstorage data serialization
<span class='line'> 16</span> * @param string key <span class='line'> 16</span> *
<span class='line'> 17</span> * @name get <span class='line'> 17</span> * @name store
<span class='line'> 18</span> * @memberOf $_.store <span class='line'> 18</span> * @namespace
<span class='line'> 19</span> * @function <span class='line'> 19</span> * @memberOf $_
<span class='line'> 20</span> * @return object <span class='line'> 20</span> */</span><span class="WHIT">
<span class='line'> 21</span> */</span><span class="WHIT"> <span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">get</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 22</span> </span><span class="COMM">/**
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 23</span> * Retrieves and deserializes a value from localstorage,
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">JSON.parse</span><span class="PUNC">(</span><span class="NAME">localStorage.getItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 24</span> * based on the specified key
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 25</span> *
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="COMM">/** <span class='line'> 26</span> * @param string key
<span class='line'> 27</span> * Puts a value into localstorage at the specified key, <span class='line'> 27</span> * @param bool session
<span class='line'> 28</span> * and JSON-encodes the value if not a string <span class='line'> 28</span> * @name get
<span class='line'> 29</span> * <span class='line'> 29</span> * @memberOf $_.store
<span class='line'> 30</span> * @param string key <span class='line'> 30</span> * @function
<span class='line'> 31</span> * @param mixed value <span class='line'> 31</span> * @return object
<span class='line'> 32</span> * @name set <span class='line'> 32</span> * @type object
<span class='line'> 33</span> * @memberOf $_.store <span class='line'> 33</span> */</span><span class="WHIT">
<span class='line'> 34</span> * @function <span class='line'> 34</span> </span><span class="WHIT"> </span><span class="NAME">get</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 35</span> * @return void <span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 36</span> */</span><span class="WHIT"> <span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">s.getItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">l.getItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 37</span> </span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 38</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">JSON.parse</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 39</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 40</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">JSON.stringify</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 41</span> * Puts a value into localstorage at the specified key,
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'> 42</span> * and JSON-encodes the value if not a string
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">localStorage.setItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 43</span> *
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 44</span> * @param string key
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="COMM">/** <span class='line'> 45</span> * @param mixed value
<span class='line'> 46</span> * Removes the specified item from localstorage <span class='line'> 46</span> * @param bool session
<span class='line'> 47</span> * <span class='line'> 47</span> * @name set
<span class='line'> 48</span> * @param string key <span class='line'> 48</span> * @memberOf $_.store
<span class='line'> 49</span> * @name remove <span class='line'> 49</span> * @function
<span class='line'> 50</span> * @memberOf $_.store <span class='line'> 50</span> */</span><span class="WHIT">
<span class='line'> 51</span> * @function <span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 52</span> * @return void <span class='line'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> */</span><span class="WHIT"> <span class='line'> 53</span> </span><span class="WHIT"> </span><span class="COMM">// Localstorage generally only accepts strings</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">JSON.stringify</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 55</span>
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">localStorage.removeItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 56</span> </span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">s.setItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">l.setItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="COMM">/** <span class='line'> 58</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 59</span> * Returns an array of all the values in localstorage <span class='line'> 59</span> * Removes the specified item from storage
<span class='line'> 60</span> * in their raw form <span class='line'> 60</span> *
<span class='line'> 61</span> * <span class='line'> 61</span> * @param string key
<span class='line'> 62</span> * @name getAll <span class='line'> 62</span> * @param bool session
<span class='line'> 63</span> * @member of $_.store <span class='line'> 63</span> * @name remove
<span class='line'> 64</span> * @function <span class='line'> 64</span> * @memberOf $_.store
<span class='line'> 65</span> * @return object <span class='line'> 65</span> * @function
<span class='line'> 66</span> */</span><span class="WHIT"> <span class='line'> 66</span> */</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">getAll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">s.removeItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">l.removeItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 71</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage.length</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 72</span> * Removes all values from the same domain storage
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 73</span> *
<span class='line'> 74</span> <span class='line'> 74</span> * @param bool session
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 75</span> * @name clear
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 76</span> * @memberOf $_.store
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage.key</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 77</span> * @function
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage.getItem</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 78</span> */</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> <span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">s.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">l.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'> 83</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 84</span> * Returns an object of all the raw values in storage
<span class='line'> 85</span> <span class='line'> 85</span> *
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'store'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 86</span> * @name getAll
<span class='line'> 87</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html> <span class='line'> 87</span> * @member of $_.store
<span class='line'> 88</span> * @function
<span class='line'> 89</span> * @return object
<span class='line'> 90</span> * @type object
<span class='line'> 91</span> */</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">getAll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT">
<span class='line'>100</span> </span><span class="COMM">//Reference to session/localstorage</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sess</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">
<span class='line'>103</span> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span>
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.key</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getItem</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>110</span>
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>114</span>
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'store'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>

View File

@ -239,7 +239,7 @@ if(typeof String.prototype.trim === "undefined")
* @private * @private
*/ */
String.prototype.trim = function(){ String.prototype.trim = function(){
return this.replace(/^\s+|\s+$/g, ""); return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
}; };
} }
@ -758,28 +758,42 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
(function (){ (function (){
"use strict"; "use strict";
//No support for localstorage? Bail out early
if(typeof localStorage === "undefined" || typeof JSON === "undefined")
{
return;
}
//Shortcuts for wrapper
var l = localStorage,
s = sessionStorage;
/** /**
* Wrapper for localstorage data serialization * Wrapper for localstorage / sessionstorage data serialization
* *
* @name store * @name store
* @namespace * @namespace
* @memberOf $_ * @memberOf $_
*/ */
var store = { var store = {
/** /**
* Retrieves and deserializes a value from localstorage, * Retrieves and deserializes a value from localstorage,
* based on the specified key * based on the specified key
* *
* @param string key * @param string key
* @param bool session
* @name get * @name get
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return object * @return object
* @type object
*/ */
get: function (key) get: function (key, sess)
{ {
return JSON.parse(localStorage.getItem(key)); var val = (sess) ? s.getItem(key) : l.getItem(key);
return JSON.parse(val);
}, },
/** /**
* Puts a value into localstorage at the specified key, * Puts a value into localstorage at the specified key,
@ -787,54 +801,69 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
* *
* @param string key * @param string key
* @param mixed value * @param mixed value
* @param bool session
* @name set * @name set
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return void
*/ */
set: function (key, value) set: function (key, value, sess)
{ {
if (typeof value !== "string") // Localstorage generally only accepts strings
{ value = JSON.stringify(value);
value = JSON.stringify(value);
} (sess) ? s.setItem(key, value) : l.setItem(key, value);
localStorage.setItem(key, value);
}, },
/** /**
* Removes the specified item from localstorage * Removes the specified item from storage
* *
* @param string key * @param string key
* @param bool session
* @name remove * @name remove
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return void
*/ */
remove: function (key) remove: function (key, sess)
{ {
localStorage.removeItem(key); (sess) ? s.removeItem(key) : l.removeItem(key);
}, },
/** /**
* Returns an array of all the values in localstorage * Removes all values from the same domain storage
* in their raw form *
* @param bool session
* @name clear
* @memberOf $_.store
* @function
*/
clear: function(sess)
{
(sess) ? s.clear() : l.clear();
},
/**
* Returns an object of all the raw values in storage
* *
* @name getAll * @name getAll
* @member of $_.store * @member of $_.store
* @function * @function
* @return object * @return object
* @type object
*/ */
getAll: function () getAll: function (sess)
{ {
var i, var i,
len, len,
data; data = {},
len = localStorage.length; k,
data = {}; o;
//Reference to session/localstorage
o = (sess) ? l : s;
len = o.length;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
var name = localStorage.key(i); k = o.key(i);
var value = localStorage.getItem(name); data[k] = o.getItem(k);
data[name] = value;
} }
return data; return data;

21
kis-min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,27 +1,41 @@
(function (){ (function (){
"use strict"; "use strict";
//No support for localstorage? Bail out early
if(typeof localStorage === "undefined" || typeof JSON === "undefined")
{
return;
}
//Shortcuts for wrapper
var l = localStorage,
s = sessionStorage;
/** /**
* Wrapper for localstorage data serialization * Wrapper for localstorage / sessionstorage data serialization
* *
* @name store * @name store
* @namespace * @namespace
* @memberOf $_ * @memberOf $_
*/ */
var store = { var store = {
/** /**
* Retrieves and deserializes a value from localstorage, * Retrieves and deserializes a value from localstorage,
* based on the specified key * based on the specified key
* *
* @param string key * @param string key
* @param bool session
* @name get * @name get
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return object * @return object
* @type object
*/ */
get: function (key) get: function (key, sess)
{ {
return JSON.parse(localStorage.getItem(key)); var val = (sess) ? s.getItem(key) : l.getItem(key);
return JSON.parse(val);
}, },
/** /**
* Puts a value into localstorage at the specified key, * Puts a value into localstorage at the specified key,
@ -29,54 +43,69 @@
* *
* @param string key * @param string key
* @param mixed value * @param mixed value
* @param bool session
* @name set * @name set
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return void
*/ */
set: function (key, value) set: function (key, value, sess)
{ {
if (typeof value !== "string") // Localstorage generally only accepts strings
{ value = JSON.stringify(value);
value = JSON.stringify(value);
} (sess) ? s.setItem(key, value) : l.setItem(key, value);
localStorage.setItem(key, value);
}, },
/** /**
* Removes the specified item from localstorage * Removes the specified item from storage
* *
* @param string key * @param string key
* @param bool session
* @name remove * @name remove
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return void
*/ */
remove: function (key) remove: function (key, sess)
{ {
localStorage.removeItem(key); (sess) ? s.removeItem(key) : l.removeItem(key);
}, },
/** /**
* Returns an array of all the values in localstorage * Removes all values from the same domain storage
* in their raw form *
* @param bool session
* @name clear
* @memberOf $_.store
* @function
*/
clear: function(sess)
{
(sess) ? s.clear() : l.clear();
},
/**
* Returns an object of all the raw values in storage
* *
* @name getAll * @name getAll
* @member of $_.store * @member of $_.store
* @function * @function
* @return object * @return object
* @type object
*/ */
getAll: function () getAll: function (sess)
{ {
var i, var i,
len, len,
data; data = {},
len = localStorage.length; k,
data = {}; o;
//Reference to session/localstorage
o = (sess) ? l : s;
len = o.length;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
var name = localStorage.key(i); k = o.key(i);
var value = localStorage.getItem(name); data[k] = o.getItem(k);
data[name] = value;
} }
return data; return data;

View File

@ -22,7 +22,7 @@ if(typeof String.prototype.trim === "undefined")
* @private * @private
*/ */
String.prototype.trim = function(){ String.prototype.trim = function(){
return this.replace(/^\s+|\s+$/g, ""); return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
}; };
} }

View File

@ -32,7 +32,7 @@ for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName
<div class="nephew"></div> <div class="nephew"></div>
</aside> </aside>
</section> </section>
<script src="../kis-min.js"></script> <script src="../kis-custom.js"></script>
<script src="qunit/qunit.js"></script> <script src="qunit/qunit.js"></script>
<script type="text/javascript"> <script type="text/javascript">
//Selector test function //Selector test function
@ -43,11 +43,59 @@ for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName
//Return the single object if applicable //Return the single object if applicable
return (x.length === 1) ? x[0] : x; return (x.length === 1) ? x[0] : x;
} }
//Object equivalence function
function is_clone(o1, o2)
{
var n,
flag=true;
for(n in o1)
{
if(o1.hasOwnProperty(n))
{
if($_.type(o1[n]) === "object")
{
flag = is_clone(o1[n], o2[n]);
}
else
{
if(o1[n] !== o2[n])
{
flag = false;
break;
}
}
}
}
for(n in o2)
{
if(o2.hasOwnProperty(n))
{
if($_.type(o1[n]) === "object")
{
flag = is_clone(o1[n], o2[n]);
}
else
{
if(o2[n] !== o1[n])
{
flag = false;
break;
}
}
}
}
return flag;
}
</script> </script>
<script src="tests/core.js"></script> <script src="tests/core.js"></script>
<script src="tests/ajax.js"></script> <script src="tests/ajax.js"></script>
<script src="tests/event.js"></script> <script src="tests/event.js"></script>
<script src="tests/dom.js"></script> <script src="tests/dom.js"></script>
<script src="tests/store.js"></script>
<script src="tests/util.js"></script> <script src="tests/util.js"></script>
</body> </body>
</html> </html>

View File

@ -5,11 +5,13 @@
module("core"); module("core");
test("Basic requirements", function(){ test("Basic requirements", function(){
expect(6); expect(8);
ok(document.querySelectorAll, "querySelectorAll"); ok(document.querySelectorAll, "querySelectorAll");
ok(document.getElementById, "getElementById"); ok(document.getElementById, "getElementById");
ok(document.getElementsByTagName, "getElementsByTagName"); ok(document.getElementsByTagName, "getElementsByTagName");
ok(String.prototype.trim, "String.trim()"); ok(String.prototype.trim, "String.trim()");
ok(JSON.parse, "JSON.parse()");
ok(JSON.stringify, "JSON.stringify()");
strictEqual(typeof $_, "function", "Global var"); strictEqual(typeof $_, "function", "Global var");
strictEqual(typeof $_(), "object"); strictEqual(typeof $_(), "object");
}); });
@ -36,8 +38,8 @@
$_.ext('test', {}); $_.ext('test', {});
strictEqual(typeof o.test, "object", "Extend function adds to $_"); strictEqual(typeof o.test, "object", "Extend function adds to $_");
strictEqual(o.test.el, $_("ol").el, "Extend function adds selector to passed object"); strictEqual(is_clone(o.test.el, $_("ol").el), true, "Extend function adds selector to passed object");
strictEqual(o.test.el, o.el, "Selector is the same on parent and child object"); strictEqual(is_clone(o.test.el, o.el), true, "Selector is the same on parent and child object");
o = null; o = null;
}); });

View File

@ -79,10 +79,14 @@
test("html", function(){ test("html", function(){
expect(2); expect(2);
var test_html = '<a href="mailto:tim@timshomepage.net">Send Tim an email</a>'; var orig_html = "This is important text!";
var test_html = '<a href="mailto:tim@timshomepage.net">send tim an email</a>';
equal($_('#r14').dom.html().trim(), "This is important text!".trim(), "Gets html"); document.getElementById('r14').innerHTML = orig_html;
equal($_('#r14').dom.html(test_html), test_html, "Sets html");
equal($_('#r14').dom.html().trim(), "This is important text!", "Gets html");
equal($_('#r14').dom.html(test_html).toLowerCase(), test_html, "Sets html");
}); });
}()); }());

118
tests/tests/store.js Normal file
View File

@ -0,0 +1,118 @@
(function (){
//"use strict";
module("store");
//Test data
var test_obj = {
test:'value',
t:3,
x:[0,5,3]
};
var t = JSON.stringify(test_obj);
test("Clear", function(){
expect(2);
//Setup
localStorage.clear();
localStorage.setItem("test", "value");
sessionStorage.clear();
sessionStorage.setItem("test", "value");
//Clear localStorage
$_.store.clear();
equal(localStorage.length, 0, "No items in localStorage");
//Clear sessionStorage
$_.store.clear(true);
equal(sessionStorage.length, 0, "No items in sessionStorage");
});
test("Set", function(){
expect(2);
$_.store.set('test', test_obj);
strictEqual(localStorage.getItem('test'), t, "Set object in localStorage");
$_.store.set('test', test_obj, true);
strictEqual(sessionStorage.getItem('test'), t, "Set object in sessionStorage");
});
test("Get", function(){
expect(2);
//Test data
var test_obj = {
test:'value',
t:3,
x:[0,5,3]
};
var t = JSON.stringify(test_obj);
var t_prime = JSON.parse(t);
//This is tricky because test_obj != JSON.parse(JSON.stringify(test_obj))
equal(JSON.stringify($_.store.get('test')), t, "Gets and parses object from localStorage");
equal(JSON.stringify($_.store.get('test', true)), t, "Gets and parses object from localStorage");
});
test("Remove", function(){
expect(2);
$_.store.remove('test');
equal(localStorage["test"], null, "Removes from localStorage");
$_.store.remove('test', true);
equal(sessionStorage["test"], null, "Removes from sessionStorage");
});
test("Get All", function(){
expect(2);
//Make sure storage is clean
localStorage.clear();
sessionStorage.clear();
var foo = {
a: [0,5,6]
};
var bar = {
x: {
b: 2
},
y: "baz"
};
var comb = {
foo: JSON.stringify(foo),
bar: JSON.stringify(bar),
q: "What is the question?"
};
$_.store.set('foo', foo);
$_.store.set('bar', bar);
localStorage.setItem('q', "What is the question?");
$_.store.set('foo', foo, true);
$_.store.set('bar', bar, true);
sessionStorage.setItem('q', "What is the question?");
var all_local = $_.store.getAll();
var all_session = $_.store.getAll(true);
//comb = comb;
equal(is_clone(all_local, comb), true, "Gets all items from localStorage");
equal(is_clone(all_session, comb), true, "Gets all items from sessionStorage");
});
}());