Misc updates
This commit is contained in:
parent
59bfb68a4e
commit
a26a04f1a7
@ -140,6 +140,11 @@ functions:
|
||||
Set: $_(selector).dom.css(property, value);
|
||||
Get: $_(selector).dom.css(property);
|
||||
|
||||
* html: Sets or gets html inside the selected element
|
||||
|
||||
Set: $_(selector).dom.html(html_string);
|
||||
Get: $_(selector).dom.html();
|
||||
|
||||
### Util: Array and string manipulation functions ###
|
||||
|
||||
**functions:**
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
|
@ -65,7 +65,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
@ -141,6 +141,30 @@
|
||||
<span class='description'>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.</span>
|
||||
</div>
|
||||
|
||||
<div class="sectionItem classMethod">
|
||||
<!--
|
||||
<div class="module-filter"> </div>
|
||||
-->
|
||||
<b class="icon" title="Sets or retrieves the text content of the element specified by the current selector."><a href="../symbols/%24_.dom.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"> </div>
|
||||
-->
|
||||
<b class="icon" title="Sets or retrieves a css property of the element specified by the current selector."><a href="../symbols/%24_.dom.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"> </div>
|
||||
-->
|
||||
<b class="icon" title="Sets or gets the innerHTML propery of the element(s) passed"><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span>
|
||||
<span class='description'>Sets or gets the innerHTML propery of the element(s) passed</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -434,6 +458,199 @@ current selector.
|
||||
|
||||
|
||||
|
||||
<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=".text"> </a>
|
||||
<div class="itemTitle icon">
|
||||
$_.dom.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
|
||||
|
||||
|
||||
|
||||
|
||||
<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">
|
||||
$_.dom.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
|
||||
|
||||
|
||||
|
||||
|
||||
<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=".html"> </a>
|
||||
<div class="itemTitle icon">
|
||||
$_.dom.html<span class="signature">(<span title="htm">string</span>)</span>
|
||||
<span class="light" title="returns string">: string</span>
|
||||
</div>
|
||||
<div class="full-description">
|
||||
Sets or gets the innerHTML propery of the element(s) passed
|
||||
|
||||
|
||||
|
||||
|
||||
<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">
|
||||
htm
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="heading">Returns:</div>
|
||||
<table class="methodItem"><tbody>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
@ -101,22 +101,6 @@
|
||||
<div class="sectionTitle">Method Summary</div>
|
||||
<div class="sectionItems">
|
||||
|
||||
<div class="sectionItem classMethod">
|
||||
<!--
|
||||
<div class="module-filter"> </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"> </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"> </div>
|
||||
@ -177,145 +161,6 @@
|
||||
<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">
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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 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_.dom.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_.dom.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='Sets or gets the innerHTML propery of the element(s) passed'><a href="../symbols/%24_.dom.html#.html">html</a></b><span class='signature'>(<span title="htm">string</span>)</span></div></div></div>
|
||||
|
||||
<div class="section">
|
||||
<div title='' class='itemName namespace'>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="section">
|
||||
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||
<div class='method-toggler'> </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='method-toggler'> </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='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'>
|
||||
|
@ -15,201 +15,207 @@
|
||||
<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="COMM">//Browser requirements check</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </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">document.querySelectorAll</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </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="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">dcopy</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel_string</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT">
|
||||
<span class='line'> 19</span>
|
||||
<span class='line'> 20</span> </span><span class="COMM">/**
|
||||
<span class='line'> 21</span> * $_
|
||||
<span class='line'> 22</span> *
|
||||
<span class='line'> 23</span> * Constructor function
|
||||
<span class='line'> 24</span> *
|
||||
<span class='line'> 25</span> * @constuctor
|
||||
<span class='line'> 26</span> * @namespace
|
||||
<span class='line'> 27</span> * @param string selector
|
||||
<span class='line'> 28</span> * @return object
|
||||
<span class='line'> 29</span> */</span><span class="WHIT">
|
||||
<span class='line'> 30</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'> 31</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="COMM">//Have documentElement be default selector, just in case</span><span class="WHIT">
|
||||
<span class='line'> 33</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">s</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 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="COMM">//Defines a "global" selector for that instance</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="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">$_.el</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$_.el</span><span class="WHIT">
|
||||
<span class='line'> 38</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'> 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="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 42</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="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">s</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><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="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'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="COMM">// Add the selector to the prototype</span><span class="WHIT">
|
||||
<span class='line'> 46</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'> 47</span>
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="COMM">// Make a copy before adding properties</span><span class="WHIT">
|
||||
<span class='line'> 49</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">dcopy</span><span class="PUNC">(</span><span class="NAME">$_</span><span class="PUNC">)</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="COMM">// Give sel to each extension.</span><span class="WHIT">
|
||||
<span class='line'> 52</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'> 53</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 54</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'> 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">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'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 59</span>
|
||||
<span class='line'> 60</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'> 61</span> </span><span class="WHIT">
|
||||
<span class='line'> 62</span> </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'> 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 class='line'> 65</span> </span><span class="COMM">/**
|
||||
<span class='line'> 66</span> * $
|
||||
<span class='line'> 67</span> *
|
||||
<span class='line'> 68</span> * Simple DOM selector function
|
||||
<span class='line'> 69</span> *
|
||||
<span class='line'> 70</span> * @memberOf $_
|
||||
<span class='line'> 71</span> * @param string selector
|
||||
<span class='line'> 72</span> * @param string context
|
||||
<span class='line'> 73</span> * @return object
|
||||
<span class='line'> 74</span> * @type object
|
||||
<span class='line'> 75</span> */</span><span class="WHIT">
|
||||
<span class='line'> 76</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'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 78</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'> 79</span> </span><span class="WHIT">
|
||||
<span class='line'> 80</span> </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="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">"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'> 81</span> </span><span class="WHIT">
|
||||
<span class='line'> 82</span> </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'> 83</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'> 84</span> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">context</span><span class="WHIT">
|
||||
<span class='line'> 85</span> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="COMM">// Most functions rely on a string selector</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="COMM">// which returns html elements. This requires</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="COMM">// document.querySelectorAll or a custom</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="COMM">// selector engine. I choose to just use the</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="COMM">// browser feature, since it is present in</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="COMM">// IE 8+, and all other major browsers</span><span class="WHIT">
|
||||
<span class='line'> 17</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">document.querySelector</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="WHIT"> </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="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">dcopy</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT">
|
||||
<span class='line'> 24</span>
|
||||
<span class='line'> 25</span> </span><span class="COMM">/**
|
||||
<span class='line'> 26</span> * $_
|
||||
<span class='line'> 27</span> *
|
||||
<span class='line'> 28</span> * Constructor function
|
||||
<span class='line'> 29</span> *
|
||||
<span class='line'> 30</span> * @constuctor
|
||||
<span class='line'> 31</span> * @namespace
|
||||
<span class='line'> 32</span> * @param string selector
|
||||
<span class='line'> 33</span> * @return object
|
||||
<span class='line'> 34</span> */</span><span class="WHIT">
|
||||
<span class='line'> 35</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'> 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="COMM">//Have documentElement be default selector, just in case</span><span class="WHIT">
|
||||
<span class='line'> 38</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">s</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 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">//Defines a "global" selector for that instance</span><span class="WHIT">
|
||||
<span class='line'> 41</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="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">$_.el</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">$_.el</span><span class="WHIT">
|
||||
<span class='line'> 43</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'> 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">else</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">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">s</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><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="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'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="COMM">// Add the selector to the prototype</span><span class="WHIT">
|
||||
<span class='line'> 51</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'> 52</span>
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="COMM">// Make a copy before adding properties</span><span class="WHIT">
|
||||
<span class='line'> 54</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">dcopy</span><span class="PUNC">(</span><span class="NAME">$_</span><span class="PUNC">)</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="COMM">// Give sel to each extension.</span><span class="WHIT">
|
||||
<span class='line'> 57</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'> 58</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 59</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'> 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">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'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </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="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'> 66</span> </span><span class="WHIT">
|
||||
<span class='line'> 67</span> </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'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="COMM">/**
|
||||
<span class='line'> 71</span> * $
|
||||
<span class='line'> 72</span> *
|
||||
<span class='line'> 73</span> * Simple DOM selector function
|
||||
<span class='line'> 74</span> *
|
||||
<span class='line'> 75</span> * @memberOf $_
|
||||
<span class='line'> 76</span> * @param string selector
|
||||
<span class='line'> 77</span> * @param string context
|
||||
<span class='line'> 78</span> * @return object
|
||||
<span class='line'> 79</span> * @type object
|
||||
<span class='line'> 80</span> */</span><span class="WHIT">
|
||||
<span class='line'> 81</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'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="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'> 84</span> </span><span class="WHIT">
|
||||
<span class='line'> 85</span> </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="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">"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'> 86</span> </span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="COMM">//Pick the quickest method for each kind of selector</span><span class="WHIT">
|
||||
<span class='line'> 88</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'> 89</span> </span><span class="WHIT"> </span><span class="PUNC">{</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="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'> 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="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="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'> 95</span> </span><span class="WHIT"> </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="COMM">//Return the single object if applicable</span><span class="WHIT">
|
||||
<span class='line'> 98</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'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>100</span> </span><span class="WHIT">
|
||||
<span class='line'>101</span> </span><span class="COMM">/**
|
||||
<span class='line'>102</span> * Deep copy/prototypical constructor function
|
||||
<span class='line'>103</span> *
|
||||
<span class='line'>104</span> * @param object obj
|
||||
<span class='line'>105</span> * @private
|
||||
<span class='line'>106</span> * @return object
|
||||
<span class='line'>107</span> * @type object
|
||||
<span class='line'>108</span> */</span><span class="WHIT">
|
||||
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">dcopy</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'>110</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>111</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><span class="NAME">F</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="WHIT">
|
||||
<span class='line'>113</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">return</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'> 87</span> </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'> 88</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'> 89</span> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">context</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="COMM">//Pick the quickest method for each kind of selector</span><span class="WHIT">
|
||||
<span class='line'> 93</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'> 94</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 95</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'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="KEYW">else</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="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'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>101</span> </span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="COMM">//Return the single object if applicable</span><span class="WHIT">
|
||||
<span class='line'>103</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'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span> </span><span class="WHIT">
|
||||
<span class='line'>106</span> </span><span class="COMM">/**
|
||||
<span class='line'>107</span> * Deep copy/prototypical constructor function
|
||||
<span class='line'>108</span> *
|
||||
<span class='line'>109</span> * @param object obj
|
||||
<span class='line'>110</span> * @private
|
||||
<span class='line'>111</span> * @return object
|
||||
<span class='line'>112</span> * @type object
|
||||
<span class='line'>113</span> */</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">dcopy</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'>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="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">F</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>117</span> </span><span class="WHIT">
|
||||
<span class='line'>118</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">Object.create</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>118</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>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="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Object.create</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="KEYW">return</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 class='line'>123</span> </span><span class="NAME">type</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">obj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>124</span> </span><span class="WHIT">
|
||||
<span class='line'>125</span> </span><span class="KEYW">if</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">"object"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">type</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'>126</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="KEYW">return</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'>123</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">Object.create</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Object.create</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>127</span> </span><span class="WHIT">
|
||||
<span class='line'>128</span> </span><span class="NAME">type</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">obj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>129</span> </span><span class="WHIT">
|
||||
<span class='line'>130</span> </span><span class="COMM">/**
|
||||
<span class='line'>131</span> * @private
|
||||
<span class='line'>132</span> */</span><span class="WHIT">
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">F</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</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'>130</span> </span><span class="KEYW">if</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">"object"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">type</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'>131</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="NAME">F.prototype</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'>136</span> </span><span class="WHIT">
|
||||
<span class='line'>137</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">F</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>138</span> </span><span class="WHIT">
|
||||
<span class='line'>139</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="WHIT">
|
||||
<span class='line'>141</span> </span><span class="COMM">/**
|
||||
<span class='line'>142</span> * Adds the property `obj` to the $_ object, calling it `name`
|
||||
<span class='line'>143</span> *
|
||||
<span class='line'>144</span> * @param string name
|
||||
<span class='line'>145</span> * @param object obj
|
||||
<span class='line'>146</span> * @return void
|
||||
<span class='line'>147</span> */</span><span class="WHIT">
|
||||
<span class='line'>148</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'>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">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'>151</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'>152</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="WHIT">
|
||||
<span class='line'>154</span> </span><span class="COMM">/**
|
||||
<span class='line'>155</span> * Iterates over a $_ object, applying a callback to each item
|
||||
<span class='line'>156</span> *
|
||||
<span class='line'>157</span> * @name $_.each
|
||||
<span class='line'>158</span> * @function
|
||||
<span class='line'>159</span> * @param function callback
|
||||
<span class='line'>160</span> * @return void
|
||||
<span class='line'>161</span> */</span><span class="WHIT">
|
||||
<span class='line'>162</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'>163</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>164</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">sel.length</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="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'>165</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="KEYW">var</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">sel.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>167</span>
|
||||
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">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'>169</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="COMM">/**
|
||||
<span class='line'>136</span> * @private
|
||||
<span class='line'>137</span> */</span><span class="WHIT">
|
||||
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="NAME">F</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</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'>139</span> </span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="NAME">F.prototype</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'>141</span> </span><span class="WHIT">
|
||||
<span class='line'>142</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">F</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>143</span> </span><span class="WHIT">
|
||||
<span class='line'>144</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="WHIT">
|
||||
<span class='line'>146</span> </span><span class="COMM">/**
|
||||
<span class='line'>147</span> * Adds the property `obj` to the $_ object, calling it `name`
|
||||
<span class='line'>148</span> *
|
||||
<span class='line'>149</span> * @param string name
|
||||
<span class='line'>150</span> * @param object obj
|
||||
<span class='line'>151</span> * @return void
|
||||
<span class='line'>152</span> */</span><span class="WHIT">
|
||||
<span class='line'>153</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'>154</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>155</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'>156</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'>157</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>158</span> </span><span class="WHIT">
|
||||
<span class='line'>159</span> </span><span class="COMM">/**
|
||||
<span class='line'>160</span> * Iterates over a $_ object, applying a callback to each item
|
||||
<span class='line'>161</span> *
|
||||
<span class='line'>162</span> * @name $_.each
|
||||
<span class='line'>163</span> * @function
|
||||
<span class='line'>164</span> * @param function callback
|
||||
<span class='line'>165</span> * @return void
|
||||
<span class='line'>166</span> */</span><span class="WHIT">
|
||||
<span class='line'>167</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'>168</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>169</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">sel.length</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="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'>170</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="KEYW">var</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">sel.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>172</span>
|
||||
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selx</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</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">x</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">selx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.item</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">sel.item</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">selx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="KEYW">else</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="NAME">callback</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>185</span> </span><span class="WHIT">
|
||||
<span class='line'>186</span> </span><span class="COMM">/**
|
||||
<span class='line'>187</span> * Retrieves the type of the passed variable
|
||||
<span class='line'>188</span> *
|
||||
<span class='line'>189</span> * @param mixed obj
|
||||
<span class='line'>190</span> * @return string
|
||||
<span class='line'>191</span> * @type string
|
||||
<span class='line'>192</span> */</span><span class="WHIT">
|
||||
<span class='line'>193</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'>194</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>195</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'>196</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="COMM">//fallback on 'typeof' for truthy primitive values</span><span class="WHIT">
|
||||
<span class='line'>198</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'>199</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>200</span> </span><span class="WHIT">
|
||||
<span class='line'>201</span> </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'>202</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>203</span>
|
||||
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="COMM">//Set global variables</span><span class="WHIT">
|
||||
<span class='line'>205</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'>206</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'>207</span> </span><span class="WHIT">
|
||||
<span class='line'>208</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
||||
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">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'>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">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>177</span>
|
||||
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selx</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</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">x</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">selx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.item</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">sel.item</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">selx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">selx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>183</span> </span><span class="WHIT"> </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="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>187</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'>188</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>190</span> </span><span class="WHIT">
|
||||
<span class='line'>191</span> </span><span class="COMM">/**
|
||||
<span class='line'>192</span> * Retrieves the type of the passed variable
|
||||
<span class='line'>193</span> *
|
||||
<span class='line'>194</span> * @param mixed obj
|
||||
<span class='line'>195</span> * @return string
|
||||
<span class='line'>196</span> * @type string
|
||||
<span class='line'>197</span> */</span><span class="WHIT">
|
||||
<span class='line'>198</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'>199</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>200</span> </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'>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="COMM">//fallback on 'typeof' for truthy primitive values</span><span class="WHIT">
|
||||
<span class='line'>203</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'>204</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>205</span> </span><span class="WHIT">
|
||||
<span class='line'>206</span> </span><span class="COMM">//Strip x from [object x] and return </span><span class="WHIT">
|
||||
<span class='line'>207</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'>208</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>209</span>
|
||||
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="COMM">//Set global variables</span><span class="WHIT">
|
||||
<span class='line'>211</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'>212</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'>213</span> </span><span class="WHIT">
|
||||
<span class='line'>214</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>
|
@ -258,7 +258,7 @@
|
||||
<span class='line'>251</span> * otherwise it will return the value of the current element
|
||||
<span class='line'>252</span> *
|
||||
<span class='line'>253</span> * @name text
|
||||
<span class='line'>254</span> * @memberOf $_.util
|
||||
<span class='line'>254</span> * @memberOf $_.dom
|
||||
<span class='line'>255</span> * @function
|
||||
<span class='line'>256</span> * @param [string] value
|
||||
<span class='line'>257</span> * @returns string
|
||||
@ -298,7 +298,7 @@
|
||||
<span class='line'>291</span> * on the current element
|
||||
<span class='line'>292</span> *
|
||||
<span class='line'>293</span> * @name css
|
||||
<span class='line'>294</span> * @memberOf $_.util
|
||||
<span class='line'>294</span> * @memberOf $_.dom
|
||||
<span class='line'>295</span> * @function
|
||||
<span class='line'>296</span> * @param string property
|
||||
<span class='line'>297</span> * @param [string] value
|
||||
@ -316,10 +316,31 @@
|
||||
<span class='line'>309</span> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</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="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>314</span>
|
||||
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'dom'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>316</span> </span><span class="WHIT">
|
||||
<span class='line'>317</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'>318</span> </span></pre></body></html>
|
||||
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>314</span> * Sets or gets the innerHTML propery of the element(s) passed
|
||||
<span class='line'>315</span> *
|
||||
<span class='line'>316</span> * @name html
|
||||
<span class='line'>317</span> * @memberOf $_.dom
|
||||
<span class='line'>318</span> * @function
|
||||
<span class='line'>319</span> * @param string htm
|
||||
<span class='line'>320</span> * @return string
|
||||
<span class='line'>321</span> * @type string
|
||||
<span class='line'>322</span> */</span><span class="WHIT">
|
||||
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">htm</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 class='line'>326</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">htm</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>329</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>330</span> </span><span class="WHIT">
|
||||
<span class='line'>331</span> </span><span class="COMM">//If the parameter is undefined, just return the current value</span><span class="WHIT">
|
||||
<span class='line'>332</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.el.innerHTML</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>333</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>334</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>335</span>
|
||||
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'dom'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>337</span> </span><span class="WHIT">
|
||||
<span class='line'>338</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'>339</span> </span></pre></body></html>
|
@ -13,100 +13,107 @@
|
||||
<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="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">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">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 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="COMM">/**
|
||||
<span class='line'> 16</span> * @private
|
||||
<span class='line'> 17</span> */</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">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'> 19</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 20</span>
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">request</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">window.XMLHttpRequest</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </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="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span>
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="KEYW">var</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'> 26</span>
|
||||
<span class='line'> 27</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">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><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"?"</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="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT">
|
||||
<span class='line'> 29</span> </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'> 30</span>
|
||||
<span class='line'> 31</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'> 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">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'> 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="NAME">callback</span><span class="PUNC">(</span><span class="NAME">request.responseText</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="PUNC">}</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="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'> 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">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'> 42</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'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="COMM">// Don't bother even defining the object if the XMLHttpRequest isn't available</span><span class="WHIT">
|
||||
<span class='line'> 11</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">window.XMLHttpRequest</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 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">return</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 class='line'> 16</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'> 17</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">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'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 19</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'> 20</span> </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'> 21</span> </span><span class="WHIT">
|
||||
<span class='line'> 22</span> </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">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </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> * @private
|
||||
<span class='line'> 26</span> */</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">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'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 29</span>
|
||||
<span class='line'> 30</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'> 31</span>
|
||||
<span class='line'> 32</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">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><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"?"</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="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT">
|
||||
<span class='line'> 34</span> </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'> 35</span>
|
||||
<span class='line'> 36</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'> 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">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'> 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="NAME">callback</span><span class="PUNC">(</span><span class="NAME">request.responseText</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="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 43</span>
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="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'> 45</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 46</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'> 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="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 49</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'> 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="KEYW">var</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'> 52</span>
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </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'> 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="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">data.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="KEYW">continue</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">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"function"</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><span class="WHIT"> </span><span class="KEYW">continue</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 class='line'> 64</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">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'> 65</span>
|
||||
<span class='line'> 66</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'> 67</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'> 68</span>
|
||||
<span class='line'> 69</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'> 70</span> </span><span class="WHIT"> </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">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'> 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="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</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'> 47</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'> 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="KEYW">else</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">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'> 52</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 54</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'> 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="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 58</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'> 59</span>
|
||||
<span class='line'> 60</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'> 61</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </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">data.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">name</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="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="KEYW">continue</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">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"function"</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="KEYW">continue</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 class='line'> 71</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'> 72</span>
|
||||
<span class='line'> 73</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'> 74</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'> 75</span>
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 77</span> * Sends a GET type ajax request
|
||||
<span class='line'> 78</span> *
|
||||
<span class='line'> 79</span> * @name get
|
||||
<span class='line'> 80</span> * @function
|
||||
<span class='line'> 81</span> * @memberOf $_
|
||||
<span class='line'> 82</span> * @param string url
|
||||
<span class='line'> 83</span> * @param object data
|
||||
<span class='line'> 84</span> * @param function callback
|
||||
<span class='line'> 85</span> * @return void
|
||||
<span class='line'> 86</span> */</span><span class="WHIT">
|
||||
<span class='line'> 87</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">callback</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">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">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'> 89</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="COMM">/**
|
||||
<span class='line'> 92</span> * Sends a POST type ajax request
|
||||
<span class='line'> 93</span> *
|
||||
<span class='line'> 94</span> * @name post
|
||||
<span class='line'> 95</span> * @function
|
||||
<span class='line'> 96</span> * @memberOf $_
|
||||
<span class='line'> 97</span> * @param string url
|
||||
<span class='line'> 98</span> * @param object data
|
||||
<span class='line'> 99</span> * @param function callback
|
||||
<span class='line'>100</span> * @return void
|
||||
<span class='line'>101</span> */</span><span class="WHIT">
|
||||
<span class='line'>102</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">callback</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>103</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">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'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
||||
<span class='line'> 76</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'> 77</span> </span><span class="WHIT"> </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="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'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 82</span>
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 84</span> * Sends a GET type ajax request
|
||||
<span class='line'> 85</span> *
|
||||
<span class='line'> 86</span> * @name get
|
||||
<span class='line'> 87</span> * @function
|
||||
<span class='line'> 88</span> * @memberOf $_
|
||||
<span class='line'> 89</span> * @param string url
|
||||
<span class='line'> 90</span> * @param object data
|
||||
<span class='line'> 91</span> * @param function callback
|
||||
<span class='line'> 92</span> * @return void
|
||||
<span class='line'> 93</span> */</span><span class="WHIT">
|
||||
<span class='line'> 94</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">callback</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">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">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'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 97</span> </span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="COMM">/**
|
||||
<span class='line'> 99</span> * Sends a POST type ajax request
|
||||
<span class='line'>100</span> *
|
||||
<span class='line'>101</span> * @name post
|
||||
<span class='line'>102</span> * @function
|
||||
<span class='line'>103</span> * @memberOf $_
|
||||
<span class='line'>104</span> * @param string url
|
||||
<span class='line'>105</span> * @param object data
|
||||
<span class='line'>106</span> * @param function callback
|
||||
<span class='line'>107</span> * @return void
|
||||
<span class='line'>108</span> */</span><span class="WHIT">
|
||||
<span class='line'>109</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">callback</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>110</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">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'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</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>
|
64
kis-all.js
64
kis-all.js
@ -8,13 +8,18 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
//Browser requirements check
|
||||
if (!document.querySelectorAll)
|
||||
// Most functions rely on a string selector
|
||||
// which returns html elements. This requires
|
||||
// document.querySelectorAll or a custom
|
||||
// selector engine. I choose to just use the
|
||||
// browser feature, since it is present in
|
||||
// IE 8+, and all other major browsers
|
||||
if (typeof document.querySelector === "undefined")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var $_, $, dcopy, sel, sel_string;
|
||||
var $_, $, dcopy, sel;
|
||||
|
||||
|
||||
/**
|
||||
@ -174,12 +179,12 @@
|
||||
for (var x = 0; x < len; x++)
|
||||
{
|
||||
selx = (sel.item(x)) ? sel.item(x) : sel[x];
|
||||
callback(selx);
|
||||
callback.call(selx, selx);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(sel);
|
||||
callback.call(sel, sel);
|
||||
}
|
||||
});
|
||||
|
||||
@ -198,6 +203,7 @@
|
||||
return (typeof obj).toLowerCase();
|
||||
}
|
||||
|
||||
//Strip x from [object x] and return
|
||||
return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
|
||||
};
|
||||
|
||||
@ -662,7 +668,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
* otherwise it will return the value of the current element
|
||||
*
|
||||
* @name text
|
||||
* @memberOf $_.util
|
||||
* @memberOf $_.dom
|
||||
* @function
|
||||
* @param [string] value
|
||||
* @returns string
|
||||
@ -702,7 +708,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
* on the current element
|
||||
*
|
||||
* @name css
|
||||
* @memberOf $_.util
|
||||
* @memberOf $_.dom
|
||||
* @function
|
||||
* @param string property
|
||||
* @param [string] value
|
||||
@ -720,6 +726,27 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
$_.each(function (e){
|
||||
_css(e, prop, val);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Sets or gets the innerHTML propery of the element(s) passed
|
||||
*
|
||||
* @name html
|
||||
* @memberOf $_.dom
|
||||
* @function
|
||||
* @param string htm
|
||||
* @return string
|
||||
* @type string
|
||||
*/
|
||||
html: function(htm)
|
||||
{
|
||||
|
||||
if(typeof htm !== "undefined")
|
||||
{
|
||||
this.el.innerHTML = htm;
|
||||
}
|
||||
|
||||
//If the parameter is undefined, just return the current value
|
||||
return this.el.innerHTML;
|
||||
}
|
||||
};
|
||||
|
||||
@ -828,9 +855,18 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
|
||||
"use strict";
|
||||
|
||||
// Don't bother even defining the object if the XMLHttpRequest isn't available
|
||||
if(typeof window.XMLHttpRequest === "undefined")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ajax = {
|
||||
_do: function (url, data, callback, isPost)
|
||||
{
|
||||
var type,
|
||||
request = new XMLHttpRequest();
|
||||
|
||||
if (typeof callback === "undefined")
|
||||
{
|
||||
/**
|
||||
@ -839,11 +875,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
callback = function (){};
|
||||
}
|
||||
|
||||
var request = (typeof window.XMLHttpRequest !== "undefined")
|
||||
? new XMLHttpRequest()
|
||||
: false;
|
||||
|
||||
var type = (isPost) ? "POST" : "GET";
|
||||
type = (isPost) ? "POST" : "GET";
|
||||
|
||||
url += (type === "GET") ? "?"+this._serialize(data) : '';
|
||||
|
||||
@ -869,9 +901,11 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
},
|
||||
_serialize: function (data)
|
||||
{
|
||||
var pairs = [];
|
||||
var name,
|
||||
value,
|
||||
pairs = [];
|
||||
|
||||
for (var name in data)
|
||||
for (name in data)
|
||||
{
|
||||
if (!data.hasOwnProperty(name))
|
||||
{
|
||||
@ -882,7 +916,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
||||
continue;
|
||||
}
|
||||
|
||||
var value = data[name].toString();
|
||||
value = data[name].toString();
|
||||
|
||||
name = encodeURIComponent(name);
|
||||
value = encodeURIComponent(value);
|
||||
|
21
kis-min.js
vendored
21
kis-min.js
vendored
File diff suppressed because one or more lines are too long
16
src/core.js
16
src/core.js
@ -8,13 +8,18 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
//Browser requirements check
|
||||
if (!document.querySelectorAll)
|
||||
// Most functions rely on a string selector
|
||||
// which returns html elements. This requires
|
||||
// document.querySelectorAll or a custom
|
||||
// selector engine. I choose to just use the
|
||||
// browser feature, since it is present in
|
||||
// IE 8+, and all other major browsers
|
||||
if (typeof document.querySelector === "undefined")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var $_, $, dcopy, sel, sel_string;
|
||||
var $_, $, dcopy, sel;
|
||||
|
||||
|
||||
/**
|
||||
@ -174,12 +179,12 @@
|
||||
for (var x = 0; x < len; x++)
|
||||
{
|
||||
selx = (sel.item(x)) ? sel.item(x) : sel[x];
|
||||
callback(selx);
|
||||
callback.call(selx, selx);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(sel);
|
||||
callback.call(sel, sel);
|
||||
}
|
||||
});
|
||||
|
||||
@ -198,6 +203,7 @@
|
||||
return (typeof obj).toLowerCase();
|
||||
}
|
||||
|
||||
//Strip x from [object x] and return
|
||||
return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase();
|
||||
};
|
||||
|
||||
|
@ -251,7 +251,7 @@
|
||||
* otherwise it will return the value of the current element
|
||||
*
|
||||
* @name text
|
||||
* @memberOf $_.util
|
||||
* @memberOf $_.dom
|
||||
* @function
|
||||
* @param [string] value
|
||||
* @returns string
|
||||
@ -291,7 +291,7 @@
|
||||
* on the current element
|
||||
*
|
||||
* @name css
|
||||
* @memberOf $_.util
|
||||
* @memberOf $_.dom
|
||||
* @function
|
||||
* @param string property
|
||||
* @param [string] value
|
||||
@ -309,6 +309,27 @@
|
||||
$_.each(function (e){
|
||||
_css(e, prop, val);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Sets or gets the innerHTML propery of the element(s) passed
|
||||
*
|
||||
* @name html
|
||||
* @memberOf $_.dom
|
||||
* @function
|
||||
* @param string htm
|
||||
* @return string
|
||||
* @type string
|
||||
*/
|
||||
html: function(htm)
|
||||
{
|
||||
|
||||
if(typeof htm !== "undefined")
|
||||
{
|
||||
this.el.innerHTML = htm;
|
||||
}
|
||||
|
||||
//If the parameter is undefined, just return the current value
|
||||
return this.el.innerHTML;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -7,9 +7,18 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
// Don't bother even defining the object if the XMLHttpRequest isn't available
|
||||
if(typeof window.XMLHttpRequest === "undefined")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ajax = {
|
||||
_do: function (url, data, callback, isPost)
|
||||
{
|
||||
var type,
|
||||
request = new XMLHttpRequest();
|
||||
|
||||
if (typeof callback === "undefined")
|
||||
{
|
||||
/**
|
||||
@ -18,11 +27,7 @@
|
||||
callback = function (){};
|
||||
}
|
||||
|
||||
var request = (typeof window.XMLHttpRequest !== "undefined")
|
||||
? new XMLHttpRequest()
|
||||
: false;
|
||||
|
||||
var type = (isPost) ? "POST" : "GET";
|
||||
type = (isPost) ? "POST" : "GET";
|
||||
|
||||
url += (type === "GET") ? "?"+this._serialize(data) : '';
|
||||
|
||||
@ -48,9 +53,11 @@
|
||||
},
|
||||
_serialize: function (data)
|
||||
{
|
||||
var pairs = [];
|
||||
var name,
|
||||
value,
|
||||
pairs = [];
|
||||
|
||||
for (var name in data)
|
||||
for (name in data)
|
||||
{
|
||||
if (!data.hasOwnProperty(name))
|
||||
{
|
||||
@ -61,7 +68,7 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
var value = data[name].toString();
|
||||
value = data[name].toString();
|
||||
|
||||
name = encodeURIComponent(name);
|
||||
value = encodeURIComponent(value);
|
||||
|
@ -4,6 +4,13 @@
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" />
|
||||
<title>Kis-js test app</title>
|
||||
<!--[if IE 8]>
|
||||
<script type="text/javascript">
|
||||
var HTML5 = "article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(",");
|
||||
for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName);
|
||||
|
||||
</script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="qunit-header">Kis-js Test Suite</h1>
|
||||
@ -25,7 +32,7 @@
|
||||
<div class="nephew"></div>
|
||||
</aside>
|
||||
</section>
|
||||
<script src="../kis-custom.js"></script>
|
||||
<script src="../kis-min.js"></script>
|
||||
<script src="qunit/qunit.js"></script>
|
||||
<script type="text/javascript">
|
||||
//Selector test function
|
||||
|
@ -25,7 +25,7 @@
|
||||
test("Show/Hide", function(){
|
||||
expect(3);
|
||||
|
||||
var $test = $_("#classChild .nephew");
|
||||
var $test = $_(".nephew");
|
||||
var ele = $test.el;
|
||||
|
||||
$test.dom.hide();
|
||||
@ -44,7 +44,7 @@
|
||||
expect(3);
|
||||
|
||||
var $test = $_("article#r14");
|
||||
var ele = $test.el;
|
||||
var ele = $_("article#r14").el;
|
||||
var text = (typeof ele.innerText !== "undefined") ? ele.innerText : ele.textContent;
|
||||
|
||||
equal($test.el, $("article#r14"), "Selector property is correct");
|
||||
@ -76,4 +76,13 @@
|
||||
equal($test.dom.css("display"), "block", "Getting CSS");
|
||||
});
|
||||
|
||||
test("html", function(){
|
||||
expect(2);
|
||||
|
||||
var test_html = '<a href="mailto:tim@timshomepage.net">Send Tim an email</a>';
|
||||
|
||||
equal($_('#r14').dom.html().trim(), "This is important text!".trim(), "Gets html");
|
||||
equal($_('#r14').dom.html(test_html), test_html, "Sets html");
|
||||
});
|
||||
|
||||
}());
|
Loading…
Reference in New Issue
Block a user