Add ability to use object as an argument to dom.css method, update docs to be more accurate

This commit is contained in:
Timothy Warren 2014-09-05 11:57:18 -04:00
parent 14b8a6c981
commit 8e9d93a525
87 changed files with 7336 additions and 4059 deletions

View File

@ -9,7 +9,7 @@ src directory, and running the "combine.php" script. This will output a
"kis-custom.js" file. (Be careful, as the script will overwrite any "kis-custom.js" "kis-custom.js" file. (Be careful, as the script will overwrite any "kis-custom.js"
file that already exists). file that already exists).
Browser support: IE9+, Latest versions of Firefox, Chrome, Safari, Opera Browser support: IE10+, Latest versions of Firefox, Chrome, Safari, Opera
## Basic Use: ## ## Basic Use: ##

1500
docs/$_.dom.html Normal file

File diff suppressed because it is too large Load Diff

1090
docs/$_.event.html Normal file

File diff suppressed because it is too large Load Diff

888
docs/$_.html Normal file
View File

@ -0,0 +1,888 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: $_</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: $_</h1>
<section>
<header>
<h2>
$_
</h2>
</header>
<article>
<div class="container-overview">
<div class="description">$_
Constructor function</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line14">line 14</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Namespaces</h3>
<dl>
<dt><a href="namespaces.html#$_.dom"><a href="$_.dom.html">dom</a></a></dt>
<dd></dd>
<dt><a href="namespaces.html#$_.event"><a href="$_.event.html">event</a></a></dt>
<dd></dd>
<dt><a href="namespaces.html#$_.store"><a href="$_.store.html">store</a></a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="$"><span class="type-signature">&lt;static> </span>$<span class="signature">(selector, <span class="optional">context</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
</dt>
<dd>
<div class="description">
Simple DOM selector function
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>selector</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>context</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line67">line 67</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="each"><span class="type-signature">&lt;static> </span>each<span class="signature">(callback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Iterates over a $_ object, applying a callback to each item
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">iteration callback</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="core.js.html">core.js</a>, <a href="core.js.html#line104">line 104</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="get"><span class="type-signature">&lt;static> </span>get<span class="signature">(url, data, success_callback, <span class="optional">error_callback</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Sends a GET type ajax request
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The url to retrieve</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last">get parameters to send</td>
</tr>
<tr>
<td class="name"><code>success_callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">callback called on success</td>
</tr>
<tr>
<td class="name"><code>error_callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">callback called if there is an error</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ajax.js.html">modules/ajax.js</a>, <a href="ajax.js.html#line96">line 96</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="post"><span class="type-signature">&lt;static> </span>post<span class="signature">(url, data, success_callback, <span class="optional">error_callback</span>)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Sends a POST type ajax request
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">The url to post to</td>
</tr>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last">post parameters to send</td>
</tr>
<tr>
<td class="name"><code>success_callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">callback called on success</td>
</tr>
<tr>
<td class="name"><code>error_callback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">callback called if there is an error</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ajax.js.html">modules/ajax.js</a>, <a href="ajax.js.html#line111">line 111</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

855
docs/$_.store.html Normal file
View File

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

377
docs/DOM.js.html Normal file
View File

@ -0,0 +1,377 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: modules/DOM.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: modules/DOM.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* DOM
*
* Dom manipulation module
*/
(function (undefined){
"use strict";
var d;
//Private function for getting/setting attributes/properties
function _attr(sel, name, value)
{
var oldVal;
//Get the value of the attribute, if it exists
if (sel.hasAttribute(name))
{
oldVal = sel.getAttribute(name);
}
//Well, I guess that attribute doesn't exist
if (oldVal === undefined &amp;&amp; (value === undefined || value === null))
{
return null;
}
//No value to set? Return the current value
if (value === undefined)
{
return oldVal;
}
//Determine what to do with the attribute
if (value !== undefined &amp;&amp; value !== null)
{
sel.setAttribute(name, value);
}
else if (value === null)
{
sel.removeAttribute(name);
}
return (value !== undefined) ? value : oldVal;
}
/**
* Change css property name to it's
* javascript camel case equivalent
*/
function _toCamel(s)
{
return String(s).replace(/(\-[a-z])/g, function($1){
return $1.toUpperCase().replace('-','');
});
}
function _css(sel, prop, val)
{
var equi;
//Camel-case
prop = _toCamel(prop);
//Equivalent properties for 'special' browsers
equi = {
outerHeight: "offsetHeight",
outerWidth: "offsetWidth",
top: "posTop"
};
//If you don't define a value, try returning the existing value
if(val === undefined &amp;&amp; sel.style[prop] !== undefined)
{
return sel.style[prop];
}
else if(val === undefined &amp;&amp; sel.style[equi[prop]] !== undefined)
{
return sel.style[equi[prop]];
}
//Let's try the easy way first
if(sel.style[prop] !== undefined)
{
sel.style[prop] = val;
//Short circuit
return null;
}
else if(sel.style[equi[prop]])
{
sel.style[equi[prop]] = val;
return null;
}
}
// --------------------------------------------------------------------------
/**
* DOM
*
* Dom manipulation module
* @namespace
* @memberOf $_
* @name dom
*/
d = {
/**
* Adds a class to the element(s) specified by the current
* selector
*
* @name addClass
* @memberOf $_.dom
* @function
* @param {string} class
*/
addClass: function (c)
{
$_.each(function (e){
e.classList.add(c);
});
},
/**
* Removes a class from the element(s) specified by the current
* selector
*
* @name removeClass
* @memberOf $_.dom
* @function
* @param {string} class
*/
removeClass: function (c)
{
$_.each(function (e){
e.classList.remove(c);
});
},
/**
* Hides the element(s) specified by the current selector
*
* @name hide
* @memberOf $_.dom
* @function
*/
hide: function ()
{
this.css('display', 'none');
},
/**
* Shows the element(s) specified by the current selector.
* if type is specified, the element will have it's style
* property set to "display:[your type]". If type is not
* specified, the element is set to "display:block".
*
* @name show
* @memberOf $_.dom
* @function
* @param {string} [type]
*/
show: function (type)
{
if (type === undefined)
{
type = "block";
}
this.css("display", type);
},
/**
* Sets attributes on element(s) specified by the current
* selector, or, if name is not specified, returns the
* value of the attribute of the element specified by the
* current selector.
*
* @name attr
* @memberOf $_.dom
* @function
* @param {string} name
* @param {?string}[value]
* @return {?string}
*/
attr: function (name, value)
{
var sel = this.el;
//Make sure you don't try to get a bunch of elements
if (sel.length > 1 &amp;&amp; value === undefined)
{
return null;
}
else if (sel.length > 1 &amp;&amp; value !== undefined) //You can set a bunch, though
{
$_.each(function (e){
return _attr(e, name, value);
});
}
else //Normal behavior
{
return _attr(sel, name, value);
}
},
/**
* Sets or retrieves the text content of the element
* specified by the current selector. If a value is
* passed, it will set that value on the current element,
* otherwise it will return the value of the current element
*
* @name text
* @memberOf $_.dom
* @function
* @param {?string} [value]
* @return {?string}
*/
text: function (value)
{
var oldValue, set, sel;
sel = this.el;
set = (value !== undefined) ? true : false;
oldValue = sel.textContent;
if(set)
{
sel.textContent = value;
return value;
}
else
{
return oldValue;
}
},
/**
* Sets or retrieves a css property of the element
* specified by the current selector. If a value is
* passed, it will set that value on the current element,
* otherwise it will return the value of the css property
* on the current element.
*
* Accepts either key/value arguments, or an object with
* multiple key/value pairs.
*
* @name css
* @memberOf $_.dom
* @function
* @param {(string|Object)} property
* @param {?string} [value]
* @return {?string}
*/
css: function (prop, val)
{
var prop_key = null;
// If passed an object, recurse!
if($_.type(prop) === 'object')
{
for (prop_key in prop)
{
if ( ! prop.hasOwnProperty(prop_key)) continue;
$_.each(function (e){
_css(e, prop_key, prop[prop_key]);
});
}
}
//Return the current value if a value is not set
else if(val === undefined &amp;&amp; $_.type(prop) !== 'object')
{
return _css(this.el, prop);
}
$_.each(function (e){
_css(e, prop, val);
});
},
/**
* Adds to the innerHTML of the current element, after the last child.
*
* @example $_("ul").dom.append("&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;") adds an li element to the end of the selected ul element
* @name append
* @memberOf $_.dom
* @function
* @param {string} htm
*/
append: function(htm)
{
this.el.insertAdjacentHTML('beforeend', htm);
},
/**
* Adds to the innerHTML of the selected element, before the current children
*
* @name prepend
* @memberOf $_.dom
* @function
* @param {string} htm
*/
prepend: function(htm)
{
this.el.insertAdjacentHTML('afterbegin', htm);
},
/**
* Sets or gets the innerHTML propery of the element(s) passed
*
* @name html
* @memberOf $_.dom
* @function
* @param {?string} [htm]
* @return {?string}
*/
html: function(htm)
{
if(htm !== undefined)
{
this.el.innerHTML = htm;
}
//If the parameter is undefined, just return the current value
return this.el.innerHTML;
}
};
$_.ext('dom', d);
}());</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

175
docs/ajax.js.html Normal file
View File

@ -0,0 +1,175 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: modules/ajax.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: modules/ajax.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Ajax
*
* Module for making ajax requests
*/
(function (undefined){
"use strict";
var ajax = {
_do: function (url, data, success_callback, error_callback, isPost)
{
var type,
request = new XMLHttpRequest();
if (success_callback === undefined)
{
/**
* @private
*/
success_callback = function (){};
}
type = (isPost) ? "POST" : "GET";
if (type === "GET")
{
url += (url.match(/\?/))
? this._serialize(data)
: "?" + this._serialize(data);
}
request.open(type, url);
request.onreadystatechange = function ()
{
if (request.readyState === 4)
{
if (request.status === 200)
{
success_callback.call(request.responseText, request.responseText);
}
else
{
if (error_callback !== undefined)
{
error_callback.call(request.status, request.status);
}
}
}
};
if (type === "POST")
{
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
request.send(this._serialize(data));
}
else
{
request.send(null);
}
},
/**
* Url encoding for non-get requests
*
* @param data
* @returns {string}
* @private
*/
_serialize: function (data)
{
var name,
value,
pairs = [];
for (name in data)
{
if ( ! data.hasOwnProperty(name) || $_.type(data[name]) === "function")
{
continue;
}
value = data[name].toString();
name = encodeURIComponent(name);
value = encodeURIComponent(value);
pairs.push(name + "=" + value);
}
return pairs.join("&amp;");
}
};
/**
* Sends a GET type ajax request
*
* @name get
* @function
* @memberOf $_
* @param {string} url - The url to retrieve
* @param {Object} data - get parameters to send
* @param {function} success_callback - callback called on success
* @param {function} [error_callback] - callback called if there is an error
*/
$_.ext('get', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, false);
});
/**
* Sends a POST type ajax request
*
* @name post
* @function
* @memberOf $_
* @param {string} url - The url to post to
* @param {Object} data - post parameters to send
* @param {function} success_callback - callback called on success
* @param {function} [error_callback] - callback called if there is an error
*/
$_.ext('post', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, true);
});
}());
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@ -1,16 +0,0 @@
body {
margin: 0;
}
.KEYW { color: #6277AA; font-weight: bold; }
.COMM { color: #008200; }
.NUMB { color: #393;}
.STRN { color: #00d; }
.REGX { color: #339;}
.linenumber {
border-right: 7px solid #8DA6C6;
color: #fff;
font-style: normal;
font-weight: bold;
padding: 0 7px;
background: #6277AA;
}

194
docs/core.js.html Normal file
View File

@ -0,0 +1,194 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: core.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: core.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
Kis JS Keep It Simple JS Library
Copyright Timothy J. Warren
License Public Domain
Version 0.8.0
*/
(function (undefined){
"use strict";
var $_, $, sel;
/**
* $_
*
* Constructor function
*
* @constructor
* @namespace $_
* @param {string} selector - The dom selector string
* @return {Object}
*/
$_ = function(s)
{
// Have documentElement be default selector, just in case
if (s === undefined)
{
// Defines a "global" selector for that instance
sel = ($_.el !== undefined)
? $_.el
: document.documentElement;
}
else
{
sel = $(s);
}
// Add the selector to the prototype
$_.prototype.el = sel;
// Use the $_ object as it's own prototype
var self = Object.create($_);
// Give sel to each extension.
for(var i in self)
{
if(typeof self[i] === "object")
{
self[i].el = sel;
}
}
self.el = sel;
return self;
};
/**
* Simple DOM selector function
*
* @memberOf $_
* @param {string} selector
* @param {Object} [context]
* @return {Object}
*/
$ = function (a, context)
{
var x, c;
if (typeof a != "string" || a === undefined){ return a;}
//Check for a context of a specific element, otherwise, just run on the document
c = (context != null &amp;&amp; context.nodeType === 1)
? context
: document;
//Pick the quickest method for each kind of selector
if (a.match(/^#([\w\-]+$)/))
{
return document.getElementById(a.split('#')[1]);
}
else
{
x = c.querySelectorAll(a);
}
//Return the single object if applicable
return (x.length === 1) ? x[0] : x;
};
/**
* Adds the property `obj` to the $_ object, calling it `name`
*
* @param {string} name - name of the module
* @param {object} obj - the object to add
*/
$_.ext = function(name, obj)
{
obj.el = sel;
$_[name] = obj;
};
/**
* Iterates over a $_ object, applying a callback to each item
*
* @name $_.each
* @function
* @param {function} callback - iteration callback
*/
$_.ext('each', function (callback)
{
if(sel.length !== undefined &amp;&amp; sel !== window)
{
[].forEach.call(sel, callback);
}
else
{
callback.call(sel, sel);
}
});
/**
* Retrieves the type of the passed variable
*
* @param {*} obj
* @return {string}
*/
$_.type = function(obj)
{
if((function() {return obj &amp;&amp; (obj !== this)}).call(obj))
{
//fallback on 'typeof' for truthy primitive values
return (typeof obj).toLowerCase();
}
//Strip x from [object x] and return
return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
};
//Set global variables
$_ = window.$_ = window.$_ || $_;
$_.$ = $;
}());
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@ -1,358 +0,0 @@
/* TABLE OF CONTENTS:
* - Browser reset
* - HTML elements
* - JsDoc styling
*/
/*
* BEGIN BROWSER RESET
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,p,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0
}
html {
height:100%;
overflow:-moz-scrollbars-vertical;
overflow-x:auto
}
table {
border:0;
border-collapse:collapse;
border-spacing:0
}
fieldset,img {
border:0
}
address,caption,cite,code,dfn,em,strong,th,var {
font-style:normal;
font-weight:normal
}
em,cite {
font-style:italic
}
strong {
font-weight:bold
}
ol,ul {
list-style:none
}
caption,th {
text-align:left
}
h1,h2,h3,h4,h5,h6 {
font-size:100%;
font-weight:normal;
margin:0;
padding:0
}
q:before,q:after {
content:''
}
abbr,acronym {
border:0
}
section,article,header,footer,nav,aside,hgroup {
display:block
}
/*
* END BROWSER RESET
*/
/*
* HTML ELEMENTS
*/
@font-face {
font-family: 'M1m';
src: url('fonts/mplus-1m-regular-webfont.eot');
src: local('☺'), url('fonts/mplus-1m-regular-webfont.woff') format('woff'), url('fonts/mplus-1m-regular-webfont.ttf') format('truetype'), url('fonts/mplus-1m-regular-webfont.svg#webfontVd14f4NN') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'M1m';
src: url('fonts/mplus-1m-bold-webfont.eot');
src: local('☺'), url('fonts/mplus-1m-bold-webfont.woff') format('woff'), url('fonts/mplus-1m-bold-webfont.ttf') format('truetype'), url('fonts/mplus-1m-bold-webfont.svg#webfontIjI5mZqE') format('svg');
font-weight: bold;
font-style: normal;
}
* {
line-height: 1.4em;
}
html {
font-size: 100%;
}
body {
font-size: 0.75em;
padding: 15px 0;
background: #eee;
background-image: -moz-linear-gradient(left, #dddddd, #f9f9f9) fixed;
background-image: -webkit-gradient(linear,left bottom,right bottom,color-stop(0, #dddddd),color-stop(1, #f9f9f9)) fixed;
}
body,
input,
select,
textarea {
color: #000;
font-family: Arial, Geneva, sans-serif;
}
a:link,
a:hover,
a:active,
a:visited {
color: #19199e;
}
a:hover,
a:focus {
color: #00f;
text-decoration: none;
}
p {
margin: 0 0 1.5em 0;
}
/*
* END HTML ELEMENTS
*/
/*
* BEGIN HACK
*/
div.containerMain:after,
div.safeBox:after {
content:"";
display:block;
height:0;
clear:both;
}
/*
* END HACK
*/
/*
* BEGIN JSDOC
*/
/* Start menu */
div.index *.heading1 {
margin-bottom: 0.5em;
border-bottom: 1px solid #999999;
font-family: M1m, Arial, sans-serif;
font-size: 1.6em;
letter-spacing: 1px;
line-height: 1.3em;
}
div.index div.menu {
background-color: #FFFFFF;
}
*+html div.index div.menu {
background-color: #FFFFFF;
}
* html div.index div.menu {
background-color: #FFFFFF;
}
div.index div.menu div {
text-align: left;
}
div.index div.menu a {
text-decoration: none;
}
div.index div.menu a:hover {
text-decoration: underline;
}
div.index ul.classList {
padding-left: 0;
}
div.index ul.classList a {
display: block;
margin: 1px 0;
padding: 4px 0 2px 10px;
text-indent: -10px;
}
div.index div.fineprint {
color: #777;
font-size: 0.9em;
}
div.index div.fineprint a {
color: #777;
}
/* End menu */
/* Start content */
div.content ul {
padding-left: 0;
}
div.content *.classTitle {
font-size: 1.2em;
font-weight: bold;
line-height: 1em;
}
div.content *.classTitle span {
display: block;
font-size: 2em;
letter-spacing: 2px;
line-height: 1em;
padding-top: 5px;
text-shadow: 1px 1px 1px #999999;
word-wrap: break-word;
}
div.content p.summary {
font-size: 1.25em;
}
div.content ul *.classname a,
div.content ul *.filename a {
font-family: Consolas, "Courier New", Courier, monospace;
text-decoration: none;
font-weight: bold;
}
div.content ul *.classname a:hover,
div.content ul *.filename a:hover {
text-decoration: underline;
}
div.content div.props {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
background: #fff;
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2)); /* FF3.6 */
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255, 255, 255, 0.7)),color-stop(1, rgba(255, 255, 255, 0.2)));
-moz-box-shadow: 0px 0px 10px #ccc;
-webkit-box-shadow: 0px 0px 5px #bbb;
box-shadow: 0px 0px 5px #bbb;
}
*.sectionTitle {
font-family: M1m, sans-serif;
font-size: 1.6em;
letter-spacing: 1px;
}
table.summaryTable td,
table.summaryTable th {
vertical-align: top;
}
table.summaryTable tr:last-child td {
padding-bottom: 0;
}
table.summaryTable th {
font-weight: bold;
}
table.summaryTable td.attributes {
font-family: Consolas, "Courier New", Courier, monospace;
color: #666;
}
table.summaryTable td.nameDescription div.fixedFont {
font-weight: bold;
}
table.summaryTable div.description {
color: #333;
}
dl.detailList dt {
font-weight: bold;
}
dl.inheritsList dd + dt {
margin-top: 10px;
}
dl.inheritsList dd {
display: inline;
}
.fixedFont {
font-family: Consolas, "Courier New", Courier, monospace;
}
.fixedFont.heading {
font-size: 1.25em;
line-height: 1.1em
}
.fixedFont.heading + .description {
font-size: 1.2em;
}
.fixedFont.heading .light,
.fixedFont.heading .lighter {
font-weight: bold;
}
pre.code {
overflow: auto;
font-family: Consolas, "Courier New", Courier, monospace;
background: #eee;
}
/* Start content */
/* Start general styles */
.light {
color: #666;
}
.lighter {
color: #999;
}
span.break {
font-size: 1px;
line-height: 1px;
}
/* End general styles */
/*
* END JSDOC
*/

View File

@ -1,134 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
This is a custom SVG webfont generated by Font Squirrel.
Foundry URL : http://mplus-fonts.sourceforge.jp
</metadata>
<defs>
<font id="webfontIjI5mZqE" horiz-adv-x="500" >
<font-face units-per-em="1000" ascent="860" descent="-140" />
<missing-glyph horiz-adv-x="500" />
<glyph unicode=" " />
<glyph unicode="!" d="M165 730h170l-20 -495h-130zM170 0v150h160v-150h-160z" />
<glyph unicode="&#x22;" d="M270 780h160l-30 -320h-100zM70 780h160l-30 -320h-100z" />
<glyph unicode="#" d="M20 165v120h62l24 185h-51v120h67l18 140h135l-18 -140h45l18 140h135l-18 -140h43v-120h-59l-24 -185h48v-120h-64l-21 -165h-135l21 165h-45l-21 -165h-135l21 165h-46zM217 285h45l24 185h-45z" />
<glyph unicode="$" d="M357 397q55 -32 76.5 -74t21.5 -108q0 -190 -192 -199v-101h-110v112q-51 16 -88 43v140q38 -35 88 -55v191q-53 33 -75.5 75.5t-22.5 103.5q0 89 50 138.5t142 51.5v100h110v-112q42 -12 78 -33v-135q-32 25 -78 42v-180zM247 445v149q-54 -9 -54 -69q0 -55 54 -80z M263 295v-157q52 13 52 77q0 55 -52 80z" />
<glyph unicode="%" d="M40 310l420 220v-110l-420 -220v110zM160 740q70 0 110 -41t40 -119t-40 -119t-110 -41t-110 41t-40 119t40 119t110 41zM340 310q70 0 110 -41t40 -119t-40 -119t-110 -41t-110 41t-40 119t40 119t110 41zM160 518q38 0 38 62t-38 62t-38 -62t38 -62zM340 88q38 0 38 62 t-38 62t-38 -62t38 -62z" />
<glyph unicode="&#x26;" d="M235 615q-23 0 -36.5 -14.5t-13.5 -40.5q0 -18 7.5 -37.5t33.5 -65.5q35 30 47 52.5t12 50.5q0 26 -13.5 40.5t-36.5 14.5zM118 368q-47 77 -62.5 116t-15.5 76q0 80 51.5 130t138.5 50t141 -50.5t54 -129.5q0 -114 -130 -220l55 -94v2v132h125v-225q-16 -25 -41 -52 l61 -103h-150l-15 24q-66 -34 -130 -34q-88 0 -136.5 45.5t-48.5 134.5q0 99 103 198zM269 124l-77 125q-27 -37 -27 -74q0 -60 65 -60q20 0 39 9z" />
<glyph unicode="'" d="M160 780h180l-35 -320h-110z" />
<glyph unicode="(" d="M100 300q0 136 50 256.5t144 213.5h126q-196 -194 -196 -470t196 -470h-126q-94 93 -144 213.5t-50 256.5z" />
<glyph unicode=")" d="M400 300q0 -136 -50 -256.5t-144 -213.5h-126q196 194 196 470t-196 470h126q94 -93 144 -213.5t50 -256.5z" />
<glyph unicode="*" d="M193 750h114l-4 -144l136 48l35 -109l-138 -40l88 -115l-93 -67l-81 119l-81 -119l-93 67l88 115l-138 40l35 109l136 -48z" />
<glyph unicode="+" d="M315 545v-195h135v-110h-135v-195h-130v195h-135v110h135v195h130z" />
<glyph unicode="," d="M180 190h190l-130 -320h-120z" />
<glyph unicode="-" d="M90 240v110h320v-110h-320z" />
<glyph unicode="." d="M155 0v190h190v-190h-190z" />
<glyph unicode="/" d="M465 730l-310 -770h-120l310 770h120z" />
<glyph unicode="0" d="M250 740q73 0 117.5 -32.5t68.5 -116t24 -226.5t-24 -226.5t-68.5 -116t-117.5 -32.5t-117.5 32.5t-68.5 116t-24 226.5t24 226.5t68.5 116t117.5 32.5zM171 317l142 248q-9 34 -24.5 47t-38.5 13q-28 0 -44.5 -19.5t-26 -77.5t-9.5 -163q0 -33 1 -48zM183 179 q9 -41 25.5 -57.5t41.5 -16.5q28 0 44.5 19.5t26 77.5t9.5 163q0 47 -1 67z" />
<glyph unicode="1" d="M240 592l-2 1l-173 -91v128l175 100h140v-730h-140v592z" />
<glyph unicode="2" d="M220 122v-2h220v-120h-380v120q127 141 181 237t54 173q0 43 -21 66.5t-59 23.5q-31 0 -74 -22t-81 -58v130q78 70 185 70q90 0 140 -51t50 -149q0 -180 -215 -418z" />
<glyph unicode="3" d="M290 608v2h-230v120h385v-120l-170 -178v-2h10q79 0 122 -51.5t43 -153.5q0 -121 -54 -178t-166 -57q-51 0 -81.5 6.5t-78.5 28.5v130q80 -45 150 -45q46 0 68 27t22 88q0 58 -26 76.5t-114 18.5h-40v120z" />
<glyph unicode="4" d="M400 150v-150h-135v150h-245v120l230 460h150v-460h80v-120h-80zM265 270v255h-2l-127 -253v-2h129z" />
<glyph unicode="5" d="M202 455q36 19 82 19q161 0 161 -239q0 -245 -230 -245q-76 0 -150 35v130q80 -45 140 -45q51 0 75.5 29t24.5 96t-14.5 93t-46.5 26q-34 0 -64 -34h-110l10 410h345v-120h-220l-5 -155h2z" />
<glyph unicode="6" d="M295 625q-54 0 -76.5 -34.5t-28.5 -135.5h2q45 35 98 35q92 0 133.5 -54.5t41.5 -185.5q0 -141 -51 -200.5t-159 -59.5q-75 0 -119 28.5t-67.5 101t-23.5 200.5q0 162 25 254t75 129t135 37q66 0 135 -20v-125q-57 30 -120 30zM255 107q39 0 55.5 29.5t16.5 113.5 q0 79 -14 104.5t-53 25.5q-38 0 -56.5 -29.5t-18.5 -100.5q0 -81 17 -112t53 -31z" />
<glyph unicode="7" d="M55 730h390v-120q-113 -273 -200 -610h-146q92 325 216 608v2h-260v120z" />
<glyph unicode="8" d="M258 625q-41 0 -59.5 -20.5t-18.5 -64.5q0 -74 75 -105q33 16 51.5 43.5t18.5 61.5q0 40 -18 62.5t-49 22.5zM250 -10q-105 0 -162.5 52t-57.5 148q0 116 105 179v2q-42 31 -66 80t-24 104q0 87 53.5 136t151.5 49t151.5 -48.5t53.5 -136.5q0 -98 -100 -164v-2 q115 -62 115 -199q0 -96 -58 -148t-162 -52zM242 105q93 0 93 100q0 75 -103 115q-33 -17 -52.5 -48.5t-19.5 -66.5q0 -48 22.5 -74t59.5 -26z" />
<glyph unicode="9" d="M205 110q55 0 77 32.5t28 132.5h-2q-45 -35 -98 -35q-89 0 -132 57.5t-43 192.5q0 131 51 190.5t159 59.5q79 0 123 -27.5t65.5 -99.5t21.5 -203q0 -162 -25 -254t-75 -129t-135 -37q-66 0 -135 20v130q57 -30 120 -30zM245 623q-39 0 -55.5 -28t-16.5 -105 q0 -83 15.5 -111.5t51.5 -28.5q75 0 75 140q0 73 -17 103t-53 30z" />
<glyph unicode=":" d="M160 390v190h180v-190h-180zM160 0v190h180v-190h-180z" />
<glyph unicode=";" d="M170 190h190l-130 -320h-120zM170 390v190h180v-190h-180z" />
<glyph unicode="&#x3c;" d="M445 470l-320 -174v-2l320 -174v-120l-400 225v140l400 225v-120z" />
<glyph unicode="=" d="M50 125v110h400v-110h-400zM50 362v103h400v-103h-400z" />
<glyph unicode="&#x3e;" d="M55 470v120l400 -225v-140l-400 -225v120l320 174v2z" />
<glyph unicode="?" d="M460 575q0 -36 -12.5 -69t-25 -51t-38.5 -49q-25 -30 -38 -48.5t-27.5 -52.5t-18.5 -70h-130q0 49 17 94.5t32 66.5t44 57q21 25 30.5 38t19 33.5t9.5 40.5q0 58 -82 58t-180 -53v130q95 40 200 40q95 0 147.5 -44t52.5 -121zM155 0v150h160v-150h-160z" />
<glyph unicode="@" d="M285 635q-72 0 -108.5 -62.5t-36.5 -207.5q0 -265 160 -265q58 0 125 30v-115q-70 -25 -150 -25q-260 0 -260 375q0 194 64 284.5t191 90.5q99 0 152 -51.5t53 -148.5v-325q-28 -28 -76 -46.5t-94 -18.5q-69 0 -102 49t-33 166q0 114 31.5 164.5t93.5 50.5q36 0 68 -25h2 v15q0 26 -23.5 45.5t-56.5 19.5zM290 365q0 -72 8 -93.5t29 -21.5q20 0 28 18v147q0 41 -6 53t-25 12t-26.5 -22t-7.5 -93z" />
<glyph unicode="A" d="M249 620h-2l-55 -335h112zM323 170h-150l-28 -170h-140l165 730h160l165 -730h-144z" />
<glyph unicode="B" d="M190 445h15q59 0 85 20.5t26 64.5q0 49 -23 71t-73 22q-17 0 -30 -5v-173zM190 330v-218q20 -5 45 -5q51 0 75 27.5t24 90.5q0 57 -25.5 81t-88.5 24h-30zM470 210q0 -220 -240 -220q-93 0 -180 15v720q92 15 190 15q210 0 210 -185q0 -62 -32 -105t-83 -54v-2 q57 -10 96 -61.5t39 -122.5z" />
<glyph unicode="C" d="M30 365q0 195 64.5 285t190.5 90q80 0 150 -25v-115q-70 25 -125 25q-74 0 -109.5 -58.5t-35.5 -201.5q0 -260 150 -260q57 0 125 30v-120q-70 -25 -150 -25q-260 0 -260 375z" />
<glyph unicode="D" d="M344 365q0 142 -30 198.5t-94 56.5q-23 0 -40 -5v-500q17 -5 40 -5q63 0 93.5 55.5t30.5 199.5zM480 365q0 -144 -28.5 -226.5t-83.5 -115.5t-148 -33q-92 0 -180 15v720q88 15 180 15q141 0 200.5 -82t59.5 -293z" />
<glyph unicode="E" d="M210 610v-165h220v-115h-220v-210h230v-120h-370v730h370v-120h-230z" />
<glyph unicode="F" d="M220 330v-330h-140v730h360v-120h-220v-165h210v-115h-210z" />
<glyph unicode="G" d="M310 625q-82 0 -116 -55t-34 -205q0 -143 32 -201.5t93 -58.5q27 0 48 10v215h-98v115h230v-415q-83 -40 -180 -40q-260 0 -260 375q0 196 69.5 285.5t215.5 89.5q70 0 130 -25v-115q-72 25 -130 25z" />
<glyph unicode="H" d="M318 330h-140v-330h-138v730h138v-280h140v280h142v-730h-142v330z" />
<glyph unicode="I" d="M430 0h-360v115h108v500h-108v115h360v-115h-108v-500h108v-115z" />
<glyph unicode="J" d="M410 730v-515q0 -126 -48.5 -175.5t-166.5 -49.5q-86 0 -155 30v130q29 -18 68 -30t67 -12q50 0 71 26.5t21 95.5v385h-147v115h290z" />
<glyph unicode="K" d="M192 330h-2v-330h-140v730h140v-300h2l135 300h148l-160 -345l165 -385h-150z" />
<glyph unicode="L" d="M230 730v-610h210v-120h-350v730h140z" />
<glyph unicode="M" d="M338 500h-2l-38 -300h-100l-38 300h-2v-500h-133v730h167l59 -400h2l59 400h163v-730h-137v500z" />
<glyph unicode="N" d="M187 460h-2v-460h-140v730h147l125 -460h2v460h136v-730h-143z" />
<glyph unicode="O" d="M250 740q121 0 175.5 -84t54.5 -291t-54.5 -291t-175.5 -84t-175.5 84t-54.5 291t54.5 291t175.5 84zM250 108q52 0 75 53.5t23 203.5t-23 203.5t-75 53.5t-75 -53.5t-23 -203.5t23 -203.5t75 -53.5z" />
<glyph unicode="P" d="M334 503q0 120 -104 120q-23 0 -40 -5v-235q18 -5 40 -5q53 0 78.5 28t25.5 97zM470 503q0 -127 -57 -184.5t-173 -57.5q-26 0 -50 5v-266h-140v725q90 15 185 15q122 0 178.5 -56t56.5 -181z" />
<glyph unicode="Q" d="M250 740q121 0 175.5 -84t54.5 -291q0 -257 -92 -333v-2q39 -22 68.5 -74t33.5 -106h-145q-15 81 -36.5 110.5t-58.5 29.5q-121 0 -175.5 84t-54.5 291t54.5 291t175.5 84zM250 108q52 0 75 53.5t23 203.5t-23 203.5t-75 53.5t-75 -53.5t-23 -203.5t23 -203.5t75 -53.5z " />
<glyph unicode="R" d="M465 513q0 -151 -98 -199l-1 -2q27 -19 58 -118l61 -194h-145l-57 204q-12 43 -25.5 57.5t-42.5 14.5h-30v-276h-140v725q90 15 185 15q124 0 179.5 -53.5t55.5 -173.5zM185 393h30q64 0 89 24.5t25 95.5q0 58 -25.5 84t-78.5 26q-23 0 -40 -5v-225z" />
<glyph unicode="S" d="M440 575q-84 48 -165 48q-41 0 -65 -21t-24 -57q0 -71 69 -100q116 -48 160.5 -103t44.5 -142q0 -210 -225 -210q-100 0 -180 50v135q83 -68 173 -68q94 0 94 88q0 76 -77 110q-108 46 -151.5 99.5t-43.5 135.5q0 90 57 145t153 55q102 0 180 -35v-130z" />
<glyph unicode="T" d="M320 615v-615h-140v615h-145v115h430v-115h-145z" />
<glyph unicode="U" d="M250 -10q-112 0 -161 54t-49 186v500h142v-460q0 -101 14.5 -131.5t55.5 -30.5t55.5 30.5t14.5 131.5v460h138v-500q0 -132 -49 -186t-161 -54z" />
<glyph unicode="V" d="M253 110l92 620h140l-155 -730h-160l-155 730h144l92 -620h2z" />
<glyph unicode="W" d="M164 190h2l38 440h100l38 -440h2l15 540h126l-45 -730h-157l-34 420h-2l-34 -420h-153l-45 730h134z" />
<glyph unicode="X" d="M251 470h2l74 260h145l-132 -360l135 -370h-152l-74 270h-2l-74 -270h-148l135 370l-132 360h149z" />
<glyph unicode="Y" d="M251 415h2l84 315h148l-165 -455v-275h-140v275l-165 455h152z" />
<glyph unicode="Z" d="M290 613v2h-235v115h390v-115l-235 -498v-2h235v-115h-390v115z" />
<glyph unicode="[" d="M410 675h-170v-750h170v-95h-290v940h290v-95z" />
<glyph unicode="\" d="M35 730h120l310 -770h-120z" />
<glyph unicode="]" d="M90 675v95h290v-940h-290v95h170v750h-170z" />
<glyph unicode="^" d="M251 655h-2l-111 -375h-123l145 450h180l145 -450h-123z" />
<glyph unicode="_" d="M40 -170v88h420v-88h-420z" />
<glyph unicode="`" d="M90 810h190l100 -320h-120z" />
<glyph unicode="a" d="M65 495q39 14 95 24.5t90 10.5q111 0 155.5 -45t44.5 -160v-325h-127l-2 65h-2q-49 -75 -134 -75q-68 0 -106.5 42t-38.5 118q0 88 63.5 136.5t186.5 48.5h25v10q0 40 -16 56.5t-54 16.5q-32 0 -86.5 -11.5t-93.5 -26.5v115zM315 245h-25q-59 0 -89.5 -23t-30.5 -62 q0 -31 15 -48t40 -17q90 0 90 130v20z" />
<glyph unicode="b" d="M45 730h137v-275h2q49 75 116 75q83 0 129 -66.5t46 -203.5q0 -133 -47.5 -201.5t-127.5 -68.5q-35 0 -62.5 17.5t-56.5 62.5h-2l-2 -70h-132v730zM338 260q0 150 -78 150q-80 0 -80 -145v-10q0 -145 80 -145q35 0 56.5 36.5t21.5 113.5z" />
<glyph unicode="c" d="M305 420q-115 0 -115 -160q0 -163 120 -163q60 0 120 28v-110q-68 -25 -140 -25q-116 0 -178 67.5t-62 202.5t60 202.5t175 67.5q67 0 135 -25v-110q-61 25 -115 25z" />
<glyph unicode="d" d="M455 0h-132l-2 70h-2q-29 -45 -56.5 -62.5t-62.5 -17.5q-80 0 -127.5 68.5t-47.5 201.5q0 137 46 203.5t129 66.5q67 0 116 -75h2v275h137v-730zM162 260q0 -77 21.5 -113.5t56.5 -36.5q80 0 80 145v10q0 145 -80 145q-78 0 -78 -150z" />
<glyph unicode="e" d="M182 206q7 -62 33 -85.5t80 -23.5q52 0 135 28v-110q-84 -25 -155 -25q-112 0 -173.5 68t-61.5 202q0 270 220 270q200 0 200 -270q0 -31 -2 -54h-276zM181 310h142q-1 63 -15.5 88t-47.5 25q-41 0 -58 -23t-21 -90z" />
<glyph unicode="f" d="M60 391v109h100v45q0 104 40.5 149.5t129.5 45.5q56 0 110 -15v-110q-36 16 -80 16q-37 0 -50 -20.5t-13 -85.5v-25h143v-109h-143v-391h-137v391h-100z" />
<glyph unicode="g" d="M323 75h-2q-45 -75 -116 -75q-78 0 -126.5 66.5t-48.5 193.5q0 137 46 203.5t129 66.5q35 0 62.5 -17.5t56.5 -62.5h2l2 70h132v-505q0 -245 -240 -245q-81 0 -150 25v115q76 -33 145 -33q55 0 81.5 34t26.5 114v50zM167 260q0 -70 22 -105t56 -35q80 0 80 135v10 q0 145 -80 145q-78 0 -78 -150z" />
<glyph unicode="h" d="M50 730h137v-275h2q47 75 126 75t112 -47.5t33 -172.5v-310h-135v290q0 74 -12.5 98t-47.5 24t-56.5 -43.5t-21.5 -131.5v-237h-137v730z" />
<glyph unicode="i" d="M110 520h240v-413h100v-107h-370v107h130v306h-100v107zM190 630v130h160v-130h-160z" />
<glyph unicode="j" d="M225 -20v433h-110v107h250v-540q0 -68 -10.5 -106t-44 -63t-87.5 -33t-148 -8v109q39 0 60.5 0.5t41 5t27 9.5t13.5 18t7 27.5t1 40.5zM205 630v130h160v-130h-160z" />
<glyph unicode="k" d="M480 520l-185 -250l185 -270h-162l-131 224v-224h-137v730h137v-418l133 208h160z" />
<glyph unicode="l" d="M310 190q0 -68 9 -80.5t56 -12.5q31 0 75 6v-108q-44 -5 -100 -5q-111 0 -145.5 32.5t-34.5 137.5v463h-120v107h260v-540z" />
<glyph unicode="m" d="M360 0v340q0 40 -21 40q-8 0 -12.5 -5t-7 -22.5t-2.5 -52.5v-300h-130v340q0 40 -21 40q-8 0 -12.5 -5t-7 -22.5t-2.5 -52.5v-300h-134v520h120l2 -65h2q15 34 39.5 54.5t48.5 20.5q28 0 45 -16t32 -59h2q42 75 99 75q48 0 69 -36t21 -134v-360h-130z" />
<glyph unicode="n" d="M50 520h132l2 -70h2q49 80 129 80q79 0 112 -47.5t33 -172.5v-310h-135v290q0 74 -12.5 98t-47.5 24t-56.5 -43.5t-21.5 -131.5v-237h-137v520z" />
<glyph unicode="o" d="M250 530q220 0 220 -270t-220 -270t-220 270t220 270zM250 97q44 0 62 33.5t18 129.5t-18 129.5t-62 33.5t-62 -33.5t-18 -129.5t18 -129.5t62 -33.5z" />
<glyph unicode="p" d="M179 70h-2v-290h-137v740h132l2 -70h2q29 45 56.5 62.5t62.5 17.5q83 0 129 -66.5t46 -203.5q0 -133 -47.5 -201.5t-127.5 -68.5q-71 0 -116 80zM333 260q0 150 -78 150q-80 0 -80 -145v-10q0 -145 80 -145q35 0 56.5 36.5t21.5 113.5z" />
<glyph unicode="q" d="M321 70q-45 -80 -116 -80q-80 0 -127.5 68.5t-47.5 201.5q0 137 46 203.5t129 66.5q35 0 62.5 -17.5t56.5 -62.5h2l2 70h132v-740h-137v290h-2zM167 260q0 -77 21.5 -113.5t56.5 -36.5q80 0 80 145v10q0 145 -80 145q-78 0 -78 -150z" />
<glyph unicode="r" d="M375 416q-69 0 -111 -52t-42 -144v-220h-137v520h135v-85h2q36 53 70.5 74t82.5 21q36 0 70 -10v-115q-36 11 -70 11z" />
<glyph unicode="s" d="M265 418q-73 0 -73 -43q0 -22 14.5 -35t48.5 -20q109 -21 149.5 -60t40.5 -115q0 -74 -50.5 -114.5t-144.5 -40.5q-107 0 -190 35v120q87 -43 165 -43q45 0 64 11.5t19 36.5q0 22 -14 34t-54 21q-99 21 -142 62.5t-43 112.5t49 110.5t146 39.5q99 0 180 -30v-115 q-87 33 -165 33z" />
<glyph unicode="t" d="M445 500v-109h-158v-201q0 -61 10.5 -74.5t57.5 -13.5q43 0 80 17v-114q-50 -15 -110 -15q-98 0 -136.5 36.5t-38.5 133.5v231h-105v109h105v190h137v-190h158z" />
<glyph unicode="u" d="M445 0h-132l-2 70h-2q-50 -80 -124 -80q-77 0 -108.5 44.5t-31.5 165.5v320h135v-300q0 -70 11 -91t44 -21q73 0 73 175v237h137v-520z" />
<glyph unicode="v" d="M251 90h2l79 430h138l-130 -520h-180l-130 520h142z" />
<glyph unicode="w" d="M343 120h2l29 400h116l-70 -520h-137l-37 358h-2l-31 -358h-133l-70 520h124l29 -400h2l39 400h100z" />
<glyph unicode="x" d="M251 335h2l69 185h143l-125 -260l125 -260h-152l-64 180h-2l-64 -180h-148l125 260l-125 260h147z" />
<glyph unicode="y" d="M254 170h2l87 350h142l-237 -740h-138l85 230l-170 510h142z" />
<glyph unicode="z" d="M275 411h-210v109h370v-109l-210 -300v-2h210v-109h-370v109l210 300v2z" />
<glyph unicode="{" d="M187 301v-2q58 -24 85.5 -62t27.5 -100v-112q0 -73 12 -86.5t75 -13.5h53v-95h-107q-80 0 -116.5 37t-36.5 123v147q0 61 -22 88t-68 27h-40v96h40q46 0 68 27t22 88v147q0 86 36.5 123t116.5 37h107v-95h-53q-63 0 -75 -13.5t-12 -86.5v-112q0 -62 -27.5 -100t-85.5 -62 z" />
<glyph unicode="|" d="M188 -220v1030h124v-1030h-124z" />
<glyph unicode="}" d="M313 301q-58 24 -85.5 62t-27.5 100v112q0 73 -12 86.5t-75 13.5h-53v95h107q80 0 116.5 -37t36.5 -123v-147q0 -61 22 -88t68 -27h40v-96h-40q-46 0 -68 -27t-22 -88v-147q0 -86 -36.5 -123t-116.5 -37h-107v95h53q63 0 75 13.5t12 86.5v112q0 62 27.5 100t85.5 62v2z " />
<glyph unicode="~" d="M40 568v107q45 35 100 35q63 0 131 -50q49 -37 84 -37q49 0 105 51v-107q-45 -35 -100 -35q-63 0 -131 50q-49 37 -84 37q-49 0 -105 -51z" />
<glyph unicode="&#xa0;" />
<glyph unicode="&#xa5;" d="M251 415h2l84 315h148l-132 -365h97v-95h-130v-65h130v-95h-130v-110h-140v110h-130v95h130v65h-130v95h97l-132 365h152z" />
<glyph unicode="&#xad;" d="M90 240v110h320v-110h-320z" />
<glyph unicode="&#x2000;" horiz-adv-x="407" />
<glyph unicode="&#x2001;" horiz-adv-x="815" />
<glyph unicode="&#x2002;" horiz-adv-x="407" />
<glyph unicode="&#x2003;" horiz-adv-x="815" />
<glyph unicode="&#x2004;" horiz-adv-x="271" />
<glyph unicode="&#x2005;" horiz-adv-x="203" />
<glyph unicode="&#x2006;" horiz-adv-x="135" />
<glyph unicode="&#x2007;" horiz-adv-x="135" />
<glyph unicode="&#x2008;" horiz-adv-x="101" />
<glyph unicode="&#x2009;" horiz-adv-x="163" />
<glyph unicode="&#x200a;" horiz-adv-x="45" />
<glyph unicode="&#x2010;" d="M90 240v110h320v-110h-320z" />
<glyph unicode="&#x2011;" d="M90 240v110h320v-110h-320z" />
<glyph unicode="&#x2013;" d="M50 240v110h400v-110h-400z" />
<glyph unicode="&#x2014;" d="M10 240v110h480v-110h-480z" />
<glyph unicode="&#x2018;" d="M305 460h-190l130 320h120z" />
<glyph unicode="&#x2019;" d="M190 780h190l-130 -320h-120z" />
<glyph unicode="&#x201c;" d="M405 460h-170l130 320h100zM195 460h-170l130 320h100z" />
<glyph unicode="&#x201d;" d="M300 780h170l-130 -320h-100zM90 780h170l-130 -320h-100z" />
<glyph unicode="&#x2026;" horiz-adv-x="1000" d="M72 270v190h190v-190h-190zM405 270v190h190v-190h-190zM738 270v190h190v-190h-190z" />
<glyph unicode="&#x202f;" horiz-adv-x="163" />
<glyph unicode="&#x205f;" horiz-adv-x="203" />
<glyph unicode="&#x2122;" horiz-adv-x="1000" d="M838 500h-2l-38 -300h-100l-38 300h-2v-500h-133v730h167l59 -400h2l59 400h163v-730h-137v500zM320 615v-615h-140v615h-145v115h430v-115h-145z" />
</font>
</defs></svg>

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,134 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
This is a custom SVG webfont generated by Font Squirrel.
Foundry URL : http://mplus-fonts.sourceforge.jp
</metadata>
<defs>
<font id="webfontVd14f4NN" horiz-adv-x="500" >
<font-face units-per-em="1000" ascent="860" descent="-140" />
<missing-glyph horiz-adv-x="500" />
<glyph unicode=" " />
<glyph unicode="!" d="M200 730h100l-10 -515h-80zM195 0v130h110v-130h-110z" />
<glyph unicode="&#x22;" d="M275 780h100l-20 -280h-60zM125 780h100l-20 -280h-60z" />
<glyph unicode="#" d="M40 188v72h77l29 228h-71v72h80l21 170h82l-21 -170h76l21 170h82l-21 -170h65v-72h-74l-29 -228h68v-72h-77l-23 -188h-82l23 188h-76l-23 -188h-82l23 188h-68zM199 260h76l29 228h-76z" />
<glyph unicode="$" d="M293 311v-214q58 21 58 108q0 71 -58 106zM293 19v-104h-76v101q-70 6 -137 49v95q65 -57 137 -69v251q-77 31 -109.5 75.5t-32.5 117.5q0 76 37 122.5t105 55.5v102h76v-102q69 -8 127 -38v-90q-52 38 -127 52v-237q77 -31 109.5 -76.5t32.5 -118.5q0 -163 -142 -186z M217 429v207q-58 -18 -58 -101q0 -73 58 -106z" />
<glyph unicode="%" d="M60 260l380 290v-80l-380 -290v80zM160 740q61 0 95.5 -41t34.5 -119t-34.5 -119t-95.5 -41t-95.5 41t-34.5 119t34.5 119t95.5 41zM340 310q61 0 95.5 -41t34.5 -119t-34.5 -119t-95.5 -41t-95.5 41t-34.5 119t34.5 119t95.5 41zM160 488q52 0 52 92t-52 92t-52 -92 t52 -92zM340 58q52 0 52 92t-52 92t-52 -92t52 -92z" />
<glyph unicode="&#x26;" d="M228 665q-38 0 -60.5 -20t-22.5 -55q0 -29 12.5 -59t53.5 -95q59 51 79 83.5t20 70.5q0 33 -22 54t-60 21zM151 385l-9 14q-47 71 -63.5 111.5t-16.5 79.5q0 66 45 108t118 42t119 -42t46 -108q0 -57 -30.5 -106.5t-106.5 -112.5l119 -183v217h80v-253q-13 -28 -26 -46 l69 -106h-87l-33 49q-69 -59 -175 -59q-82 0 -128.5 46t-46.5 129q0 107 126 220zM331 115l-137 206q-84 -79 -84 -153q0 -51 27 -77t78 -26q70 0 116 50z" />
<glyph unicode="'" d="M195 780h110l-25 -280h-60z" />
<glyph unicode="(" d="M125 315q0 275 194 455h76q-196 -184 -196 -455t196 -455h-76q-194 180 -194 455z" />
<glyph unicode=")" d="M375 315q0 -275 -194 -455h-76q196 184 196 455t-196 455h76q194 -180 194 -455z" />
<glyph unicode="*" d="M214 750h72l-3 -169l160 55l22 -68l-161 -50l101 -135l-58 -42l-97 138l-97 -138l-58 42l101 135l-161 50l22 68l160 -55z" />
<glyph unicode="+" d="M291 555v-214h149v-72h-149v-214h-82v214h-149v72h149v214h82z" />
<glyph unicode="," d="M210 150h120l-110 -280h-70z" />
<glyph unicode="-" d="M100 269v72h300v-72h-300z" />
<glyph unicode="." d="M185 0v150h130v-150h-130z" />
<glyph unicode="/" d="M452 730l-332 -770h-72l332 770h72z" />
<glyph unicode="0" d="M250 740q48 0 82 -18t59 -60t37 -115.5t12 -181.5t-12 -181.5t-37 -115.5t-59 -60t-82 -18t-82 18t-59 60t-37 115.5t-12 181.5t12 181.5t37 115.5t59 60t82 18zM142 249l196 339q-26 82 -88 82q-36 0 -60 -26t-38 -95t-14 -184q0 -50 4 -116zM158 155q26 -95 92 -95 q36 0 60 26t38 95t14 184q0 78 -6 133z" />
<glyph unicode="1" d="M258 0v645l-2 1l-173 -101v80l175 105h82v-730h-82z" />
<glyph unicode="2" d="M175 74v-2h245v-72h-340v72q251 288 251 478q0 116 -93 116q-30 0 -76 -22.5t-82 -55.5v87q75 65 170 65q85 0 125 -47t40 -143q0 -99 -54 -208t-186 -268z" />
<glyph unicode="3" d="M330 656v2h-250v72h345v-72l-180 -229v-2h10q91 0 133 -51t42 -166q0 -220 -195 -220q-73 0 -145 30v87q77 -43 130 -43q64 0 95 34.5t31 111.5q0 89 -25 117t-101 28h-70v72z" />
<glyph unicode="4" d="M293 590h-2l-175 -341v-2h177v343zM293 175h-253v82l243 473h92v-483h85v-72h-85v-175h-82v175z" />
<glyph unicode="5" d="M180 430h2q33 30 88 30q160 0 160 -230q0 -125 -49.5 -182.5t-145.5 -57.5q-74 0 -145 30v87q75 -43 140 -43q116 0 116 166q0 156 -96 156q-46 0 -80 -41h-75l10 385h305v-72h-223z" />
<glyph unicode="6" d="M285 740q61 0 115 -20v-77q-50 25 -105 25q-70 0 -101 -48.5t-39 -184.5h2q50 50 113 50q87 0 128.5 -56t41.5 -184q0 -134 -46.5 -194.5t-138.5 -60.5q-65 0 -104 28.5t-60 101.5t-21 200q0 158 25.5 252t71 131t118.5 37zM255 62q54 0 78.5 39t24.5 144q0 94 -23.5 132 t-74.5 38q-106 0 -106 -160q0 -107 25 -150t76 -43z" />
<glyph unicode="7" d="M345 656v2h-270v72h350v-72q-128 -296 -210 -658h-88q84 353 218 656z" />
<glyph unicode="8" d="M255 670q-53 0 -81.5 -27.5t-28.5 -77.5q0 -54 29 -94t76 -51q52 14 80.5 51.5t28.5 93.5q0 47 -28.5 76t-75.5 29zM250 -10q-96 0 -148 51t-52 149q0 68 33 119t92 75v2q-48 23 -79 73.5t-31 105.5q0 82 49 128.5t136 46.5t136 -47t49 -128q0 -56 -30.5 -103.5 t-79.5 -70.5v-2q59 -23 92 -75t33 -124q0 -98 -52 -149t-148 -51zM255 60q53 0 84 33.5t31 96.5q0 130 -125 160q-61 -16 -90 -54.5t-29 -105.5q0 -62 35 -96t94 -34z" />
<glyph unicode="9" d="M215 -10q-61 0 -115 20v80q52 -26 105 -26q70 0 101 47.5t39 183.5h-2q-50 -50 -113 -50q-84 0 -127 59t-43 191q0 126 46 185.5t139 59.5q68 0 107 -28t58.5 -100.5t19.5 -201.5q0 -158 -25.5 -252t-71 -131t-118.5 -37zM245 668q-55 0 -79 -38t-24 -135t25 -138.5 t73 -41.5q49 0 77.5 41.5t28.5 128.5q0 100 -25 141.5t-76 41.5z" />
<glyph unicode=":" d="M190 390v150h120v-150h-120zM190 0v150h120v-150h-120z" />
<glyph unicode=";" d="M200 150h120l-110 -280h-70zM200 390v150h120v-150h-120z" />
<glyph unicode="&#x3c;" d="M435 510l-330 -204v-2l330 -204v-80l-380 245v80l380 245v-80z" />
<glyph unicode="=" d="M60 165v72h380v-72h-380zM60 373v72h380v-72h-380z" />
<glyph unicode="&#x3e;" d="M65 510v80l380 -245v-80l-380 -245v80l330 204v2z" />
<glyph unicode="?" d="M445 580q0 -41 -14 -77t-28.5 -55t-42.5 -49q-29 -33 -43 -52t-28 -55t-14 -77h-80q0 55 16.5 101.5t32.5 68t47 56.5q24 27 36 42.5t23 41.5t11 55q0 41 -29.5 63.5t-86.5 22.5q-85 0 -180 -61v90q93 45 190 45q91 0 140.5 -42t49.5 -118zM180 0v130h110v-130h-110z" />
<glyph unicode="@" d="M375 258v167q0 41 -16 63t-44 22q-40 0 -56 -29.5t-16 -115.5q0 -82 17 -113.5t55 -31.5q44 0 60 38zM165 365q0 215 140 215q38 0 73 -25h2v5q0 50 -27.5 79t-72.5 29q-83 0 -124 -70.5t-41 -232.5q0 -166 40 -234.5t125 -68.5q62 0 125 38v-80q-59 -30 -130 -30 q-122 0 -181 86t-59 289q0 197 60.5 286t179.5 89q87 0 133.5 -50t46.5 -150v-325q-65 -65 -140 -65q-76 0 -113 49t-37 166z" />
<glyph unicode="A" d="M249 660h-2l-83 -380h168zM348 210h-200l-46 -210h-82l180 730h100l180 -730h-86z" />
<glyph unicode="B" d="M157 430h45q80 0 116.5 29.5t36.5 90.5q0 57 -36 88.5t-102 31.5q-36 0 -60 -8v-232zM157 360v-292q37 -8 90 -8q126 0 126 160q0 140 -161 140h-55zM455 210q0 -220 -225 -220q-80 0 -155 15v720q75 15 155 15q205 0 205 -180q0 -61 -30.5 -103t-84.5 -56v-2 q58 -11 96.5 -64t38.5 -125z" />
<glyph unicode="C" d="M55 365q0 197 60.5 286t179.5 89q66 0 125 -30v-75q-60 33 -120 33q-165 0 -165 -303q0 -164 42 -233.5t123 -69.5q62 0 125 38v-80q-59 -30 -130 -30q-122 0 -181 86t-59 289z" />
<glyph unicode="D" d="M383 365q0 168 -43.5 235.5t-137.5 67.5q-33 0 -55 -8v-590q22 -8 55 -8q65 0 102.5 24.5t58 91.5t20.5 187zM465 365q0 -207 -63.5 -291t-199.5 -84q-70 0 -137 15v720q67 15 137 15q137 0 200 -85.5t63 -289.5z" />
<glyph unicode="E" d="M162 658v-228h248v-70h-248v-288h258v-72h-340v730h340v-72h-258z" />
<glyph unicode="F" d="M172 360v-360h-82v730h330v-72h-248v-228h238v-70h-238z" />
<glyph unicode="G" d="M370 85v275h-155v70h235v-400q-80 -40 -170 -40q-118 0 -179 89t-61 286q0 196 63.5 285.5t191.5 89.5q59 0 130 -25v-77q-66 30 -130 30q-87 0 -132 -72t-45 -231q0 -303 167 -303q45 0 85 23z" />
<glyph unicode="H" d="M140 730v-298h216v298h84v-730h-84v360h-216v-360h-80v730h80z" />
<glyph unicode="I" d="M410 0h-320v70h118v590h-118v70h320v-70h-118v-590h118v-70z" />
<glyph unicode="J" d="M400 730v-540q0 -110 -43.5 -155t-146.5 -45q-82 0 -150 30v87q29 -17 75.5 -31t74.5 -14q53 0 79 30.5t26 99.5v468h-165v70h250z" />
<glyph unicode="K" d="M157 400h2l206 330h95l-225 -350l230 -380h-95l-211 360h-2v-360h-82v730h82v-330z" />
<glyph unicode="L" d="M182 730v-658h238v-72h-320v730h82z" />
<glyph unicode="M" d="M378 540h-2l-88 -340h-80l-88 340h-2v-540h-78v730h92l119 -450h2l119 450h88v-730h-82v540z" />
<glyph unicode="N" d="M151 550h-2v-550h-84v730h84l204 -550h2v550h80v-730h-80z" />
<glyph unicode="O" d="M250 740q107 0 158.5 -84.5t51.5 -290.5t-51.5 -290.5t-158.5 -84.5t-158.5 84.5t-51.5 290.5t51.5 290.5t158.5 84.5zM250 62q44 0 71 25.5t43 93.5t16 184t-16 184t-43 93.5t-71 25.5t-71 -25.5t-43 -93.5t-16 -184t16 -184t43 -93.5t71 -25.5z" />
<glyph unicode="P" d="M375 520q0 79 -36 114.5t-112 35.5q-41 0 -70 -8v-292q30 -5 70 -5q77 0 112.5 35.5t35.5 119.5zM455 520q0 -120 -52.5 -172.5t-165.5 -52.5q-35 0 -80 5v-300h-82v725q78 15 160 15q114 0 167 -52.5t53 -167.5z" />
<glyph unicode="Q" d="M250 740q107 0 158.5 -84.5t51.5 -290.5q0 -273 -100 -344v-2q41 -21 73 -66t47 -103h-88q-21 78 -54 109t-88 31q-107 0 -158.5 84.5t-51.5 290.5t51.5 290.5t158.5 84.5zM250 62q44 0 71 25.5t43 93.5t16 184t-16 184t-43 93.5t-71 25.5t-71 -25.5t-43 -93.5t-16 -184 t16 -184t43 -93.5t71 -25.5z" />
<glyph unicode="R" d="M370 540q0 130 -148 130q-41 0 -70 -8v-272h60q87 0 122.5 33.5t35.5 116.5zM152 320v-320h-82v725q78 15 160 15q112 0 166 -49.5t54 -150.5q0 -143 -109 -193v-2q31 -15 66 -131l63 -214h-86l-59 216q-17 64 -41 84t-82 20h-50z" />
<glyph unicode="S" d="M260 668q-47 0 -77.5 -30.5t-30.5 -77.5q0 -50 21.5 -82.5t71.5 -55.5q111 -49 153 -102.5t42 -139.5q0 -94 -51.5 -142t-148.5 -48q-91 0 -165 55v95q80 -78 170 -78q113 0 113 118q0 55 -26 91t-87 64q-94 42 -134.5 95.5t-40.5 129.5q0 80 51 130t134 50q53 0 87 -8 t78 -32v-90q-77 58 -160 58z" />
<glyph unicode="T" d="M209 0v660h-154v70h390v-70h-154v-660h-82z" />
<glyph unicode="U" d="M250 -10q-95 0 -142.5 48.5t-47.5 151.5v540h84v-520q0 -81 26.5 -114.5t81.5 -33.5t81.5 33.5t26.5 114.5v520h80v-540q0 -103 -47.5 -151.5t-142.5 -48.5z" />
<glyph unicode="V" d="M253 70l135 660h82l-170 -730h-100l-170 730h86l135 -660h2z" />
<glyph unicode="W" d="M153 120h2l54 510h90l54 -510h2l45 610h75l-60 -730h-109l-55 520h-2l-55 -520h-109l-60 730h83z" />
<glyph unicode="X" d="M251 440h2l112 290h83l-148 -355l150 -375h-90l-111 305h-2l-112 -305h-85l150 375l-148 355h88z" />
<glyph unicode="Y" d="M251 375h2l132 355h85l-179 -440v-290h-82v290l-179 440h90z" />
<glyph unicode="Z" d="M335 658v2h-260v70h350v-70l-260 -588v-2h260v-70h-350v70z" />
<glyph unicode="[" d="M390 710h-178v-790h178v-60h-250v910h250v-60z" />
<glyph unicode="\" d="M48 730h72l332 -770h-72z" />
<glyph unicode="]" d="M110 710v60h250v-910h-250v60h178v790h-178z" />
<glyph unicode="^" d="M251 680h-2l-147 -400h-72l170 450h100l170 -450h-72z" />
<glyph unicode="_" d="M50 -140v56h400v-56h-400z" />
<glyph unicode="`" d="M130 810h120l100 -280h-70z" />
<glyph unicode="a" d="M255 530q100 0 137.5 -40t37.5 -150v-340h-72l-2 75h-2q-47 -85 -149 -85q-65 0 -105 41.5t-40 113.5q0 91 61.5 140.5t183.5 49.5h48v25q0 57 -22 80t-76 23q-33 0 -84 -12t-86 -28v72q35 15 85 25t85 10zM353 275h-48q-170 0 -170 -125q0 -45 23 -69t62 -24q59 0 96 48 t37 135v35z" />
<glyph unicode="b" d="M144 445h2q43 85 134 85q175 0 175 -270q0 -135 -48 -202.5t-127 -67.5q-84 0 -137 85h-2l-2 -75h-74v730h79v-285zM376 260q0 195 -116 195q-51 0 -83.5 -49.5t-32.5 -140.5v-10q0 -91 32.5 -140.5t83.5 -49.5q53 0 84.5 48.5t31.5 146.5z" />
<glyph unicode="c" d="M70 260q0 134 55 202t155 68q61 0 125 -25v-80q-60 33 -120 33q-63 0 -98 -50t-35 -148q0 -101 37 -151t101 -50q59 0 120 36v-80q-64 -25 -125 -25q-102 0 -158.5 67.5t-56.5 202.5z" />
<glyph unicode="d" d="M356 730h79v-730h-74l-2 75h-2q-53 -85 -137 -85q-79 0 -127 67.5t-48 202.5q0 270 175 270q91 0 134 -85h2v285zM124 260q0 -98 31.5 -146.5t84.5 -48.5q51 0 83.5 49.5t32.5 140.5v10q0 91 -32.5 140.5t-83.5 49.5q-116 0 -116 -195z" />
<glyph unicode="e" d="M138 234q4 -93 38 -134t99 -41q61 0 135 36v-80q-74 -25 -140 -25q-215 0 -215 270q0 141 50 205.5t150 64.5q91 0 135.5 -62t44.5 -203q0 -11 -2 -31h-295zM138 300h218q-1 161 -101 161q-57 0 -85 -36t-32 -125z" />
<glyph unicode="f" d="M75 431v69h120v60q0 98 33 139t107 41q45 0 90 -15v-72q-38 18 -75 18q-47 0 -61.5 -23.5t-14.5 -107.5v-40h151v-69h-151v-431h-79v431h-120z" />
<glyph unicode="g" d="M50 260q0 270 175 270q83 0 137 -85h2l2 75h74v-515q0 -125 -50.5 -180t-154.5 -55q-71 0 -140 25v80q71 -36 140 -36q126 0 126 166v80h-2q-43 -85 -134 -85q-80 0 -127.5 66t-47.5 194zM129 260q0 -92 31.5 -138.5t84.5 -46.5q52 0 84 45.5t32 134.5v10 q0 91 -32.5 140.5t-83.5 49.5q-58 0 -87 -46.5t-29 -148.5z" />
<glyph unicode="h" d="M440 330v-330h-77v312q0 88 -20 117.5t-73 29.5q-50 0 -85.5 -56t-35.5 -151v-252h-79v730h79v-285h2q19 39 56.5 62t82.5 23q79 0 114.5 -45.5t35.5 -154.5z" />
<glyph unicode="i" d="M316 520v-452h109v-68h-330v68h139v384h-109v68h191zM214 640v120h102v-120h-102z" />
<glyph unicode="j" d="M249 -33v485h-119v68h201v-553q0 -65 -8.5 -101t-36.5 -59t-72 -30t-123 -7v68q40 0 63 1t42.5 6.5t28.5 12.5t15.5 23.5t7.5 34.5t1 51zM229 640v120h102v-120h-102z" />
<glyph unicode="k" d="M460 520l-230 -250l230 -270h-95l-206 253v-253h-79v730h79v-444l207 234h94z" />
<glyph unicode="l" d="M281 150q0 -66 10.5 -79t63.5 -13q33 0 75 6v-69q-47 -5 -85 -5q-90 0 -118 28.5t-28 121.5v522h-129v68h211v-580z" />
<glyph unicode="m" d="M290 0h-78v360q-1 58 -10.5 77.5t-32.5 19.5q-20 0 -35 -24t-25 -83.5t-10 -149.5v-200h-79v520h70l2 -70h2q17 38 42.5 59t53.5 21q31 0 50.5 -18.5t33.5 -61.5h2q39 80 104 80q53 0 76.5 -32.5t23.5 -117.5v-380h-77v360q-1 59 -11.5 78t-37.5 19q-64 0 -64 -197v-260z " />
<glyph unicode="n" d="M440 330v-330h-77v312q0 88 -20 117.5t-73 29.5q-50 0 -85.5 -56t-35.5 -151v-252h-79v520h74l2 -75h2q19 38 58 61.5t84 23.5q79 0 114.5 -45.5t35.5 -154.5z" />
<glyph unicode="o" d="M250 530q200 0 200 -270t-200 -270t-200 270t200 270zM250 59q61 0 89.5 45.5t28.5 155.5t-28.5 155.5t-89.5 45.5t-89.5 -45.5t-28.5 -155.5t28.5 -155.5t89.5 -45.5z" />
<glyph unicode="p" d="M141 75h-2v-295h-79v740h74l2 -75h2q54 85 137 85q175 0 175 -270q0 -135 -48 -202.5t-127 -67.5q-91 0 -134 85zM371 260q0 195 -116 195q-51 0 -83.5 -49.5t-32.5 -140.5v-10q0 -91 32.5 -140.5t83.5 -49.5q53 0 84.5 48.5t31.5 146.5z" />
<glyph unicode="q" d="M359 75q-43 -85 -134 -85q-79 0 -127 67.5t-48 202.5q0 270 175 270q83 0 137 -85h2l2 75h74v-740h-79v295h-2zM129 260q0 -98 31.5 -146.5t84.5 -48.5q51 0 83.5 49.5t32.5 140.5v10q0 91 -32.5 140.5t-83.5 49.5q-116 0 -116 -195z" />
<glyph unicode="r" d="M186 520v-100h2q62 110 172 110q37 0 70 -10v-70q-35 11 -70 11q-73 0 -122 -61t-49 -160v-240h-79v520h76z" />
<glyph unicode="s" d="M255 463q-96 0 -96 -73q0 -34 21 -54.5t75 -35.5q106 -30 140.5 -63t34.5 -102t-47 -107t-133 -38t-165 40v80q78 -53 155 -53q111 0 111 78q0 37 -21.5 57t-84.5 38q-92 26 -128.5 62t-36.5 98q0 66 43.5 103t126.5 37q84 0 160 -35v-75q-79 43 -155 43z" />
<glyph unicode="t" d="M244 500h181v-69h-181v-281q0 -56 16.5 -74.5t64.5 -18.5q50 0 90 18v-70q-48 -15 -100 -15q-84 0 -117 32.5t-33 117.5v291h-100v69h100v190h79v-190z" />
<glyph unicode="u" d="M65 180v340h77v-322q0 -83 18.5 -110t69.5 -27q49 0 82.5 55t33.5 152v252h79v-520h-74l-2 75h-2q-19 -40 -56 -62.5t-81 -22.5q-77 0 -111 43t-34 147z" />
<glyph unicode="v" d="M251 60h2l115 460h82l-145 -520h-110l-145 520h86z" />
<glyph unicode="w" d="M351 80h2l49 440h78l-80 -520h-99l-54 440h-2l-49 -440h-96l-80 520h82l49 -440h2l49 440h100z" />
<glyph unicode="x" d="M251 305h2l104 215h88l-145 -260l145 -260h-94l-102 215h-2l-102 -215h-90l145 260l-145 260h92z" />
<glyph unicode="y" d="M259 120h2l117 400h87l-240 -740h-83l78 230l-175 510h88z" />
<glyph unicode="z" d="M80 520h340v-69l-248 -380v-2h248v-69h-340v69l248 380v2h-248v69z" />
<glyph unicode="{" d="M195 316l4 -2q81 -38 81 -149v-135q0 -72 16.5 -91t78.5 -19h40v-60h-65q-73 0 -107.5 35.5t-34.5 114.5v150q0 66 -21.5 95.5t-66.5 29.5h-45v60h45q45 0 66.5 29.5t21.5 95.5v150q0 79 34.5 114.5t107.5 35.5h65v-60h-40q-62 0 -78.5 -19t-16.5 -91v-135q0 -61 -20 -95 t-65 -54z" />
<glyph unicode="|" d="M212 -220v1030h76v-1030h-76z" />
<glyph unicode="}" d="M305 316q-45 20 -65 54t-20 95v135q0 72 -16.5 91t-78.5 19h-40v60h65q73 0 107.5 -35.5t34.5 -114.5v-150q0 -66 21.5 -95.5t66.5 -29.5h45v-60h-45q-45 0 -66.5 -29.5t-21.5 -95.5v-150q0 -79 -34.5 -114.5t-107.5 -35.5h-65v60h40q62 0 78.5 19t16.5 91v135 q0 111 81 149z" />
<glyph unicode="~" d="M50 602v75q42 33 95 33q61 0 125 -48q48 -35 80 -35q25 0 47 10t53 39v-75q-42 -33 -95 -33q-61 0 -125 48q-47 35 -80 35q-25 0 -47 -10t-53 -39z" />
<glyph unicode="&#xa0;" />
<glyph unicode="&#xa5;" d="M251 375h2l132 355h85l-153 -375h123v-65h-149v-85h149v-65h-149v-140h-82v140h-149v65h149v85h-149v65h123l-153 375h90z" />
<glyph unicode="&#xad;" d="M100 269v72h300v-72h-300z" />
<glyph unicode="&#x2000;" horiz-adv-x="407" />
<glyph unicode="&#x2001;" horiz-adv-x="815" />
<glyph unicode="&#x2002;" horiz-adv-x="407" />
<glyph unicode="&#x2003;" horiz-adv-x="815" />
<glyph unicode="&#x2004;" horiz-adv-x="271" />
<glyph unicode="&#x2005;" horiz-adv-x="203" />
<glyph unicode="&#x2006;" horiz-adv-x="135" />
<glyph unicode="&#x2007;" horiz-adv-x="135" />
<glyph unicode="&#x2008;" horiz-adv-x="101" />
<glyph unicode="&#x2009;" horiz-adv-x="163" />
<glyph unicode="&#x200a;" horiz-adv-x="45" />
<glyph unicode="&#x2010;" d="M100 269v72h300v-72h-300z" />
<glyph unicode="&#x2011;" d="M100 269v72h300v-72h-300z" />
<glyph unicode="&#x2013;" d="M60 269v72h380v-72h-380z" />
<glyph unicode="&#x2014;" d="M20 269v72h460v-72h-460z" />
<glyph unicode="&#x2018;" d="M275 500h-120l110 280h70z" />
<glyph unicode="&#x2019;" d="M220 780h120l-110 -280h-70z" />
<glyph unicode="&#x201c;" d="M340 500h-110l110 280h60zM190 500h-110l110 280h60z" />
<glyph unicode="&#x201d;" d="M300 780h110l-110 -280h-60zM150 780h110l-110 -280h-60z" />
<glyph unicode="&#x2026;" horiz-adv-x="1000" d="M102 288v150h130v-150h-130zM435 288v150h130v-150h-130zM768 288v150h130v-150h-130z" />
<glyph unicode="&#x202f;" horiz-adv-x="163" />
<glyph unicode="&#x205f;" horiz-adv-x="203" />
<glyph unicode="&#x2122;" horiz-adv-x="1000" d="M878 540h-2l-88 -340h-80l-88 340h-2v-540h-78v730h92l119 -450h2l119 450h88v-730h-82v540zM209 0v660h-154v70h390v-70h-154v-660h-82z" />
</font>
</defs></svg>

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,217 +0,0 @@
/*
* TABLE OF CONTENTS:
* - Browser reset
* - HTML elements
* - JsDoc styling
* - Media query check
*/
/*
* HTML ELEMENTS
*/
body {
padding: 1% 4% 1% 4%;
}
/*
* HTML ELEMENTS
*/
/*
* BEGIN JSDOC
*/
/* Start menu */
div.index div.menu {
position: fixed;
top: 0;
right: 0;
-moz-border-radius-bottomleft: 15px;
-webkit-border-bottom-left-radius: 15px;
-border-bottom-left-radius: 15px;
padding: 4px 5px 8px 10px;
-moz-box-shadow: 0px 0px 10px #c4c4c4;
-webkit-box-shadow: 0px 0px 10px #c4c4c4;
box-shadow: 0px 0px 10px #c4c4c4;
background-color: rgba(255, 255, 255, 0.9);
}
div.index input.classFilter {
display: none;
}
div.index div.indexLinks a {
float: right;
clear: both;
font-size: 1.1em;
}
div.index *.heading1 {
display:none;
}
div.index ul.classList {
display:none;
}
div.index div.fineprint {
display:none;
}
div.indexStatic {
display: none;
}
/* End menu */
/* Start content */
div.content *.classTitle {
margin-right: 60px;
margin-bottom: 15px;
}
div.content div.intro {
margin: 15px 0 35px;
}
div.content p.description.summary {
margin-bottom: 0.2em;
}
div.content div.props {
margin: 1.5em -2% 0 -2%;
padding: 2%;
}
table.summaryTable {
position: relative;
left: -10px;
width: 100%;
border-collapse: collapse;
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
-ms-box-sizing: content-box;
-o-box-sizing: content-box;
-icab-box-sizing: content-box;
-khtml-box-sizing: content-box;
}
*.sectionTitle {
padding: 0 10px 10px 0;
}
caption.sectionTitle {
padding-left: 10px;
}
table.summaryTable td,
table.summaryTable th {
padding: 0px 10px 10px 10px;
}
table.summaryTable tr:last-child td {
padding-bottom: 0;
}
table.summaryTable td.attributes {
width: 35%;
}
table.summaryTable td.nameDescription {
width: 65%
}
dl.detailList {
margin-top: 0.5em;
}
dl.detailList.nomargin + dl.detailList.nomargin {
margin-top: 0;
}
dl.detailList dt {
display: inline;
margin-right: 5px;
}
dl.detailList dt:before {
display: block;
content: "";
}
dl.detailList dd {
display: inline;
}
dl.detailList.params dt {
display: block;
}
dl.detailList.params dd {
display: block;
padding-left: 2em;
padding-bottom: 0.4em;
}
ul.fileList li {
margin-bottom: 1.5em;
}
.fixedFont.heading {
margin-bottom: 0.5em;
}
pre.code {
margin: 10px 0 10px 0;
padding: 10px;
border: 1px solid #ccc;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
}
/* End content */
/*
* END JSDOC
*/
/*
* START MEDIA QUERY CHECK
*/
.cssLoadCheck {
position: absolute;
top: -99999px;
left: -99999px;
border: 0;
width: 100px;
padding: 0;
overflow: hidden;
}
/*
* END MEDIA QUERY CHECK
*/

View File

@ -1,297 +0,0 @@
/*
* TABLE OF CONTENTS:
* - JsDoc styling
* - Media query check
*/
/*
* BEGIN JSDOC
*/
/* Start menu */
div.index {
position: fixed;
top: 0;
bottom: 0;
float: left;
width: 30%;
min-width: 100px;
max-width: 300px;
padding: 0 0 10px 0;
overflow: auto;
}
div.index *.heading1 {
padding: 8px 0 0 0;
}
div.index div.menu {
margin: 0 15px 0 -15px;
-moz-border-radius-bottomright: 15px;
-webkit-border-bottom-right-radius: 15px;
-border-bottom-right-radius: 15px;
padding: 15px 15px 15px 30px;
-moz-box-shadow: 0px 0px 10px #c4c4c4;
-webkit-box-shadow: 0px 0px 10px #c4c4c4;
box-shadow: 0px 0px 10px #c4c4c4;
background-color: rgba(255, 255, 255, 0.5);
}
div.index div.indexLinks {
margin-top: 13px;
position: absolute;
right: 30px;
}
div.index div.indexLinks a {
color: #999999;
text-transform: lowercase;
}
div.index div.indexLinks a:first-child {
margin-right: 3px;
border-right: 1px solid #999999;
padding-right: 5px;
}
div.index input.classFilter {
margin-bottom: 4px;
width: 100%;
border-width: 1px;
border-style: solid;
border-color: #CCCCCC #999999 #999999 #CCCCCC;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-border-radius: 3px;
}
div.index ul.classList a {
line-height: 1.3em;
}
div.index ul.classList a + a {
margin-left: 0.5em;
}
div.index div.fineprint {
margin: 1em 0 0 15px;
color: #777;
font-size: 0.9em;
}
div.index div.fineprint a {
color: #777;
}
div.indexStatic {
position: static;
min-height: 1em;
}
/* End menu */
/* Start content */
div.content {
float: left;
width: 70%;
min-width: 300px;
max-width: 600px;
}
div.innerContent {
padding: 0 0 0 2.5em;
}
div.content ul,
div.content ol {
margin-bottom: 3em;
}
div.content ul.methodDetail {
margin-bottom: 0;
}
div.content *.classTitle {
position: relative;
left: -10px;
margin: -30px 0 15px 0;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
padding: 25px 15px 15px 15px;
background-color: #FFFFFF;
background-color: rgba(255, 255, 255, 0.5);
-moz-box-shadow: 0px 0px 10px #c4c4c4;
-webkit-box-shadow: 0px 0px 10px #c4c4c4;
box-shadow: 0px 0px 10px #c4c4c4;
}
div.content div.intro {
margin: 15px 0 45px
}
div.content p.summary {
margin-bottom: 0.5em;
}
div.content ul.summary {
margin-bottom: 1.5em;
}
div.content ul *.classname a,
div.content ul *.filename a {
font-family: Consolas, "Courier New", Courier, monospace;
text-decoration: none;
font-weight: bold;
}
div.content ul *.classname a:hover,
div.content ul *.filename a:hover {
text-decoration: underline;
}
div.content div.props {
position: relative;
left: -10px;
margin-bottom: 2.5em;
padding: 10px 15px 15px 15px;
overflow: hidden;
}
div.content div.hr {
margin: 0 10px 0 0;
height: 4em;
}
table.summaryTable {
position: relative;
left: -10px;
width: 100%;
border-collapse: collapse;
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
-ms-box-sizing: content-box;
-o-box-sizing: content-box;
-icab-box-sizing: content-box;
-khtml-box-sizing: content-box;
}
*.sectionTitle {
padding: 0 10px 10px 0;
}
caption.sectionTitle {
padding-left: 10px;
}
table.summaryTable td,
table.summaryTable th {
padding: 0px 10px 10px 10px;
}
table.summaryTable tr:last-child td {
padding-bottom: 0;
}
table.summaryTable td.attributes {
width: 35%;
}
table.summaryTable td.nameDescription {
width: 65%
}
dl.detailList {
margin-top: 0.5em;
}
dl.detailList.nomargin + dl.detailList.nomargin {
margin-top: 0;
}
dl.detailList dt {
display: inline;
margin-right: 5px;
}
dl.detailList dt:before {
display: block;
content: "";
}
dl.detailList dd {
display: inline;
}
dl.detailList.params dt {
display: block;
}
dl.detailList.params dd {
display: block;
padding-left: 2em;
padding-bottom: 0.4em;
}
ul.fileList li {
margin-bottom: 1.5em;
}
.fixedFont.heading {
margin-bottom: 0.5em;
}
pre.code {
margin: 10px 0 10px 0;
padding: 10px;
border: 1px solid #ccc;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
}
/* End content */
.clear {
clear: both;
width: 100%;
min-height: 0;
}
/*
* END JSDOC
*/
/*
* START MEDIA QUERY CHECK
*/
.cssLoadCheck {
position: absolute;
top: -99999px;
left: -99999px;
border: 0;
width: 100px;
padding: 0;
overflow: hidden;
}
/*
* END MEDIA QUERY CHECK
*/

View File

@ -1,440 +0,0 @@
/* --- Basic Layout -------------------------------------------------------- */
/* For IE for Windows \*/
* html{
width: 100%;
height: 100%;
overflow: hidden;
}
* html body{
width: 100%;
height: 100%;
overflow: auto;
}
* html .fixed{
position: absolute;
}
.fixed {
position: fixed;
overflow: auto;
}
/* */
/* --- Basic Layout -------------------------------------------------------- */
body {
padding: 0;
margin: 0;
background: #fafafa;
font: 100% Verdana, Arial, Helvetica, sans-serif;
}
#main {
border-left: 0.625em #356aa0 solid;
margin-left: 16.25em;
}
#index {
top: 0;
left: 0;
width: 16.25em;
height: 100%;
overflow: auto;
overflow-x: hidden;
border-right: 0.625em solid #356aa0;
}
/* --- General layout ------------------------------------------------------ */
h1 {
margin: 0.625em 0 0.625em;
font-size: 1.5em;
font-weight: bold;
}
h1.classTitle {
color: #007b00;
font-size: 1.5em;
line-height:130%;
}
h2 {
font-size: 1.25em;
color: #6277AA;
margin: 2em 0pt 1em;
}
h3 {
font-size: 1.1em;
color: #6277AA;
}
p {
margin: 1em 0;
text-align: justify;
}
a:link {
color: #001C58;
}
a:visited {
color: #6277AA;
}
hr {
border: none 0;
border-top: 0.0625em solid #7f8fb1;
height: 0.0625em;
}
.invisible {
display: none !important;
}
.clear {
clear: both;
line-height: 0.0625em;
}
.description {
font: 0.8125em Verdana, Arial;
line-height: 0.9375em;
padding: 0.25em;
padding-left: 0.25em;
}
.fineprint {
padding-top: 1.25em;
text-align: right;
font-size: 0.625em;
}
div.sectionTitle {
background-color: #356aa0;
color: #fff;
font-size: 1.1em;
font-weight: bold;
text-align: left;
padding: 0.125em 0.5em 0.125em 0.5em;
border: 0.0625em #7F8FB1 solid;
}
/* --- Index toggler ------------------------------------------------------- */
#index-toggler {
width: 1em;
top: 0.25em;
left: 16.25em;
cursor: pointer;
font-weight: bold;
font-family: Arial;
font-size: 1em;
color: #fff;
z-index: 100;
}
#index-close {
background: url(images/never_translate.png) no-repeat left;
height: 1em;
width: 1em;
float: left;
cursor: pointer;
margin: 0.0625em 0.25em;
display: inline;
}
body.index-collapsed { background-position: 0; }
body.index-collapsed #main { margin-left: 0; }
body.index-collapsed #index { width: 0; }
body.index-collapsed #index-wrapper { display: none; }
body.index-collapsed #index-toggler { left: 0; }
/* --- Module Filter ------------------------------------------------------- */
.module-filter {
display: inline;
float: left;
cursor: pointer;
width: 4em;
font-size: 0.8em;
text-align: center;
padding-top: 0.125em;
}
.module-filter, .module-filter a {
text-decoration: none;
color: #007B00 !important;
}
body.filter .sectionItem { display: none; }
body.filter .module-filter, body.filter .module-filter a { color: red !important; }
body.filter.module-core .module-core { display: block; }
body.filter.module-dom .module-dom { display: block; }
body.filter.module-css .module-css { display: block; }
body.filter.module-ajax .module-ajax { display: block; }
body.filter.module-event .module-event { display: block; }
/* --- Method Toggler ------------------------------------------------------ */
.method-toggler {
background: url(images/minus.gif) no-repeat left;
cursor: pointer;
float: left;
width: 0.875em;
height: 0.875em;
}
.method-toggler.toggled {
background: url(images/plus.gif) no-repeat left;
}
/* --- Class Name and File Name Icons -------------------------------------- */
.itemName .icon, .itemName .icon a {
color: #007B00 !important;
}
.itemName .icon {
font-size: 1em;
font-weight: bold;
padding: 0 0 0.125em 1.5em;
}
.itemName .icon {
background: url(images/class_obj.png) no-repeat left;
}
.itemName.namespace .icon {
background-image: url(images/namespace_obj.png) !important;
}
.itemName.namespace-function .icon {
background-image: url(images/namespace_function_obj.png) !important;
}
.fileName .icon {
background: url(images/file_obj.png) no-repeat left !important;
}
/* --- Class Method and Property Icons ------------------------------------- */
div.classMethod .icon {
padding-left: 1.275em;
background: url(images/method_public_obj.png) no-repeat left;
}
div.classMethod .private {
background-image: url(images/method_private_obj.png) !important;
}
div.classProperty .icon {
padding-left: 1.275em;
background: url(images/field_public_obj.png) no-repeat left;
}
div.classProperty .private {
background-image: url(images/field_private_obj.png) !important;
}
/* --- Headers ------------------------------------------------------------- */
.header {
color: #fff;
font-weight: bold;
font-size: 1.4em;
height: 1.2em;
background: #356aa0;
padding: 0.15em 0.4375em;
}
#index .header {
padding: 0.5em 0 0 0;
height: 1.625em;
font-size: 1em;
background: #356aa0;
}
/* --- Main/Index Shared Layouts ------------------------------------------- */
#content .section {
margin-top: 1.5em;
}
div.classList {
padding: 0.625em;
font-family: arial, sans-serif;
font-size: 0.75em;
}
div.sectionItem .signature {
color: #000;
margin-left: 0.250em;
font-weight: normal;
}
.help, div.sectionItem .signature span {
cursor: help;
}
/* --- Main layout --------------------------------------------------------- */
#main .full-description {
font-size: 0.9em;
line-height: 135%;
}
#main code {
font-size: 1.1em;
font-weight: bold;
color: #666;
}
html:not([lang*=""]) #main code {
font-size: 1.4em !important; /* Firefox hack */
}
#main p p, #main .full-description p, #main span a {
font-size: 1em;
}
#content {
padding: 0 1.25em 1.25em 1.25em;
}
#main .sectionItem {
background: #fff;
padding-left: 0.8em;
}
#main .sectionItem .description {
font-size: 0.8em;
padding-left: 0.4375em;
color: #777;
}
#main .summary .sectionItems, #main .details .sectionItem {
border: 0.25em #8DA6C6 solid;
padding: 0.625em;
}
/* --- Summary layout ------------------------------------------------------ */
#main .summary {
background: #fff;
}
#main .summary .sectionItems {
border-width: 0.125em 0.125em 0.250em;
}
#main .summary .sectionItem {
padding: 0 0 0.3em 1.6em;
font-family: Verdana, Arial;
font-size: 0.875em;
}
#main .summary .sectionItem b {
margin-left: -1.4286em;
}
#main .summary .module-filter {
margin-left: -5.3571em;
}
/* --- Details layout ------------------------------------------------------ */
#main .details .module-filter {
font-size: 70%;
}
#main .details .sectionItem {
border-width: 0.125em 0.125em 0.250em;
margin-bottom: 0.75em;
}
#main .details .itemTitle {
color: #001C58;
font-family: Verdana;
font-weight: bold;
font-size: 1em;
display: inline;
}
#main .details .itemTitle .light {
font-size: 0.9em;
}
#main .details .full-description {
padding: 0 0.625em;
}
.light, .light a:link, .light a:visited {
color: #777;
font-weight: normal;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
}
/* --- Details data -------------------------------------------------------- */
table.methodItem {
font-size: 0.8em;
}
table.methodItem p {
margin: 0;
}
table.methodItem td {
padding: 0 0.1em 0.1em;
vertical-align: text-top;
}
table.methodItem .methodItemType {
text-align: center;
}
div.heading {
color: #6277AA;
font-size: 0.875em;
font-weight: bold;
margin: 0.625em 0 0;
}
/* --- Index Layout -------------------------------------------------------- */
#index-wrapper {
width: 100%;
}
#index-menu {
background: #8DA6C6;
color: #fff;
text-align: center;
padding: 0.125em 0 0.25em;
font-weight: bold;
font-size: 0.9em;
}
#index-menu a:link, #index-menu a:visited {
color: #fff;
}
#index-title {
float: left;
}
#index-content {
background: #fff;
border: 0 #8DA6C6 solid;
border-width: 0 0 0.25em;
font-size: 1.1em;
}
#index-content .signature {
font-size: 0.85em;
}
#index .section {
padding-bottom: 0.625em;
}
/* --- Class index / File index layout ------------------------------------- */
* html #content.index-page {
width: 92%; /* IE only hack para evitar bug no layout */
}
#content.index-page .sectionItem {
padding: 0.125em;
}
#content.index-page .sectionItems {
border-top-width: 0.125em;
}
#content.index-page .summary {
margin: 0;
}
/* --- Hide private members ------------------------------------------------ */
/*
div.sectionItem.private {
display: none !important;
}
/**/

237
docs/event.js.html Normal file
View File

@ -0,0 +1,237 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: modules/event.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: modules/event.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Event
*
* Event api wrapper
* @todo Add method for triggering events
*/
(function (undefined){
"use strict";
var _add_remove, e, _attach_delegate;
_add_remove = function (sel, event, callback, add)
{
var i, len;
// Multiple events? Run recursively!
if ( ! event.match(/^([\w\-]+)$/))
{
event = event.split(" ");
len = event.length;
for (i = 0; i &lt; len; i++)
{
_add_remove(sel, event[i], callback, add);
}
return;
}
// Bind the event
(add === true)
? sel.addEventListener(event, callback, false)
: sel.removeEventListener(event, callback, false);
};
_attach_delegate = function(sel, target, event, callback)
{
// attach the listener to the parent object
_add_remove(sel, event, function(e){
var elem, t;
// Get the live version of the target selector
t = $_.$(target, sel);
// Check each element to see if it matches the target
for(elem in t)
{
// Fire target callback when event bubbles from target
if(e.target == t[elem])
{
// Trigger the event callback
callback.call(t[elem], e);
// Stop event propegation
e.stopPropagation();
}
}
}, true);
};
// --------------------------------------------------------------------------
/**
* Event Listener module
*
* @namespace
* @name event
* @memberOf $_
*/
e = {
/**
* Create a custom event
*
* @memberOf $_.event
* @name create
* @function
* @example Eg. var event = $_("#selector").event.create('foo', {});
* @param {string} name
* @param {object} [data]
* @return {Object}
*/
create: function(name, data)
{
// Do a terrible browser-sniffic hack because I don't know of a good
// feature test
if (/MSIE|Trident/i.test(navigator.userAgent))
{
// Okay, I guess we have to do this the hard way... :(
// Microsoft, your browser still sucks
var e = document.createEvent('CustomEvent');
e.initCustomEvent(name, true, true, data);
return e;
}
else
{
return new CustomEvent(name, data);
}
},
/**
* Adds an event that returns a callback when triggered on the selected
* event and selector
*
* @memberOf $_.event
* @name add
* @function
* @example Eg. $_("#selector").event.add("click", do_something());
* @param {string} event
* @param {function} callback
*/
add: function (event, callback)
{
$_.each(function(e){
_add_remove(e, event, callback, true);
});
},
/**
* Removes an event bound the the specified selector, event type, and callback
*
* @memberOf $_.event
* @name remove
* @function
* @example Eg. $_("#selector").event.remove("click", do_something());
* @param {string} event
* @param {string} callback
*/
remove: function (event, callback)
{
$_.each(function(e){
_add_remove(e, event, callback, false);
});
},
/**
* Binds a persistent event to the document
*
* @memberOf $_.event
* @name live
* @function
* @example Eg. $_.event.live(".button", "click", do_something());
* @param {string} target
* @param {string} event
* @param {function} callback
*/
live: function (target, event, callback)
{
_attach_delegate(document.documentElement, target, event, callback);
},
/**
* Binds an event to a parent object
*
* @memberOf $_.event
* @name delegate
* @function
* @example Eg. $_("#parent").delegate(".button", "click", do_something());
* @param {string} target
* @param {string} event
* @param {function} callback
*/
delegate: function (target, event, callback)
{
$_.each(function(e){
_attach_delegate(e, target, event, callback);
});
},
/**
* Trigger an event to fire
*
* @memberOf $_.event
* @name trigger
* @function
* @example Eg. $_("#my_id").trigger('click');
* @param {object} event
* @return {boolean}
*/
trigger: function(event)
{
var target = this.el;
return target.dispatchEvent(event);
}
};
$_.ext('event', e);
}());</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

File diff suppressed because one or more lines are too long

177
docs/global.html Normal file
View File

@ -0,0 +1,177 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<h4 class="name" id="data[undefined]"><span class="type-signature"></span>data[undefined]<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Ajax
Module for making ajax requests
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ajax.js.html">modules/ajax.js</a>, <a href="ajax.js.html#line84">line 84</a>
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

147
docs/index.html Executable file → Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,326 +0,0 @@
/**
* @fileOverview Contains standard code in the namespace 'wbos' and code specifically written for Codeview in the namespace 'codeview'
* @author Wouter Bos (www.thebrightlines.com)
* @since 1.0 - 2010-09-10
* @version 1.0 - 2010-09-10
*/
if (typeof(wbos) == "undefined") {
/**
* @namespace Standard code of Wouter Bos (wbos)
*/
wbos = {}
}
if (typeof(wbos.CssTools) == "undefined") {
/**
* @namespace Namespace for CSS-related functionality
*/
wbos.CssTools = {}
}
/**
* @namespace Fallback for CSS advanced media query
* @class
* @since 1.0 - 2010-09-10
* @version 1.0 - 2010-09-10
*/
wbos.CssTools.MediaQueryFallBack = ( function() {
var config = {
cssScreen: "/css/screen.css",
cssHandheld: "/css/handheld.css",
mobileMaxWidth: 660,
testDivClass: "cssLoadCheck",
dynamicCssLinkId: "DynCssLink",
resizeDelay: 30
}
var noMediaQuery = false;
var delay;
var currentCssMediaType;
// Adding events to elements in the DOM without overwriting it
function addEvent(element, newFunction, eventType) {
var oldEvent = eval("element." + eventType);
var eventContentType = eval("typeof element." + eventType)
if ( eventContentType != 'function' ) {
eval("element." + eventType + " = newFunction")
} else {
eval("element." + eventType + " = function(e) { oldEvent(e); newFunction(e); }")
}
}
// Get the the inner width of the browser window
function getWindowWidth() {
if (window.innerWidth) {
return window.innerWidth;
} else if (document.documentElement.clientWidth) {
return document.documentElement.clientWidth;
} else if (document.body.clientWidth) {
return document.body.clientWidth;
} else{
return 0;
}
}
function addCssLink(cssHref) {
var cssNode = document.createElement('link');
var windowWidth;
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.media = 'screen, handheld, fallback';
cssNode.href = cssHref;
document.getElementsByTagName("head")[0].appendChild(cssNode);
}
/* Start public */
return {
/**
* Adds link to CSS in the head if no CSS is loaded
*
* @since 1.0 - 2010-08-21
* @version 1.0 - 2010-08-21
* @param {String|Object} cssScreen URL to CSS file for larger screens
* @param {String|Object} cssHandheld URL to CSS file for smaller screens
* @param {Number} mobileMaxWidth Maximum width for handheld devices
* @example
* wbos.CssTools.MediaQueryFallBack.LoadCss(['screen.css', 'screen2.css'], 'mobile.css', 480)
*/
LoadCss: function(cssScreen, cssHandheld, mobileMaxWidth) {
// Set config values
if (typeof(cssScreen) != "undefined") {
config.cssScreen = cssScreen;
}
if (typeof(cssHandheld) != "undefined") {
config.cssHandheld = cssHandheld;
}
if (typeof(mobileMaxWidth) != "undefined") {
config.mobileMaxWidth = mobileMaxWidth;
}
// Check if CSS is loaded
var cssloadCheckNode = document.createElement('div');
cssloadCheckNode.className = config.testDivClass;
document.getElementsByTagName("body")[0].appendChild(cssloadCheckNode);
if (cssloadCheckNode.offsetWidth != 100 && noMediaQuery == false) {
noMediaQuery = true;
}
cssloadCheckNode.parentNode.removeChild(cssloadCheckNode)
if (noMediaQuery == true) {
// Browser does not support Media Queries, so JavaScript will supply a fallback
var cssHref = "";
// Determines what CSS file to load
if (getWindowWidth() <= config.mobileMaxWidth) {
cssHref = config.cssHandheld;
newCssMediaType = "handheld";
} else {
cssHref = config.cssScreen;
newCssMediaType = "screen";
}
// Add CSS link to <head> of page
if (cssHref != "" && currentCssMediaType != newCssMediaType) {
var currentCssLinks = document.styleSheets
for (var i = 0; i < currentCssLinks.length; i++) {
for (var ii = 0; ii < currentCssLinks[i].media.length; ii++) {
if (typeof(currentCssLinks[i].media) == "object") {
if (currentCssLinks[i].media.item(ii) == "fallback") {
currentCssLinks[i].ownerNode.parentNode.removeChild(currentCssLinks[i].ownerNode)
i--
break;
}
} else {
if (currentCssLinks[i].media.indexOf("fallback") >= 0) {
currentCssLinks[i].owningElement.parentNode.removeChild(currentCssLinks[i].owningElement)
i--
break;
}
}
}
}
if (typeof(cssHref) == "object") {
for (var i = 0; i < cssHref.length; i++) {
addCssLink(cssHref[i])
}
} else {
addCssLink(cssHref)
}
currentCssMediaType = newCssMediaType;
}
// Check screen size again if user resizes window
addEvent(window, wbos.CssTools.MediaQueryFallBack.LoadCssDelayed, 'onresize')
}
},
/**
* Runs LoadCSS after a short delay
*
* @since 1.0 - 2010-08-21
* @version 1.0 - 2010-08-21
* @example
* wbos.CssTools.MediaQueryFallBack.LoadCssDelayed()
*/
LoadCssDelayed: function() {
clearTimeout(delay);
delay = setTimeout( "wbos.CssTools.MediaQueryFallBack.LoadCss()", config.resizeDelay)
}
}
/* End public */
})();
/**
* @namespace Adds a function to an event of a single element. Use this if
* you don't want to use jQuery
* @class
* @since 1.0 - 2010-02-23
* @version 1.0 - 2010-02-23
*/
wbos.Events = ( function() {
/* Start public */
return {
/**
* Adds a function to an event of a single element
*
* @since 1.0 - 2010-02-23
* @version 1.0 - 2010-02-23
* @param {Object} element The element on which the event is placed
* @param {Function} newFunction The function that has to be linked to the event
* @param {String} eventType Name of the event
* @example
* wbos.Events.AddEvent( document.getElementById('elementId'), functionName, "onclick" )
*/
AddEvent: function( element, newFunction, eventType ) {
var oldEvent = eval("element." + eventType);
var eventContentType = eval("typeof element." + eventType)
if ( eventContentType != 'function' ) {
eval("element." + eventType + " = newFunction")
} else {
eval("element." + eventType + " = function(e) { oldEvent(e); newFunction(e); }")
}
}
}
/* End public */
})();
if (typeof(codeview) == "undefined") {
/**
* @namespace Code written for the Codeview template
*/
codeview = {}
}
/**
* @namespace Enables filtering in class lists
* @class
* @since 1.0 - 2010-11-08
* @version 1.0 - 2010-11-08
*/
codeview.classFilter = ( function() {
function onkeyup_ClassFilter() {
var listItems
var search = document.getElementById('ClassFilter').value
search = search.toLowerCase()
if (document.getElementById('ClassList')) {
listItems = document.getElementById('ClassList').getElementsByTagName('li')
filterList(listItems, search)
}
if (document.getElementById('ClassList2')) {
listItems = document.getElementById('ClassList2').getElementsByTagName('li')
filterList(listItems, search)
}
if (document.getElementById('FileList')) {
listItems = document.getElementById('FileList').getElementsByTagName('li')
filterList(listItems, search)
}
if (document.getElementById('MethodsListInherited')) {
var links = document.getElementById('MethodsListInherited').getElementsByTagName('a')
var linksSelected = new Array()
for (var i=0; i < links.length; i++) {
if (links[i].parentNode.parentNode.tagName == "DD") {
linksSelected.push(links[i])
}
}
filterList(linksSelected, search)
}
if (document.getElementById('MethodsList')) {
listItems = document.getElementById('MethodsList').getElementsByTagName('tbody')[0].getElementsByTagName('tr')
filterList(listItems, search, document.getElementById('MethodDetail').getElementsByTagName('li'))
}
}
function filterList(listItems, search, relatedElements) {
var itemContent = ""
for (var i=0; i < listItems.length; i++) {
itemContent = listItems[i].textContent||listItems[i].innerText
if (itemContent != undefined) {
itemContent = itemContent.toLowerCase()
itemContent = itemContent.replace(/\s/g, "")
if (itemContent.indexOf(search) >= 0 || itemContent == "") {
listItems[i].style.display = ""
} else {
listItems[i].style.display = "none"
}
if (relatedElements != null) {
filterRelatedList(listItems[i], search, relatedElements)
}
}
}
}
function filterRelatedList(listItem, search, relatedElements) {
var itemIndex = parseInt(listItem.className.replace('item', ''))
if (itemIndex <= relatedElements.length) {
if (relatedElements[itemIndex].className == "item"+ itemIndex) {
relatedElements[itemIndex].style.display = listItem.style.display
}
}
}
/* Start public */
return {
Init: function() {
wbos.Events.AddEvent(
document.getElementById('ClassFilter'),
onkeyup_ClassFilter,
"onkeyup"
)
}
}
/* End public */
})();

View File

@ -1,6 +0,0 @@
// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector
/*@cc_on(function(m,c){var z="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video";function n(d){for(var a=-1;++a<o;)d.createElement(i[a])}function p(d,a){for(var e=-1,b=d.length,j,q=[];++e<b;){j=d[e];if((a=j.media||a)!="screen")q.push(p(j.imports,a),j.cssText)}return q.join("")}var g=c.createElement("div");g.innerHTML="<z>i</z>";if(g.childNodes.length!==1){var i=z.split("|"),o=i.length,s=RegExp("(^|\\s)("+z+")",
"gi"),t=RegExp("<(/*)("+z+")","gi"),u=RegExp("(^|[^\\n]*?\\s)("+z+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),r=c.createDocumentFragment(),k=c.documentElement;g=k.firstChild;var h=c.createElement("body"),l=c.createElement("style"),f;n(c);n(r);g.insertBefore(l,
g.firstChild);l.media="print";m.attachEvent("onbeforeprint",function(){var d=-1,a=p(c.styleSheets,"all"),e=[],b;for(f=f||c.body;(b=u.exec(a))!=null;)e.push((b[1]+b[2]+b[3]).replace(s,"$1.iepp_$2")+b[4]);for(l.styleSheet.cssText=e.join("\n");++d<o;){a=c.getElementsByTagName(i[d]);e=a.length;for(b=-1;++b<e;)if(a[b].className.indexOf("iepp_")<0)a[b].className+=" iepp_"+i[d]}r.appendChild(f);k.appendChild(h);h.className=f.className;h.innerHTML=f.innerHTML.replace(t,"<$1font")});m.attachEvent("onafterprint",
function(){h.innerHTML="";k.removeChild(h);k.appendChild(f);l.styleSheet.cssText=""})}})(this,document);@*/

File diff suppressed because one or more lines are too long

58
docs/polyfill.js.html Normal file
View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: polyfill.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: polyfill.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* A module of various browser polyfills
* @file polyfill.js
*/
/**
* Promise.prototype.done polyfill
*/
if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

162
docs/promise.js.html Normal file
View File

@ -0,0 +1,162 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: modules/promise.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: modules/promise.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Module for polyfilling promises
*/
(function(w, undefined) {
if (typeof Promise === "undefined")
{
/**
* Promise constructor
*
* @constructor
* @namespace
* @param function fn
*/
w.Promise = function(fn)
{
var state = 'pending';
var value;
var deferred = null;
function resolve(newValue)
{
try
{
if (newValue &amp;&amp; typeof newValue.then === 'function')
{
newValue.then(resolve);
return;
}
state = 'resolved';
value = newValue;
if (deferred)
{
handle(deferred);
}
}
catch(e)
{
reject(e);
}
}
function reject(reason)
{
state = 'rejected';
value = reason;
if (deferred)
{
handle(deferred);
}
}
function handle(handler)
{
if (state === 'pending')
{
deferred = onResolved;
return;
}
var handlerCallback;
setTimeout(function() {
handlerCallback = (state === 'resolved')
? handler.onResolved
: handler.onRejected;
if ( ! handlerCallback)
{
(state === 'resolved')
? handler.resolve(value)
: handler.reject(value);
return;
}
try
{
ret = handlerCallback(value);
}
catch(e)
{
handler.reject(e);
return;
}
handler.resolve(ret);
}, 1);
}
this.then = function(onResolved, onRejected) {
return new Promise(function(resolve, reject) {
handle({
onResolved: onResolved,
onRejected: onRejected,
resolve: resolve,
reject: reject
});
});
};
fn(resolve, reject);
}
}
})(window);
</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li><li><a href="w.Promise.html">Promise</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:37:54 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@ -0,0 +1,25 @@
/*global document */
(function() {
var source = document.getElementsByClassName('prettyprint source linenums');
var i = 0;
var lineNumber = 0;
var lineId;
var lines;
var totalLines;
var anchorHash;
if (source && source[0]) {
anchorHash = document.location.hash.substring(1);
lines = source[0].getElementsByTagName('li');
totalLines = lines.length;
for (; i < totalLines; i++) {
lineNumber++;
lineId = 'line' + lineNumber;
lines[i].id = lineId;
if (lineId === anchorHash) {
lines[i].className += ' selected';
}
}
}
})();

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);

View File

@ -0,0 +1,28 @@
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();

View File

@ -1,182 +0,0 @@
.dp-highlighter
{
font-family: "Consolas", "Courier New", Courier, mono, serif;
background-color: #E7E5DC;
margin: 1.5em 0 !important;
padding: 1px; /* adds a little border on top when controls are hidden */
}
/* clear styles */
.dp-highlighter ol,
.dp-highlighter ol li,
.dp-highlighter ol li span
{
line-height: 1.25em;
margin: 0;
padding: 0;
border: none;
}
.dp-highlighter a,
.dp-highlighter a:hover
{
background: none;
border: none;
padding: 0;
margin: 0;
}
.dp-highlighter .bar
{
padding-left: 45px;
}
.dp-highlighter.collapsed .bar,
.dp-highlighter.nogutter .bar
{
padding-left: 0px;
}
.dp-highlighter ol
{
list-style: decimal; /* for ie */
background-color: #fff;
margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
padding: 0px;
color: #5C5C5C;
}
.dp-highlighter.nogutter ol,
.dp-highlighter.nogutter ol li
{
list-style: none !important;
margin-left: 0px !important;
}
.dp-highlighter ol li,
.dp-highlighter .columns div
{
list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
list-style-position: outside !important;
border-left: 3px solid #6CE26C;
background-color: #fafafa;
color: #5C5C5C;
padding: 0 3px 0 10px !important;
margin: 0 !important;
}
.dp-highlighter.nogutter ol li,
.dp-highlighter.nogutter .columns div
{
border: 0;
}
.dp-highlighter .columns
{
background-color: #fafafa;
color: gray;
overflow: hidden;
width: 100%;
}
.dp-highlighter .columns div
{
padding-bottom: 5px;
}
.dp-highlighter ol li.alt
{
background-color: #FFF;
color: inherit;
}
.dp-highlighter ol li span
{
color: black;
background-color: inherit;
}
/* Adjust some properties when collapsed */
.dp-highlighter.collapsed ol
{
margin: 0px;
}
.dp-highlighter.collapsed ol li
{
display: none;
}
/* Additional modifications when in print-view */
.dp-highlighter.printing
{
border: none;
}
.dp-highlighter.printing .tools
{
display: none !important;
}
.dp-highlighter.printing li
{
display: list-item !important;
}
/* Styles for the tools */
.dp-highlighter .tools
{
padding: 3px 8px 3px 10px;
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
color: silver;
background-color: #f8f8f8;
padding-bottom: 10px;
border-left: 3px solid #6CE26C;
}
.dp-highlighter.nogutter .tools
{
border-left: 0;
}
.dp-highlighter.collapsed .tools
{
border-bottom: 0;
}
.dp-highlighter .tools a
{
font-size: 9px;
color: #a0a0a0;
background-color: inherit;
text-decoration: none;
margin-right: 10px;
}
.dp-highlighter .tools a:hover
{
color: red;
background-color: inherit;
text-decoration: underline;
}
/* About dialog styles */
.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
.dp-about td { padding: 10px; vertical-align: top; }
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
.dp-about .para { margin: 0 0 4px 0; }
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
/* Language specific styles */
.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
.dp-highlighter .string { color: #00d; background-color: inherit; }
.dp-highlighter .keyword { color: #6277AA; font-weight: bold; background-color: inherit; }
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }

File diff suppressed because one or more lines are too long

166
docs/store.js.html Normal file
View File

@ -0,0 +1,166 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: modules/store.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: modules/store.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>/**
* Store
*
* Wrapper for local / sessionstorage
*/
(function (undefined){
"use strict";
//Shortcuts for wrapper
var l = localStorage,
s = sessionStorage;
/**
* Wrapper for localstorage / sessionstorage data serialization.
* Each method has a boolean parameter, that when set as true switches the method
* to use sessionStorage rather than the default localStorage.
*
* @name store
* @namespace
* @memberOf $_
*/
var store = {
/**
* Retrieves and deserializes a value from localstorage,
* based on the specified key
*
* @param {string} key
* @param {bool} session
* @name get
* @memberOf $_.store
* @function
* @return {Object}
*/
get: function (key, sess)
{
var val = (sess) ? s.getItem(key) : l.getItem(key);
return JSON.parse(val);
},
/**
* Puts a value into localstorage at the specified key,
* and JSON-encodes the value if not a string
*
* @param {string} key
* @param {mixed} value
* @param {bool} session
* @name set
* @memberOf $_.store
* @function
*/
set: function (key, value, sess)
{
// Localstorage generally only accepts strings
value = JSON.stringify(value);
(sess) ? s.setItem(key, value) : l.setItem(key, value);
},
/**
* Removes the specified item from storage
*
* @param {string} key
* @param {bool} session
* @name remove
* @memberOf $_.store
* @function
*/
remove: function (key, sess)
{
(sess) ? s.removeItem(key) : l.removeItem(key);
},
/**
* Returns an object of all the raw values in storage
*
* @param {bool} session
* @name getAll
* @memberOf $_.store
* @function
* @return {Object}
*/
getAll: function (sess)
{
var i,
len,
data = {},
k,
o;
//Reference to session/localstorage
o = (sess) ? l : s;
len = o.length;
for (i = 0; i &lt; len; i++)
{
k = o.key(i);
data[k] = o.getItem(k);
}
return data;
},
/**
* Removes all values from the same domain storage
*
* @param {bool} session
* @name clear
* @memberOf $_.store
* @function
*/
clear: function(sess)
{
(sess) ? s.clear() : l.clear();
}
};
$_.ext('store', store);
}());</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:56:00 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@ -0,0 +1,334 @@
html
{
overflow: auto;
background-color: #fff;
}
body
{
font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 130%;
color: #000;
background-color: #fff;
}
a {
color: #444;
}
a:visited {
color: #444;
}
a:active {
color: #444;
}
header
{
display: block;
padding: 6px 4px;
}
.class-description {
font-style: italic;
font-family: Palatino, 'Palatino Linotype', serif;
font-size: 130%;
line-height: 140%;
margin-bottom: 1em;
margin-top: 1em;
}
#main {
float: left;
width: 100%;
}
section
{
display: block;
background-color: #fff;
padding: 12px 24px;
border-bottom: 1px solid #ccc;
margin-right: 240px;
}
.variation {
display: none;
}
.optional:after {
content: "opt";
font-size: 60%;
color: #aaa;
font-style: italic;
font-weight: lighter;
}
nav
{
display: block;
float: left;
margin-left: -230px;
margin-top: 28px;
width: 220px;
border-left: 1px solid #ccc;
padding-left: 9px;
}
nav ul {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
font-size: 100%;
line-height: 17px;
padding:0;
margin:0;
list-style-type:none;
}
nav h2 a, nav h2 a:visited {
color: #A35A00;
text-decoration: none;
}
nav h3 {
margin-top: 12px;
}
nav li {
margin-top: 6px;
}
nav a {
color: #5C5954;
}
nav a:visited {
color: #5C5954;
}
nav a:active {
color: #5C5954;
}
footer {
display: block;
padding: 6px;
margin-top: 12px;
font-style: italic;
font-size: 90%;
}
h1
{
font-size: 200%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 6px 0 9px 0;
}
h2
{
font-size: 170%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
}
h3
{
font-size: 150%;
font-weight: bold;
letter-spacing: -0.01em;
margin-top: 16px;
margin: 6px 0 3px 0;
}
h4
{
font-size: 130%;
font-weight: bold;
letter-spacing: -0.01em;
margin-top: 16px;
margin: 18px 0 3px 0;
color: #A35A00;
}
h5, .container-overview .subsection-title
{
font-size: 120%;
font-weight: bold;
letter-spacing: -0.01em;
margin: 8px 0 3px -16px;
}
h6
{
font-size: 100%;
letter-spacing: -0.01em;
margin: 6px 0 3px 0;
font-style: italic;
}
.ancestors { color: #999; }
.ancestors a
{
color: #999 !important;
text-decoration: none;
}
.important
{
font-weight: bold;
color: #950B02;
}
.yes-def {
text-indent: -1000px;
}
.type-signature {
color: #aaa;
}
.name, .signature {
font-family: Consolas, "Lucida Console", Monaco, monospace;
}
.details { margin-top: 14px; border-left: 2px solid #DDD; }
.details dt { width:100px; float:left; padding-left: 10px; padding-top: 6px; }
.details dd { margin-left: 50px; }
.details ul { margin: 0; }
.details ul { list-style-type: none; }
.details li { margin-left: 30px; padding-top: 6px; }
.details pre.prettyprint { margin: 0 }
.details .object-value { padding-top: 0; }
.description {
margin-bottom: 1em;
margin-left: -16px;
margin-top: 1em;
}
.code-caption
{
font-style: italic;
font-family: Palatino, 'Palatino Linotype', serif;
font-size: 107%;
margin: 0;
}
.prettyprint
{
border: 1px solid #ddd;
width: 80%;
overflow: auto;
}
.prettyprint.source {
width: inherit;
}
.prettyprint code
{
font-family: Consolas, 'Lucida Console', Monaco, monospace;
font-size: 100%;
line-height: 18px;
display: block;
padding: 4px 12px;
margin: 0;
background-color: #fff;
color: #000;
}
.prettyprint code span.line
{
display: inline-block;
}
.prettyprint.linenums
{
padding-left: 70px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.prettyprint.linenums ol
{
padding-left: 0;
}
.prettyprint.linenums li
{
border-left: 3px #ddd solid;
}
.prettyprint.linenums li.selected,
.prettyprint.linenums li.selected *
{
background-color: lightyellow;
}
.prettyprint.linenums li *
{
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.params, .props
{
border-spacing: 0;
border: 0;
border-collapse: collapse;
}
.params .name, .props .name, .name code {
color: #A35A00;
font-family: Consolas, 'Lucida Console', Monaco, monospace;
font-size: 100%;
}
.params td, .params th, .props td, .props th
{
border: 1px solid #ddd;
margin: 0px;
text-align: left;
vertical-align: top;
padding: 4px 6px;
display: table-cell;
}
.params thead tr, .props thead tr
{
background-color: #ddd;
font-weight: bold;
}
.params .params thead tr, .props .props thead tr
{
background-color: #fff;
font-weight: bold;
}
.params th, .props th { border-right: 1px solid #aaa; }
.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
.params td.description > p:first-child
{
margin-top: 0;
padding-top: 0;
}
.params td.description > p:last-child
{
margin-bottom: 0;
padding-bottom: 0;
}
.disabled {
color: #454545;
}

View File

@ -0,0 +1,111 @@
/* JSDoc prettify.js theme */
/* plain text */
.pln {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* string content */
.str {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a keyword */
.kwd {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a comment */
.com {
font-weight: normal;
font-style: italic;
}
/* a type name */
.typ {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a literal value */
.lit {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* punctuation */
.pun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp open bracket */
.opn {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* lisp close bracket */
.clo {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a markup tag name */
.tag {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute name */
.atn {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a markup attribute value */
.atv {
color: #006400;
font-weight: normal;
font-style: normal;
}
/* a declaration */
.dec {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* a variable name */
.var {
color: #000000;
font-weight: normal;
font-style: normal;
}
/* a function name */
.fun {
color: #000000;
font-weight: bold;
font-style: normal;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}

View File

@ -0,0 +1,132 @@
/* Tomorrow Theme */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
/* plain text */
.pln {
color: #4d4d4c; }
@media screen {
/* string content */
.str {
color: #718c00; }
/* a keyword */
.kwd {
color: #8959a8; }
/* a comment */
.com {
color: #8e908c; }
/* a type name */
.typ {
color: #4271ae; }
/* a literal value */
.lit {
color: #f5871f; }
/* punctuation */
.pun {
color: #4d4d4c; }
/* lisp open bracket */
.opn {
color: #4d4d4c; }
/* lisp close bracket */
.clo {
color: #4d4d4c; }
/* a markup tag name */
.tag {
color: #c82829; }
/* a markup attribute name */
.atn {
color: #f5871f; }
/* a markup attribute value */
.atv {
color: #3e999f; }
/* a declaration */
.dec {
color: #f5871f; }
/* a variable name */
.var {
color: #c82829; }
/* a function name */
.fun {
color: #4271ae; } }
/* Use higher contrast and text-weight for printable form. */
@media print, projection {
.str {
color: #060; }
.kwd {
color: #006;
font-weight: bold; }
.com {
color: #600;
font-style: italic; }
.typ {
color: #404;
font-weight: bold; }
.lit {
color: #044; }
.pun, .opn, .clo {
color: #440; }
.tag {
color: #006;
font-weight: bold; }
.atn {
color: #404; }
.atv {
color: #060; } }
/* Style */
/*
pre.prettyprint {
background: white;
font-family: Menlo, Monaco, Consolas, monospace;
font-size: 12px;
line-height: 1.5;
border: 1px solid #ccc;
padding: 10px; }
*/
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0; }
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L4,
li.L5,
li.L6,
li.L7,
li.L8,
li.L9 {
/* */ }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
/* */ }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,154 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> Kis JS Keep It Simple JS Library
<span class='line'> 3</span> Copyright Timothy J. Warren
<span class='line'> 4</span> License Public Domain
<span class='line'> 5</span> Version 0.8.0
<span class='line'> 6</span> */</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span>
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span>
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 15</span> * $_
<span class='line'> 16</span> *
<span class='line'> 17</span> * Constructor function
<span class='line'> 18</span> *
<span class='line'> 19</span> * @constuctor
<span class='line'> 20</span> * @namespace
<span class='line'> 21</span> * @param string selector
<span class='line'> 22</span> * @return object
<span class='line'> 23</span> */</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">$_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="COMM">// Have documentElement be default selector, just in case</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="COMM">// Defines a "global" selector for that instance</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$_.el</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$_.el</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">document.documentElement</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<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><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 38</span>
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="COMM">// Add the selector to the prototype</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">$_.prototype.el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span>
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="COMM">// Use the $_ object as it's own prototype</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Object.create</span><span class="PUNC">(</span><span class="NAME">$_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span>
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="COMM">// Give sel to each extension.</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 48</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">self</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 53</span>
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">self.el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</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="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self</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 class='line'> 59</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 60</span> * Simple DOM selector function
<span class='line'> 61</span> *
<span class='line'> 62</span> * @memberOf $_
<span class='line'> 63</span> * @param string selector
<span class='line'> 64</span> * @param object context
<span class='line'> 65</span> * @return object
<span class='line'> 66</span> * @type object
<span class='line'> 67</span> */</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">$</span><span class="WHIT"> </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">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">c</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 71</span>
<span class='line'> 72</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">a</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 73</span>
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="COMM">//Check for a context of a specific element, otherwise, just run on the document</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">context.nodeType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">context</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span>
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="COMM">//Pick the quickest method for each kind of selector</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a.match</span><span class="PUNC">(</span><span class="REGX">/^#([\w\-]+$)/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </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">document.getElementById</span><span class="PUNC">(</span><span class="NAME">a.split</span><span class="PUNC">(</span><span class="STRN">'#'</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</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'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">c.querySelectorAll</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 88</span>
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="COMM">//Return the single object if applicable</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span>
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 94</span> * Adds the property `obj` to the $_ object, calling it `name`
<span class='line'> 95</span> *
<span class='line'> 96</span> * @param string name
<span class='line'> 97</span> * @param object obj
<span class='line'> 98</span> */</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">obj.el</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">$_</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">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="PUNC">}</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="COMM">/**
<span class='line'>106</span> * Iterates over a $_ object, applying a callback to each item
<span class='line'>107</span> *
<span class='line'>108</span> * @name $_.each
<span class='line'>109</span> * @function
<span class='line'>110</span> * @param function callback
<span class='line'>111</span> */</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'each'</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">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">window</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">forEach.call</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span>
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>125</span> * Retrieves the type of the passed variable
<span class='line'>126</span> *
<span class='line'>127</span> * @param mixed obj
<span class='line'>128</span> * @return string
<span class='line'>129</span> * @type string
<span class='line'>130</span> */</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">$_.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">call</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="COMM">//fallback on 'typeof' for truthy primitive values</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>138</span>
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="COMM">//Strip x from [object x] and return</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toString.call</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">match</span><span class="PUNC">(</span><span class="REGX">/\s([a-z|A-Z]+)/</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span>
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="COMM">//Set global variables</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">$_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.$_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.$_</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">$_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">$_.$</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>146</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span></pre></body></html>

File diff suppressed because one or more lines are too long

View File

@ -1,126 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Ajax
<span class='line'> 3</span> *
<span class='line'> 4</span> * Module for making ajax requests
<span class='line'> 5</span> */</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 7</span>
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 9</span>
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ajax</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="NAME">_do</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">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">success_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">error_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isPost</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">request</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 15</span>
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">success_callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 19</span> * @private
<span class='line'> 20</span> */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">success_callback</span><span class="WHIT"> </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="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 23</span>
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isPost</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"POST"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"GET"</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="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"GET"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">url.match</span><span class="PUNC">(</span><span class="REGX">/\?/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this._serialize</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"?"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this._serialize</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 32</span>
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">request.open</span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 34</span>
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">request.onreadystatechange</span><span class="WHIT"> </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'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">request.readyState</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </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="NAME">request.status</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">200</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'> 41</span> </span><span class="WHIT"> </span><span class="NAME">success_callback.call</span><span class="PUNC">(</span><span class="NAME">request.responseText</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request.responseText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">error_callback</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">error_callback.call</span><span class="PUNC">(</span><span class="NAME">request.status</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">request.status</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 50</span>
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 53</span>
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"POST"</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'> 56</span> </span><span class="WHIT"> </span><span class="NAME">request.setRequestHeader</span><span class="PUNC">(</span><span class="STRN">"Content-Type"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"application/x-www-form-urlencoded"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">request.send</span><span class="PUNC">(</span><span class="NAME">this._serialize</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">request.send</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">_serialize</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">data</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">pairs</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'> 69</span>
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="KEYW">in</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="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">data.hasOwnProperty</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">$_.type</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"function"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 76</span>
<span class='line'> 77</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">data</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span>
<span class='line'> 79</span> </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">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</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">encodeURIComponent</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span>
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">pairs.push</span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"="</span><span class="WHIT"> </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'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 84</span>
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">pairs.join</span><span class="PUNC">(</span><span class="STRN">"&"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 88</span>
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 90</span> * Sends a GET type ajax request
<span class='line'> 91</span> *
<span class='line'> 92</span> * @name get
<span class='line'> 93</span> * @function
<span class='line'> 94</span> * @memberOf $_
<span class='line'> 95</span> * @param string url
<span class='line'> 96</span> * @param object data
<span class='line'> 97</span> * @param function success_callback
<span class='line'> 98</span> * @param function error_callback
<span class='line'> 99</span> */</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'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">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">success_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">error_callback</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">ajax._do</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">success_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">error_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span>
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>105</span> * Sends a POST type ajax request
<span class='line'>106</span> *
<span class='line'>107</span> * @name post
<span class='line'>108</span> * @function
<span class='line'>109</span> * @memberOf $_
<span class='line'>110</span> * @param string url
<span class='line'>111</span> * @param object data
<span class='line'>112</span> * @param function success_callback
<span class='line'>113</span> * @param function error_callback
<span class='line'>114</span> */</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'post'</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">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">success_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">error_callback</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="NAME">ajax._do</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">success_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">error_callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span></pre></body></html>

View File

@ -1,196 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Event
<span class='line'> 3</span> *
<span class='line'> 4</span> * Event api wrapper
<span class='line'> 5</span> * @todo Add method for triggering events
<span class='line'> 6</span> */</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span>
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="WHIT"> </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">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</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><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 16</span>
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="COMM">// Multiple events? Run recursively!</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">event.match</span><span class="PUNC">(</span><span class="REGX">/^([\w\-]+)$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">event</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.split</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span>
<span class='line'> 22</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">event.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 23</span>
<span class='line'> 24</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'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 28</span>
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 31</span>
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="COMM">// Bind the event</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">add</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">sel.addEventListener</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">sel.removeEventListener</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span>
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 39</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">// attach the listener to the parent object</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span>
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span>
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="COMM">// Get the live version of the target selector</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$_.$</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span>
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="COMM">// Check each element to see if it matches the target</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">elem</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="COMM">// Fire target callback when event bubbles from target</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">e.target</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="COMM">// Trigger the event callback</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">[</span><span class="NAME">elem</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span>
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="COMM">// Stop event propegation</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 61</span>
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span>
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
<span class='line'> 66</span>
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 68</span> * Event Listener module
<span class='line'> 69</span> *
<span class='line'> 70</span> * @namespace
<span class='line'> 71</span> * @name event
<span class='line'> 72</span> * @memberOf $_
<span class='line'> 73</span> */</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 76</span> * Create a custom event
<span class='line'> 77</span> *
<span class='line'> 78</span> * @memberOf $_.event
<span class='line'> 79</span> * @name create
<span class='line'> 80</span> * @function
<span class='line'> 81</span> * @example Eg. var event = $_("#selector").event.create('foo', {});
<span class='line'> 82</span> * @param string name
<span class='line'> 83</span> * @param [object] data
<span class='line'> 84</span> * @return object
<span class='line'> 85</span> */</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">create</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="COMM">// Do a terrible browser-sniffic hack because I don't know of a good </span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="COMM">// feature test</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/MSIE|Trident/i</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">navigator.userAgent</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="COMM">// Okay, I guess we have to do this the hard way... :(</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="COMM">// Microsoft, your browser still sucks</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">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createEvent</span><span class="PUNC">(</span><span class="STRN">'CustomEvent'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">e.initCustomEvent</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">
<span class='line'> 97</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">CustomEvent</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>105</span> * Adds an event that returns a callback when triggered on the selected
<span class='line'>106</span> * event and selector
<span class='line'>107</span> *
<span class='line'>108</span> * @memberOf $_.event
<span class='line'>109</span> * @name add
<span class='line'>110</span> * @function
<span class='line'>111</span> * @example Eg. $_("#selector").event.add("click", do_something());
<span class='line'>112</span> * @param string event
<span class='line'>113</span> * @param function callback
<span class='line'>114</span> */</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">add</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">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>122</span> * Removes an event bound the the specified selector, event type, and callback
<span class='line'>123</span> *
<span class='line'>124</span> * @memberOf $_.event
<span class='line'>125</span> * @name remove
<span class='line'>126</span> * @function
<span class='line'>127</span> * @example Eg. $_("#selector").event.remove("click", do_something());
<span class='line'>128</span> * @param string event
<span class='line'>129</span> * @param string callback
<span class='line'>130</span> */</span><span class="WHIT">
<span class='line'>131</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">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>138</span> * Binds a persistent event to the document
<span class='line'>139</span> *
<span class='line'>140</span> * @memberOf $_.event
<span class='line'>141</span> * @name live
<span class='line'>142</span> * @function
<span class='line'>143</span> * @example Eg. $_.event.live(".button", "click", do_something());
<span class='line'>144</span> * @param string target
<span class='line'>145</span> * @param string event
<span class='line'>146</span> * @param function callback
<span class='line'>147</span> */</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">live</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">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">document.documentElement</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>153</span> * Binds an event to a parent object
<span class='line'>154</span> *
<span class='line'>155</span> * @memberOf $_.event
<span class='line'>156</span> * @name delegate
<span class='line'>157</span> * @function
<span class='line'>158</span> * @example Eg. $_("#parent").delegate(".button", "click", do_something());
<span class='line'>159</span> * @param string target
<span class='line'>160</span> * @param string event_type
<span class='line'>161</span> * @param function callback
<span class='line'>162</span> */</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">delegate</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">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>170</span> * Trigger an event to fire
<span class='line'>171</span> *
<span class='line'>172</span> * @memberOf $_.event
<span class='line'>173</span> * @name trigger
<span class='line'>174</span> * @function
<span class='line'>175</span> * @example Eg. $_("#my_id").trigger('click');
<span class='line'>176</span> * @param string target
<span class='line'>177</span> * @param object event
<span class='line'>178</span> * @return bool
<span class='line'>179</span> */</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="NAME">trigger</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">target</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.el</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">target.dispatchEvent</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>186</span>
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'event'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span>
<span class='line'>189</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

@ -1,126 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Store
<span class='line'> 3</span> *
<span class='line'> 4</span> * Wrapper for local / sessionstorage
<span class='line'> 5</span> */</span><span class="WHIT">
<span class='line'> 6</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 7</span>
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 9</span>
<span class='line'> 10</span> </span><span class="WHIT"> </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">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="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>
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 15</span> * Wrapper for localstorage / sessionstorage data serialization.
<span class='line'> 16</span> * Each method has a boolean parameter, that when set as true switches the method
<span class='line'> 17</span> * to use sessionStorage rather than the default localStorage.
<span class='line'> 18</span> *
<span class='line'> 19</span> * @name store
<span class='line'> 20</span> * @namespace
<span class='line'> 21</span> * @memberOf $_
<span class='line'> 22</span> */</span><span class="WHIT">
<span class='line'> 23</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'> 24</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 25</span> * Retrieves and deserializes a value from localstorage,
<span class='line'> 26</span> * based on the specified key
<span class='line'> 27</span> *
<span class='line'> 28</span> * @param string key
<span class='line'> 29</span> * @param bool session
<span class='line'> 30</span> * @name get
<span class='line'> 31</span> * @memberOf $_.store
<span class='line'> 32</span> * @function
<span class='line'> 33</span> * @return object
<span class='line'> 34</span> * @type object
<span class='line'> 35</span> */</span><span class="WHIT">
<span class='line'> 36</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'> 37</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 38</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'> 39</span>
<span class='line'> 40</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">val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 43</span> * Puts a value into localstorage at the specified key,
<span class='line'> 44</span> * and JSON-encodes the value if not a string
<span class='line'> 45</span> *
<span class='line'> 46</span> * @param string key
<span class='line'> 47</span> * @param mixed value
<span class='line'> 48</span> * @param bool session
<span class='line'> 49</span> * @name set
<span class='line'> 50</span> * @memberOf $_.store
<span class='line'> 51</span> * @function
<span class='line'> 52</span> */</span><span class="WHIT">
<span class='line'> 53</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'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="COMM">// Localstorage generally only accepts strings</span><span class="WHIT">
<span class='line'> 56</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'> 57</span>
<span class='line'> 58</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.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'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 61</span> * Removes the specified item from storage
<span class='line'> 62</span> *
<span class='line'> 63</span> * @param string key
<span class='line'> 64</span> * @param bool session
<span class='line'> 65</span> * @name remove
<span class='line'> 66</span> * @memberOf $_.store
<span class='line'> 67</span> * @function
<span class='line'> 68</span> */</span><span class="WHIT">
<span class='line'> 69</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'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</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'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 74</span> * Returns an object of all the raw values in storage
<span class='line'> 75</span> *
<span class='line'> 76</span> * @param bool session
<span class='line'> 77</span> * @name getAll
<span class='line'> 78</span> * @memberOf $_.store
<span class='line'> 79</span> * @function
<span class='line'> 80</span> * @return object
<span class='line'> 81</span> * @type object
<span class='line'> 82</span> */</span><span class="WHIT">
<span class='line'> 83</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'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</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'> 86</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 87</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'> 88</span> </span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 90</span>
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="COMM">//Reference to session/localstorage</span><span class="WHIT">
<span class='line'> 92</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'> 93</span>
<span class='line'> 94</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">o.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 95</span>
<span class='line'> 96</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'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 98</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'> 99</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'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>101</span>
<span class='line'>102</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'>103</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>105</span> * Removes all values from the same domain storage
<span class='line'>106</span> *
<span class='line'>107</span> * @param bool session
<span class='line'>108</span> * @name clear
<span class='line'>109</span> * @memberOf $_.store
<span class='line'>110</span> * @function
<span class='line'>111</span> */</span><span class="WHIT">
<span class='line'>112</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'>113</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>114</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'>115</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span>
<span class='line'>118</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'>119</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

@ -1,366 +0,0 @@
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: #933;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
<span class='line'> 2</span> * Util Object
<span class='line'> 3</span> *
<span class='line'> 4</span> * Various object and string manipulation functions
<span class='line'> 5</span> * Note: these are based on similar phpjs functions: http://phpjs.org
<span class='line'> 6</span> */</span><span class="WHIT">
<span class='line'> 7</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 8</span>
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 10</span>
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">reverse_key_sort</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="COMM">//Define some variables</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keys</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'> 15</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</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 class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">new_o</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'> 17</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 18</span>
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="COMM">//Extract the keys</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">u.object_keys</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 21</span>
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="COMM">//Sort the keys</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">keys.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">bNumeric</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 28</span>
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">bNumeric</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</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 class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">bNumeric</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">bNumeric</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</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'> 41</span>
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</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 class='line'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span>
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="COMM">// cache object/array size</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">keys.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span>
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="COMM">// Recreate the object/array</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</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">num_keys</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'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">new_o</span><span class="PUNC">[</span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 53</span>
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_o</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 56</span>
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 58</span> * String and object manipulation utilities
<span class='line'> 59</span> *
<span class='line'> 60</span> * @namespace
<span class='line'> 61</span> * @name util
<span class='line'> 62</span> * @memberOf $_
<span class='line'> 63</span> */</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">u</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 66</span> * Retrieve the keys, or member names of an object
<span class='line'> 67</span> *
<span class='line'> 68</span> * @name object_keys
<span class='line'> 69</span> * @memberOf $_.util
<span class='line'> 70</span> * @function
<span class='line'> 71</span> * @param object
<span class='line'> 72</span> * @return array
<span class='line'> 73</span> * @type array
<span class='line'> 74</span> */</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">object_keys</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keys</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'> 78</span> </span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 79</span>
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">k</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">o.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">k</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'> 84</span> </span><span class="WHIT"> </span><span class="NAME">keys.push</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 87</span>
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'> 91</span> * Retrieves the values of an object, and returns
<span class='line'> 92</span> * them as an array
<span class='line'> 93</span> *
<span class='line'> 94</span> * @name object_values
<span class='line'> 95</span> * @memberOf $_.util
<span class='line'> 96</span> * @function
<span class='line'> 97</span> * @param object
<span class='line'> 98</span> * @return array
<span class='line'> 99</span> * @type array
<span class='line'>100</span> */</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">object_values</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vals</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'>104</span> </span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>105</span>
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">prop</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">vals.push</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</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">vals</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>114</span> * Creates an object, with the property names of the first array,
<span class='line'>115</span> * and the values of the second. If objects are passed, the values
<span class='line'>116</span> * of the object are used. If the arrays or objects passed are
<span class='line'>117</span> * not the same size, the function will return false.
<span class='line'>118</span> *
<span class='line'>119</span> * @name array_combine
<span class='line'>120</span> * @memberOf $_.util
<span class='line'>121</span> * @function
<span class='line'>122</span> * @param array/object keys
<span class='line'>123</span> * @param array/object vals
<span class='line'>124</span> * @return object
<span class='line'>125</span> * @type object
<span class='line'>126</span> */</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">array_combine</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">new_object</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'>130</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </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 class='line'>132</span>
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="COMM">// Extract the keys or values if needed</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.object_values</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">vals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.object_values</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>142</span>
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="COMM">// cache the number of keys</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">keys.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span>
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">vals.length</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>150</span>
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="COMM">// Create and return the new object</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="KEYW">for</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">num_keys</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'>153</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">new_object</span><span class="PUNC">[</span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>156</span>
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_object</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>160</span> * Combines two or more objects/arrays. If the keys are numeric, the outputted
<span class='line'>161</span> * object will have re-indexed keys. If a key/value pair exists in both objects,
<span class='line'>162</span> * indentical values will be droped, but if a key exists with a different value,
<span class='line'>163</span> * with the same key, the value in the second array will replace the value in the
<span class='line'>164</span> * first
<span class='line'>165</span> *
<span class='line'>166</span> * @name object_merge
<span class='line'>167</span> * @memberOf $_.util
<span class='line'>168</span> * @function
<span class='line'>169</span> * @param object [as many as you wish to combine]
<span class='line'>170</span> * @type object
<span class='line'>171</span> * @return object
<span class='line'>172</span> */</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">object_merge</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Array.prototype.slice.call</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">arg_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</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'>178</span> </span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">iarg_len</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 class='line'>180</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">is_array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>184</span>
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="COMM">// Check for an array in the arguments</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</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">arg_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'>187</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="NAME">is_array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>194</span>
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="COMM">// If all the arguments are javascript arrays</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">is_array</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</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'>199</span> </span><span class="WHIT"> </span><span class="COMM">// Let javascript do all the work!</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">arg_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'>201</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">new_obj.contact</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>204</span>
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="COMM">// Return early</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>208</span>
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="COMM">// No, there's at least one object</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">=</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">arg_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'>211</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">arg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span>
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="COMM">// If the argument is an array, add the array items as</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="COMM">// numeric object properties</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">arg</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iarg_len</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">iarg_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">j</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">arg.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="COMM">// If the key is numeric, add the property with</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="COMM">// a numeric key</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>243</span>
<span class='line'>244</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>247</span> * Replaces sections of strings in a greedy fashion,
<span class='line'>248</span> * starting with the longest replace pairs first. Accepts
<span class='line'>249</span> * one replace pair as two parameters, or an object, with
<span class='line'>250</span> * from => to replacements as key/value pairs
<span class='line'>251</span> *
<span class='line'>252</span> * @name str_trans
<span class='line'>253</span> * @memberOf $_.util
<span class='line'>254</span> * @function
<span class='line'>255</span> * @param string input_string
<span class='line'>256</span> * @param mixed from (string)/replace pairs (object)
<span class='line'>257</span> * @param [string]
<span class='line'>258</span> * @return string
<span class='line'>259</span> * @type string
<span class='line'>260</span> */</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT"> </span><span class="NAME">str_trans</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">to</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">froms</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'>264</span> </span><span class="WHIT"> </span><span class="NAME">tos</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'>265</span> </span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="NAME">from_len</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 class='line'>268</span> </span><span class="WHIT"> </span><span class="NAME">str_len</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 class='line'>269</span> </span><span class="WHIT"> </span><span class="NAME">to_len</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 class='line'>270</span> </span><span class="WHIT"> </span><span class="NAME">to_is_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="NAME">from_is_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="NAME">strx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="NAME">strw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">stry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="NAME">from_strx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span>
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="COMM">//Replace pairs? add them to the internal arrays</span><span class="WHIT">
<span class='line'>282</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">from</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="COMM">// Sort the keys in descending order for better</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="COMM">// replacement functionality</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">reverse_key_sort</span><span class="PUNC">(</span><span class="NAME">from</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span>
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">f</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">from.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">f</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="NAME">froms.push</span><span class="PUNC">(</span><span class="NAME">f</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="NAME">tos.push</span><span class="PUNC">(</span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">f</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>296</span>
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">froms</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="NAME">to</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tos</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>300</span>
<span class='line'>301</span> </span><span class="WHIT"> </span><span class="COMM">//Go through the string, and replace characters as needed</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT"> </span><span class="NAME">str_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">from.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">to_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">to.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="NAME">to_is_str</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">to</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'>306</span> </span><span class="WHIT"> </span><span class="NAME">from_is_str</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">from</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'>307</span>
<span class='line'>308</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</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">str_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'>309</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">from_is_str</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="NAME">strw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="NAME">strx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">stry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">strx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">from.charAt</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str.substr</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span>
<span class='line'>333</span> </span><span class="WHIT"> </span><span class="COMM">//Go past the current match</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</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="NAME">from</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>336</span>
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>338</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>339</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>340</span>
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">to_is_str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">to.charAt</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">to</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>350</span>
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>352</span>
<span class='line'>353</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>354</span>
<span class='line'>355</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>356</span>
<span class='line'>357</span> </span><span class="WHIT"> </span><span class="COMM">//Add it to the $_ object</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'util'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">u</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>359</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

@ -1,113 +0,0 @@
ui = {
toggleIndex: function() {
$('body').toggleClass('index-collapsed');
var indexToggler = $('#index-toggler');
if (encodeURIComponent(indexToggler.html()) == '%C2%AB')
indexToggler.html('&raquo;');
else
indexToggler.html('&laquo;');
},
toggleMethods: function() {
$.element.toggleClass(this, 'toggled');
$('.sectionItems', this.parentNode.parentNode).toggleClass('invisible');
},
toggleModule: function(module) {
if (module) {
var name = 'filter module-'+module;
if ($('body').toggleClass(name).hasClass(name)) {
createCookie("jProtonDocModule", module);
} else {
eraseCookie("jProtonDocModule");
}
}
ui.hideEmptySections();
ui.updateFragmentLocation();
},
hideEmptySections: function() {
var sections = $('.section');
sections.each(function(i){
var count = 0;
var sectionItems = $(this).find('.sectionItems');
sectionItems.find('.sectionItem').each(function(){
if ($.element.css(this, 'display') != 'none')
count++;
});
if (sectionItems.e.length > 0 && count == 0)
$.element.addClass(this, 'invisible');
else
$.element.removeClass(this, 'invisible');
});
},
updateFragmentLocation: function() {
if (window.location.hash)
window.location.hash = window.location.hash;
},
updateModuleState: function() {
var module = readCookie("jProtonDocModule");
if (module) {
$('body').addClass('filter module-'+module);
ui.hideEmptySections();
}
ui.updateFragmentLocation();
}
}
window.onload = function() {
// Controle para alternar a exibição do outline
$('#index-toggler').attr('title', 'Alterna a exibição do outline');
$('#index-toggler, #index-close').on('click', ui.toggleIndex);
// Controle para alternar a exibição de métodos
$('.method-toggler').on('click', ui.toggleMethods);
// Controle para filtro de módulos
$('.module-filter').attr('title', 'Liga/Desliga filtro do módulo');
$.each(['core', 'css', 'dom', 'event', 'ajax'], function(i,e){
$('.module-' + e + ' .module-filter').on('click', function(){
ui.toggleModule(e);
});
});
ui.updateModuleState();
if (typeof dp != 'undefined')
dp.SyntaxHighlighter.HighlightAll('code');
}
window.onunload = function() {
$.event.removeAll();
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}

122
docs/w.Promise.html Normal file
View File

@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: Promise</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: Promise</h1>
<section>
<header>
<h2>
Promise
</h2>
</header>
<article>
<div class="container-overview">
<div class="description">Promise constructor</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="promise.js.html">modules/promise.js</a>, <a href="promise.js.html#line15">line 15</a>
</li></ul></dd>
</dl>
</div>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Namespaces</h3><ul><li><a href="$_.html">$_</a></li><li><a href="$_.dom.html">dom</a></li><li><a href="$_.event.html">event</a></li><li><a href="$_.store.html">store</a></li><li><a href="w.Promise.html">Promise</a></li></ul><h3>Global</h3><ul><li><a href="global.html#data[undefined]">data[undefined]</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha5</a> on Fri Sep 05 2014 11:37:54 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>

View File

@ -16,10 +16,10 @@
* *
* Constructor function * Constructor function
* *
* @constuctor * @constructor
* @namespace * @namespace $_
* @param string selector * @param {string} selector - The dom selector string
* @return object * @return {Object}
*/ */
$_ = function(s) $_ = function(s)
{ {
@ -60,10 +60,9 @@
* Simple DOM selector function * Simple DOM selector function
* *
* @memberOf $_ * @memberOf $_
* @param string selector * @param {string} selector
* @param object context * @param {Object} [context]
* @return object * @return {Object}
* @type object
*/ */
$ = function (a, context) $ = function (a, context)
{ {
@ -93,8 +92,8 @@
/** /**
* Adds the property `obj` to the $_ object, calling it `name` * Adds the property `obj` to the $_ object, calling it `name`
* *
* @param string name * @param {string} name - name of the module
* @param object obj * @param {object} obj - the object to add
*/ */
$_.ext = function(name, obj) $_.ext = function(name, obj)
{ {
@ -107,7 +106,7 @@
* *
* @name $_.each * @name $_.each
* @function * @function
* @param function callback * @param {function} callback - iteration callback
*/ */
$_.ext('each', function (callback) $_.ext('each', function (callback)
{ {
@ -124,9 +123,8 @@
/** /**
* Retrieves the type of the passed variable * Retrieves the type of the passed variable
* *
* @param mixed obj * @param {*} obj
* @return string * @return {string}
* @type string
*/ */
$_.type = function(obj) $_.type = function(obj)
{ {
@ -154,31 +152,9 @@
*/ */
/** /**
* String trim function polyfill * Promise.prototype.done polyfill
*/ */
if(typeof String.prototype.trim === "undefined") if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }
{
/**
* @private
*/
String.prototype.trim = function()
{
return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
};
}
// --------------------------------------------------------------------------
/**
* Array.isArray polyfill
*/
if (typeof Array.isArray === "undefined")
{
Array.isArray = function(v)
{
return Object.prototype.toString.apply(v) === '[object Array]';
}
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -190,10 +166,6 @@ if (typeof Array.isArray === "undefined")
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
//This is used so IE can use the classList api
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){if(!("HTMLElement" in j)&&!("Element" in j)){return}var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.className),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.className=this.toString()}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
/** /**
* DOM * DOM
* *
@ -206,30 +178,14 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
//Private function for getting/setting attributes/properties //Private function for getting/setting attributes/properties
function _attr(sel, name, value) function _attr(sel, name, value)
{ {
var oldVal, doAttr; var oldVal;
//Get the value of the attribute, if it exists //Get the value of the attribute, if it exists
if (sel.hasAttribute !== undefined)
{
if (sel.hasAttribute(name)) if (sel.hasAttribute(name))
{ {
oldVal = sel.getAttribute(name); oldVal = sel.getAttribute(name);
} }
doAttr = true;
}
else if (sel[name] !== undefined)
{
oldVal = sel[name];
doAttr = false;
}
else if (name === "class" && sel.className !== undefined) //className attribute
{
name = "className";
oldVal = sel.className;
doAttr = false;
}
//Well, I guess that attribute doesn't exist //Well, I guess that attribute doesn't exist
if (oldVal === undefined && (value === undefined || value === null)) if (oldVal === undefined && (value === undefined || value === null))
{ {
@ -244,27 +200,13 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
//Determine what to do with the attribute //Determine what to do with the attribute
if (value !== undefined && value !== null) if (value !== undefined && value !== null)
{
if(doAttr === true)
{ {
sel.setAttribute(name, value); sel.setAttribute(name, value);
} }
else
{
sel[name] = value;
}
}
else if (value === null) else if (value === null)
{
if(doAttr === true)
{ {
sel.removeAttribute(name); sel.removeAttribute(name);
} }
else
{
delete sel[name];
}
}
return (value !== undefined) ? value : oldVal; return (value !== undefined) ? value : oldVal;
} }
@ -275,7 +217,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
*/ */
function _toCamel(s) function _toCamel(s)
{ {
return s.replace(/(\-[a-z])/g, function($1){ return String(s).replace(/(\-[a-z])/g, function($1){
return $1.toUpperCase().replace('-',''); return $1.toUpperCase().replace('-','');
}); });
} }
@ -338,7 +280,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name addClass * @name addClass
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string class * @param {string} class
*/ */
addClass: function (c) addClass: function (c)
{ {
@ -353,7 +295,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name removeClass * @name removeClass
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string class * @param {string} class
*/ */
removeClass: function (c) removeClass: function (c)
{ {
@ -381,7 +323,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name show * @name show
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] type * @param {string} [type]
*/ */
show: function (type) show: function (type)
{ {
@ -401,10 +343,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name attr * @name attr
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string name * @param {string} name
* @param [string] value * @param {?string}[value]
* @return string * @return {?string}
* @type string
*/ */
attr: function (name, value) attr: function (name, value)
{ {
@ -435,9 +376,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name text * @name text
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] value * @param {?string} [value]
* @return string * @return {?string}
* @type string
*/ */
text: function (value) text: function (value)
{ {
@ -464,20 +404,36 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* specified by the current selector. If a value is * specified by the current selector. If a value is
* passed, it will set that value on the current element, * passed, it will set that value on the current element,
* otherwise it will return the value of the css property * otherwise it will return the value of the css property
* on the current element * on the current element.
*
* Accepts either key/value arguments, or an object with
* multiple key/value pairs.
* *
* @name css * @name css
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string property * @param {(string|Object)} property
* @param [string] value * @param {?string} [value]
* @return string * @return {?string}
* @type string
*/ */
css: function (prop, val) css: function (prop, val)
{ {
var prop_key = null;
// If passed an object, recurse!
if($_.type(prop) === 'object')
{
for (prop_key in prop)
{
if ( ! prop.hasOwnProperty(prop_key)) continue;
$_.each(function (e){
_css(e, prop_key, prop[prop_key]);
});
}
}
//Return the current value if a value is not set //Return the current value if a value is not set
if(val === undefined) else if(val === undefined && $_.type(prop) !== 'object')
{ {
return _css(this.el, prop); return _css(this.el, prop);
} }
@ -493,7 +449,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name append * @name append
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string htm * @param {string} htm
*/ */
append: function(htm) append: function(htm)
{ {
@ -505,7 +461,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name prepend * @name prepend
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string htm * @param {string} htm
*/ */
prepend: function(htm) prepend: function(htm)
{ {
@ -517,9 +473,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name html * @name html
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] htm * @param {?string} [htm]
* @return string * @return {?string}
* @type string
*/ */
html: function(htm) html: function(htm)
{ {
@ -601,6 +556,13 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
request.send(null); request.send(null);
} }
}, },
/**
* Url encoding for non-get requests
*
* @param data
* @returns {string}
* @private
*/
_serialize: function (data) _serialize: function (data)
{ {
var name, var name,
@ -632,10 +594,10 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name get * @name get
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to retrieve
* @param object data * @param {Object} data - get parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('get', function (url, data, success_callback, error_callback){ $_.ext('get', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, false); ajax._do(url, data, success_callback, error_callback, false);
@ -647,10 +609,10 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name post * @name post
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to post to
* @param object data * @param {Object} data - post parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('post', function (url, data, success_callback, error_callback){ $_.ext('post', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, true); ajax._do(url, data, success_callback, error_callback, true);
@ -738,9 +700,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name create * @name create
* @function * @function
* @example Eg. var event = $_("#selector").event.create('foo', {}); * @example Eg. var event = $_("#selector").event.create('foo', {});
* @param string name * @param {string} name
* @param [object] data * @param {object} [data]
* @return object * @return {Object}
*/ */
create: function(name, data) create: function(name, data)
{ {
@ -768,8 +730,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name add * @name add
* @function * @function
* @example Eg. $_("#selector").event.add("click", do_something()); * @example Eg. $_("#selector").event.add("click", do_something());
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
add: function (event, callback) add: function (event, callback)
{ {
@ -784,8 +746,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name remove * @name remove
* @function * @function
* @example Eg. $_("#selector").event.remove("click", do_something()); * @example Eg. $_("#selector").event.remove("click", do_something());
* @param string event * @param {string} event
* @param string callback * @param {string} callback
*/ */
remove: function (event, callback) remove: function (event, callback)
{ {
@ -800,9 +762,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name live * @name live
* @function * @function
* @example Eg. $_.event.live(".button", "click", do_something()); * @example Eg. $_.event.live(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
live: function (target, event, callback) live: function (target, event, callback)
{ {
@ -815,9 +777,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name delegate * @name delegate
* @function * @function
* @example Eg. $_("#parent").delegate(".button", "click", do_something()); * @example Eg. $_("#parent").delegate(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event_type * @param {string} event
* @param function callback * @param {function} callback
*/ */
delegate: function (target, event, callback) delegate: function (target, event, callback)
{ {
@ -832,9 +794,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name trigger * @name trigger
* @function * @function
* @example Eg. $_("#my_id").trigger('click'); * @example Eg. $_("#my_id").trigger('click');
* @param string target * @param {object} event
* @param object event * @return {boolean}
* @return bool
*/ */
trigger: function(event) trigger: function(event)
{ {
@ -874,13 +835,12 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* 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 * @param {bool} session
* @name get * @name get
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return object * @return {Object}
* @type object
*/ */
get: function (key, sess) get: function (key, sess)
{ {
@ -892,9 +852,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* Puts a value into localstorage at the specified key, * Puts a value into localstorage at the specified key,
* and JSON-encodes the value if not a string * and JSON-encodes the value if not a string
* *
* @param string key * @param {string} key
* @param mixed value * @param {mixed} value
* @param bool session * @param {bool} session
* @name set * @name set
* @memberOf $_.store * @memberOf $_.store
* @function * @function
@ -909,8 +869,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
/** /**
* Removes the specified item from storage * Removes the specified item from storage
* *
* @param string key * @param {string} key
* @param bool session * @param {bool} session
* @name remove * @name remove
* @memberOf $_.store * @memberOf $_.store
* @function * @function
@ -922,12 +882,11 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
/** /**
* Returns an object of all the raw values in storage * Returns an object of all the raw values in storage
* *
* @param bool session * @param {bool} session
* @name getAll * @name getAll
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return object * @return {Object}
* @type object
*/ */
getAll: function (sess) getAll: function (sess)
{ {
@ -953,7 +912,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
/** /**
* Removes all values from the same domain storage * Removes all values from the same domain storage
* *
* @param bool session * @param {bool} session
* @name clear * @name clear
* @memberOf $_.store * @memberOf $_.store
* @function * @function

22
kis-lite-dom-min.js vendored
View File

@ -1,13 +1,9 @@
(function(d){var f,g,c;f=function(a){c=a===d?f.el!==d?f.el:document.documentElement:g(a);f.prototype.el=c;a=Object.create(f);for(var b in a)"object"===typeof a[b]&&(a[b].el=c);a.el=c;return a};g=function(a,b){var c;if("string"!=typeof a||a===d)return a;c=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);c=c.querySelectorAll(a);return 1===c.length?c[0]:c};f.ext=function(a,b){b.el=c;f[a]=b};f.ext("each",function(a){c.length!==d&&c!==window? (function(e){var c,h,b;c=function(a){b=a===e?c.el!==e?c.el:document.documentElement:h(a);c.prototype.el=b;a=Object.create(c);for(var d in a)"object"===typeof a[d]&&(a[d].el=b);a.el=b;return a};h=function(a,d){var b;if("string"!=typeof a||a===e)return a;b=null!=d&&1===d.nodeType?d:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);b=b.querySelectorAll(a);return 1===b.length?b[0]:b};c.ext=function(a,d){d.el=b;c[a]=d};c.ext("each",function(a){b.length!==e&&b!==window?
[].forEach.call(c,a):a.call(c,c)});f.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};f=window.$_=window.$_||f;f.$=g})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});"undefined"===typeof Array.isArray&&(Array.isArray=function(d){return"[object Array]"===Object.prototype.toString.apply(d)}); [].forEach.call(b,a):a.call(b,b)});c.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};c=window.$_=window.$_||c;c.$=h})();Promise.prototype.done||(Promise.prototype.done=function(e,c){this.then(e,c).then(null,function(e){setTimeout(function(){throw e;},0)})});
(function(d){var f={_do:function(f,c,a,b,h){var e=new XMLHttpRequest;a===d&&(a=function(){});h=h?"POST":"GET";"GET"===h&&(f+=f.match(/\?/)?this._serialize(c):"?"+this._serialize(c));e.open(h,f);e.onreadystatechange=function(){4===e.readyState&&(200===e.status?a.call(e.responseText,e.responseText):b!==d&&b.call(e.status,e.status))};"POST"===h?(e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.send(this._serialize(c))):e.send(null)},_serialize:function(d){var c,a,b=[];for(c in d)d.hasOwnProperty(c)&& (function(e){var c={_do:function(c,b,a,d,g){var f=new XMLHttpRequest;a===e&&(a=function(){});g=g?"POST":"GET";"GET"===g&&(c+=c.match(/\?/)?this._serialize(b):"?"+this._serialize(b));f.open(g,c);f.onreadystatechange=function(){4===f.readyState&&(200===f.status?a.call(f.responseText,f.responseText):d!==e&&d.call(f.status,f.status))};"POST"===g?(f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(this._serialize(b))):f.send(null)},_serialize:function(c){var b,a,d=[];for(b in c)c.hasOwnProperty(b)&&
"function"!==$_.type(d[c])&&(a=d[c].toString(),c=encodeURIComponent(c),a=encodeURIComponent(a),b.push(c+"="+a));return b.join("&")}};$_.ext("get",function(d,c,a,b){f._do(d,c,a,b,!1)});$_.ext("post",function(d,c,a,b){f._do(d,c,a,b,!0)})})(); "function"!==$_.type(c[b])&&(a=c[b].toString(),b=encodeURIComponent(b),a=encodeURIComponent(a),d.push(b+"="+a));return d.join("&")}};$_.ext("get",function(e,b,a,d){c._do(e,b,a,d,!1)});$_.ext("post",function(e,b,a,d){c._do(e,b,a,d,!0)})})();
(function(d){var f,g;f=function(c,a,b,d){var e,k;if(a.match(/^([\w\-]+)$/))!0===d?c.addEventListener(a,b,!1):c.removeEventListener(a,b,!1);else for(a=a.split(" "),k=a.length,e=0;e<k;e++)f(c,a[e],b,d)};g=function(c,a,b,d){f(c,b,function(b){var f,g;g=$_.$(a,c);for(f in g)b.target==g[f]&&(d.call(g[f],b),b.stopPropagation())},!0)};$_.ext("event",{create:function(c,a){if(/MSIE|Trident/i.test(navigator.userAgent)){var b=document.createEvent("CustomEvent");b.initCustomEvent(c,!0,!0,a);return b}return new CustomEvent(c, (function(e){var c,h;c=function(b,a,d,g){var f,e;if(a.match(/^([\w\-]+)$/))!0===g?b.addEventListener(a,d,!1):b.removeEventListener(a,d,!1);else for(a=a.split(" "),e=a.length,f=0;f<e;f++)c(b,a[f],d,g)};h=function(b,a,d,g){c(b,d,function(d){var e,c;c=$_.$(a,b);for(e in c)d.target==c[e]&&(g.call(c[e],d),d.stopPropagation())},!0)};$_.ext("event",{create:function(b,a){if(/MSIE|Trident/i.test(navigator.userAgent)){var d=document.createEvent("CustomEvent");d.initCustomEvent(b,!0,!0,a);return d}return new CustomEvent(b,
a)},add:function(c,a){$_.each(function(b){f(b,c,a,!0)})},remove:function(c,a){$_.each(function(b){f(b,c,a,!1)})},live:function(c,a,b){g(document.documentElement,c,a,b)},delegate:function(c,a,b){$_.each(function(d){g(d,c,a,b)})},trigger:function(c){return this.el.dispatchEvent(c)}})})(); a)},add:function(b,a){$_.each(function(d){c(d,b,a,!0)})},remove:function(b,a){$_.each(function(d){c(d,b,a,!1)})},live:function(b,a,d){h(document.documentElement,b,a,d)},delegate:function(b,a,d){$_.each(function(c){h(c,b,a,d)})},trigger:function(b){return this.el.dispatchEvent(b)}})})();
"undefined"===typeof document||"classList"in document.createElement("a")||function(d){if("HTMLElement"in d||"Element"in d){d=(d.HTMLElement||d.Element).prototype;var f=Object,g=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},a=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},b=function(b,d){if(""===d)throw new a("SYNTAX_ERR","An invalid or illegal string was specified"); (function(e){function c(a,d,b){var c;a.hasAttribute(d)&&(c=a.getAttribute(d));if(c===e&&(b===e||null===b))return null;if(b===e)return c;b!==e&&null!==b?a.setAttribute(d,b):null===b&&a.removeAttribute(d);return b!==e?b:c}function h(a){return String(a).replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function b(a,d,b){var c;d=h(d);c={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(b===e&&a.style[d]!==e)return a.style[d];if(b===e&&a.style[c[d]]!==e)return a.style[c[d]];
if(/\s/.test(d))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return c.call(b,d)},h=function(a){for(var b=g.call(a.className),b=b?b.split(/\s+/):[],c=0,d=b.length;c<d;c++)this.push(b[c]);this._updateClassName=function(){a.className=this.toString()}},e=h.prototype=[],k=function(){return new h(this)};a.prototype=Error.prototype;e.item=function(a){return this[a]||null};e.contains=function(a){return-1!==b(this,a+"")};e.add=function(){var a=arguments,c=0,d=a.length,e,f=!1; if(a.style[d]!==e)return a.style[d]=b,null;if(a.style[c[d]])return a.style[c[d]]=b,null}$_.ext("dom",{addClass:function(a){$_.each(function(b){b.classList.add(a)})},removeClass:function(a){$_.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){a===e&&(a="block");this.css("display",a)},attr:function(a,b){var g=this.el;if(1<g.length&&b===e)return null;if(1<g.length&&b!==e)$_.each(function(e){return c(e,a,b)});else return c(g,a,b)},text:function(a){var b,
do e=a[c]+"",-1===b(this,e)&&(this.push(e),f=!0);while(++c<d);f&&this._updateClassName()};e.remove=function(){var a=arguments,c=0,d=a.length,e,f=!1;do e=a[c]+"",e=b(this,e),-1!==e&&(this.splice(e,1),f=!0);while(++c<d);f&&this._updateClassName()};e.toggle=function(a,b){a+="";var c=this.contains(a),d=c?!0!==b&&"remove":!1!==b&&"add";if(d)this[d](a);return!c};e.toString=function(){return this.join(" ")};if(f.defineProperty){e={get:k,enumerable:!0,configurable:!0};try{f.defineProperty(d,"classList",e)}catch(l){-2146823252=== c,f;f=this.el;c=a!==e?!0:!1;b=f.textContent;return c?f.textContent=a:b},css:function(a,d){var c=null;if("object"===$_.type(a))for(c in a)a.hasOwnProperty(c)&&$_.each(function(d){b(d,c,a[c])});else if(d===e&&"object"!==$_.type(a))return b(this.el,a);$_.each(function(c){b(c,a,d)})},append:function(a){this.el.insertAdjacentHTML("beforeend",a)},prepend:function(a){this.el.insertAdjacentHTML("afterbegin",a)},html:function(a){a!==e&&(this.el.innerHTML=a);return this.el.innerHTML}})})();
l.number&&(e.enumerable=!1,f.defineProperty(d,"classList",e))}}else f.prototype.__defineGetter__&&d.__defineGetter__("classList",k)}}(self);
(function(d){function f(a,b,c){var e,f;a.hasAttribute!==d?(a.hasAttribute(b)&&(e=a.getAttribute(b)),f=!0):a[b]!==d?(e=a[b],f=!1):"class"===b&&a.className!==d&&(b="className",e=a.className,f=!1);if(e===d&&(c===d||null===c))return null;if(c===d)return e;c!==d&&null!==c?!0===f?a.setAttribute(b,c):a[b]=c:null===c&&(!0===f?a.removeAttribute(b):delete a[b]);return c!==d?c:e}function g(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function c(a,b,c){var e;b=g(b);e=
{outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(c===d&&a.style[b]!==d)return a.style[b];if(c===d&&a.style[e[b]]!==d)return a.style[e[b]];if(a.style[b]!==d)return a.style[b]=c,null;if(a.style[e[b]])return a.style[e[b]]=c,null}$_.ext("dom",{addClass:function(a){$_.each(function(b){b.classList.add(a)})},removeClass:function(a){$_.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){a===d&&(a="block");this.css("display",a)},attr:function(a,
b){var c=this.el;if(1<c.length&&b===d)return null;if(1<c.length&&b!==d)$_.each(function(c){return f(c,a,b)});else return f(c,a,b)},text:function(a){var b,c,e;e=this.el;c=a!==d?!0:!1;b=e.textContent;return c?e.textContent=a:b},css:function(a,b){if(b===d)return c(this.el,a);$_.each(function(d){c(d,a,b)})},append:function(a){this.el.insertAdjacentHTML("beforeend",a)},prepend:function(a){this.el.insertAdjacentHTML("afterbegin",a)},html:function(a){a!==d&&(this.el.innerHTML=a);return this.el.innerHTML}})})();

View File

@ -16,10 +16,10 @@
* *
* Constructor function * Constructor function
* *
* @constuctor * @constructor
* @namespace * @namespace $_
* @param string selector * @param {string} selector - The dom selector string
* @return object * @return {Object}
*/ */
$_ = function(s) $_ = function(s)
{ {
@ -60,10 +60,9 @@
* Simple DOM selector function * Simple DOM selector function
* *
* @memberOf $_ * @memberOf $_
* @param string selector * @param {string} selector
* @param object context * @param {Object} [context]
* @return object * @return {Object}
* @type object
*/ */
$ = function (a, context) $ = function (a, context)
{ {
@ -93,8 +92,8 @@
/** /**
* Adds the property `obj` to the $_ object, calling it `name` * Adds the property `obj` to the $_ object, calling it `name`
* *
* @param string name * @param {string} name - name of the module
* @param object obj * @param {object} obj - the object to add
*/ */
$_.ext = function(name, obj) $_.ext = function(name, obj)
{ {
@ -107,7 +106,7 @@
* *
* @name $_.each * @name $_.each
* @function * @function
* @param function callback * @param {function} callback - iteration callback
*/ */
$_.ext('each', function (callback) $_.ext('each', function (callback)
{ {
@ -124,9 +123,8 @@
/** /**
* Retrieves the type of the passed variable * Retrieves the type of the passed variable
* *
* @param mixed obj * @param {*} obj
* @return string * @return {string}
* @type string
*/ */
$_.type = function(obj) $_.type = function(obj)
{ {
@ -154,31 +152,9 @@
*/ */
/** /**
* String trim function polyfill * Promise.prototype.done polyfill
*/ */
if(typeof String.prototype.trim === "undefined") if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }
{
/**
* @private
*/
String.prototype.trim = function()
{
return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
};
}
// --------------------------------------------------------------------------
/**
* Array.isArray polyfill
*/
if (typeof Array.isArray === "undefined")
{
Array.isArray = function(v)
{
return Object.prototype.toString.apply(v) === '[object Array]';
}
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -245,6 +221,13 @@ if (typeof Array.isArray === "undefined")
request.send(null); request.send(null);
} }
}, },
/**
* Url encoding for non-get requests
*
* @param data
* @returns {string}
* @private
*/
_serialize: function (data) _serialize: function (data)
{ {
var name, var name,
@ -276,10 +259,10 @@ if (typeof Array.isArray === "undefined")
* @name get * @name get
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to retrieve
* @param object data * @param {Object} data - get parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('get', function (url, data, success_callback, error_callback){ $_.ext('get', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, false); ajax._do(url, data, success_callback, error_callback, false);
@ -291,10 +274,10 @@ if (typeof Array.isArray === "undefined")
* @name post * @name post
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to post to
* @param object data * @param {Object} data - post parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('post', function (url, data, success_callback, error_callback){ $_.ext('post', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, true); ajax._do(url, data, success_callback, error_callback, true);
@ -385,9 +368,9 @@ if (typeof Array.isArray === "undefined")
* @name create * @name create
* @function * @function
* @example Eg. var event = $_("#selector").event.create('foo', {}); * @example Eg. var event = $_("#selector").event.create('foo', {});
* @param string name * @param {string} name
* @param [object] data * @param {object} [data]
* @return object * @return {Object}
*/ */
create: function(name, data) create: function(name, data)
{ {
@ -415,8 +398,8 @@ if (typeof Array.isArray === "undefined")
* @name add * @name add
* @function * @function
* @example Eg. $_("#selector").event.add("click", do_something()); * @example Eg. $_("#selector").event.add("click", do_something());
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
add: function (event, callback) add: function (event, callback)
{ {
@ -431,8 +414,8 @@ if (typeof Array.isArray === "undefined")
* @name remove * @name remove
* @function * @function
* @example Eg. $_("#selector").event.remove("click", do_something()); * @example Eg. $_("#selector").event.remove("click", do_something());
* @param string event * @param {string} event
* @param string callback * @param {string} callback
*/ */
remove: function (event, callback) remove: function (event, callback)
{ {
@ -447,9 +430,9 @@ if (typeof Array.isArray === "undefined")
* @name live * @name live
* @function * @function
* @example Eg. $_.event.live(".button", "click", do_something()); * @example Eg. $_.event.live(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
live: function (target, event, callback) live: function (target, event, callback)
{ {
@ -462,9 +445,9 @@ if (typeof Array.isArray === "undefined")
* @name delegate * @name delegate
* @function * @function
* @example Eg. $_("#parent").delegate(".button", "click", do_something()); * @example Eg. $_("#parent").delegate(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event_type * @param {string} event
* @param function callback * @param {function} callback
*/ */
delegate: function (target, event, callback) delegate: function (target, event, callback)
{ {
@ -479,9 +462,8 @@ if (typeof Array.isArray === "undefined")
* @name trigger * @name trigger
* @function * @function
* @example Eg. $_("#my_id").trigger('click'); * @example Eg. $_("#my_id").trigger('click');
* @param string target * @param {object} event
* @param object event * @return {boolean}
* @return bool
*/ */
trigger: function(event) trigger: function(event)
{ {
@ -496,10 +478,6 @@ if (typeof Array.isArray === "undefined")
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
//This is used so IE can use the classList api
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){if(!("HTMLElement" in j)&&!("Element" in j)){return}var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.className),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.className=this.toString()}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
/** /**
* DOM * DOM
* *
@ -514,30 +492,14 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
//Private function for getting/setting attributes/properties //Private function for getting/setting attributes/properties
function _attr(sel, name, value) function _attr(sel, name, value)
{ {
var oldVal, doAttr; var oldVal;
//Get the value of the attribute, if it exists //Get the value of the attribute, if it exists
if (sel.hasAttribute !== undefined)
{
if (sel.hasAttribute(name)) if (sel.hasAttribute(name))
{ {
oldVal = sel.getAttribute(name); oldVal = sel.getAttribute(name);
} }
doAttr = true;
}
else if (sel[name] !== undefined)
{
oldVal = sel[name];
doAttr = false;
}
else if (name === "class" && sel.className !== undefined) //className attribute
{
name = "className";
oldVal = sel.className;
doAttr = false;
}
//Well, I guess that attribute doesn't exist //Well, I guess that attribute doesn't exist
if (oldVal === undefined && (value === undefined || value === null)) if (oldVal === undefined && (value === undefined || value === null))
{ {
@ -552,27 +514,13 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
//Determine what to do with the attribute //Determine what to do with the attribute
if (value !== undefined && value !== null) if (value !== undefined && value !== null)
{
if(doAttr === true)
{ {
sel.setAttribute(name, value); sel.setAttribute(name, value);
} }
else
{
sel[name] = value;
}
}
else if (value === null) else if (value === null)
{
if(doAttr === true)
{ {
sel.removeAttribute(name); sel.removeAttribute(name);
} }
else
{
delete sel[name];
}
}
return (value !== undefined) ? value : oldVal; return (value !== undefined) ? value : oldVal;
} }
@ -583,7 +531,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
*/ */
function _toCamel(s) function _toCamel(s)
{ {
return s.replace(/(\-[a-z])/g, function($1){ return String(s).replace(/(\-[a-z])/g, function($1){
return $1.toUpperCase().replace('-',''); return $1.toUpperCase().replace('-','');
}); });
} }
@ -646,7 +594,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name addClass * @name addClass
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string class * @param {string} class
*/ */
addClass: function (c) addClass: function (c)
{ {
@ -661,7 +609,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name removeClass * @name removeClass
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string class * @param {string} class
*/ */
removeClass: function (c) removeClass: function (c)
{ {
@ -689,7 +637,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name show * @name show
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] type * @param {string} [type]
*/ */
show: function (type) show: function (type)
{ {
@ -709,10 +657,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name attr * @name attr
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string name * @param {string} name
* @param [string] value * @param {?string}[value]
* @return string * @return {?string}
* @type string
*/ */
attr: function (name, value) attr: function (name, value)
{ {
@ -743,9 +690,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name text * @name text
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] value * @param {?string} [value]
* @return string * @return {?string}
* @type string
*/ */
text: function (value) text: function (value)
{ {
@ -772,20 +718,36 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* specified by the current selector. If a value is * specified by the current selector. If a value is
* passed, it will set that value on the current element, * passed, it will set that value on the current element,
* otherwise it will return the value of the css property * otherwise it will return the value of the css property
* on the current element * on the current element.
*
* Accepts either key/value arguments, or an object with
* multiple key/value pairs.
* *
* @name css * @name css
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string property * @param {(string|Object)} property
* @param [string] value * @param {?string} [value]
* @return string * @return {?string}
* @type string
*/ */
css: function (prop, val) css: function (prop, val)
{ {
var prop_key = null;
// If passed an object, recurse!
if($_.type(prop) === 'object')
{
for (prop_key in prop)
{
if ( ! prop.hasOwnProperty(prop_key)) continue;
$_.each(function (e){
_css(e, prop_key, prop[prop_key]);
});
}
}
//Return the current value if a value is not set //Return the current value if a value is not set
if(val === undefined) else if(val === undefined && $_.type(prop) !== 'object')
{ {
return _css(this.el, prop); return _css(this.el, prop);
} }
@ -801,7 +763,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name append * @name append
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string htm * @param {string} htm
*/ */
append: function(htm) append: function(htm)
{ {
@ -813,7 +775,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name prepend * @name prepend
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string htm * @param {string} htm
*/ */
prepend: function(htm) prepend: function(htm)
{ {
@ -825,9 +787,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name html * @name html
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] htm * @param {?string} [htm]
* @return string * @return {?string}
* @type string
*/ */
html: function(htm) html: function(htm)
{ {

12
kis-lite-min.js vendored
View File

@ -1,6 +1,6 @@
(function(e){var c,f,b;c=function(a){b=a===e?c.el!==e?c.el:document.documentElement:f(a);c.prototype.el=b;a=Object.create(c);for(var d in a)"object"===typeof a[d]&&(a[d].el=b);a.el=b;return a};f=function(a,b){var c;if("string"!=typeof a||a===e)return a;c=null!=b&&1===b.nodeType?b:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);c=c.querySelectorAll(a);return 1===c.length?c[0]:c};c.ext=function(a,d){d.el=b;c[a]=d};c.ext("each",function(a){b.length!==e&&b!==window? (function(e){var b,f,c;b=function(a){c=a===e?b.el!==e?b.el:document.documentElement:f(a);b.prototype.el=c;a=Object.create(b);for(var d in a)"object"===typeof a[d]&&(a[d].el=c);a.el=c;return a};f=function(a,c){var b;if("string"!=typeof a||a===e)return a;b=null!=c&&1===c.nodeType?c:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);b=b.querySelectorAll(a);return 1===b.length?b[0]:b};b.ext=function(a,d){d.el=c;b[a]=d};b.ext("each",function(a){c.length!==e&&c!==window?
[].forEach.call(b,a):a.call(b,b)});c.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};c=window.$_=window.$_||c;c.$=f})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});"undefined"===typeof Array.isArray&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)}); [].forEach.call(c,a):a.call(c,c)});b.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};b=window.$_=window.$_||b;b.$=f})();Promise.prototype.done||(Promise.prototype.done=function(e,b){this.then(e,b).then(null,function(b){setTimeout(function(){throw b;},0)})});
(function(e){var c={_do:function(c,b,a,d,h){var g=new XMLHttpRequest;a===e&&(a=function(){});h=h?"POST":"GET";"GET"===h&&(c+=c.match(/\?/)?this._serialize(b):"?"+this._serialize(b));g.open(h,c);g.onreadystatechange=function(){4===g.readyState&&(200===g.status?a.call(g.responseText,g.responseText):d!==e&&d.call(g.status,g.status))};"POST"===h?(g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(this._serialize(b))):g.send(null)},_serialize:function(c){var b,a,d=[];for(b in c)c.hasOwnProperty(b)&& (function(e){var b={_do:function(b,c,a,d,h){var g=new XMLHttpRequest;a===e&&(a=function(){});h=h?"POST":"GET";"GET"===h&&(b+=b.match(/\?/)?this._serialize(c):"?"+this._serialize(c));g.open(h,b);g.onreadystatechange=function(){4===g.readyState&&(200===g.status?a.call(g.responseText,g.responseText):d!==e&&d.call(g.status,g.status))};"POST"===h?(g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(this._serialize(c))):g.send(null)},_serialize:function(b){var c,a,d=[];for(c in b)b.hasOwnProperty(c)&&
"function"!==$_.type(c[b])&&(a=c[b].toString(),b=encodeURIComponent(b),a=encodeURIComponent(a),d.push(b+"="+a));return d.join("&")}};$_.ext("get",function(f,b,a,d){c._do(f,b,a,d,!1)});$_.ext("post",function(f,b,a,d){c._do(f,b,a,d,!0)})})(); "function"!==$_.type(b[c])&&(a=b[c].toString(),c=encodeURIComponent(c),a=encodeURIComponent(a),d.push(c+"="+a));return d.join("&")}};$_.ext("get",function(f,c,a,d){b._do(f,c,a,d,!1)});$_.ext("post",function(f,c,a,d){b._do(f,c,a,d,!0)})})();
(function(e){var c,f;c=function(b,a,d,h){var g,f;if(a.match(/^([\w\-]+)$/))!0===h?b.addEventListener(a,d,!1):b.removeEventListener(a,d,!1);else for(a=a.split(" "),f=a.length,g=0;g<f;g++)c(b,a[g],d,h)};f=function(b,a,d,f){c(b,d,function(c){var d,e;e=$_.$(a,b);for(d in e)c.target==e[d]&&(f.call(e[d],c),c.stopPropagation())},!0)};$_.ext("event",{create:function(b,a){if(/MSIE|Trident/i.test(navigator.userAgent)){var c=document.createEvent("CustomEvent");c.initCustomEvent(b,!0,!0,a);return c}return new CustomEvent(b, (function(e){var b,f;b=function(c,a,d,h){var g,f;if(a.match(/^([\w\-]+)$/))!0===h?c.addEventListener(a,d,!1):c.removeEventListener(a,d,!1);else for(a=a.split(" "),f=a.length,g=0;g<f;g++)b(c,a[g],d,h)};f=function(c,a,d,f){b(c,d,function(b){var d,e;e=$_.$(a,c);for(d in e)b.target==e[d]&&(f.call(e[d],b),b.stopPropagation())},!0)};$_.ext("event",{create:function(c,a){if(/MSIE|Trident/i.test(navigator.userAgent)){var b=document.createEvent("CustomEvent");b.initCustomEvent(c,!0,!0,a);return b}return new CustomEvent(c,
a)},add:function(b,a){$_.each(function(d){c(d,b,a,!0)})},remove:function(b,a){$_.each(function(d){c(d,b,a,!1)})},live:function(b,a,c){f(document.documentElement,b,a,c)},delegate:function(b,a,c){$_.each(function(e){f(e,b,a,c)})},trigger:function(b){return this.el.dispatchEvent(b)}})})(); a)},add:function(c,a){$_.each(function(d){b(d,c,a,!0)})},remove:function(c,a){$_.each(function(d){b(d,c,a,!1)})},live:function(c,a,b){f(document.documentElement,c,a,b)},delegate:function(b,a,d){$_.each(function(e){f(e,b,a,d)})},trigger:function(b){return this.el.dispatchEvent(b)}})})();

View File

@ -16,10 +16,10 @@
* *
* Constructor function * Constructor function
* *
* @constuctor * @constructor
* @namespace * @namespace $_
* @param string selector * @param {string} selector - The dom selector string
* @return object * @return {Object}
*/ */
$_ = function(s) $_ = function(s)
{ {
@ -60,10 +60,9 @@
* Simple DOM selector function * Simple DOM selector function
* *
* @memberOf $_ * @memberOf $_
* @param string selector * @param {string} selector
* @param object context * @param {Object} [context]
* @return object * @return {Object}
* @type object
*/ */
$ = function (a, context) $ = function (a, context)
{ {
@ -93,8 +92,8 @@
/** /**
* Adds the property `obj` to the $_ object, calling it `name` * Adds the property `obj` to the $_ object, calling it `name`
* *
* @param string name * @param {string} name - name of the module
* @param object obj * @param {object} obj - the object to add
*/ */
$_.ext = function(name, obj) $_.ext = function(name, obj)
{ {
@ -107,7 +106,7 @@
* *
* @name $_.each * @name $_.each
* @function * @function
* @param function callback * @param {function} callback - iteration callback
*/ */
$_.ext('each', function (callback) $_.ext('each', function (callback)
{ {
@ -124,9 +123,8 @@
/** /**
* Retrieves the type of the passed variable * Retrieves the type of the passed variable
* *
* @param mixed obj * @param {*} obj
* @return string * @return {string}
* @type string
*/ */
$_.type = function(obj) $_.type = function(obj)
{ {
@ -154,31 +152,9 @@
*/ */
/** /**
* String trim function polyfill * Promise.prototype.done polyfill
*/ */
if(typeof String.prototype.trim === "undefined") if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }
{
/**
* @private
*/
String.prototype.trim = function()
{
return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
};
}
// --------------------------------------------------------------------------
/**
* Array.isArray polyfill
*/
if (typeof Array.isArray === "undefined")
{
Array.isArray = function(v)
{
return Object.prototype.toString.apply(v) === '[object Array]';
}
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -245,6 +221,13 @@ if (typeof Array.isArray === "undefined")
request.send(null); request.send(null);
} }
}, },
/**
* Url encoding for non-get requests
*
* @param data
* @returns {string}
* @private
*/
_serialize: function (data) _serialize: function (data)
{ {
var name, var name,
@ -276,10 +259,10 @@ if (typeof Array.isArray === "undefined")
* @name get * @name get
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to retrieve
* @param object data * @param {Object} data - get parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('get', function (url, data, success_callback, error_callback){ $_.ext('get', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, false); ajax._do(url, data, success_callback, error_callback, false);
@ -291,10 +274,10 @@ if (typeof Array.isArray === "undefined")
* @name post * @name post
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to post to
* @param object data * @param {Object} data - post parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('post', function (url, data, success_callback, error_callback){ $_.ext('post', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, true); ajax._do(url, data, success_callback, error_callback, true);
@ -385,9 +368,9 @@ if (typeof Array.isArray === "undefined")
* @name create * @name create
* @function * @function
* @example Eg. var event = $_("#selector").event.create('foo', {}); * @example Eg. var event = $_("#selector").event.create('foo', {});
* @param string name * @param {string} name
* @param [object] data * @param {object} [data]
* @return object * @return {Object}
*/ */
create: function(name, data) create: function(name, data)
{ {
@ -415,8 +398,8 @@ if (typeof Array.isArray === "undefined")
* @name add * @name add
* @function * @function
* @example Eg. $_("#selector").event.add("click", do_something()); * @example Eg. $_("#selector").event.add("click", do_something());
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
add: function (event, callback) add: function (event, callback)
{ {
@ -431,8 +414,8 @@ if (typeof Array.isArray === "undefined")
* @name remove * @name remove
* @function * @function
* @example Eg. $_("#selector").event.remove("click", do_something()); * @example Eg. $_("#selector").event.remove("click", do_something());
* @param string event * @param {string} event
* @param string callback * @param {string} callback
*/ */
remove: function (event, callback) remove: function (event, callback)
{ {
@ -447,9 +430,9 @@ if (typeof Array.isArray === "undefined")
* @name live * @name live
* @function * @function
* @example Eg. $_.event.live(".button", "click", do_something()); * @example Eg. $_.event.live(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
live: function (target, event, callback) live: function (target, event, callback)
{ {
@ -462,9 +445,9 @@ if (typeof Array.isArray === "undefined")
* @name delegate * @name delegate
* @function * @function
* @example Eg. $_("#parent").delegate(".button", "click", do_something()); * @example Eg. $_("#parent").delegate(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event_type * @param {string} event
* @param function callback * @param {function} callback
*/ */
delegate: function (target, event, callback) delegate: function (target, event, callback)
{ {
@ -479,9 +462,8 @@ if (typeof Array.isArray === "undefined")
* @name trigger * @name trigger
* @function * @function
* @example Eg. $_("#my_id").trigger('click'); * @example Eg. $_("#my_id").trigger('click');
* @param string target * @param {object} event
* @param object event * @return {boolean}
* @return bool
*/ */
trigger: function(event) trigger: function(event)
{ {

21
kis-min.js vendored
View File

@ -1,12 +1,9 @@
(function(e){var c,m,k;c=function(f){k=f===e?c.el!==e?c.el:document.documentElement:m(f);c.prototype.el=k;f=Object.create(c);for(var n in f)"object"===typeof f[n]&&(f[n].el=k);f.el=k;return f};m=function(c,k){var l;if("string"!=typeof c||c===e)return c;l=null!=k&&1===k.nodeType?k:document;if(c.match(/^#([\w\-]+$)/))return document.getElementById(c.split("#")[1]);l=l.querySelectorAll(c);return 1===l.length?l[0]:l};c.ext=function(f,e){e.el=k;c[f]=e};c.ext("each",function(c){k.length!==e&&k!==window? (function(e){var d,m,f;d=function(k){f=k===e?d.el!==e?d.el:document.documentElement:m(k);d.prototype.el=f;k=Object.create(d);for(var n in k)"object"===typeof k[n]&&(k[n].el=f);k.el=f;return k};m=function(d,f){var l;if("string"!=typeof d||d===e)return d;l=null!=f&&1===f.nodeType?f:document;if(d.match(/^#([\w\-]+$)/))return document.getElementById(d.split("#")[1]);l=l.querySelectorAll(d);return 1===l.length?l[0]:l};d.ext=function(e,m){m.el=f;d[e]=m};d.ext("each",function(d){f.length!==e&&f!==window?
[].forEach.call(k,c):c.call(k,k)});c.type=function(c){return function(){return c&&c!==this}.call(c)?(typeof c).toLowerCase():{}.toString.call(c).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};c=window.$_=window.$_||c;c.$=m})();"undefined"===typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")});"undefined"===typeof Array.isArray&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.apply(e)}); [].forEach.call(f,d):d.call(f,f)});d.type=function(d){return function(){return d&&d!==this}.call(d)?(typeof d).toLowerCase():{}.toString.call(d).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};d=window.$_=window.$_||d;d.$=m})();Promise.prototype.done||(Promise.prototype.done=function(e,d){this.then(e,d).then(null,function(d){setTimeout(function(){throw d;},0)})});
(function(e,c){function m(a,b,d){var g,h;a.hasAttribute!==c?(a.hasAttribute(b)&&(g=a.getAttribute(b)),h=!0):a[b]!==c?(g=a[b],h=!1):"class"===b&&a.className!==c&&(b="className",g=a.className,h=!1);if(g===c&&(d===c||null===d))return null;if(d===c)return g;d!==c&&null!==d?!0===h?a.setAttribute(b,d):a[b]=d:null===d&&(!0===h?a.removeAttribute(b):delete a[b]);return d!==c?d:g}function k(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function f(a,b,d){var g;b=k(b); (function(e,d){function m(a,b,c){var h;a.hasAttribute(b)&&(h=a.getAttribute(b));if(h===d&&(c===d||null===c))return null;if(c===d)return h;c!==d&&null!==c?a.setAttribute(b,c):null===c&&a.removeAttribute(b);return c!==d?c:h}function f(a){return String(a).replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function k(a,b,c){var h;b=f(b);h={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(c===d&&a.style[b]!==d)return a.style[b];if(c===d&&a.style[h[b]]!==d)return a.style[h[b]];
g={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(d===c&&a.style[b]!==c)return a.style[b];if(d===c&&a.style[g[b]]!==c)return a.style[g[b]];if(a.style[b]!==c)return a.style[b]=d,null;if(a.style[g[b]])return a.style[g[b]]=d,null}"undefined"===typeof document||"classList"in document.createElement("a")||function(a){if("HTMLElement"in a||"Element"in a){a=(a.HTMLElement||a.Element).prototype;var b=Object,d=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array.prototype.indexOf|| if(a.style[b]!==d)return a.style[b]=c,null;if(a.style[h[b]])return a.style[h[b]]=c,null}e.ext("dom",{addClass:function(a){e.each(function(b){b.classList.add(a)})},removeClass:function(a){e.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){a===d&&(a="block");this.css("display",a)},attr:function(a,b){var c=this.el;if(1<c.length&&b===d)return null;if(1<c.length&&b!==d)e.each(function(c){return m(c,a,b)});else return m(c,a,b)},text:function(a){var b,
function(a){for(var b=0,d=this.length;b<d;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},e=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return c.call(a,b)},k=function(a){for(var b=d.call(a.className),b=b?b.split(/\s+/):[],c=0,g=b.length;c<g;c++)this.push(b[c]);this._updateClassName=function(){a.className= c,h;h=this.el;c=a!==d?!0:!1;b=h.textContent;return c?h.textContent=a:b},css:function(a,b){var c=null;if("object"===e.type(a))for(c in a)a.hasOwnProperty(c)&&e.each(function(b){k(b,c,a[c])});else if(b===d&&"object"!==e.type(a))return k(this.el,a);e.each(function(c){k(c,a,b)})},append:function(a){this.el.insertAdjacentHTML("beforeend",a)},prepend:function(a){this.el.insertAdjacentHTML("afterbegin",a)},html:function(a){a!==d&&(this.el.innerHTML=a);return this.el.innerHTML}});var n={_do:function(a,b,
this.toString()}},f=k.prototype=[],l=function(){return new k(this)};h.prototype=Error.prototype;f.item=function(a){return this[a]||null};f.contains=function(a){return-1!==e(this,a+"")};f.add=function(){var a=arguments,b=0,d=a.length,c,g=!1;do c=a[b]+"",-1===e(this,c)&&(this.push(c),g=!0);while(++b<d);g&&this._updateClassName()};f.remove=function(){var a=arguments,b=0,d=a.length,c,g=!1;do c=a[b]+"",c=e(this,c),-1!==c&&(this.splice(c,1),g=!0);while(++b<d);g&&this._updateClassName()};f.toggle=function(a, c,h,e){var g=new XMLHttpRequest;c===d&&(c=function(){});e=e?"POST":"GET";"GET"===e&&(a+=a.match(/\?/)?this._serialize(b):"?"+this._serialize(b));g.open(e,a);g.onreadystatechange=function(){4===g.readyState&&(200===g.status?c.call(g.responseText,g.responseText):h!==d&&h.call(g.status,g.status))};"POST"===e?(g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.send(this._serialize(b))):g.send(null)},_serialize:function(a){var b,c,d=[];for(b in a)a.hasOwnProperty(b)&&"function"!==
b){a+="";var d=this.contains(a),c=d?!0!==b&&"remove":!1!==b&&"add";if(c)this[c](a);return!d};f.toString=function(){return this.join(" ")};if(b.defineProperty){f={get:l,enumerable:!0,configurable:!0};try{b.defineProperty(a,"classList",f)}catch(m){-2146823252===m.number&&(f.enumerable=!1,b.defineProperty(a,"classList",f))}}else b.prototype.__defineGetter__&&a.__defineGetter__("classList",l)}}(self);e.ext("dom",{addClass:function(a){e.each(function(b){b.classList.add(a)})},removeClass:function(a){e.each(function(b){b.classList.remove(a)})}, e.type(a[b])&&(c=a[b].toString(),b=encodeURIComponent(b),c=encodeURIComponent(c),d.push(b+"="+c));return d.join("&")}};e.ext("get",function(a,b,c,d){n._do(a,b,c,d,!1)});e.ext("post",function(a,b,c,d){n._do(a,b,c,d,!0)});var l,r;l=function(a,b,c,d){var e,g;if(b.match(/^([\w\-]+)$/))!0===d?a.addEventListener(b,c,!1):a.removeEventListener(b,c,!1);else for(b=b.split(" "),g=b.length,e=0;e<g;e++)l(a,b[e],c,d)};r=function(a,b,c,d){l(a,c,function(c){var g,f;f=e.$(b,a);for(g in f)c.target==f[g]&&(d.call(f[g],
hide:function(){this.css("display","none")},show:function(a){a===c&&(a="block");this.css("display",a)},attr:function(a,b){var d=this.el;if(1<d.length&&b===c)return null;if(1<d.length&&b!==c)e.each(function(d){return m(d,a,b)});else return m(d,a,b)},text:function(a){var b,d,g;g=this.el;d=a!==c?!0:!1;b=g.textContent;return d?g.textContent=a:b},css:function(a,b){if(b===c)return f(this.el,a);e.each(function(d){f(d,a,b)})},append:function(a){this.el.insertAdjacentHTML("beforeend",a)},prepend:function(a){this.el.insertAdjacentHTML("afterbegin", c),c.stopPropagation())},!0)};e.ext("event",{create:function(a,b){if(/MSIE|Trident/i.test(navigator.userAgent)){var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!0,!0,b);return c}return new CustomEvent(a,b)},add:function(a,b){e.each(function(c){l(c,a,b,!0)})},remove:function(a,b){e.each(function(c){l(c,a,b,!1)})},live:function(a,b,c){r(document.documentElement,a,b,c)},delegate:function(a,b,c){e.each(function(d){r(d,a,b,c)})},trigger:function(a){return this.el.dispatchEvent(a)}});var p=
a)},html:function(a){a!==c&&(this.el.innerHTML=a);return this.el.innerHTML}});var n={_do:function(a,b,d,g,h){var e=new XMLHttpRequest;d===c&&(d=function(){});h=h?"POST":"GET";"GET"===h&&(a+=a.match(/\?/)?this._serialize(b):"?"+this._serialize(b));e.open(h,a);e.onreadystatechange=function(){4===e.readyState&&(200===e.status?d.call(e.responseText,e.responseText):g!==c&&g.call(e.status,e.status))};"POST"===h?(e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.send(this._serialize(b))): localStorage,q=sessionStorage;e.ext("store",{get:function(a,b){var c=b?q.getItem(a):p.getItem(a);return JSON.parse(c)},set:function(a,b,c){b=JSON.stringify(b);c?q.setItem(a,b):p.setItem(a,b)},remove:function(a,b){b?q.removeItem(a):p.removeItem(a)},getAll:function(a){var b,c={},d,e;e=a?p:q;b=e.length;for(a=0;a<b;a++)d=e.key(a),c[d]=e.getItem(d);return c},clear:function(a){a?q.clear():p.clear()}})})($_);
e.send(null)},_serialize:function(a){var b,d,c=[];for(b in a)a.hasOwnProperty(b)&&"function"!==e.type(a[b])&&(d=a[b].toString(),b=encodeURIComponent(b),d=encodeURIComponent(d),c.push(b+"="+d));return c.join("&")}};e.ext("get",function(a,b,d,c){n._do(a,b,d,c,!1)});e.ext("post",function(a,b,c,e){n._do(a,b,c,e,!0)});var l,r;l=function(a,b,c,e){var h,f;if(b.match(/^([\w\-]+)$/))!0===e?a.addEventListener(b,c,!1):a.removeEventListener(b,c,!1);else for(b=b.split(" "),f=b.length,h=0;h<f;h++)l(a,b[h],c,e)};
r=function(a,b,c,g){l(a,c,function(c){var d,f;f=e.$(b,a);for(d in f)c.target==f[d]&&(g.call(f[d],c),c.stopPropagation())},!0)};e.ext("event",{create:function(a,b){if(/MSIE|Trident/i.test(navigator.userAgent)){var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!0,!0,b);return c}return new CustomEvent(a,b)},add:function(a,b){e.each(function(c){l(c,a,b,!0)})},remove:function(a,b){e.each(function(c){l(c,a,b,!1)})},live:function(a,b,c){r(document.documentElement,a,b,c)},delegate:function(a,
b,c){e.each(function(e){r(e,a,b,c)})},trigger:function(a){return this.el.dispatchEvent(a)}});var p=localStorage,q=sessionStorage;e.ext("store",{get:function(a,b){var c=b?q.getItem(a):p.getItem(a);return JSON.parse(c)},set:function(a,b,c){b=JSON.stringify(b);c?q.setItem(a,b):p.setItem(a,b)},remove:function(a,b){b?q.removeItem(a):p.removeItem(a)},getAll:function(a){var b,c={},e,f;f=a?p:q;b=f.length;for(a=0;a<b;a++)e=f.key(a),c[e]=f.getItem(e);return c},clear:function(a){a?q.clear():p.clear()}})})($_);

View File

@ -16,10 +16,10 @@
* *
* Constructor function * Constructor function
* *
* @constuctor * @constructor
* @namespace * @namespace $_
* @param string selector * @param {string} selector - The dom selector string
* @return object * @return {Object}
*/ */
$_ = function(s) $_ = function(s)
{ {
@ -60,10 +60,9 @@
* Simple DOM selector function * Simple DOM selector function
* *
* @memberOf $_ * @memberOf $_
* @param string selector * @param {string} selector
* @param object context * @param {Object} [context]
* @return object * @return {Object}
* @type object
*/ */
$ = function (a, context) $ = function (a, context)
{ {
@ -93,8 +92,8 @@
/** /**
* Adds the property `obj` to the $_ object, calling it `name` * Adds the property `obj` to the $_ object, calling it `name`
* *
* @param string name * @param {string} name - name of the module
* @param object obj * @param {object} obj - the object to add
*/ */
$_.ext = function(name, obj) $_.ext = function(name, obj)
{ {
@ -107,7 +106,7 @@
* *
* @name $_.each * @name $_.each
* @function * @function
* @param function callback * @param {function} callback - iteration callback
*/ */
$_.ext('each', function (callback) $_.ext('each', function (callback)
{ {
@ -124,9 +123,8 @@
/** /**
* Retrieves the type of the passed variable * Retrieves the type of the passed variable
* *
* @param mixed obj * @param {*} obj
* @return string * @return {string}
* @type string
*/ */
$_.type = function(obj) $_.type = function(obj)
{ {

View File

@ -1,7 +1,3 @@
//This is used so IE can use the classList api
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){if(!("HTMLElement" in j)&&!("Element" in j)){return}var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.className),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.className=this.toString()}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
/** /**
* DOM * DOM
* *
@ -16,30 +12,14 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
//Private function for getting/setting attributes/properties //Private function for getting/setting attributes/properties
function _attr(sel, name, value) function _attr(sel, name, value)
{ {
var oldVal, doAttr; var oldVal;
//Get the value of the attribute, if it exists //Get the value of the attribute, if it exists
if (sel.hasAttribute !== undefined)
{
if (sel.hasAttribute(name)) if (sel.hasAttribute(name))
{ {
oldVal = sel.getAttribute(name); oldVal = sel.getAttribute(name);
} }
doAttr = true;
}
else if (sel[name] !== undefined)
{
oldVal = sel[name];
doAttr = false;
}
else if (name === "class" && sel.className !== undefined) //className attribute
{
name = "className";
oldVal = sel.className;
doAttr = false;
}
//Well, I guess that attribute doesn't exist //Well, I guess that attribute doesn't exist
if (oldVal === undefined && (value === undefined || value === null)) if (oldVal === undefined && (value === undefined || value === null))
{ {
@ -54,27 +34,13 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
//Determine what to do with the attribute //Determine what to do with the attribute
if (value !== undefined && value !== null) if (value !== undefined && value !== null)
{
if(doAttr === true)
{ {
sel.setAttribute(name, value); sel.setAttribute(name, value);
} }
else
{
sel[name] = value;
}
}
else if (value === null) else if (value === null)
{
if(doAttr === true)
{ {
sel.removeAttribute(name); sel.removeAttribute(name);
} }
else
{
delete sel[name];
}
}
return (value !== undefined) ? value : oldVal; return (value !== undefined) ? value : oldVal;
} }
@ -85,7 +51,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
*/ */
function _toCamel(s) function _toCamel(s)
{ {
return s.replace(/(\-[a-z])/g, function($1){ return String(s).replace(/(\-[a-z])/g, function($1){
return $1.toUpperCase().replace('-',''); return $1.toUpperCase().replace('-','');
}); });
} }
@ -148,7 +114,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name addClass * @name addClass
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string class * @param {string} class
*/ */
addClass: function (c) addClass: function (c)
{ {
@ -163,7 +129,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name removeClass * @name removeClass
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string class * @param {string} class
*/ */
removeClass: function (c) removeClass: function (c)
{ {
@ -191,7 +157,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name show * @name show
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] type * @param {string} [type]
*/ */
show: function (type) show: function (type)
{ {
@ -211,10 +177,9 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name attr * @name attr
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string name * @param {string} name
* @param [string] value * @param {?string}[value]
* @return string * @return {?string}
* @type string
*/ */
attr: function (name, value) attr: function (name, value)
{ {
@ -245,9 +210,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name text * @name text
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] value * @param {?string} [value]
* @return string * @return {?string}
* @type string
*/ */
text: function (value) text: function (value)
{ {
@ -274,20 +238,36 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* specified by the current selector. If a value is * specified by the current selector. If a value is
* passed, it will set that value on the current element, * passed, it will set that value on the current element,
* otherwise it will return the value of the css property * otherwise it will return the value of the css property
* on the current element * on the current element.
*
* Accepts either key/value arguments, or an object with
* multiple key/value pairs.
* *
* @name css * @name css
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string property * @param {(string|Object)} property
* @param [string] value * @param {?string} [value]
* @return string * @return {?string}
* @type string
*/ */
css: function (prop, val) css: function (prop, val)
{ {
var prop_key = null;
// If passed an object, recurse!
if($_.type(prop) === 'object')
{
for (prop_key in prop)
{
if ( ! prop.hasOwnProperty(prop_key)) continue;
$_.each(function (e){
_css(e, prop_key, prop[prop_key]);
});
}
}
//Return the current value if a value is not set //Return the current value if a value is not set
if(val === undefined) else if(val === undefined && $_.type(prop) !== 'object')
{ {
return _css(this.el, prop); return _css(this.el, prop);
} }
@ -303,7 +283,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name append * @name append
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string htm * @param {string} htm
*/ */
append: function(htm) append: function(htm)
{ {
@ -315,7 +295,7 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name prepend * @name prepend
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param string htm * @param {string} htm
*/ */
prepend: function(htm) prepend: function(htm)
{ {
@ -327,9 +307,8 @@ if(typeof document!=="undefined"&&!("classList" in document.createElement("a")))
* @name html * @name html
* @memberOf $_.dom * @memberOf $_.dom
* @function * @function
* @param [string] htm * @param {?string} [htm]
* @return string * @return {?string}
* @type string
*/ */
html: function(htm) html: function(htm)
{ {

View File

@ -61,6 +61,13 @@
request.send(null); request.send(null);
} }
}, },
/**
* Url encoding for non-get requests
*
* @param data
* @returns {string}
* @private
*/
_serialize: function (data) _serialize: function (data)
{ {
var name, var name,
@ -92,10 +99,10 @@
* @name get * @name get
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to retrieve
* @param object data * @param {Object} data - get parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('get', function (url, data, success_callback, error_callback){ $_.ext('get', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, false); ajax._do(url, data, success_callback, error_callback, false);
@ -107,10 +114,10 @@
* @name post * @name post
* @function * @function
* @memberOf $_ * @memberOf $_
* @param string url * @param {string} url - The url to post to
* @param object data * @param {Object} data - post parameters to send
* @param function success_callback * @param {function} success_callback - callback called on success
* @param function error_callback * @param {function} [error_callback] - callback called if there is an error
*/ */
$_.ext('post', function (url, data, success_callback, error_callback){ $_.ext('post', function (url, data, success_callback, error_callback){
ajax._do(url, data, success_callback, error_callback, true); ajax._do(url, data, success_callback, error_callback, true);

View File

@ -79,9 +79,9 @@
* @name create * @name create
* @function * @function
* @example Eg. var event = $_("#selector").event.create('foo', {}); * @example Eg. var event = $_("#selector").event.create('foo', {});
* @param string name * @param {string} name
* @param [object] data * @param {object} [data]
* @return object * @return {Object}
*/ */
create: function(name, data) create: function(name, data)
{ {
@ -109,8 +109,8 @@
* @name add * @name add
* @function * @function
* @example Eg. $_("#selector").event.add("click", do_something()); * @example Eg. $_("#selector").event.add("click", do_something());
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
add: function (event, callback) add: function (event, callback)
{ {
@ -125,8 +125,8 @@
* @name remove * @name remove
* @function * @function
* @example Eg. $_("#selector").event.remove("click", do_something()); * @example Eg. $_("#selector").event.remove("click", do_something());
* @param string event * @param {string} event
* @param string callback * @param {string} callback
*/ */
remove: function (event, callback) remove: function (event, callback)
{ {
@ -141,9 +141,9 @@
* @name live * @name live
* @function * @function
* @example Eg. $_.event.live(".button", "click", do_something()); * @example Eg. $_.event.live(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event * @param {string} event
* @param function callback * @param {function} callback
*/ */
live: function (target, event, callback) live: function (target, event, callback)
{ {
@ -156,9 +156,9 @@
* @name delegate * @name delegate
* @function * @function
* @example Eg. $_("#parent").delegate(".button", "click", do_something()); * @example Eg. $_("#parent").delegate(".button", "click", do_something());
* @param string target * @param {string} target
* @param string event_type * @param {string} event
* @param function callback * @param {function} callback
*/ */
delegate: function (target, event, callback) delegate: function (target, event, callback)
{ {
@ -173,9 +173,8 @@
* @name trigger * @name trigger
* @function * @function
* @example Eg. $_("#my_id").trigger('click'); * @example Eg. $_("#my_id").trigger('click');
* @param string target * @param {object} event
* @param object event * @return {boolean}
* @return bool
*/ */
trigger: function(event) trigger: function(event)
{ {

View File

@ -25,13 +25,12 @@
* 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 * @param {bool} session
* @name get * @name get
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return object * @return {Object}
* @type object
*/ */
get: function (key, sess) get: function (key, sess)
{ {
@ -43,9 +42,9 @@
* Puts a value into localstorage at the specified key, * Puts a value into localstorage at the specified key,
* and JSON-encodes the value if not a string * and JSON-encodes the value if not a string
* *
* @param string key * @param {string} key
* @param mixed value * @param {mixed} value
* @param bool session * @param {bool} session
* @name set * @name set
* @memberOf $_.store * @memberOf $_.store
* @function * @function
@ -60,8 +59,8 @@
/** /**
* Removes the specified item from storage * Removes the specified item from storage
* *
* @param string key * @param {string} key
* @param bool session * @param {bool} session
* @name remove * @name remove
* @memberOf $_.store * @memberOf $_.store
* @function * @function
@ -73,12 +72,11 @@
/** /**
* Returns an object of all the raw values in storage * Returns an object of all the raw values in storage
* *
* @param bool session * @param {bool} session
* @name getAll * @name getAll
* @memberOf $_.store * @memberOf $_.store
* @function * @function
* @return object * @return {Object}
* @type object
*/ */
getAll: function (sess) getAll: function (sess)
{ {
@ -104,7 +102,7 @@
/** /**
* Removes all values from the same domain storage * Removes all values from the same domain storage
* *
* @param bool session * @param {bool} session
* @name clear * @name clear
* @memberOf $_.store * @memberOf $_.store
* @function * @function

View File

@ -4,28 +4,6 @@
*/ */
/** /**
* String trim function polyfill * Promise.prototype.done polyfill
*/ */
if(typeof String.prototype.trim === "undefined") if (!Promise.prototype.done) { Promise.prototype.done = function (cb, eb) { this.then(cb, eb).then(null, function (err) { setTimeout(function () { throw err; }, 0); }); }; }
{
/**
* @private
*/
String.prototype.trim = function()
{
return this.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
};
}
// --------------------------------------------------------------------------
/**
* Array.isArray polyfill
*/
if (typeof Array.isArray === "undefined")
{
Array.isArray = function(v)
{
return Object.prototype.toString.apply(v) === '[object Array]';
}
}

0
tests/ajax.php Normal file → Executable file
View File

0
tests/blanket.js Normal file → Executable file
View File

1
tests/index.html Normal file → Executable file
View File

@ -21,6 +21,7 @@
</section> </section>
<script src="qunit/qunit.js"></script> <script src="qunit/qunit.js"></script>
<script src='../src/core.js' data-cover></script> <script src='../src/core.js' data-cover></script>
<script src='../src/polyfill.js'></script>
<script src='../src/modules/ajax.js' data-cover></script> <script src='../src/modules/ajax.js' data-cover></script>
<script src='../src/modules/event.js' data-cover></script> <script src='../src/modules/event.js' data-cover></script>
<script src='../src/modules/DOM.js' data-cover></script> <script src='../src/modules/DOM.js' data-cover></script>

0
tests/qunit/test_funcs.js Normal file → Executable file
View File

View File

@ -59,16 +59,15 @@
}); });
asyncTest("Interator tests", function() { asyncTest("Iterator tests", function() {
$_('#qunit').each(function(el) { $_('#qunit').each(function(el) {
equal(el, $_.$('#qunit')); equal(el, $_.$('#qunit'));
start(); start();
}); });
/*$_('foo').each(function(el) { $_('foo').each(function(el) {
equal(el, undefined); equal(el, undefined);
start(); });
});*/
}); });
test("Array.isArray", function(){ test("Array.isArray", function(){