kis-js/docs/symbols/$_.util.html

669 lines
26 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="generator" content="JsDoc Toolkit" />
<title>JsDoc Reference - $_.util</title>
<script type="text/javascript" src="../jproton.js"></script>
<script type="text/javascript" src="../ui.js"></script>
<script type="text/javascript" src="../sh.js"></script>
<link rel=stylesheet href="../sh.css" type="text/css">
<link rel=stylesheet href="../default.css" type="text/css">
</head>
<body>
<div id="main-wrapper">
<div id="main">
<!-- ============================== classes index ============================ -->
<div id="index" class="fixed">
<div id="index-wrapper">
<div class="header">
<div id="index-close" title="Esconde o outline.">&nbsp;</div>
<div id="index-title">Project Outline</div>
</div>
<div id="index-menu"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<div id="index-content">
<div class="classList">
<div class="section">
<div title='DOM Dom manipulation module' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="../symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='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.'><a href="../symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
<div class="section">
<div title='' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
<div class="section">
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
<div class="section">
<div title='String and object manipulation utilities' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
<div class="section">
<div title='Global namespace.' class='itemName namespace'>
<div class='method-toggler'>&nbsp;</div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
</div>
</div>
</div>
</div>
<div id="index-toggler" class="fixed">&laquo;</div>
<!-- ============================== header ================================= -->
<!-- begin static/header.html -->
<div class="header">
Framework jProton
</div>
<!-- end static/header.html -->
<div id="content">
<!-- ============================== class title ============================ -->
<h1 class="classTitle">
Namespace $_.util
</h1>
<!-- ============================== class summary ========================== -->
<!--
-->
<div class="full-description">
<p></p>
</div>
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_util.js.html">util.js</a>.</span></p>
<!-- ============================== constructor summary ==================== -->
<!-- ============================== properties summary ===================== -->
<!-- ============================== methods summary ======================== -->
<div class="summary section">
<div class="sectionTitle">Method Summary</div>
<div class="sectionItems">
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Sets or retrieves the text content of the element specified by the current selector."><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span>
<span class='description'>Sets or retrieves the text content of the element specified by the current selector.</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Sets or retrieves a css property of the element specified by the current selector."><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span>
<span class='description'>Sets or retrieves a css property of the element specified by the current selector.</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Retrieve the keys, or member names of an object"><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span>
<span class='description'>Retrieve the keys, or member names of an object</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Retrieves the values of an object, and returns them as an array"><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span>
<span class='description'>Retrieves the values of an object, and returns them as an array</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Creates an object, with the property names of the first array, and the values of the second."><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span>
<span class='description'>Creates an object, with the property names of the first array, and the values of the second.</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Combines two or more objects/arrays."><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span>
<span class='description'>Combines two or more objects/arrays.</span>
</div>
<div class="sectionItem classMethod">
<!--
<div class="module-filter">&nbsp;</div>
-->
<b class="icon" title="Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first."><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span>
<span class='description'>Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.</span>
</div>
</div>
</div>
<!-- ============================== constructor details ==================== -->
<!-- ============================== field details ========================== -->
<!-- ============================== method details ========================= -->
<div class="details section">
<div class="sectionTitle">
Method Detail
</div>
<div class="sectionItems">
<div class='sectionItem classMethod '>
<a name=".text"> </a>
<div class="itemTitle icon">
$_.util.text<span class="signature">(<span title="value">string</span>)</span>
<span class="light" title="returns string">: string</span>
</div>
<div class="full-description">
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
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_DOM.js.html">DOM.js</a>.</span></p>
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>string</b><i class="help" title="Optional parameter">?</i>, Default: </i>
</td>
<td class="methodItemDesc">
value
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
string
</td>
</tr>
</tbody></table>
</div>
<div class='sectionItem classMethod '>
<a name=".css"> </a>
<div class="itemTitle icon">
$_.util.css<span class="signature">(<span title="property">string</span>, <span title="value">string</span>)</span>
<span class="light" title="returns string">: string</span>
</div>
<div class="full-description">
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
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_DOM.js.html">DOM.js</a>.</span></p>
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>string</b>
</td>
<td class="methodItemDesc">
property
</td>
</tr>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>string</b><i class="help" title="Optional parameter">?</i>, Default: </i>
</td>
<td class="methodItemDesc">
value
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
string
</td>
</tr>
</tbody></table>
</div>
<div class='sectionItem classMethod '>
<a name=".object_keys"> </a>
<div class="itemTitle icon">
$_.util.object_keys<span class="signature">(<span>object</span>)</span>
<span class="light" title="returns array">: array</span>
</div>
<div class="full-description">
Retrieve the keys, or member names of an object
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>object</b>
</td>
<td class="methodItemDesc">
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
array
</td>
</tr>
</tbody></table>
</div>
<div class='sectionItem classMethod '>
<a name=".object_values"> </a>
<div class="itemTitle icon">
$_.util.object_values<span class="signature">(<span>object</span>)</span>
<span class="light" title="returns array">: array</span>
</div>
<div class="full-description">
Retrieves the values of an object, and returns
them as an array
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>object</b>
</td>
<td class="methodItemDesc">
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
array
</td>
</tr>
</tbody></table>
</div>
<div class='sectionItem classMethod '>
<a name=".array_combine"> </a>
<div class="itemTitle icon">
$_.util.array_combine<span class="signature">(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span>
<span class="light" title="returns object">: object</span>
</div>
<div class="full-description">
Creates an object, with the property names of the first array,
and the values of the second. If objects are passed, the values
of the object are used. If the arrays or objects passed are
not the same size, the function will return false.
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>array/object</b>
</td>
<td class="methodItemDesc">
keys
</td>
</tr>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>array/object</b>
</td>
<td class="methodItemDesc">
vals
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
object
</td>
</tr>
</tbody></table>
</div>
<div class='sectionItem classMethod '>
<a name=".object_merge"> </a>
<div class="itemTitle icon">
$_.util.object_merge<span class="signature">(<span title="[as many as you wish to combine]">object</span>)</span>
<span class="light" title="returns object">: object</span>
</div>
<div class="full-description">
Combines two or more objects/arrays. If the keys are numeric, the outputted
object will have re-indexed keys. If a key/value pair exists in both objects,
indentical values will be droped, but if a key exists with a different value,
with the same key, the value in the second array will replace the value in the
first
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>object</b>
</td>
<td class="methodItemDesc">
[as many as you wish to combine]
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
object
</td>
</tr>
</tbody></table>
</div>
<div class='sectionItem classMethod '>
<a name=".str_trans"> </a>
<div class="itemTitle icon">
$_.util.str_trans<span class="signature">(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span>
<span class="light" title="returns string">: string</span>
</div>
<div class="full-description">
Replaces sections of strings in a greedy fashion,
starting with the longest replace pairs first. Accepts
one replace pair as two parameters, or an object, with
from => to replacements as key/value pairs
<pre class="prettyprint"></pre>
</div>
<div class="heading">Parameters:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>string</b>
</td>
<td class="methodItemDesc">
input_string
</td>
</tr>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>mixed</b>
</td>
<td class="methodItemDesc">
</td>
</tr>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemName">
<b>string</b><i class="help" title="Optional parameter">?</i>, Default: </i>
</td>
<td class="methodItemDesc">
to
</td>
</tr>
</tbody></table>
<div class="heading">Returns:</div>
<table class="methodItem"><tbody>
<tr>
<td class="methodItemType">
</td>
<td class="methodItemDesc">
string
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 20:13:40 GMT-0400 (EDT)
</div>
</div>
</div>
</body>
</html>