Added better documention, changed version number
15
README.md
@ -62,21 +62,6 @@ functions:
|
|||||||
|
|
||||||
$_.post(url, data_object, callback);
|
$_.post(url, data_object, callback);
|
||||||
|
|
||||||
### QS: querystring parsing and serialization for hashbang strings, and pushState urls ###
|
|
||||||
|
|
||||||
**functions:**
|
|
||||||
|
|
||||||
* Parse:
|
|
||||||
|
|
||||||
$_.qs.parse(hb);
|
|
||||||
|
|
||||||
* Set: This function will set the hash url if browser doesn't have history.pushState
|
|
||||||
|
|
||||||
$_.qs.set(key, value);
|
|
||||||
|
|
||||||
* Get: Retrieves the value of the key in the url string
|
|
||||||
|
|
||||||
$_.qs.get(key);
|
|
||||||
|
|
||||||
### Store: localstorage wrapper with automatic data serialization ###
|
### Store: localstorage wrapper with automatic data serialization ###
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
//The name of the source folder
|
//The name of the source folder
|
||||||
$folder = "src";
|
$folder = "src";
|
||||||
$src_folder = "{$folder}/modules";
|
$src_folder = "{$folder}/modules";
|
||||||
$core_folder = "{$folder}/core";
|
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
|
|
||||||
@ -29,7 +28,7 @@ if($dir = opendir($src_folder))
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Start with the core
|
//Start with the core
|
||||||
$new_file = file_get_contents($core_folder."/core.js") . "\n";
|
$new_file = file_get_contents("{$folder}/core.js") . "\n";
|
||||||
|
|
||||||
|
|
||||||
//Add the modules
|
//Add the modules
|
||||||
|
16
docs/code.css
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.KEYW { color: #6277AA; font-weight: bold; }
|
||||||
|
.COMM { color: #008200; }
|
||||||
|
.NUMB { color: #393;}
|
||||||
|
.STRN { color: #00d; }
|
||||||
|
.REGX { color: #339;}
|
||||||
|
.linenumber {
|
||||||
|
border-right: 7px solid #8DA6C6;
|
||||||
|
color: #fff;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 0 7px;
|
||||||
|
background: #6277AA;
|
||||||
|
}
|
358
docs/css/all.css
Normal file
@ -0,0 +1,358 @@
|
|||||||
|
/* TABLE OF CONTENTS:
|
||||||
|
* - Browser reset
|
||||||
|
* - HTML elements
|
||||||
|
* - JsDoc styling
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BEGIN BROWSER RESET
|
||||||
|
*/
|
||||||
|
|
||||||
|
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,p,pre,form,fieldset,input,textarea,p,blockquote,th,td {
|
||||||
|
margin:0;
|
||||||
|
padding:0
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
height:100%;
|
||||||
|
overflow:-moz-scrollbars-vertical;
|
||||||
|
overflow-x:auto
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
border:0;
|
||||||
|
border-collapse:collapse;
|
||||||
|
border-spacing:0
|
||||||
|
}
|
||||||
|
fieldset,img {
|
||||||
|
border:0
|
||||||
|
}
|
||||||
|
address,caption,cite,code,dfn,em,strong,th,var {
|
||||||
|
font-style:normal;
|
||||||
|
font-weight:normal
|
||||||
|
}
|
||||||
|
em,cite {
|
||||||
|
font-style:italic
|
||||||
|
}
|
||||||
|
strong {
|
||||||
|
font-weight:bold
|
||||||
|
}
|
||||||
|
ol,ul {
|
||||||
|
list-style:none
|
||||||
|
}
|
||||||
|
caption,th {
|
||||||
|
text-align:left
|
||||||
|
}
|
||||||
|
h1,h2,h3,h4,h5,h6 {
|
||||||
|
font-size:100%;
|
||||||
|
font-weight:normal;
|
||||||
|
margin:0;
|
||||||
|
padding:0
|
||||||
|
}
|
||||||
|
q:before,q:after {
|
||||||
|
content:''
|
||||||
|
}
|
||||||
|
abbr,acronym {
|
||||||
|
border:0
|
||||||
|
}
|
||||||
|
section,article,header,footer,nav,aside,hgroup {
|
||||||
|
display:block
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END BROWSER RESET
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HTML ELEMENTS
|
||||||
|
*/
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'M1m';
|
||||||
|
src: url('fonts/mplus-1m-regular-webfont.eot');
|
||||||
|
src: local('☺'), url('fonts/mplus-1m-regular-webfont.woff') format('woff'), url('fonts/mplus-1m-regular-webfont.ttf') format('truetype'), url('fonts/mplus-1m-regular-webfont.svg#webfontVd14f4NN') format('svg');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'M1m';
|
||||||
|
src: url('fonts/mplus-1m-bold-webfont.eot');
|
||||||
|
src: local('☺'), url('fonts/mplus-1m-bold-webfont.woff') format('woff'), url('fonts/mplus-1m-bold-webfont.ttf') format('truetype'), url('fonts/mplus-1m-bold-webfont.svg#webfontIjI5mZqE') format('svg');
|
||||||
|
font-weight: bold;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
* {
|
||||||
|
line-height: 1.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-size: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-size: 0.75em;
|
||||||
|
padding: 15px 0;
|
||||||
|
background: #eee;
|
||||||
|
background-image: -moz-linear-gradient(left, #dddddd, #f9f9f9) fixed;
|
||||||
|
background-image: -webkit-gradient(linear,left bottom,right bottom,color-stop(0, #dddddd),color-stop(1, #f9f9f9)) fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
body,
|
||||||
|
input,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
color: #000;
|
||||||
|
font-family: Arial, Geneva, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link,
|
||||||
|
a:hover,
|
||||||
|
a:active,
|
||||||
|
a:visited {
|
||||||
|
color: #19199e;
|
||||||
|
}
|
||||||
|
a:hover,
|
||||||
|
a:focus {
|
||||||
|
color: #00f;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0 0 1.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END HTML ELEMENTS
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BEGIN HACK
|
||||||
|
*/
|
||||||
|
|
||||||
|
div.containerMain:after,
|
||||||
|
div.safeBox:after {
|
||||||
|
content:"";
|
||||||
|
display:block;
|
||||||
|
height:0;
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END HACK
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BEGIN JSDOC
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Start menu */
|
||||||
|
div.index *.heading1 {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
border-bottom: 1px solid #999999;
|
||||||
|
font-family: M1m, Arial, sans-serif;
|
||||||
|
font-size: 1.6em;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
line-height: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.menu {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
*+html div.index div.menu {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
* html div.index div.menu {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.menu div {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.menu a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
div.index div.menu a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index ul.classList {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index ul.classList a {
|
||||||
|
display: block;
|
||||||
|
margin: 1px 0;
|
||||||
|
padding: 4px 0 2px 10px;
|
||||||
|
text-indent: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.fineprint {
|
||||||
|
color: #777;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
div.index div.fineprint a {
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
/* End menu */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Start content */
|
||||||
|
div.content ul {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content *.classTitle {
|
||||||
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content *.classTitle span {
|
||||||
|
display: block;
|
||||||
|
font-size: 2em;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
line-height: 1em;
|
||||||
|
padding-top: 5px;
|
||||||
|
text-shadow: 1px 1px 1px #999999;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content p.summary {
|
||||||
|
font-size: 1.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content ul *.classname a,
|
||||||
|
div.content ul *.filename a {
|
||||||
|
font-family: Consolas, "Courier New", Courier, monospace;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
div.content ul *.classname a:hover,
|
||||||
|
div.content ul *.filename a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content div.props {
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #fff;
|
||||||
|
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.2)); /* FF3.6 */
|
||||||
|
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255, 255, 255, 0.7)),color-stop(1, rgba(255, 255, 255, 0.2)));
|
||||||
|
-moz-box-shadow: 0px 0px 10px #ccc;
|
||||||
|
-webkit-box-shadow: 0px 0px 5px #bbb;
|
||||||
|
box-shadow: 0px 0px 5px #bbb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*.sectionTitle {
|
||||||
|
font-family: M1m, sans-serif;
|
||||||
|
font-size: 1.6em;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td,
|
||||||
|
table.summaryTable th {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
table.summaryTable tr:last-child td {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable th {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td.attributes {
|
||||||
|
font-family: Consolas, "Courier New", Courier, monospace;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td.nameDescription div.fixedFont {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable div.description {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dl.detailList dt {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.inheritsList dd + dt {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.inheritsList dd {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.fixedFont {
|
||||||
|
font-family: Consolas, "Courier New", Courier, monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedFont.heading {
|
||||||
|
font-size: 1.25em;
|
||||||
|
line-height: 1.1em
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedFont.heading + .description {
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixedFont.heading .light,
|
||||||
|
.fixedFont.heading .lighter {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.code {
|
||||||
|
overflow: auto;
|
||||||
|
font-family: Consolas, "Courier New", Courier, monospace;
|
||||||
|
background: #eee;
|
||||||
|
}
|
||||||
|
/* Start content */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Start general styles */
|
||||||
|
.light {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lighter {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.break {
|
||||||
|
font-size: 1px;
|
||||||
|
line-height: 1px;
|
||||||
|
}
|
||||||
|
/* End general styles */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END JSDOC
|
||||||
|
*/
|
BIN
docs/css/fonts/mplus-1m-bold-webfont.eot
Normal file
134
docs/css/fonts/mplus-1m-bold-webfont.svg
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<metadata>
|
||||||
|
This is a custom SVG webfont generated by Font Squirrel.
|
||||||
|
Foundry URL : http://mplus-fonts.sourceforge.jp
|
||||||
|
</metadata>
|
||||||
|
<defs>
|
||||||
|
<font id="webfontIjI5mZqE" horiz-adv-x="500" >
|
||||||
|
<font-face units-per-em="1000" ascent="860" descent="-140" />
|
||||||
|
<missing-glyph horiz-adv-x="500" />
|
||||||
|
<glyph unicode=" " />
|
||||||
|
<glyph unicode="!" d="M165 730h170l-20 -495h-130zM170 0v150h160v-150h-160z" />
|
||||||
|
<glyph unicode=""" d="M270 780h160l-30 -320h-100zM70 780h160l-30 -320h-100z" />
|
||||||
|
<glyph unicode="#" d="M20 165v120h62l24 185h-51v120h67l18 140h135l-18 -140h45l18 140h135l-18 -140h43v-120h-59l-24 -185h48v-120h-64l-21 -165h-135l21 165h-45l-21 -165h-135l21 165h-46zM217 285h45l24 185h-45z" />
|
||||||
|
<glyph unicode="$" d="M357 397q55 -32 76.5 -74t21.5 -108q0 -190 -192 -199v-101h-110v112q-51 16 -88 43v140q38 -35 88 -55v191q-53 33 -75.5 75.5t-22.5 103.5q0 89 50 138.5t142 51.5v100h110v-112q42 -12 78 -33v-135q-32 25 -78 42v-180zM247 445v149q-54 -9 -54 -69q0 -55 54 -80z M263 295v-157q52 13 52 77q0 55 -52 80z" />
|
||||||
|
<glyph unicode="%" d="M40 310l420 220v-110l-420 -220v110zM160 740q70 0 110 -41t40 -119t-40 -119t-110 -41t-110 41t-40 119t40 119t110 41zM340 310q70 0 110 -41t40 -119t-40 -119t-110 -41t-110 41t-40 119t40 119t110 41zM160 518q38 0 38 62t-38 62t-38 -62t38 -62zM340 88q38 0 38 62 t-38 62t-38 -62t38 -62z" />
|
||||||
|
<glyph unicode="&" d="M235 615q-23 0 -36.5 -14.5t-13.5 -40.5q0 -18 7.5 -37.5t33.5 -65.5q35 30 47 52.5t12 50.5q0 26 -13.5 40.5t-36.5 14.5zM118 368q-47 77 -62.5 116t-15.5 76q0 80 51.5 130t138.5 50t141 -50.5t54 -129.5q0 -114 -130 -220l55 -94v2v132h125v-225q-16 -25 -41 -52 l61 -103h-150l-15 24q-66 -34 -130 -34q-88 0 -136.5 45.5t-48.5 134.5q0 99 103 198zM269 124l-77 125q-27 -37 -27 -74q0 -60 65 -60q20 0 39 9z" />
|
||||||
|
<glyph unicode="'" d="M160 780h180l-35 -320h-110z" />
|
||||||
|
<glyph unicode="(" d="M100 300q0 136 50 256.5t144 213.5h126q-196 -194 -196 -470t196 -470h-126q-94 93 -144 213.5t-50 256.5z" />
|
||||||
|
<glyph unicode=")" d="M400 300q0 -136 -50 -256.5t-144 -213.5h-126q196 194 196 470t-196 470h126q94 -93 144 -213.5t50 -256.5z" />
|
||||||
|
<glyph unicode="*" d="M193 750h114l-4 -144l136 48l35 -109l-138 -40l88 -115l-93 -67l-81 119l-81 -119l-93 67l88 115l-138 40l35 109l136 -48z" />
|
||||||
|
<glyph unicode="+" d="M315 545v-195h135v-110h-135v-195h-130v195h-135v110h135v195h130z" />
|
||||||
|
<glyph unicode="," d="M180 190h190l-130 -320h-120z" />
|
||||||
|
<glyph unicode="-" d="M90 240v110h320v-110h-320z" />
|
||||||
|
<glyph unicode="." d="M155 0v190h190v-190h-190z" />
|
||||||
|
<glyph unicode="/" d="M465 730l-310 -770h-120l310 770h120z" />
|
||||||
|
<glyph unicode="0" d="M250 740q73 0 117.5 -32.5t68.5 -116t24 -226.5t-24 -226.5t-68.5 -116t-117.5 -32.5t-117.5 32.5t-68.5 116t-24 226.5t24 226.5t68.5 116t117.5 32.5zM171 317l142 248q-9 34 -24.5 47t-38.5 13q-28 0 -44.5 -19.5t-26 -77.5t-9.5 -163q0 -33 1 -48zM183 179 q9 -41 25.5 -57.5t41.5 -16.5q28 0 44.5 19.5t26 77.5t9.5 163q0 47 -1 67z" />
|
||||||
|
<glyph unicode="1" d="M240 592l-2 1l-173 -91v128l175 100h140v-730h-140v592z" />
|
||||||
|
<glyph unicode="2" d="M220 122v-2h220v-120h-380v120q127 141 181 237t54 173q0 43 -21 66.5t-59 23.5q-31 0 -74 -22t-81 -58v130q78 70 185 70q90 0 140 -51t50 -149q0 -180 -215 -418z" />
|
||||||
|
<glyph unicode="3" d="M290 608v2h-230v120h385v-120l-170 -178v-2h10q79 0 122 -51.5t43 -153.5q0 -121 -54 -178t-166 -57q-51 0 -81.5 6.5t-78.5 28.5v130q80 -45 150 -45q46 0 68 27t22 88q0 58 -26 76.5t-114 18.5h-40v120z" />
|
||||||
|
<glyph unicode="4" d="M400 150v-150h-135v150h-245v120l230 460h150v-460h80v-120h-80zM265 270v255h-2l-127 -253v-2h129z" />
|
||||||
|
<glyph unicode="5" d="M202 455q36 19 82 19q161 0 161 -239q0 -245 -230 -245q-76 0 -150 35v130q80 -45 140 -45q51 0 75.5 29t24.5 96t-14.5 93t-46.5 26q-34 0 -64 -34h-110l10 410h345v-120h-220l-5 -155h2z" />
|
||||||
|
<glyph unicode="6" d="M295 625q-54 0 -76.5 -34.5t-28.5 -135.5h2q45 35 98 35q92 0 133.5 -54.5t41.5 -185.5q0 -141 -51 -200.5t-159 -59.5q-75 0 -119 28.5t-67.5 101t-23.5 200.5q0 162 25 254t75 129t135 37q66 0 135 -20v-125q-57 30 -120 30zM255 107q39 0 55.5 29.5t16.5 113.5 q0 79 -14 104.5t-53 25.5q-38 0 -56.5 -29.5t-18.5 -100.5q0 -81 17 -112t53 -31z" />
|
||||||
|
<glyph unicode="7" d="M55 730h390v-120q-113 -273 -200 -610h-146q92 325 216 608v2h-260v120z" />
|
||||||
|
<glyph unicode="8" d="M258 625q-41 0 -59.5 -20.5t-18.5 -64.5q0 -74 75 -105q33 16 51.5 43.5t18.5 61.5q0 40 -18 62.5t-49 22.5zM250 -10q-105 0 -162.5 52t-57.5 148q0 116 105 179v2q-42 31 -66 80t-24 104q0 87 53.5 136t151.5 49t151.5 -48.5t53.5 -136.5q0 -98 -100 -164v-2 q115 -62 115 -199q0 -96 -58 -148t-162 -52zM242 105q93 0 93 100q0 75 -103 115q-33 -17 -52.5 -48.5t-19.5 -66.5q0 -48 22.5 -74t59.5 -26z" />
|
||||||
|
<glyph unicode="9" d="M205 110q55 0 77 32.5t28 132.5h-2q-45 -35 -98 -35q-89 0 -132 57.5t-43 192.5q0 131 51 190.5t159 59.5q79 0 123 -27.5t65.5 -99.5t21.5 -203q0 -162 -25 -254t-75 -129t-135 -37q-66 0 -135 20v130q57 -30 120 -30zM245 623q-39 0 -55.5 -28t-16.5 -105 q0 -83 15.5 -111.5t51.5 -28.5q75 0 75 140q0 73 -17 103t-53 30z" />
|
||||||
|
<glyph unicode=":" d="M160 390v190h180v-190h-180zM160 0v190h180v-190h-180z" />
|
||||||
|
<glyph unicode=";" d="M170 190h190l-130 -320h-120zM170 390v190h180v-190h-180z" />
|
||||||
|
<glyph unicode="<" d="M445 470l-320 -174v-2l320 -174v-120l-400 225v140l400 225v-120z" />
|
||||||
|
<glyph unicode="=" d="M50 125v110h400v-110h-400zM50 362v103h400v-103h-400z" />
|
||||||
|
<glyph unicode=">" d="M55 470v120l400 -225v-140l-400 -225v120l320 174v2z" />
|
||||||
|
<glyph unicode="?" d="M460 575q0 -36 -12.5 -69t-25 -51t-38.5 -49q-25 -30 -38 -48.5t-27.5 -52.5t-18.5 -70h-130q0 49 17 94.5t32 66.5t44 57q21 25 30.5 38t19 33.5t9.5 40.5q0 58 -82 58t-180 -53v130q95 40 200 40q95 0 147.5 -44t52.5 -121zM155 0v150h160v-150h-160z" />
|
||||||
|
<glyph unicode="@" d="M285 635q-72 0 -108.5 -62.5t-36.5 -207.5q0 -265 160 -265q58 0 125 30v-115q-70 -25 -150 -25q-260 0 -260 375q0 194 64 284.5t191 90.5q99 0 152 -51.5t53 -148.5v-325q-28 -28 -76 -46.5t-94 -18.5q-69 0 -102 49t-33 166q0 114 31.5 164.5t93.5 50.5q36 0 68 -25h2 v15q0 26 -23.5 45.5t-56.5 19.5zM290 365q0 -72 8 -93.5t29 -21.5q20 0 28 18v147q0 41 -6 53t-25 12t-26.5 -22t-7.5 -93z" />
|
||||||
|
<glyph unicode="A" d="M249 620h-2l-55 -335h112zM323 170h-150l-28 -170h-140l165 730h160l165 -730h-144z" />
|
||||||
|
<glyph unicode="B" d="M190 445h15q59 0 85 20.5t26 64.5q0 49 -23 71t-73 22q-17 0 -30 -5v-173zM190 330v-218q20 -5 45 -5q51 0 75 27.5t24 90.5q0 57 -25.5 81t-88.5 24h-30zM470 210q0 -220 -240 -220q-93 0 -180 15v720q92 15 190 15q210 0 210 -185q0 -62 -32 -105t-83 -54v-2 q57 -10 96 -61.5t39 -122.5z" />
|
||||||
|
<glyph unicode="C" d="M30 365q0 195 64.5 285t190.5 90q80 0 150 -25v-115q-70 25 -125 25q-74 0 -109.5 -58.5t-35.5 -201.5q0 -260 150 -260q57 0 125 30v-120q-70 -25 -150 -25q-260 0 -260 375z" />
|
||||||
|
<glyph unicode="D" d="M344 365q0 142 -30 198.5t-94 56.5q-23 0 -40 -5v-500q17 -5 40 -5q63 0 93.5 55.5t30.5 199.5zM480 365q0 -144 -28.5 -226.5t-83.5 -115.5t-148 -33q-92 0 -180 15v720q88 15 180 15q141 0 200.5 -82t59.5 -293z" />
|
||||||
|
<glyph unicode="E" d="M210 610v-165h220v-115h-220v-210h230v-120h-370v730h370v-120h-230z" />
|
||||||
|
<glyph unicode="F" d="M220 330v-330h-140v730h360v-120h-220v-165h210v-115h-210z" />
|
||||||
|
<glyph unicode="G" d="M310 625q-82 0 -116 -55t-34 -205q0 -143 32 -201.5t93 -58.5q27 0 48 10v215h-98v115h230v-415q-83 -40 -180 -40q-260 0 -260 375q0 196 69.5 285.5t215.5 89.5q70 0 130 -25v-115q-72 25 -130 25z" />
|
||||||
|
<glyph unicode="H" d="M318 330h-140v-330h-138v730h138v-280h140v280h142v-730h-142v330z" />
|
||||||
|
<glyph unicode="I" d="M430 0h-360v115h108v500h-108v115h360v-115h-108v-500h108v-115z" />
|
||||||
|
<glyph unicode="J" d="M410 730v-515q0 -126 -48.5 -175.5t-166.5 -49.5q-86 0 -155 30v130q29 -18 68 -30t67 -12q50 0 71 26.5t21 95.5v385h-147v115h290z" />
|
||||||
|
<glyph unicode="K" d="M192 330h-2v-330h-140v730h140v-300h2l135 300h148l-160 -345l165 -385h-150z" />
|
||||||
|
<glyph unicode="L" d="M230 730v-610h210v-120h-350v730h140z" />
|
||||||
|
<glyph unicode="M" d="M338 500h-2l-38 -300h-100l-38 300h-2v-500h-133v730h167l59 -400h2l59 400h163v-730h-137v500z" />
|
||||||
|
<glyph unicode="N" d="M187 460h-2v-460h-140v730h147l125 -460h2v460h136v-730h-143z" />
|
||||||
|
<glyph unicode="O" d="M250 740q121 0 175.5 -84t54.5 -291t-54.5 -291t-175.5 -84t-175.5 84t-54.5 291t54.5 291t175.5 84zM250 108q52 0 75 53.5t23 203.5t-23 203.5t-75 53.5t-75 -53.5t-23 -203.5t23 -203.5t75 -53.5z" />
|
||||||
|
<glyph unicode="P" d="M334 503q0 120 -104 120q-23 0 -40 -5v-235q18 -5 40 -5q53 0 78.5 28t25.5 97zM470 503q0 -127 -57 -184.5t-173 -57.5q-26 0 -50 5v-266h-140v725q90 15 185 15q122 0 178.5 -56t56.5 -181z" />
|
||||||
|
<glyph unicode="Q" d="M250 740q121 0 175.5 -84t54.5 -291q0 -257 -92 -333v-2q39 -22 68.5 -74t33.5 -106h-145q-15 81 -36.5 110.5t-58.5 29.5q-121 0 -175.5 84t-54.5 291t54.5 291t175.5 84zM250 108q52 0 75 53.5t23 203.5t-23 203.5t-75 53.5t-75 -53.5t-23 -203.5t23 -203.5t75 -53.5z " />
|
||||||
|
<glyph unicode="R" d="M465 513q0 -151 -98 -199l-1 -2q27 -19 58 -118l61 -194h-145l-57 204q-12 43 -25.5 57.5t-42.5 14.5h-30v-276h-140v725q90 15 185 15q124 0 179.5 -53.5t55.5 -173.5zM185 393h30q64 0 89 24.5t25 95.5q0 58 -25.5 84t-78.5 26q-23 0 -40 -5v-225z" />
|
||||||
|
<glyph unicode="S" d="M440 575q-84 48 -165 48q-41 0 -65 -21t-24 -57q0 -71 69 -100q116 -48 160.5 -103t44.5 -142q0 -210 -225 -210q-100 0 -180 50v135q83 -68 173 -68q94 0 94 88q0 76 -77 110q-108 46 -151.5 99.5t-43.5 135.5q0 90 57 145t153 55q102 0 180 -35v-130z" />
|
||||||
|
<glyph unicode="T" d="M320 615v-615h-140v615h-145v115h430v-115h-145z" />
|
||||||
|
<glyph unicode="U" d="M250 -10q-112 0 -161 54t-49 186v500h142v-460q0 -101 14.5 -131.5t55.5 -30.5t55.5 30.5t14.5 131.5v460h138v-500q0 -132 -49 -186t-161 -54z" />
|
||||||
|
<glyph unicode="V" d="M253 110l92 620h140l-155 -730h-160l-155 730h144l92 -620h2z" />
|
||||||
|
<glyph unicode="W" d="M164 190h2l38 440h100l38 -440h2l15 540h126l-45 -730h-157l-34 420h-2l-34 -420h-153l-45 730h134z" />
|
||||||
|
<glyph unicode="X" d="M251 470h2l74 260h145l-132 -360l135 -370h-152l-74 270h-2l-74 -270h-148l135 370l-132 360h149z" />
|
||||||
|
<glyph unicode="Y" d="M251 415h2l84 315h148l-165 -455v-275h-140v275l-165 455h152z" />
|
||||||
|
<glyph unicode="Z" d="M290 613v2h-235v115h390v-115l-235 -498v-2h235v-115h-390v115z" />
|
||||||
|
<glyph unicode="[" d="M410 675h-170v-750h170v-95h-290v940h290v-95z" />
|
||||||
|
<glyph unicode="\" d="M35 730h120l310 -770h-120z" />
|
||||||
|
<glyph unicode="]" d="M90 675v95h290v-940h-290v95h170v750h-170z" />
|
||||||
|
<glyph unicode="^" d="M251 655h-2l-111 -375h-123l145 450h180l145 -450h-123z" />
|
||||||
|
<glyph unicode="_" d="M40 -170v88h420v-88h-420z" />
|
||||||
|
<glyph unicode="`" d="M90 810h190l100 -320h-120z" />
|
||||||
|
<glyph unicode="a" d="M65 495q39 14 95 24.5t90 10.5q111 0 155.5 -45t44.5 -160v-325h-127l-2 65h-2q-49 -75 -134 -75q-68 0 -106.5 42t-38.5 118q0 88 63.5 136.5t186.5 48.5h25v10q0 40 -16 56.5t-54 16.5q-32 0 -86.5 -11.5t-93.5 -26.5v115zM315 245h-25q-59 0 -89.5 -23t-30.5 -62 q0 -31 15 -48t40 -17q90 0 90 130v20z" />
|
||||||
|
<glyph unicode="b" d="M45 730h137v-275h2q49 75 116 75q83 0 129 -66.5t46 -203.5q0 -133 -47.5 -201.5t-127.5 -68.5q-35 0 -62.5 17.5t-56.5 62.5h-2l-2 -70h-132v730zM338 260q0 150 -78 150q-80 0 -80 -145v-10q0 -145 80 -145q35 0 56.5 36.5t21.5 113.5z" />
|
||||||
|
<glyph unicode="c" d="M305 420q-115 0 -115 -160q0 -163 120 -163q60 0 120 28v-110q-68 -25 -140 -25q-116 0 -178 67.5t-62 202.5t60 202.5t175 67.5q67 0 135 -25v-110q-61 25 -115 25z" />
|
||||||
|
<glyph unicode="d" d="M455 0h-132l-2 70h-2q-29 -45 -56.5 -62.5t-62.5 -17.5q-80 0 -127.5 68.5t-47.5 201.5q0 137 46 203.5t129 66.5q67 0 116 -75h2v275h137v-730zM162 260q0 -77 21.5 -113.5t56.5 -36.5q80 0 80 145v10q0 145 -80 145q-78 0 -78 -150z" />
|
||||||
|
<glyph unicode="e" d="M182 206q7 -62 33 -85.5t80 -23.5q52 0 135 28v-110q-84 -25 -155 -25q-112 0 -173.5 68t-61.5 202q0 270 220 270q200 0 200 -270q0 -31 -2 -54h-276zM181 310h142q-1 63 -15.5 88t-47.5 25q-41 0 -58 -23t-21 -90z" />
|
||||||
|
<glyph unicode="f" d="M60 391v109h100v45q0 104 40.5 149.5t129.5 45.5q56 0 110 -15v-110q-36 16 -80 16q-37 0 -50 -20.5t-13 -85.5v-25h143v-109h-143v-391h-137v391h-100z" />
|
||||||
|
<glyph unicode="g" d="M323 75h-2q-45 -75 -116 -75q-78 0 -126.5 66.5t-48.5 193.5q0 137 46 203.5t129 66.5q35 0 62.5 -17.5t56.5 -62.5h2l2 70h132v-505q0 -245 -240 -245q-81 0 -150 25v115q76 -33 145 -33q55 0 81.5 34t26.5 114v50zM167 260q0 -70 22 -105t56 -35q80 0 80 135v10 q0 145 -80 145q-78 0 -78 -150z" />
|
||||||
|
<glyph unicode="h" d="M50 730h137v-275h2q47 75 126 75t112 -47.5t33 -172.5v-310h-135v290q0 74 -12.5 98t-47.5 24t-56.5 -43.5t-21.5 -131.5v-237h-137v730z" />
|
||||||
|
<glyph unicode="i" d="M110 520h240v-413h100v-107h-370v107h130v306h-100v107zM190 630v130h160v-130h-160z" />
|
||||||
|
<glyph unicode="j" d="M225 -20v433h-110v107h250v-540q0 -68 -10.5 -106t-44 -63t-87.5 -33t-148 -8v109q39 0 60.5 0.5t41 5t27 9.5t13.5 18t7 27.5t1 40.5zM205 630v130h160v-130h-160z" />
|
||||||
|
<glyph unicode="k" d="M480 520l-185 -250l185 -270h-162l-131 224v-224h-137v730h137v-418l133 208h160z" />
|
||||||
|
<glyph unicode="l" d="M310 190q0 -68 9 -80.5t56 -12.5q31 0 75 6v-108q-44 -5 -100 -5q-111 0 -145.5 32.5t-34.5 137.5v463h-120v107h260v-540z" />
|
||||||
|
<glyph unicode="m" d="M360 0v340q0 40 -21 40q-8 0 -12.5 -5t-7 -22.5t-2.5 -52.5v-300h-130v340q0 40 -21 40q-8 0 -12.5 -5t-7 -22.5t-2.5 -52.5v-300h-134v520h120l2 -65h2q15 34 39.5 54.5t48.5 20.5q28 0 45 -16t32 -59h2q42 75 99 75q48 0 69 -36t21 -134v-360h-130z" />
|
||||||
|
<glyph unicode="n" d="M50 520h132l2 -70h2q49 80 129 80q79 0 112 -47.5t33 -172.5v-310h-135v290q0 74 -12.5 98t-47.5 24t-56.5 -43.5t-21.5 -131.5v-237h-137v520z" />
|
||||||
|
<glyph unicode="o" d="M250 530q220 0 220 -270t-220 -270t-220 270t220 270zM250 97q44 0 62 33.5t18 129.5t-18 129.5t-62 33.5t-62 -33.5t-18 -129.5t18 -129.5t62 -33.5z" />
|
||||||
|
<glyph unicode="p" d="M179 70h-2v-290h-137v740h132l2 -70h2q29 45 56.5 62.5t62.5 17.5q83 0 129 -66.5t46 -203.5q0 -133 -47.5 -201.5t-127.5 -68.5q-71 0 -116 80zM333 260q0 150 -78 150q-80 0 -80 -145v-10q0 -145 80 -145q35 0 56.5 36.5t21.5 113.5z" />
|
||||||
|
<glyph unicode="q" d="M321 70q-45 -80 -116 -80q-80 0 -127.5 68.5t-47.5 201.5q0 137 46 203.5t129 66.5q35 0 62.5 -17.5t56.5 -62.5h2l2 70h132v-740h-137v290h-2zM167 260q0 -77 21.5 -113.5t56.5 -36.5q80 0 80 145v10q0 145 -80 145q-78 0 -78 -150z" />
|
||||||
|
<glyph unicode="r" d="M375 416q-69 0 -111 -52t-42 -144v-220h-137v520h135v-85h2q36 53 70.5 74t82.5 21q36 0 70 -10v-115q-36 11 -70 11z" />
|
||||||
|
<glyph unicode="s" d="M265 418q-73 0 -73 -43q0 -22 14.5 -35t48.5 -20q109 -21 149.5 -60t40.5 -115q0 -74 -50.5 -114.5t-144.5 -40.5q-107 0 -190 35v120q87 -43 165 -43q45 0 64 11.5t19 36.5q0 22 -14 34t-54 21q-99 21 -142 62.5t-43 112.5t49 110.5t146 39.5q99 0 180 -30v-115 q-87 33 -165 33z" />
|
||||||
|
<glyph unicode="t" d="M445 500v-109h-158v-201q0 -61 10.5 -74.5t57.5 -13.5q43 0 80 17v-114q-50 -15 -110 -15q-98 0 -136.5 36.5t-38.5 133.5v231h-105v109h105v190h137v-190h158z" />
|
||||||
|
<glyph unicode="u" d="M445 0h-132l-2 70h-2q-50 -80 -124 -80q-77 0 -108.5 44.5t-31.5 165.5v320h135v-300q0 -70 11 -91t44 -21q73 0 73 175v237h137v-520z" />
|
||||||
|
<glyph unicode="v" d="M251 90h2l79 430h138l-130 -520h-180l-130 520h142z" />
|
||||||
|
<glyph unicode="w" d="M343 120h2l29 400h116l-70 -520h-137l-37 358h-2l-31 -358h-133l-70 520h124l29 -400h2l39 400h100z" />
|
||||||
|
<glyph unicode="x" d="M251 335h2l69 185h143l-125 -260l125 -260h-152l-64 180h-2l-64 -180h-148l125 260l-125 260h147z" />
|
||||||
|
<glyph unicode="y" d="M254 170h2l87 350h142l-237 -740h-138l85 230l-170 510h142z" />
|
||||||
|
<glyph unicode="z" d="M275 411h-210v109h370v-109l-210 -300v-2h210v-109h-370v109l210 300v2z" />
|
||||||
|
<glyph unicode="{" d="M187 301v-2q58 -24 85.5 -62t27.5 -100v-112q0 -73 12 -86.5t75 -13.5h53v-95h-107q-80 0 -116.5 37t-36.5 123v147q0 61 -22 88t-68 27h-40v96h40q46 0 68 27t22 88v147q0 86 36.5 123t116.5 37h107v-95h-53q-63 0 -75 -13.5t-12 -86.5v-112q0 -62 -27.5 -100t-85.5 -62 z" />
|
||||||
|
<glyph unicode="|" d="M188 -220v1030h124v-1030h-124z" />
|
||||||
|
<glyph unicode="}" d="M313 301q-58 24 -85.5 62t-27.5 100v112q0 73 -12 86.5t-75 13.5h-53v95h107q80 0 116.5 -37t36.5 -123v-147q0 -61 22 -88t68 -27h40v-96h-40q-46 0 -68 -27t-22 -88v-147q0 -86 -36.5 -123t-116.5 -37h-107v95h53q63 0 75 13.5t12 86.5v112q0 62 27.5 100t85.5 62v2z " />
|
||||||
|
<glyph unicode="~" d="M40 568v107q45 35 100 35q63 0 131 -50q49 -37 84 -37q49 0 105 51v-107q-45 -35 -100 -35q-63 0 -131 50q-49 37 -84 37q-49 0 -105 -51z" />
|
||||||
|
<glyph unicode=" " />
|
||||||
|
<glyph unicode="¥" d="M251 415h2l84 315h148l-132 -365h97v-95h-130v-65h130v-95h-130v-110h-140v110h-130v95h130v65h-130v95h97l-132 365h152z" />
|
||||||
|
<glyph unicode="­" d="M90 240v110h320v-110h-320z" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="407" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="815" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="407" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="815" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="271" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="203" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="135" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="135" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="101" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="163" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="45" />
|
||||||
|
<glyph unicode="‐" d="M90 240v110h320v-110h-320z" />
|
||||||
|
<glyph unicode="‑" d="M90 240v110h320v-110h-320z" />
|
||||||
|
<glyph unicode="–" d="M50 240v110h400v-110h-400z" />
|
||||||
|
<glyph unicode="—" d="M10 240v110h480v-110h-480z" />
|
||||||
|
<glyph unicode="‘" d="M305 460h-190l130 320h120z" />
|
||||||
|
<glyph unicode="’" d="M190 780h190l-130 -320h-120z" />
|
||||||
|
<glyph unicode="“" d="M405 460h-170l130 320h100zM195 460h-170l130 320h100z" />
|
||||||
|
<glyph unicode="”" d="M300 780h170l-130 -320h-100zM90 780h170l-130 -320h-100z" />
|
||||||
|
<glyph unicode="…" horiz-adv-x="1000" d="M72 270v190h190v-190h-190zM405 270v190h190v-190h-190zM738 270v190h190v-190h-190z" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="163" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="203" />
|
||||||
|
<glyph unicode="™" horiz-adv-x="1000" d="M838 500h-2l-38 -300h-100l-38 300h-2v-500h-133v730h167l59 -400h2l59 400h163v-730h-137v500zM320 615v-615h-140v615h-145v115h430v-115h-145z" />
|
||||||
|
</font>
|
||||||
|
</defs></svg>
|
After Width: | Height: | Size: 17 KiB |
BIN
docs/css/fonts/mplus-1m-bold-webfont.ttf
Normal file
BIN
docs/css/fonts/mplus-1m-bold-webfont.woff
Normal file
BIN
docs/css/fonts/mplus-1m-regular-webfont.eot
Normal file
134
docs/css/fonts/mplus-1m-regular-webfont.svg
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<metadata>
|
||||||
|
This is a custom SVG webfont generated by Font Squirrel.
|
||||||
|
Foundry URL : http://mplus-fonts.sourceforge.jp
|
||||||
|
</metadata>
|
||||||
|
<defs>
|
||||||
|
<font id="webfontVd14f4NN" horiz-adv-x="500" >
|
||||||
|
<font-face units-per-em="1000" ascent="860" descent="-140" />
|
||||||
|
<missing-glyph horiz-adv-x="500" />
|
||||||
|
<glyph unicode=" " />
|
||||||
|
<glyph unicode="!" d="M200 730h100l-10 -515h-80zM195 0v130h110v-130h-110z" />
|
||||||
|
<glyph unicode=""" d="M275 780h100l-20 -280h-60zM125 780h100l-20 -280h-60z" />
|
||||||
|
<glyph unicode="#" d="M40 188v72h77l29 228h-71v72h80l21 170h82l-21 -170h76l21 170h82l-21 -170h65v-72h-74l-29 -228h68v-72h-77l-23 -188h-82l23 188h-76l-23 -188h-82l23 188h-68zM199 260h76l29 228h-76z" />
|
||||||
|
<glyph unicode="$" d="M293 311v-214q58 21 58 108q0 71 -58 106zM293 19v-104h-76v101q-70 6 -137 49v95q65 -57 137 -69v251q-77 31 -109.5 75.5t-32.5 117.5q0 76 37 122.5t105 55.5v102h76v-102q69 -8 127 -38v-90q-52 38 -127 52v-237q77 -31 109.5 -76.5t32.5 -118.5q0 -163 -142 -186z M217 429v207q-58 -18 -58 -101q0 -73 58 -106z" />
|
||||||
|
<glyph unicode="%" d="M60 260l380 290v-80l-380 -290v80zM160 740q61 0 95.5 -41t34.5 -119t-34.5 -119t-95.5 -41t-95.5 41t-34.5 119t34.5 119t95.5 41zM340 310q61 0 95.5 -41t34.5 -119t-34.5 -119t-95.5 -41t-95.5 41t-34.5 119t34.5 119t95.5 41zM160 488q52 0 52 92t-52 92t-52 -92 t52 -92zM340 58q52 0 52 92t-52 92t-52 -92t52 -92z" />
|
||||||
|
<glyph unicode="&" d="M228 665q-38 0 -60.5 -20t-22.5 -55q0 -29 12.5 -59t53.5 -95q59 51 79 83.5t20 70.5q0 33 -22 54t-60 21zM151 385l-9 14q-47 71 -63.5 111.5t-16.5 79.5q0 66 45 108t118 42t119 -42t46 -108q0 -57 -30.5 -106.5t-106.5 -112.5l119 -183v217h80v-253q-13 -28 -26 -46 l69 -106h-87l-33 49q-69 -59 -175 -59q-82 0 -128.5 46t-46.5 129q0 107 126 220zM331 115l-137 206q-84 -79 -84 -153q0 -51 27 -77t78 -26q70 0 116 50z" />
|
||||||
|
<glyph unicode="'" d="M195 780h110l-25 -280h-60z" />
|
||||||
|
<glyph unicode="(" d="M125 315q0 275 194 455h76q-196 -184 -196 -455t196 -455h-76q-194 180 -194 455z" />
|
||||||
|
<glyph unicode=")" d="M375 315q0 -275 -194 -455h-76q196 184 196 455t-196 455h76q194 -180 194 -455z" />
|
||||||
|
<glyph unicode="*" d="M214 750h72l-3 -169l160 55l22 -68l-161 -50l101 -135l-58 -42l-97 138l-97 -138l-58 42l101 135l-161 50l22 68l160 -55z" />
|
||||||
|
<glyph unicode="+" d="M291 555v-214h149v-72h-149v-214h-82v214h-149v72h149v214h82z" />
|
||||||
|
<glyph unicode="," d="M210 150h120l-110 -280h-70z" />
|
||||||
|
<glyph unicode="-" d="M100 269v72h300v-72h-300z" />
|
||||||
|
<glyph unicode="." d="M185 0v150h130v-150h-130z" />
|
||||||
|
<glyph unicode="/" d="M452 730l-332 -770h-72l332 770h72z" />
|
||||||
|
<glyph unicode="0" d="M250 740q48 0 82 -18t59 -60t37 -115.5t12 -181.5t-12 -181.5t-37 -115.5t-59 -60t-82 -18t-82 18t-59 60t-37 115.5t-12 181.5t12 181.5t37 115.5t59 60t82 18zM142 249l196 339q-26 82 -88 82q-36 0 -60 -26t-38 -95t-14 -184q0 -50 4 -116zM158 155q26 -95 92 -95 q36 0 60 26t38 95t14 184q0 78 -6 133z" />
|
||||||
|
<glyph unicode="1" d="M258 0v645l-2 1l-173 -101v80l175 105h82v-730h-82z" />
|
||||||
|
<glyph unicode="2" d="M175 74v-2h245v-72h-340v72q251 288 251 478q0 116 -93 116q-30 0 -76 -22.5t-82 -55.5v87q75 65 170 65q85 0 125 -47t40 -143q0 -99 -54 -208t-186 -268z" />
|
||||||
|
<glyph unicode="3" d="M330 656v2h-250v72h345v-72l-180 -229v-2h10q91 0 133 -51t42 -166q0 -220 -195 -220q-73 0 -145 30v87q77 -43 130 -43q64 0 95 34.5t31 111.5q0 89 -25 117t-101 28h-70v72z" />
|
||||||
|
<glyph unicode="4" d="M293 590h-2l-175 -341v-2h177v343zM293 175h-253v82l243 473h92v-483h85v-72h-85v-175h-82v175z" />
|
||||||
|
<glyph unicode="5" d="M180 430h2q33 30 88 30q160 0 160 -230q0 -125 -49.5 -182.5t-145.5 -57.5q-74 0 -145 30v87q75 -43 140 -43q116 0 116 166q0 156 -96 156q-46 0 -80 -41h-75l10 385h305v-72h-223z" />
|
||||||
|
<glyph unicode="6" d="M285 740q61 0 115 -20v-77q-50 25 -105 25q-70 0 -101 -48.5t-39 -184.5h2q50 50 113 50q87 0 128.5 -56t41.5 -184q0 -134 -46.5 -194.5t-138.5 -60.5q-65 0 -104 28.5t-60 101.5t-21 200q0 158 25.5 252t71 131t118.5 37zM255 62q54 0 78.5 39t24.5 144q0 94 -23.5 132 t-74.5 38q-106 0 -106 -160q0 -107 25 -150t76 -43z" />
|
||||||
|
<glyph unicode="7" d="M345 656v2h-270v72h350v-72q-128 -296 -210 -658h-88q84 353 218 656z" />
|
||||||
|
<glyph unicode="8" d="M255 670q-53 0 -81.5 -27.5t-28.5 -77.5q0 -54 29 -94t76 -51q52 14 80.5 51.5t28.5 93.5q0 47 -28.5 76t-75.5 29zM250 -10q-96 0 -148 51t-52 149q0 68 33 119t92 75v2q-48 23 -79 73.5t-31 105.5q0 82 49 128.5t136 46.5t136 -47t49 -128q0 -56 -30.5 -103.5 t-79.5 -70.5v-2q59 -23 92 -75t33 -124q0 -98 -52 -149t-148 -51zM255 60q53 0 84 33.5t31 96.5q0 130 -125 160q-61 -16 -90 -54.5t-29 -105.5q0 -62 35 -96t94 -34z" />
|
||||||
|
<glyph unicode="9" d="M215 -10q-61 0 -115 20v80q52 -26 105 -26q70 0 101 47.5t39 183.5h-2q-50 -50 -113 -50q-84 0 -127 59t-43 191q0 126 46 185.5t139 59.5q68 0 107 -28t58.5 -100.5t19.5 -201.5q0 -158 -25.5 -252t-71 -131t-118.5 -37zM245 668q-55 0 -79 -38t-24 -135t25 -138.5 t73 -41.5q49 0 77.5 41.5t28.5 128.5q0 100 -25 141.5t-76 41.5z" />
|
||||||
|
<glyph unicode=":" d="M190 390v150h120v-150h-120zM190 0v150h120v-150h-120z" />
|
||||||
|
<glyph unicode=";" d="M200 150h120l-110 -280h-70zM200 390v150h120v-150h-120z" />
|
||||||
|
<glyph unicode="<" d="M435 510l-330 -204v-2l330 -204v-80l-380 245v80l380 245v-80z" />
|
||||||
|
<glyph unicode="=" d="M60 165v72h380v-72h-380zM60 373v72h380v-72h-380z" />
|
||||||
|
<glyph unicode=">" d="M65 510v80l380 -245v-80l-380 -245v80l330 204v2z" />
|
||||||
|
<glyph unicode="?" d="M445 580q0 -41 -14 -77t-28.5 -55t-42.5 -49q-29 -33 -43 -52t-28 -55t-14 -77h-80q0 55 16.5 101.5t32.5 68t47 56.5q24 27 36 42.5t23 41.5t11 55q0 41 -29.5 63.5t-86.5 22.5q-85 0 -180 -61v90q93 45 190 45q91 0 140.5 -42t49.5 -118zM180 0v130h110v-130h-110z" />
|
||||||
|
<glyph unicode="@" d="M375 258v167q0 41 -16 63t-44 22q-40 0 -56 -29.5t-16 -115.5q0 -82 17 -113.5t55 -31.5q44 0 60 38zM165 365q0 215 140 215q38 0 73 -25h2v5q0 50 -27.5 79t-72.5 29q-83 0 -124 -70.5t-41 -232.5q0 -166 40 -234.5t125 -68.5q62 0 125 38v-80q-59 -30 -130 -30 q-122 0 -181 86t-59 289q0 197 60.5 286t179.5 89q87 0 133.5 -50t46.5 -150v-325q-65 -65 -140 -65q-76 0 -113 49t-37 166z" />
|
||||||
|
<glyph unicode="A" d="M249 660h-2l-83 -380h168zM348 210h-200l-46 -210h-82l180 730h100l180 -730h-86z" />
|
||||||
|
<glyph unicode="B" d="M157 430h45q80 0 116.5 29.5t36.5 90.5q0 57 -36 88.5t-102 31.5q-36 0 -60 -8v-232zM157 360v-292q37 -8 90 -8q126 0 126 160q0 140 -161 140h-55zM455 210q0 -220 -225 -220q-80 0 -155 15v720q75 15 155 15q205 0 205 -180q0 -61 -30.5 -103t-84.5 -56v-2 q58 -11 96.5 -64t38.5 -125z" />
|
||||||
|
<glyph unicode="C" d="M55 365q0 197 60.5 286t179.5 89q66 0 125 -30v-75q-60 33 -120 33q-165 0 -165 -303q0 -164 42 -233.5t123 -69.5q62 0 125 38v-80q-59 -30 -130 -30q-122 0 -181 86t-59 289z" />
|
||||||
|
<glyph unicode="D" d="M383 365q0 168 -43.5 235.5t-137.5 67.5q-33 0 -55 -8v-590q22 -8 55 -8q65 0 102.5 24.5t58 91.5t20.5 187zM465 365q0 -207 -63.5 -291t-199.5 -84q-70 0 -137 15v720q67 15 137 15q137 0 200 -85.5t63 -289.5z" />
|
||||||
|
<glyph unicode="E" d="M162 658v-228h248v-70h-248v-288h258v-72h-340v730h340v-72h-258z" />
|
||||||
|
<glyph unicode="F" d="M172 360v-360h-82v730h330v-72h-248v-228h238v-70h-238z" />
|
||||||
|
<glyph unicode="G" d="M370 85v275h-155v70h235v-400q-80 -40 -170 -40q-118 0 -179 89t-61 286q0 196 63.5 285.5t191.5 89.5q59 0 130 -25v-77q-66 30 -130 30q-87 0 -132 -72t-45 -231q0 -303 167 -303q45 0 85 23z" />
|
||||||
|
<glyph unicode="H" d="M140 730v-298h216v298h84v-730h-84v360h-216v-360h-80v730h80z" />
|
||||||
|
<glyph unicode="I" d="M410 0h-320v70h118v590h-118v70h320v-70h-118v-590h118v-70z" />
|
||||||
|
<glyph unicode="J" d="M400 730v-540q0 -110 -43.5 -155t-146.5 -45q-82 0 -150 30v87q29 -17 75.5 -31t74.5 -14q53 0 79 30.5t26 99.5v468h-165v70h250z" />
|
||||||
|
<glyph unicode="K" d="M157 400h2l206 330h95l-225 -350l230 -380h-95l-211 360h-2v-360h-82v730h82v-330z" />
|
||||||
|
<glyph unicode="L" d="M182 730v-658h238v-72h-320v730h82z" />
|
||||||
|
<glyph unicode="M" d="M378 540h-2l-88 -340h-80l-88 340h-2v-540h-78v730h92l119 -450h2l119 450h88v-730h-82v540z" />
|
||||||
|
<glyph unicode="N" d="M151 550h-2v-550h-84v730h84l204 -550h2v550h80v-730h-80z" />
|
||||||
|
<glyph unicode="O" d="M250 740q107 0 158.5 -84.5t51.5 -290.5t-51.5 -290.5t-158.5 -84.5t-158.5 84.5t-51.5 290.5t51.5 290.5t158.5 84.5zM250 62q44 0 71 25.5t43 93.5t16 184t-16 184t-43 93.5t-71 25.5t-71 -25.5t-43 -93.5t-16 -184t16 -184t43 -93.5t71 -25.5z" />
|
||||||
|
<glyph unicode="P" d="M375 520q0 79 -36 114.5t-112 35.5q-41 0 -70 -8v-292q30 -5 70 -5q77 0 112.5 35.5t35.5 119.5zM455 520q0 -120 -52.5 -172.5t-165.5 -52.5q-35 0 -80 5v-300h-82v725q78 15 160 15q114 0 167 -52.5t53 -167.5z" />
|
||||||
|
<glyph unicode="Q" d="M250 740q107 0 158.5 -84.5t51.5 -290.5q0 -273 -100 -344v-2q41 -21 73 -66t47 -103h-88q-21 78 -54 109t-88 31q-107 0 -158.5 84.5t-51.5 290.5t51.5 290.5t158.5 84.5zM250 62q44 0 71 25.5t43 93.5t16 184t-16 184t-43 93.5t-71 25.5t-71 -25.5t-43 -93.5t-16 -184 t16 -184t43 -93.5t71 -25.5z" />
|
||||||
|
<glyph unicode="R" d="M370 540q0 130 -148 130q-41 0 -70 -8v-272h60q87 0 122.5 33.5t35.5 116.5zM152 320v-320h-82v725q78 15 160 15q112 0 166 -49.5t54 -150.5q0 -143 -109 -193v-2q31 -15 66 -131l63 -214h-86l-59 216q-17 64 -41 84t-82 20h-50z" />
|
||||||
|
<glyph unicode="S" d="M260 668q-47 0 -77.5 -30.5t-30.5 -77.5q0 -50 21.5 -82.5t71.5 -55.5q111 -49 153 -102.5t42 -139.5q0 -94 -51.5 -142t-148.5 -48q-91 0 -165 55v95q80 -78 170 -78q113 0 113 118q0 55 -26 91t-87 64q-94 42 -134.5 95.5t-40.5 129.5q0 80 51 130t134 50q53 0 87 -8 t78 -32v-90q-77 58 -160 58z" />
|
||||||
|
<glyph unicode="T" d="M209 0v660h-154v70h390v-70h-154v-660h-82z" />
|
||||||
|
<glyph unicode="U" d="M250 -10q-95 0 -142.5 48.5t-47.5 151.5v540h84v-520q0 -81 26.5 -114.5t81.5 -33.5t81.5 33.5t26.5 114.5v520h80v-540q0 -103 -47.5 -151.5t-142.5 -48.5z" />
|
||||||
|
<glyph unicode="V" d="M253 70l135 660h82l-170 -730h-100l-170 730h86l135 -660h2z" />
|
||||||
|
<glyph unicode="W" d="M153 120h2l54 510h90l54 -510h2l45 610h75l-60 -730h-109l-55 520h-2l-55 -520h-109l-60 730h83z" />
|
||||||
|
<glyph unicode="X" d="M251 440h2l112 290h83l-148 -355l150 -375h-90l-111 305h-2l-112 -305h-85l150 375l-148 355h88z" />
|
||||||
|
<glyph unicode="Y" d="M251 375h2l132 355h85l-179 -440v-290h-82v290l-179 440h90z" />
|
||||||
|
<glyph unicode="Z" d="M335 658v2h-260v70h350v-70l-260 -588v-2h260v-70h-350v70z" />
|
||||||
|
<glyph unicode="[" d="M390 710h-178v-790h178v-60h-250v910h250v-60z" />
|
||||||
|
<glyph unicode="\" d="M48 730h72l332 -770h-72z" />
|
||||||
|
<glyph unicode="]" d="M110 710v60h250v-910h-250v60h178v790h-178z" />
|
||||||
|
<glyph unicode="^" d="M251 680h-2l-147 -400h-72l170 450h100l170 -450h-72z" />
|
||||||
|
<glyph unicode="_" d="M50 -140v56h400v-56h-400z" />
|
||||||
|
<glyph unicode="`" d="M130 810h120l100 -280h-70z" />
|
||||||
|
<glyph unicode="a" d="M255 530q100 0 137.5 -40t37.5 -150v-340h-72l-2 75h-2q-47 -85 -149 -85q-65 0 -105 41.5t-40 113.5q0 91 61.5 140.5t183.5 49.5h48v25q0 57 -22 80t-76 23q-33 0 -84 -12t-86 -28v72q35 15 85 25t85 10zM353 275h-48q-170 0 -170 -125q0 -45 23 -69t62 -24q59 0 96 48 t37 135v35z" />
|
||||||
|
<glyph unicode="b" d="M144 445h2q43 85 134 85q175 0 175 -270q0 -135 -48 -202.5t-127 -67.5q-84 0 -137 85h-2l-2 -75h-74v730h79v-285zM376 260q0 195 -116 195q-51 0 -83.5 -49.5t-32.5 -140.5v-10q0 -91 32.5 -140.5t83.5 -49.5q53 0 84.5 48.5t31.5 146.5z" />
|
||||||
|
<glyph unicode="c" d="M70 260q0 134 55 202t155 68q61 0 125 -25v-80q-60 33 -120 33q-63 0 -98 -50t-35 -148q0 -101 37 -151t101 -50q59 0 120 36v-80q-64 -25 -125 -25q-102 0 -158.5 67.5t-56.5 202.5z" />
|
||||||
|
<glyph unicode="d" d="M356 730h79v-730h-74l-2 75h-2q-53 -85 -137 -85q-79 0 -127 67.5t-48 202.5q0 270 175 270q91 0 134 -85h2v285zM124 260q0 -98 31.5 -146.5t84.5 -48.5q51 0 83.5 49.5t32.5 140.5v10q0 91 -32.5 140.5t-83.5 49.5q-116 0 -116 -195z" />
|
||||||
|
<glyph unicode="e" d="M138 234q4 -93 38 -134t99 -41q61 0 135 36v-80q-74 -25 -140 -25q-215 0 -215 270q0 141 50 205.5t150 64.5q91 0 135.5 -62t44.5 -203q0 -11 -2 -31h-295zM138 300h218q-1 161 -101 161q-57 0 -85 -36t-32 -125z" />
|
||||||
|
<glyph unicode="f" d="M75 431v69h120v60q0 98 33 139t107 41q45 0 90 -15v-72q-38 18 -75 18q-47 0 -61.5 -23.5t-14.5 -107.5v-40h151v-69h-151v-431h-79v431h-120z" />
|
||||||
|
<glyph unicode="g" d="M50 260q0 270 175 270q83 0 137 -85h2l2 75h74v-515q0 -125 -50.5 -180t-154.5 -55q-71 0 -140 25v80q71 -36 140 -36q126 0 126 166v80h-2q-43 -85 -134 -85q-80 0 -127.5 66t-47.5 194zM129 260q0 -92 31.5 -138.5t84.5 -46.5q52 0 84 45.5t32 134.5v10 q0 91 -32.5 140.5t-83.5 49.5q-58 0 -87 -46.5t-29 -148.5z" />
|
||||||
|
<glyph unicode="h" d="M440 330v-330h-77v312q0 88 -20 117.5t-73 29.5q-50 0 -85.5 -56t-35.5 -151v-252h-79v730h79v-285h2q19 39 56.5 62t82.5 23q79 0 114.5 -45.5t35.5 -154.5z" />
|
||||||
|
<glyph unicode="i" d="M316 520v-452h109v-68h-330v68h139v384h-109v68h191zM214 640v120h102v-120h-102z" />
|
||||||
|
<glyph unicode="j" d="M249 -33v485h-119v68h201v-553q0 -65 -8.5 -101t-36.5 -59t-72 -30t-123 -7v68q40 0 63 1t42.5 6.5t28.5 12.5t15.5 23.5t7.5 34.5t1 51zM229 640v120h102v-120h-102z" />
|
||||||
|
<glyph unicode="k" d="M460 520l-230 -250l230 -270h-95l-206 253v-253h-79v730h79v-444l207 234h94z" />
|
||||||
|
<glyph unicode="l" d="M281 150q0 -66 10.5 -79t63.5 -13q33 0 75 6v-69q-47 -5 -85 -5q-90 0 -118 28.5t-28 121.5v522h-129v68h211v-580z" />
|
||||||
|
<glyph unicode="m" d="M290 0h-78v360q-1 58 -10.5 77.5t-32.5 19.5q-20 0 -35 -24t-25 -83.5t-10 -149.5v-200h-79v520h70l2 -70h2q17 38 42.5 59t53.5 21q31 0 50.5 -18.5t33.5 -61.5h2q39 80 104 80q53 0 76.5 -32.5t23.5 -117.5v-380h-77v360q-1 59 -11.5 78t-37.5 19q-64 0 -64 -197v-260z " />
|
||||||
|
<glyph unicode="n" d="M440 330v-330h-77v312q0 88 -20 117.5t-73 29.5q-50 0 -85.5 -56t-35.5 -151v-252h-79v520h74l2 -75h2q19 38 58 61.5t84 23.5q79 0 114.5 -45.5t35.5 -154.5z" />
|
||||||
|
<glyph unicode="o" d="M250 530q200 0 200 -270t-200 -270t-200 270t200 270zM250 59q61 0 89.5 45.5t28.5 155.5t-28.5 155.5t-89.5 45.5t-89.5 -45.5t-28.5 -155.5t28.5 -155.5t89.5 -45.5z" />
|
||||||
|
<glyph unicode="p" d="M141 75h-2v-295h-79v740h74l2 -75h2q54 85 137 85q175 0 175 -270q0 -135 -48 -202.5t-127 -67.5q-91 0 -134 85zM371 260q0 195 -116 195q-51 0 -83.5 -49.5t-32.5 -140.5v-10q0 -91 32.5 -140.5t83.5 -49.5q53 0 84.5 48.5t31.5 146.5z" />
|
||||||
|
<glyph unicode="q" d="M359 75q-43 -85 -134 -85q-79 0 -127 67.5t-48 202.5q0 270 175 270q83 0 137 -85h2l2 75h74v-740h-79v295h-2zM129 260q0 -98 31.5 -146.5t84.5 -48.5q51 0 83.5 49.5t32.5 140.5v10q0 91 -32.5 140.5t-83.5 49.5q-116 0 -116 -195z" />
|
||||||
|
<glyph unicode="r" d="M186 520v-100h2q62 110 172 110q37 0 70 -10v-70q-35 11 -70 11q-73 0 -122 -61t-49 -160v-240h-79v520h76z" />
|
||||||
|
<glyph unicode="s" d="M255 463q-96 0 -96 -73q0 -34 21 -54.5t75 -35.5q106 -30 140.5 -63t34.5 -102t-47 -107t-133 -38t-165 40v80q78 -53 155 -53q111 0 111 78q0 37 -21.5 57t-84.5 38q-92 26 -128.5 62t-36.5 98q0 66 43.5 103t126.5 37q84 0 160 -35v-75q-79 43 -155 43z" />
|
||||||
|
<glyph unicode="t" d="M244 500h181v-69h-181v-281q0 -56 16.5 -74.5t64.5 -18.5q50 0 90 18v-70q-48 -15 -100 -15q-84 0 -117 32.5t-33 117.5v291h-100v69h100v190h79v-190z" />
|
||||||
|
<glyph unicode="u" d="M65 180v340h77v-322q0 -83 18.5 -110t69.5 -27q49 0 82.5 55t33.5 152v252h79v-520h-74l-2 75h-2q-19 -40 -56 -62.5t-81 -22.5q-77 0 -111 43t-34 147z" />
|
||||||
|
<glyph unicode="v" d="M251 60h2l115 460h82l-145 -520h-110l-145 520h86z" />
|
||||||
|
<glyph unicode="w" d="M351 80h2l49 440h78l-80 -520h-99l-54 440h-2l-49 -440h-96l-80 520h82l49 -440h2l49 440h100z" />
|
||||||
|
<glyph unicode="x" d="M251 305h2l104 215h88l-145 -260l145 -260h-94l-102 215h-2l-102 -215h-90l145 260l-145 260h92z" />
|
||||||
|
<glyph unicode="y" d="M259 120h2l117 400h87l-240 -740h-83l78 230l-175 510h88z" />
|
||||||
|
<glyph unicode="z" d="M80 520h340v-69l-248 -380v-2h248v-69h-340v69l248 380v2h-248v69z" />
|
||||||
|
<glyph unicode="{" d="M195 316l4 -2q81 -38 81 -149v-135q0 -72 16.5 -91t78.5 -19h40v-60h-65q-73 0 -107.5 35.5t-34.5 114.5v150q0 66 -21.5 95.5t-66.5 29.5h-45v60h45q45 0 66.5 29.5t21.5 95.5v150q0 79 34.5 114.5t107.5 35.5h65v-60h-40q-62 0 -78.5 -19t-16.5 -91v-135q0 -61 -20 -95 t-65 -54z" />
|
||||||
|
<glyph unicode="|" d="M212 -220v1030h76v-1030h-76z" />
|
||||||
|
<glyph unicode="}" d="M305 316q-45 20 -65 54t-20 95v135q0 72 -16.5 91t-78.5 19h-40v60h65q73 0 107.5 -35.5t34.5 -114.5v-150q0 -66 21.5 -95.5t66.5 -29.5h45v-60h-45q-45 0 -66.5 -29.5t-21.5 -95.5v-150q0 -79 -34.5 -114.5t-107.5 -35.5h-65v60h40q62 0 78.5 19t16.5 91v135 q0 111 81 149z" />
|
||||||
|
<glyph unicode="~" d="M50 602v75q42 33 95 33q61 0 125 -48q48 -35 80 -35q25 0 47 10t53 39v-75q-42 -33 -95 -33q-61 0 -125 48q-47 35 -80 35q-25 0 -47 -10t-53 -39z" />
|
||||||
|
<glyph unicode=" " />
|
||||||
|
<glyph unicode="¥" d="M251 375h2l132 355h85l-153 -375h123v-65h-149v-85h149v-65h-149v-140h-82v140h-149v65h149v85h-149v65h123l-153 375h90z" />
|
||||||
|
<glyph unicode="­" d="M100 269v72h300v-72h-300z" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="407" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="815" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="407" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="815" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="271" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="203" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="135" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="135" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="101" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="163" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="45" />
|
||||||
|
<glyph unicode="‐" d="M100 269v72h300v-72h-300z" />
|
||||||
|
<glyph unicode="‑" d="M100 269v72h300v-72h-300z" />
|
||||||
|
<glyph unicode="–" d="M60 269v72h380v-72h-380z" />
|
||||||
|
<glyph unicode="—" d="M20 269v72h460v-72h-460z" />
|
||||||
|
<glyph unicode="‘" d="M275 500h-120l110 280h70z" />
|
||||||
|
<glyph unicode="’" d="M220 780h120l-110 -280h-70z" />
|
||||||
|
<glyph unicode="“" d="M340 500h-110l110 280h60zM190 500h-110l110 280h60z" />
|
||||||
|
<glyph unicode="”" d="M300 780h110l-110 -280h-60zM150 780h110l-110 -280h-60z" />
|
||||||
|
<glyph unicode="…" horiz-adv-x="1000" d="M102 288v150h130v-150h-130zM435 288v150h130v-150h-130zM768 288v150h130v-150h-130z" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="163" />
|
||||||
|
<glyph unicode=" " horiz-adv-x="203" />
|
||||||
|
<glyph unicode="™" horiz-adv-x="1000" d="M878 540h-2l-88 -340h-80l-88 340h-2v-540h-78v730h92l119 -450h2l119 450h88v-730h-82v540zM209 0v660h-154v70h390v-70h-154v-660h-82z" />
|
||||||
|
</font>
|
||||||
|
</defs></svg>
|
After Width: | Height: | Size: 17 KiB |
BIN
docs/css/fonts/mplus-1m-regular-webfont.ttf
Normal file
BIN
docs/css/fonts/mplus-1m-regular-webfont.woff
Normal file
217
docs/css/handheld.css
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
/*
|
||||||
|
* TABLE OF CONTENTS:
|
||||||
|
* - Browser reset
|
||||||
|
* - HTML elements
|
||||||
|
* - JsDoc styling
|
||||||
|
* - Media query check
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HTML ELEMENTS
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
padding: 1% 4% 1% 4%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HTML ELEMENTS
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BEGIN JSDOC
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Start menu */
|
||||||
|
div.index div.menu {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
-moz-border-radius-bottomleft: 15px;
|
||||||
|
-webkit-border-bottom-left-radius: 15px;
|
||||||
|
-border-bottom-left-radius: 15px;
|
||||||
|
padding: 4px 5px 8px 10px;
|
||||||
|
-moz-box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
-webkit-box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
background-color: rgba(255, 255, 255, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index input.classFilter {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.indexLinks a {
|
||||||
|
float: right;
|
||||||
|
clear: both;
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index *.heading1 {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index ul.classList {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.fineprint {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.indexStatic {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
/* End menu */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Start content */
|
||||||
|
div.content *.classTitle {
|
||||||
|
margin-right: 60px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content div.intro {
|
||||||
|
margin: 15px 0 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content p.description.summary {
|
||||||
|
margin-bottom: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content div.props {
|
||||||
|
margin: 1.5em -2% 0 -2%;
|
||||||
|
padding: 2%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable {
|
||||||
|
position: relative;
|
||||||
|
left: -10px;
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
box-sizing: content-box;
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
-webkit-box-sizing: content-box;
|
||||||
|
-ms-box-sizing: content-box;
|
||||||
|
-o-box-sizing: content-box;
|
||||||
|
-icab-box-sizing: content-box;
|
||||||
|
-khtml-box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
*.sectionTitle {
|
||||||
|
padding: 0 10px 10px 0;
|
||||||
|
}
|
||||||
|
caption.sectionTitle {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td,
|
||||||
|
table.summaryTable th {
|
||||||
|
padding: 0px 10px 10px 10px;
|
||||||
|
}
|
||||||
|
table.summaryTable tr:last-child td {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td.attributes {
|
||||||
|
width: 35%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td.nameDescription {
|
||||||
|
width: 65%
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dl.detailList {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList.nomargin + dl.detailList.nomargin {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList dt {
|
||||||
|
display: inline;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList dt:before {
|
||||||
|
display: block;
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList dd {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList.params dt {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
dl.detailList.params dd {
|
||||||
|
display: block;
|
||||||
|
padding-left: 2em;
|
||||||
|
padding-bottom: 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ul.fileList li {
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.fixedFont.heading {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.code {
|
||||||
|
margin: 10px 0 10px 0;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
-moz-border-radius: 2px;
|
||||||
|
-webkit-border-radius: 2px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
/* End content */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END JSDOC
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* START MEDIA QUERY CHECK
|
||||||
|
*/
|
||||||
|
|
||||||
|
.cssLoadCheck {
|
||||||
|
position: absolute;
|
||||||
|
top: -99999px;
|
||||||
|
left: -99999px;
|
||||||
|
border: 0;
|
||||||
|
width: 100px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END MEDIA QUERY CHECK
|
||||||
|
*/
|
||||||
|
|
297
docs/css/screen.css
Normal file
@ -0,0 +1,297 @@
|
|||||||
|
/*
|
||||||
|
* TABLE OF CONTENTS:
|
||||||
|
* - JsDoc styling
|
||||||
|
* - Media query check
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BEGIN JSDOC
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Start menu */
|
||||||
|
div.index {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
float: left;
|
||||||
|
width: 30%;
|
||||||
|
min-width: 100px;
|
||||||
|
max-width: 300px;
|
||||||
|
padding: 0 0 10px 0;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index *.heading1 {
|
||||||
|
padding: 8px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.menu {
|
||||||
|
margin: 0 15px 0 -15px;
|
||||||
|
-moz-border-radius-bottomright: 15px;
|
||||||
|
-webkit-border-bottom-right-radius: 15px;
|
||||||
|
-border-bottom-right-radius: 15px;
|
||||||
|
padding: 15px 15px 15px 30px;
|
||||||
|
-moz-box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
-webkit-box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.indexLinks {
|
||||||
|
margin-top: 13px;
|
||||||
|
position: absolute;
|
||||||
|
right: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.indexLinks a {
|
||||||
|
color: #999999;
|
||||||
|
text-transform: lowercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.indexLinks a:first-child {
|
||||||
|
margin-right: 3px;
|
||||||
|
border-right: 1px solid #999999;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index input.classFilter {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
width: 100%;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #CCCCCC #999999 #999999 #CCCCCC;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index ul.classList a {
|
||||||
|
line-height: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index ul.classList a + a {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.fineprint {
|
||||||
|
margin: 1em 0 0 15px;
|
||||||
|
color: #777;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index div.fineprint a {
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.indexStatic {
|
||||||
|
position: static;
|
||||||
|
min-height: 1em;
|
||||||
|
}
|
||||||
|
/* End menu */
|
||||||
|
|
||||||
|
|
||||||
|
/* Start content */
|
||||||
|
div.content {
|
||||||
|
float: left;
|
||||||
|
width: 70%;
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
|
div.innerContent {
|
||||||
|
padding: 0 0 0 2.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content ul,
|
||||||
|
div.content ol {
|
||||||
|
margin-bottom: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content ul.methodDetail {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content *.classTitle {
|
||||||
|
position: relative;
|
||||||
|
left: -10px;
|
||||||
|
margin: -30px 0 15px 0;
|
||||||
|
-moz-border-radius: 15px;
|
||||||
|
-webkit-border-radius: 15px;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 25px 15px 15px 15px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
background-color: rgba(255, 255, 255, 0.5);
|
||||||
|
-moz-box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
-webkit-box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
box-shadow: 0px 0px 10px #c4c4c4;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content div.intro {
|
||||||
|
margin: 15px 0 45px
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content p.summary {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content ul.summary {
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content ul *.classname a,
|
||||||
|
div.content ul *.filename a {
|
||||||
|
font-family: Consolas, "Courier New", Courier, monospace;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
div.content ul *.classname a:hover,
|
||||||
|
div.content ul *.filename a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content div.props {
|
||||||
|
position: relative;
|
||||||
|
left: -10px;
|
||||||
|
margin-bottom: 2.5em;
|
||||||
|
padding: 10px 15px 15px 15px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.content div.hr {
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
height: 4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
table.summaryTable {
|
||||||
|
position: relative;
|
||||||
|
left: -10px;
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
box-sizing: content-box;
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
-webkit-box-sizing: content-box;
|
||||||
|
-ms-box-sizing: content-box;
|
||||||
|
-o-box-sizing: content-box;
|
||||||
|
-icab-box-sizing: content-box;
|
||||||
|
-khtml-box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
*.sectionTitle {
|
||||||
|
padding: 0 10px 10px 0;
|
||||||
|
}
|
||||||
|
caption.sectionTitle {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td,
|
||||||
|
table.summaryTable th {
|
||||||
|
padding: 0px 10px 10px 10px;
|
||||||
|
}
|
||||||
|
table.summaryTable tr:last-child td {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td.attributes {
|
||||||
|
width: 35%;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.summaryTable td.nameDescription {
|
||||||
|
width: 65%
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dl.detailList {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList.nomargin + dl.detailList.nomargin {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList dt {
|
||||||
|
display: inline;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList dt:before {
|
||||||
|
display: block;
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList dd {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl.detailList.params dt {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
dl.detailList.params dd {
|
||||||
|
display: block;
|
||||||
|
padding-left: 2em;
|
||||||
|
padding-bottom: 0.4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ul.fileList li {
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.fixedFont.heading {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre.code {
|
||||||
|
margin: 10px 0 10px 0;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
-moz-border-radius: 2px;
|
||||||
|
-webkit-border-radius: 2px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
/* End content */
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END JSDOC
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* START MEDIA QUERY CHECK
|
||||||
|
*/
|
||||||
|
|
||||||
|
.cssLoadCheck {
|
||||||
|
position: absolute;
|
||||||
|
top: -99999px;
|
||||||
|
left: -99999px;
|
||||||
|
border: 0;
|
||||||
|
width: 100px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* END MEDIA QUERY CHECK
|
||||||
|
*/
|
||||||
|
|
440
docs/default.css
Normal file
@ -0,0 +1,440 @@
|
|||||||
|
/* --- Basic Layout -------------------------------------------------------- */
|
||||||
|
/* For IE for Windows \*/
|
||||||
|
* html{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
* html body{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
* html .fixed{
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.fixed {
|
||||||
|
position: fixed;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
/* */
|
||||||
|
/* --- Basic Layout -------------------------------------------------------- */
|
||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
background: #fafafa;
|
||||||
|
font: 100% Verdana, Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
border-left: 0.625em #356aa0 solid;
|
||||||
|
margin-left: 16.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index {
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 16.25em;
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
border-right: 0.625em solid #356aa0;
|
||||||
|
}
|
||||||
|
/* --- General layout ------------------------------------------------------ */
|
||||||
|
h1 {
|
||||||
|
margin: 0.625em 0 0.625em;
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1.classTitle {
|
||||||
|
color: #007b00;
|
||||||
|
font-size: 1.5em;
|
||||||
|
line-height:130%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1.25em;
|
||||||
|
color: #6277AA;
|
||||||
|
margin: 2em 0pt 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: 1.1em;
|
||||||
|
color: #6277AA;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 1em 0;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:link {
|
||||||
|
color: #001C58;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited {
|
||||||
|
color: #6277AA;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
border: none 0;
|
||||||
|
border-top: 0.0625em solid #7f8fb1;
|
||||||
|
height: 0.0625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invisible {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
line-height: 0.0625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
font: 0.8125em Verdana, Arial;
|
||||||
|
line-height: 0.9375em;
|
||||||
|
padding: 0.25em;
|
||||||
|
padding-left: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fineprint {
|
||||||
|
padding-top: 1.25em;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 0.625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.sectionTitle {
|
||||||
|
background-color: #356aa0;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0.125em 0.5em 0.125em 0.5em;
|
||||||
|
border: 0.0625em #7F8FB1 solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Index toggler ------------------------------------------------------- */
|
||||||
|
#index-toggler {
|
||||||
|
width: 1em;
|
||||||
|
top: 0.25em;
|
||||||
|
left: 16.25em;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: Arial;
|
||||||
|
font-size: 1em;
|
||||||
|
color: #fff;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
#index-close {
|
||||||
|
background: url(images/never_translate.png) no-repeat left;
|
||||||
|
height: 1em;
|
||||||
|
width: 1em;
|
||||||
|
float: left;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 0.0625em 0.25em;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
body.index-collapsed { background-position: 0; }
|
||||||
|
body.index-collapsed #main { margin-left: 0; }
|
||||||
|
body.index-collapsed #index { width: 0; }
|
||||||
|
body.index-collapsed #index-wrapper { display: none; }
|
||||||
|
body.index-collapsed #index-toggler { left: 0; }
|
||||||
|
|
||||||
|
/* --- Module Filter ------------------------------------------------------- */
|
||||||
|
.module-filter {
|
||||||
|
display: inline;
|
||||||
|
float: left;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 4em;
|
||||||
|
font-size: 0.8em;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 0.125em;
|
||||||
|
}
|
||||||
|
.module-filter, .module-filter a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #007B00 !important;
|
||||||
|
}
|
||||||
|
body.filter .sectionItem { display: none; }
|
||||||
|
body.filter .module-filter, body.filter .module-filter a { color: red !important; }
|
||||||
|
body.filter.module-core .module-core { display: block; }
|
||||||
|
body.filter.module-dom .module-dom { display: block; }
|
||||||
|
body.filter.module-css .module-css { display: block; }
|
||||||
|
body.filter.module-ajax .module-ajax { display: block; }
|
||||||
|
body.filter.module-event .module-event { display: block; }
|
||||||
|
|
||||||
|
/* --- Method Toggler ------------------------------------------------------ */
|
||||||
|
.method-toggler {
|
||||||
|
background: url(images/minus.gif) no-repeat left;
|
||||||
|
cursor: pointer;
|
||||||
|
float: left;
|
||||||
|
width: 0.875em;
|
||||||
|
height: 0.875em;
|
||||||
|
}
|
||||||
|
.method-toggler.toggled {
|
||||||
|
background: url(images/plus.gif) no-repeat left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Class Name and File Name Icons -------------------------------------- */
|
||||||
|
.itemName .icon, .itemName .icon a {
|
||||||
|
color: #007B00 !important;
|
||||||
|
}
|
||||||
|
.itemName .icon {
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 0 0 0.125em 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemName .icon {
|
||||||
|
background: url(images/class_obj.png) no-repeat left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemName.namespace .icon {
|
||||||
|
background-image: url(images/namespace_obj.png) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemName.namespace-function .icon {
|
||||||
|
background-image: url(images/namespace_function_obj.png) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fileName .icon {
|
||||||
|
background: url(images/file_obj.png) no-repeat left !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Class Method and Property Icons ------------------------------------- */
|
||||||
|
div.classMethod .icon {
|
||||||
|
padding-left: 1.275em;
|
||||||
|
background: url(images/method_public_obj.png) no-repeat left;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.classMethod .private {
|
||||||
|
background-image: url(images/method_private_obj.png) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.classProperty .icon {
|
||||||
|
padding-left: 1.275em;
|
||||||
|
background: url(images/field_public_obj.png) no-repeat left;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.classProperty .private {
|
||||||
|
background-image: url(images/field_private_obj.png) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* --- Headers ------------------------------------------------------------- */
|
||||||
|
.header {
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.4em;
|
||||||
|
height: 1.2em;
|
||||||
|
background: #356aa0;
|
||||||
|
padding: 0.15em 0.4375em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index .header {
|
||||||
|
padding: 0.5em 0 0 0;
|
||||||
|
height: 1.625em;
|
||||||
|
font-size: 1em;
|
||||||
|
background: #356aa0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Main/Index Shared Layouts ------------------------------------------- */
|
||||||
|
#content .section {
|
||||||
|
margin-top: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.classList {
|
||||||
|
padding: 0.625em;
|
||||||
|
font-family: arial, sans-serif;
|
||||||
|
font-size: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.sectionItem .signature {
|
||||||
|
color: #000;
|
||||||
|
margin-left: 0.250em;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.help, div.sectionItem .signature span {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Main layout --------------------------------------------------------- */
|
||||||
|
#main .full-description {
|
||||||
|
font-size: 0.9em;
|
||||||
|
line-height: 135%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main code {
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
html:not([lang*=""]) #main code {
|
||||||
|
font-size: 1.4em !important; /* Firefox hack */
|
||||||
|
}
|
||||||
|
|
||||||
|
#main p p, #main .full-description p, #main span a {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
padding: 0 1.25em 1.25em 1.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .sectionItem {
|
||||||
|
background: #fff;
|
||||||
|
padding-left: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .sectionItem .description {
|
||||||
|
font-size: 0.8em;
|
||||||
|
padding-left: 0.4375em;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .summary .sectionItems, #main .details .sectionItem {
|
||||||
|
border: 0.25em #8DA6C6 solid;
|
||||||
|
padding: 0.625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Summary layout ------------------------------------------------------ */
|
||||||
|
#main .summary {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .summary .sectionItems {
|
||||||
|
border-width: 0.125em 0.125em 0.250em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .summary .sectionItem {
|
||||||
|
padding: 0 0 0.3em 1.6em;
|
||||||
|
font-family: Verdana, Arial;
|
||||||
|
font-size: 0.875em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .summary .sectionItem b {
|
||||||
|
margin-left: -1.4286em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .summary .module-filter {
|
||||||
|
margin-left: -5.3571em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Details layout ------------------------------------------------------ */
|
||||||
|
#main .details .module-filter {
|
||||||
|
font-size: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .details .sectionItem {
|
||||||
|
border-width: 0.125em 0.125em 0.250em;
|
||||||
|
margin-bottom: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .details .itemTitle {
|
||||||
|
color: #001C58;
|
||||||
|
font-family: Verdana;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1em;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .details .itemTitle .light {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main .details .full-description {
|
||||||
|
padding: 0 0.625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.light, .light a:link, .light a:visited {
|
||||||
|
color: #777;
|
||||||
|
font-weight: normal;
|
||||||
|
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Details data -------------------------------------------------------- */
|
||||||
|
table.methodItem {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
table.methodItem p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
table.methodItem td {
|
||||||
|
padding: 0 0.1em 0.1em;
|
||||||
|
vertical-align: text-top;
|
||||||
|
}
|
||||||
|
table.methodItem .methodItemType {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
div.heading {
|
||||||
|
color: #6277AA;
|
||||||
|
font-size: 0.875em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0.625em 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Index Layout -------------------------------------------------------- */
|
||||||
|
#index-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-menu {
|
||||||
|
background: #8DA6C6;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0.125em 0 0.25em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-menu a:link, #index-menu a:visited {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-title {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-content {
|
||||||
|
background: #fff;
|
||||||
|
border: 0 #8DA6C6 solid;
|
||||||
|
border-width: 0 0 0.25em;
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index-content .signature {
|
||||||
|
font-size: 0.85em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#index .section {
|
||||||
|
padding-bottom: 0.625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Class index / File index layout ------------------------------------- */
|
||||||
|
* html #content.index-page {
|
||||||
|
width: 92%; /* IE only hack para evitar bug no layout */
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.index-page .sectionItem {
|
||||||
|
padding: 0.125em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.index-page .sectionItems {
|
||||||
|
border-top-width: 0.125em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content.index-page .summary {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- Hide private members ------------------------------------------------ */
|
||||||
|
/*
|
||||||
|
div.sectionItem.private {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
/**/
|
129
docs/files.html
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - File Index</title>
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<script type="text/javascript" src="jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="ui.js"></script>
|
||||||
|
<link rel=stylesheet href="default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="index.html">Class Index</a>
|
||||||
|
| <a href="files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="content" class="index-page">
|
||||||
|
|
||||||
|
<h1 class="classTitle">File Index</h1>
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="fileName itemName">
|
||||||
|
<span class="icon"><a href="symbols/src/kis-js_src_modules_ajax.js.html">ajax.js</a></span> <span class="full-description">../kis-js/src/modules/event.js</span>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fileName itemName">
|
||||||
|
<span class="icon"><a href="symbols/src/kis-js_src_modules_DOM.js.html">DOM.js</a></span> <span class="full-description">../kis-js/src/modules/event.js</span>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fileName itemName">
|
||||||
|
<span class="icon"><a href="symbols/src/kis-js_src_modules_event.js.html">event.js</a></span> <span class="full-description">../kis-js/src/modules/event.js</span>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fileName itemName">
|
||||||
|
<span class="icon"><a href="symbols/src/kis-js_src_modules_store.js.html">store.js</a></span> <span class="full-description">../kis-js/src/modules/event.js</span>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fileName itemName">
|
||||||
|
<span class="icon"><a href="symbols/src/kis-js_src_modules_util.js.html">util.js</a></span> <span class="full-description">../kis-js/src/modules/event.js</span>
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
|
||||||
|
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
BIN
docs/images/bg.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
docs/images/class_default_obj.png
Normal file
After Width: | Height: | Size: 609 B |
BIN
docs/images/class_obj.png
Normal file
After Width: | Height: | Size: 529 B |
BIN
docs/images/collapsebtn.gif
Normal file
After Width: | Height: | Size: 273 B |
BIN
docs/images/expandbtn.gif
Normal file
After Width: | Height: | Size: 274 B |
BIN
docs/images/field_private_obj.png
Normal file
After Width: | Height: | Size: 127 B |
BIN
docs/images/field_public_obj.png
Normal file
After Width: | Height: | Size: 155 B |
BIN
docs/images/file_obj.png
Normal file
After Width: | Height: | Size: 425 B |
BIN
docs/images/method_private_obj.png
Normal file
After Width: | Height: | Size: 197 B |
BIN
docs/images/method_public_obj.png
Normal file
After Width: | Height: | Size: 255 B |
BIN
docs/images/minus.gif
Normal file
After Width: | Height: | Size: 114 B |
BIN
docs/images/namespace_function_obj.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
docs/images/namespace_obj.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
docs/images/never_translate.png
Normal file
After Width: | Height: | Size: 207 B |
BIN
docs/images/plus.gif
Normal file
After Width: | Height: | Size: 118 B |
147
docs/index.html
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - Index</title>
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<script type="text/javascript" src="jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="ui.js"></script>
|
||||||
|
<script type="text/javascript" src="sh.js"></script>
|
||||||
|
<link rel=stylesheet href="sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="default.css" type="text/css">
|
||||||
|
<style>
|
||||||
|
.fixed { position: fixed; }
|
||||||
|
</style>
|
||||||
|
<!--[if lte IE 7]>
|
||||||
|
<style type="text/css">
|
||||||
|
.fixed {
|
||||||
|
position: absolute !important;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
height: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
overflow-y: hidden !important;
|
||||||
|
}
|
||||||
|
#main-wrapper {
|
||||||
|
position: relative !important;
|
||||||
|
overflow-y: scroll !important;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
height: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="index.html">Class Index</a>
|
||||||
|
| <a href="files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="content" class="index-page">
|
||||||
|
|
||||||
|
<h1 class="classTitle">Class Index</h1>
|
||||||
|
|
||||||
|
<div class="summary section"">
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="itemName namespace">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="itemName namespace">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="itemName namespace">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="itemName namespace">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="itemName namespace">
|
||||||
|
|
||||||
|
|
||||||
|
<span class="icon"><i><a href="symbols/_global_.html">_global_</a></i></span>
|
||||||
|
<div class="full-description">
|
||||||
|
<p>
|
||||||
|
Global namespace.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
326
docs/javascript/all.js
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
/**
|
||||||
|
* @fileOverview Contains standard code in the namespace 'wbos' and code specifically written for Codeview in the namespace 'codeview'
|
||||||
|
* @author Wouter Bos (www.thebrightlines.com)
|
||||||
|
* @since 1.0 - 2010-09-10
|
||||||
|
* @version 1.0 - 2010-09-10
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof(wbos) == "undefined") {
|
||||||
|
/**
|
||||||
|
* @namespace Standard code of Wouter Bos (wbos)
|
||||||
|
*/
|
||||||
|
wbos = {}
|
||||||
|
}
|
||||||
|
if (typeof(wbos.CssTools) == "undefined") {
|
||||||
|
/**
|
||||||
|
* @namespace Namespace for CSS-related functionality
|
||||||
|
*/
|
||||||
|
wbos.CssTools = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @namespace Fallback for CSS advanced media query
|
||||||
|
* @class
|
||||||
|
* @since 1.0 - 2010-09-10
|
||||||
|
* @version 1.0 - 2010-09-10
|
||||||
|
*/
|
||||||
|
wbos.CssTools.MediaQueryFallBack = ( function() {
|
||||||
|
var config = {
|
||||||
|
cssScreen: "/css/screen.css",
|
||||||
|
cssHandheld: "/css/handheld.css",
|
||||||
|
mobileMaxWidth: 660,
|
||||||
|
testDivClass: "cssLoadCheck",
|
||||||
|
dynamicCssLinkId: "DynCssLink",
|
||||||
|
resizeDelay: 30
|
||||||
|
}
|
||||||
|
var noMediaQuery = false;
|
||||||
|
var delay;
|
||||||
|
var currentCssMediaType;
|
||||||
|
|
||||||
|
// Adding events to elements in the DOM without overwriting it
|
||||||
|
function addEvent(element, newFunction, eventType) {
|
||||||
|
var oldEvent = eval("element." + eventType);
|
||||||
|
var eventContentType = eval("typeof element." + eventType)
|
||||||
|
|
||||||
|
if ( eventContentType != 'function' ) {
|
||||||
|
eval("element." + eventType + " = newFunction")
|
||||||
|
} else {
|
||||||
|
eval("element." + eventType + " = function(e) { oldEvent(e); newFunction(e); }")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the the inner width of the browser window
|
||||||
|
function getWindowWidth() {
|
||||||
|
if (window.innerWidth) {
|
||||||
|
return window.innerWidth;
|
||||||
|
} else if (document.documentElement.clientWidth) {
|
||||||
|
return document.documentElement.clientWidth;
|
||||||
|
} else if (document.body.clientWidth) {
|
||||||
|
return document.body.clientWidth;
|
||||||
|
} else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addCssLink(cssHref) {
|
||||||
|
var cssNode = document.createElement('link');
|
||||||
|
var windowWidth;
|
||||||
|
cssNode.type = 'text/css';
|
||||||
|
cssNode.rel = 'stylesheet';
|
||||||
|
cssNode.media = 'screen, handheld, fallback';
|
||||||
|
cssNode.href = cssHref;
|
||||||
|
document.getElementsByTagName("head")[0].appendChild(cssNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Start public */
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Adds link to CSS in the head if no CSS is loaded
|
||||||
|
*
|
||||||
|
* @since 1.0 - 2010-08-21
|
||||||
|
* @version 1.0 - 2010-08-21
|
||||||
|
* @param {String|Object} cssScreen URL to CSS file for larger screens
|
||||||
|
* @param {String|Object} cssHandheld URL to CSS file for smaller screens
|
||||||
|
* @param {Number} mobileMaxWidth Maximum width for handheld devices
|
||||||
|
* @example
|
||||||
|
* wbos.CssTools.MediaQueryFallBack.LoadCss(['screen.css', 'screen2.css'], 'mobile.css', 480)
|
||||||
|
*/
|
||||||
|
LoadCss: function(cssScreen, cssHandheld, mobileMaxWidth) {
|
||||||
|
// Set config values
|
||||||
|
if (typeof(cssScreen) != "undefined") {
|
||||||
|
config.cssScreen = cssScreen;
|
||||||
|
}
|
||||||
|
if (typeof(cssHandheld) != "undefined") {
|
||||||
|
config.cssHandheld = cssHandheld;
|
||||||
|
}
|
||||||
|
if (typeof(mobileMaxWidth) != "undefined") {
|
||||||
|
config.mobileMaxWidth = mobileMaxWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if CSS is loaded
|
||||||
|
var cssloadCheckNode = document.createElement('div');
|
||||||
|
cssloadCheckNode.className = config.testDivClass;
|
||||||
|
document.getElementsByTagName("body")[0].appendChild(cssloadCheckNode);
|
||||||
|
if (cssloadCheckNode.offsetWidth != 100 && noMediaQuery == false) {
|
||||||
|
noMediaQuery = true;
|
||||||
|
}
|
||||||
|
cssloadCheckNode.parentNode.removeChild(cssloadCheckNode)
|
||||||
|
|
||||||
|
if (noMediaQuery == true) {
|
||||||
|
// Browser does not support Media Queries, so JavaScript will supply a fallback
|
||||||
|
var cssHref = "";
|
||||||
|
|
||||||
|
// Determines what CSS file to load
|
||||||
|
if (getWindowWidth() <= config.mobileMaxWidth) {
|
||||||
|
cssHref = config.cssHandheld;
|
||||||
|
newCssMediaType = "handheld";
|
||||||
|
} else {
|
||||||
|
cssHref = config.cssScreen;
|
||||||
|
newCssMediaType = "screen";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add CSS link to <head> of page
|
||||||
|
if (cssHref != "" && currentCssMediaType != newCssMediaType) {
|
||||||
|
var currentCssLinks = document.styleSheets
|
||||||
|
for (var i = 0; i < currentCssLinks.length; i++) {
|
||||||
|
for (var ii = 0; ii < currentCssLinks[i].media.length; ii++) {
|
||||||
|
if (typeof(currentCssLinks[i].media) == "object") {
|
||||||
|
if (currentCssLinks[i].media.item(ii) == "fallback") {
|
||||||
|
currentCssLinks[i].ownerNode.parentNode.removeChild(currentCssLinks[i].ownerNode)
|
||||||
|
i--
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (currentCssLinks[i].media.indexOf("fallback") >= 0) {
|
||||||
|
currentCssLinks[i].owningElement.parentNode.removeChild(currentCssLinks[i].owningElement)
|
||||||
|
i--
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof(cssHref) == "object") {
|
||||||
|
for (var i = 0; i < cssHref.length; i++) {
|
||||||
|
addCssLink(cssHref[i])
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
addCssLink(cssHref)
|
||||||
|
}
|
||||||
|
|
||||||
|
currentCssMediaType = newCssMediaType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Check screen size again if user resizes window
|
||||||
|
addEvent(window, wbos.CssTools.MediaQueryFallBack.LoadCssDelayed, 'onresize')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs LoadCSS after a short delay
|
||||||
|
*
|
||||||
|
* @since 1.0 - 2010-08-21
|
||||||
|
* @version 1.0 - 2010-08-21
|
||||||
|
* @example
|
||||||
|
* wbos.CssTools.MediaQueryFallBack.LoadCssDelayed()
|
||||||
|
*/
|
||||||
|
LoadCssDelayed: function() {
|
||||||
|
clearTimeout(delay);
|
||||||
|
delay = setTimeout( "wbos.CssTools.MediaQueryFallBack.LoadCss()", config.resizeDelay)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/* End public */
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @namespace Adds a function to an event of a single element. Use this if
|
||||||
|
* you don't want to use jQuery
|
||||||
|
* @class
|
||||||
|
* @since 1.0 - 2010-02-23
|
||||||
|
* @version 1.0 - 2010-02-23
|
||||||
|
*/
|
||||||
|
wbos.Events = ( function() {
|
||||||
|
/* Start public */
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Adds a function to an event of a single element
|
||||||
|
*
|
||||||
|
* @since 1.0 - 2010-02-23
|
||||||
|
* @version 1.0 - 2010-02-23
|
||||||
|
* @param {Object} element The element on which the event is placed
|
||||||
|
* @param {Function} newFunction The function that has to be linked to the event
|
||||||
|
* @param {String} eventType Name of the event
|
||||||
|
* @example
|
||||||
|
* wbos.Events.AddEvent( document.getElementById('elementId'), functionName, "onclick" )
|
||||||
|
*/
|
||||||
|
AddEvent: function( element, newFunction, eventType ) {
|
||||||
|
var oldEvent = eval("element." + eventType);
|
||||||
|
var eventContentType = eval("typeof element." + eventType)
|
||||||
|
|
||||||
|
if ( eventContentType != 'function' ) {
|
||||||
|
eval("element." + eventType + " = newFunction")
|
||||||
|
} else {
|
||||||
|
eval("element." + eventType + " = function(e) { oldEvent(e); newFunction(e); }")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* End public */
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof(codeview) == "undefined") {
|
||||||
|
/**
|
||||||
|
* @namespace Code written for the Codeview template
|
||||||
|
*/
|
||||||
|
codeview = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @namespace Enables filtering in class lists
|
||||||
|
* @class
|
||||||
|
* @since 1.0 - 2010-11-08
|
||||||
|
* @version 1.0 - 2010-11-08
|
||||||
|
*/
|
||||||
|
codeview.classFilter = ( function() {
|
||||||
|
function onkeyup_ClassFilter() {
|
||||||
|
var listItems
|
||||||
|
var search = document.getElementById('ClassFilter').value
|
||||||
|
search = search.toLowerCase()
|
||||||
|
if (document.getElementById('ClassList')) {
|
||||||
|
listItems = document.getElementById('ClassList').getElementsByTagName('li')
|
||||||
|
filterList(listItems, search)
|
||||||
|
}
|
||||||
|
if (document.getElementById('ClassList2')) {
|
||||||
|
listItems = document.getElementById('ClassList2').getElementsByTagName('li')
|
||||||
|
filterList(listItems, search)
|
||||||
|
}
|
||||||
|
if (document.getElementById('FileList')) {
|
||||||
|
listItems = document.getElementById('FileList').getElementsByTagName('li')
|
||||||
|
filterList(listItems, search)
|
||||||
|
}
|
||||||
|
if (document.getElementById('MethodsListInherited')) {
|
||||||
|
var links = document.getElementById('MethodsListInherited').getElementsByTagName('a')
|
||||||
|
var linksSelected = new Array()
|
||||||
|
for (var i=0; i < links.length; i++) {
|
||||||
|
if (links[i].parentNode.parentNode.tagName == "DD") {
|
||||||
|
linksSelected.push(links[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filterList(linksSelected, search)
|
||||||
|
}
|
||||||
|
if (document.getElementById('MethodsList')) {
|
||||||
|
listItems = document.getElementById('MethodsList').getElementsByTagName('tbody')[0].getElementsByTagName('tr')
|
||||||
|
filterList(listItems, search, document.getElementById('MethodDetail').getElementsByTagName('li'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterList(listItems, search, relatedElements) {
|
||||||
|
var itemContent = ""
|
||||||
|
for (var i=0; i < listItems.length; i++) {
|
||||||
|
itemContent = listItems[i].textContent||listItems[i].innerText
|
||||||
|
if (itemContent != undefined) {
|
||||||
|
itemContent = itemContent.toLowerCase()
|
||||||
|
itemContent = itemContent.replace(/\s/g, "")
|
||||||
|
if (itemContent.indexOf(search) >= 0 || itemContent == "") {
|
||||||
|
listItems[i].style.display = ""
|
||||||
|
} else {
|
||||||
|
listItems[i].style.display = "none"
|
||||||
|
}
|
||||||
|
if (relatedElements != null) {
|
||||||
|
filterRelatedList(listItems[i], search, relatedElements)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterRelatedList(listItem, search, relatedElements) {
|
||||||
|
var itemIndex = parseInt(listItem.className.replace('item', ''))
|
||||||
|
if (itemIndex <= relatedElements.length) {
|
||||||
|
if (relatedElements[itemIndex].className == "item"+ itemIndex) {
|
||||||
|
relatedElements[itemIndex].style.display = listItem.style.display
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Start public */
|
||||||
|
return {
|
||||||
|
Init: function() {
|
||||||
|
wbos.Events.AddEvent(
|
||||||
|
document.getElementById('ClassFilter'),
|
||||||
|
onkeyup_ClassFilter,
|
||||||
|
"onkeyup"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* End public */
|
||||||
|
})();
|
6
docs/javascript/html5.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// html5shiv MIT @rem remysharp.com/html5-enabling-script
|
||||||
|
// iepp v1.6.2 MIT @jon_neal iecss.com/print-protector
|
||||||
|
/*@cc_on(function(m,c){var z="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video";function n(d){for(var a=-1;++a<o;)d.createElement(i[a])}function p(d,a){for(var e=-1,b=d.length,j,q=[];++e<b;){j=d[e];if((a=j.media||a)!="screen")q.push(p(j.imports,a),j.cssText)}return q.join("")}var g=c.createElement("div");g.innerHTML="<z>i</z>";if(g.childNodes.length!==1){var i=z.split("|"),o=i.length,s=RegExp("(^|\\s)("+z+")",
|
||||||
|
"gi"),t=RegExp("<(/*)("+z+")","gi"),u=RegExp("(^|[^\\n]*?\\s)("+z+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),r=c.createDocumentFragment(),k=c.documentElement;g=k.firstChild;var h=c.createElement("body"),l=c.createElement("style"),f;n(c);n(r);g.insertBefore(l,
|
||||||
|
g.firstChild);l.media="print";m.attachEvent("onbeforeprint",function(){var d=-1,a=p(c.styleSheets,"all"),e=[],b;for(f=f||c.body;(b=u.exec(a))!=null;)e.push((b[1]+b[2]+b[3]).replace(s,"$1.iepp_$2")+b[4]);for(l.styleSheet.cssText=e.join("\n");++d<o;){a=c.getElementsByTagName(i[d]);e=a.length;for(b=-1;++b<e;)if(a[b].className.indexOf("iepp_")<0)a[b].className+=" iepp_"+i[d]}r.appendChild(f);k.appendChild(h);h.className=f.className;h.innerHTML=f.innerHTML.replace(t,"<$1font")});m.attachEvent("onafterprint",
|
||||||
|
function(){h.innerHTML="";k.removeChild(h);k.appendChild(f);l.styleSheet.cssText=""})}})(this,document);@*/
|
1
docs/jproton.js
Normal file
182
docs/sh.css
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
.dp-highlighter
|
||||||
|
{
|
||||||
|
font-family: "Consolas", "Courier New", Courier, mono, serif;
|
||||||
|
background-color: #E7E5DC;
|
||||||
|
margin: 1.5em 0 !important;
|
||||||
|
padding: 1px; /* adds a little border on top when controls are hidden */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clear styles */
|
||||||
|
.dp-highlighter ol,
|
||||||
|
.dp-highlighter ol li,
|
||||||
|
.dp-highlighter ol li span
|
||||||
|
{
|
||||||
|
line-height: 1.25em;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter a,
|
||||||
|
.dp-highlighter a:hover
|
||||||
|
{
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter .bar
|
||||||
|
{
|
||||||
|
padding-left: 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.collapsed .bar,
|
||||||
|
.dp-highlighter.nogutter .bar
|
||||||
|
{
|
||||||
|
padding-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter ol
|
||||||
|
{
|
||||||
|
list-style: decimal; /* for ie */
|
||||||
|
background-color: #fff;
|
||||||
|
margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
|
||||||
|
padding: 0px;
|
||||||
|
color: #5C5C5C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.nogutter ol,
|
||||||
|
.dp-highlighter.nogutter ol li
|
||||||
|
{
|
||||||
|
list-style: none !important;
|
||||||
|
margin-left: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter ol li,
|
||||||
|
.dp-highlighter .columns div
|
||||||
|
{
|
||||||
|
list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
|
||||||
|
list-style-position: outside !important;
|
||||||
|
border-left: 3px solid #6CE26C;
|
||||||
|
background-color: #fafafa;
|
||||||
|
color: #5C5C5C;
|
||||||
|
padding: 0 3px 0 10px !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.nogutter ol li,
|
||||||
|
.dp-highlighter.nogutter .columns div
|
||||||
|
{
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter .columns
|
||||||
|
{
|
||||||
|
background-color: #fafafa;
|
||||||
|
color: gray;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter .columns div
|
||||||
|
{
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter ol li.alt
|
||||||
|
{
|
||||||
|
background-color: #FFF;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter ol li span
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Adjust some properties when collapsed */
|
||||||
|
|
||||||
|
.dp-highlighter.collapsed ol
|
||||||
|
{
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.collapsed ol li
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Additional modifications when in print-view */
|
||||||
|
|
||||||
|
.dp-highlighter.printing
|
||||||
|
{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.printing .tools
|
||||||
|
{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.printing li
|
||||||
|
{
|
||||||
|
display: list-item !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Styles for the tools */
|
||||||
|
|
||||||
|
.dp-highlighter .tools
|
||||||
|
{
|
||||||
|
padding: 3px 8px 3px 10px;
|
||||||
|
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||||
|
color: silver;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
border-left: 3px solid #6CE26C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.nogutter .tools
|
||||||
|
{
|
||||||
|
border-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter.collapsed .tools
|
||||||
|
{
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter .tools a
|
||||||
|
{
|
||||||
|
font-size: 9px;
|
||||||
|
color: #a0a0a0;
|
||||||
|
background-color: inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp-highlighter .tools a:hover
|
||||||
|
{
|
||||||
|
color: red;
|
||||||
|
background-color: inherit;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* About dialog styles */
|
||||||
|
|
||||||
|
.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
|
||||||
|
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
|
||||||
|
.dp-about td { padding: 10px; vertical-align: top; }
|
||||||
|
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
|
||||||
|
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
|
||||||
|
.dp-about .para { margin: 0 0 4px 0; }
|
||||||
|
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
|
||||||
|
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
|
||||||
|
|
||||||
|
/* Language specific styles */
|
||||||
|
|
||||||
|
.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
|
||||||
|
.dp-highlighter .string { color: #00d; background-color: inherit; }
|
||||||
|
.dp-highlighter .keyword { color: #6277AA; font-weight: bold; background-color: inherit; }
|
||||||
|
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
|
1
docs/sh.js
Normal file
469
docs/symbols/$_.dom.html
Normal file
@ -0,0 +1,469 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - $_.dom</title>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="../ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../sh.js"></script>
|
||||||
|
<link rel=stylesheet href="../sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="../default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<!-- ============================== classes index ============================ -->
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="../index.html">Class Index</a>
|
||||||
|
| <a href="../files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="../symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="../symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<!-- ============================== header ================================= -->
|
||||||
|
<!-- begin static/header.html -->
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end static/header.html -->
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<!-- ============================== class title ============================ -->
|
||||||
|
<h1 class="classTitle">
|
||||||
|
Namespace $_.dom
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<!-- ============================== class summary ========================== -->
|
||||||
|
<!--
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="full-description">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_DOM.js.html">DOM.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor summary ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== properties summary ===================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== methods summary ======================== -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionTitle">Method Summary</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<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>
|
||||||
|
<span class='description'>Adds a class to the element(s) specified by the current selector</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<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>
|
||||||
|
<span class='description'>Removes a class from the element(s) specified by the current selector</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<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>
|
||||||
|
<span class='description'>Hides the element(s) specified by the current selector</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<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>
|
||||||
|
<span class='description'>Shows the element(s) specified by the current selector.</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor details ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== field details ========================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== method details ========================= -->
|
||||||
|
|
||||||
|
<div class="details section">
|
||||||
|
<div class="sectionTitle">
|
||||||
|
Method Detail
|
||||||
|
</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".addClass"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.dom.addClass<span class="signature">(<span title="class">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Adds a class to the element(s) specified by the current
|
||||||
|
selector
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
class
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".removeClass"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.dom.removeClass<span class="signature">(<span title="class">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Removes a class from the element(s) specified by the current
|
||||||
|
selector
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
class
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".hide"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.dom.hide<span class="signature">()</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Hides the element(s) specified by the current selector
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".show"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.dom.show<span class="signature">(<span title="type">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Shows the element(s) specified by the current selector.
|
||||||
|
if type is specified, the element will have it's style
|
||||||
|
property set to "display:[your type]". If type is not
|
||||||
|
specified, the element is set to "display:block".
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
type
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".attr"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.dom.attr<span class="signature">(<span title="name">string</span>, <span title="value">string</span>)</span>
|
||||||
|
<span class="light" title="returns string">: string</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
name
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ============================== footer ================================= -->
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
461
docs/symbols/$_.event.html
Normal file
@ -0,0 +1,461 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - $_.event</title>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="../ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../sh.js"></script>
|
||||||
|
<link rel=stylesheet href="../sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="../default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<!-- ============================== classes index ============================ -->
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="../index.html">Class Index</a>
|
||||||
|
| <a href="../files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="../symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="../symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<!-- ============================== header ================================= -->
|
||||||
|
<!-- begin static/header.html -->
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end static/header.html -->
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<!-- ============================== class title ============================ -->
|
||||||
|
<h1 class="classTitle">
|
||||||
|
Namespace $_.event
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<!-- ============================== class summary ========================== -->
|
||||||
|
<!--
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="full-description">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_event.js.html">event.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor summary ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== properties summary ===================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== methods summary ======================== -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionTitle">Method Summary</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Adds an event that returns a callback when triggered on the selected event and selector"><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span>
|
||||||
|
<span class='description'>Adds an event that returns a callback when triggered on the selected event and selector</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Removes an event bound the the specified selector, event type, and callback"><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span>
|
||||||
|
<span class='description'>Removes an event bound the the specified selector, event type, and callback</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Binds a persistent, delegated event"><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span>
|
||||||
|
<span class='description'>Binds a persistent, delegated event</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Binds an event to a parent object"><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span>
|
||||||
|
<span class='description'>Binds an event to a parent object</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor details ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== field details ========================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== method details ========================= -->
|
||||||
|
|
||||||
|
<div class="details section">
|
||||||
|
<div class="sectionTitle">
|
||||||
|
Method Detail
|
||||||
|
</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".add"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.event.add<span class="signature">(<span title="event">string</span>, <span title="callback">function</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Adds an event that returns a callback when triggered on the selected
|
||||||
|
event and selector
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint">Eg. $_("#selector").event.add("click", do_something());</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">
|
||||||
|
event
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>function</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
callback
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".remove"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.event.remove<span class="signature">(<span title="event">string</span>, <span title="callback">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Removes an event bound the the specified selector, event type, and callback
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint">Eg. $_("#selector").event.remove("click", do_something());</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">
|
||||||
|
event
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
callback
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".live"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.event.live<span class="signature">(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Binds a persistent, delegated event
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint">Eg. $_.event.live(".button", "click", do_something());</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">
|
||||||
|
target
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
event
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>function</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
callback
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".delegate"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.event.delegate<span class="signature">(<span title="target">string</span>, <span title="event_type">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Binds an event to a parent object
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint">Eg. $_("#parent").delegate(".button", "click", do_something());</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">
|
||||||
|
target
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
event_type
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ============================== footer ================================= -->
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
775
docs/symbols/$_.html
Normal file
@ -0,0 +1,775 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - $_</title>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="../ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../sh.js"></script>
|
||||||
|
<link rel=stylesheet href="../sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="../default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<!-- ============================== classes index ============================ -->
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="../index.html">Class Index</a>
|
||||||
|
| <a href="../files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='$_ Constructor function' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.html">$_</a></span></div><div class='sectionItems'><div class='sectionItem classProperty'><b class='icon' title='DOM Dom manipulation module'><a href="../symbols/%24_.dom.html">dom</a></b></div><div class='sectionItem classProperty'><b class='icon' title='Wrapper for localstorage data serialization'><a href="../symbols/%24_.store.html">store</a></b></div><div class='sectionItem classProperty'><b class='icon' title='String and object manipulation utilities'><a href="../symbols/%24_.util.html">util</a></b></div><div class='sectionItem classProperty'><b class='icon' title=''><a href="../symbols/%24_.event.html">event</a></b></div><div class='sectionItem classMethod'><b class='icon' title='$ Simple DOM selector function'><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Adds the property `obj` to the $_ object, calling it `name`'><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Iterates over a $_ object, applying a callback to each item'><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the type of the passed variable'><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a GET type ajax request'><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sends a POST type ajax request'><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="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="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<!-- ============================== header ================================= -->
|
||||||
|
<!-- begin static/header.html -->
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end static/header.html -->
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<!-- ============================== class title ============================ -->
|
||||||
|
<h1 class="classTitle">
|
||||||
|
Namespace $_
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<!-- ============================== class summary ========================== -->
|
||||||
|
<!--
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="full-description">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_core_core.js.html">core.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor summary ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== properties summary ===================== -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionTitle">Field Summary</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="sectionItem classProperty">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="DOM Dom manipulation module"><a href="../symbols/%24_.dom.html">dom</a></b>
|
||||||
|
<span class='description'>DOM Dom manipulation module</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classProperty">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Wrapper for localstorage data serialization"><a href="../symbols/%24_.store.html">store</a></b>
|
||||||
|
<span class='description'>Wrapper for localstorage data serialization</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classProperty">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="String and object manipulation utilities"><a href="../symbols/%24_.util.html">util</a></b>
|
||||||
|
<span class='description'>String and object manipulation utilities</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classProperty">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title=""><a href="../symbols/%24_.event.html">event</a></b>
|
||||||
|
<span class='description'></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== methods summary ======================== -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionTitle">Method Summary</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="$ Simple DOM selector function"><a href="../symbols/%24_.html#.$">$</a></b><span class='signature'>(<span title="selector">string</span>, <span title="context">string</span>)</span>
|
||||||
|
<span class='description'>$ Simple DOM selector function</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Adds the property `obj` to the $_ object, calling it `name`"><a href="../symbols/%24_.html#.ext">ext</a></b><span class='signature'>(<span title="name">string</span>, <span title="obj">object</span>)</span>
|
||||||
|
<span class='description'>Adds the property `obj` to the $_ object, calling it `name`</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Iterates over a $_ object, applying a callback to each item"><a href="../symbols/%24_.html#.each">each</a></b><span class='signature'>(<span title="callback">function</span>)</span>
|
||||||
|
<span class='description'>Iterates over a $_ object, applying a callback to each item</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Retrieves the type of the passed variable"><a href="../symbols/%24_.html#.type">type</a></b><span class='signature'>(<span title="obj">mixed</span>)</span>
|
||||||
|
<span class='description'>Retrieves the type of the passed variable</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Sends a GET type ajax request"><a href="../symbols/%24_.html#.get">get</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span>
|
||||||
|
<span class='description'>Sends a GET type ajax request</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Sends a POST type ajax request"><a href="../symbols/%24_.html#.post">post</a></b><span class='signature'>(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span>
|
||||||
|
<span class='description'>Sends a POST type ajax request</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor details ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== field details ========================== -->
|
||||||
|
|
||||||
|
<div class="section details">
|
||||||
|
<div class="sectionTitle">
|
||||||
|
Field Detail
|
||||||
|
</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class='sectionItem classProperty'>
|
||||||
|
<a name=".dom"> </a>
|
||||||
|
<div class="itemTitle signature icon">
|
||||||
|
$_.<b>dom</b>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full-description">
|
||||||
|
DOM
|
||||||
|
|
||||||
|
Dom manipulation module
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='sectionItem classProperty'>
|
||||||
|
<a name=".store"> </a>
|
||||||
|
<div class="itemTitle signature icon">
|
||||||
|
$_.<b>store</b>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full-description">
|
||||||
|
Wrapper for localstorage data serialization
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_store.js.html">store.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='sectionItem classProperty'>
|
||||||
|
<a name=".util"> </a>
|
||||||
|
<div class="itemTitle signature icon">
|
||||||
|
$_.<b>util</b>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full-description">
|
||||||
|
String and object manipulation utilities
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_util.js.html">util.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='sectionItem classProperty'>
|
||||||
|
<a name=".event"> </a>
|
||||||
|
<div class="itemTitle signature icon">
|
||||||
|
$_.<b>event</b>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="full-description">
|
||||||
|
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_event.js.html">event.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== method details ========================= -->
|
||||||
|
|
||||||
|
<div class="details section">
|
||||||
|
<div class="sectionTitle">
|
||||||
|
Method Detail
|
||||||
|
</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".$"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.$<span class="signature">(<span title="selector">string</span>, <span title="context">string</span>)</span>
|
||||||
|
<span class="light" title="returns object">: object</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
$
|
||||||
|
|
||||||
|
Simple DOM selector function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
selector
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
context
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
object
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".ext"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.ext<span class="signature">(<span title="name">string</span>, <span title="obj">object</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Adds the property `obj` to the $_ object, calling it `name`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
name
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
obj
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".each"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.each<span class="signature">(<span title="callback">function</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Iterates over a $_ object, applying a callback to each item
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>function</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
callback
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".type"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.type<span class="signature">(<span title="obj">mixed</span>)</span>
|
||||||
|
<span class="light" title="returns string">: string</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Retrieves the type of the passed variable
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>mixed</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
obj
|
||||||
|
</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=".get"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.get<span class="signature">(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Sends a GET type ajax request
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_ajax.js.html">ajax.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">
|
||||||
|
url
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
data
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>function</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
callback
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".post"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.post<span class="signature">(<span title="url">string</span>, <span title="data">object</span>, <span title="callback">function</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Sends a POST type ajax request
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_ajax.js.html">ajax.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">
|
||||||
|
url
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
data
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>function</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
callback
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ============================== footer ================================= -->
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:50:02 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
348
docs/symbols/$_.store.html
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - $_.store</title>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="../ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../sh.js"></script>
|
||||||
|
<link rel=stylesheet href="../sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="../default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<!-- ============================== classes index ============================ -->
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="../index.html">Class Index</a>
|
||||||
|
| <a href="../files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="../symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="../symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<!-- ============================== header ================================= -->
|
||||||
|
<!-- begin static/header.html -->
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end static/header.html -->
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<!-- ============================== class title ============================ -->
|
||||||
|
<h1 class="classTitle">
|
||||||
|
Namespace $_.store
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<!-- ============================== class summary ========================== -->
|
||||||
|
<!--
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="full-description">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_store.js.html">store.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor summary ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== properties summary ===================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== methods summary ======================== -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionTitle">Method Summary</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Retrieves and deserializes a value from localstorage, based on the specified key"><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span>
|
||||||
|
<span class='description'>Retrieves and deserializes a value from localstorage, based on the specified key</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string"><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span>
|
||||||
|
<span class='description'>Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Removes the specified item from localstorage"><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span>
|
||||||
|
<span class='description'>Removes the specified item from localstorage</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor details ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== field details ========================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== method details ========================= -->
|
||||||
|
|
||||||
|
<div class="details section">
|
||||||
|
<div class="sectionTitle">
|
||||||
|
Method Detail
|
||||||
|
</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".get"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.store.get<span class="signature">(<span title="key">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Retrieves and deserializes a value from localstorage,
|
||||||
|
based on the specified key
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
key
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
object
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".set"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.store.set<span class="signature">(<span title="key">string</span>, <span title="value">mixed</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Puts a value into localstorage at the specified key,
|
||||||
|
and JSON-encodes the value if not a string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
key
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>mixed</b>
|
||||||
|
</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">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".remove"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.store.remove<span class="signature">(<span title="key">string</span>)</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Removes the specified item from localstorage
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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">
|
||||||
|
key
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
void
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ============================== footer ================================= -->
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
668
docs/symbols/$_.util.html
Normal file
@ -0,0 +1,668 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - $_.util</title>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="../ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../sh.js"></script>
|
||||||
|
<link rel=stylesheet href="../sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="../default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<!-- ============================== classes index ============================ -->
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="../index.html">Class Index</a>
|
||||||
|
| <a href="../files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="../symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="../symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<!-- ============================== header ================================= -->
|
||||||
|
<!-- begin static/header.html -->
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end static/header.html -->
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<!-- ============================== class title ============================ -->
|
||||||
|
<h1 class="classTitle">
|
||||||
|
Namespace $_.util
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<!-- ============================== class summary ========================== -->
|
||||||
|
<!--
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="full-description">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_util.js.html">util.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor summary ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== properties summary ===================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== methods summary ======================== -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="summary section">
|
||||||
|
<div class="sectionTitle">Method Summary</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </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>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Retrieve the keys, or member names of an object"><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span>
|
||||||
|
<span class='description'>Retrieve the keys, or member names of an object</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Retrieves the values of an object, and returns them as an array"><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span>
|
||||||
|
<span class='description'>Retrieves the values of an object, and returns them as an array</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Creates an object, with the property names of the first array, and the values of the second."><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span>
|
||||||
|
<span class='description'>Creates an object, with the property names of the first array, and the values of the second.</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Combines two or more objects/arrays."><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span>
|
||||||
|
<span class='description'>Combines two or more objects/arrays.</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sectionItem classMethod">
|
||||||
|
<!--
|
||||||
|
<div class="module-filter"> </div>
|
||||||
|
-->
|
||||||
|
<b class="icon" title="Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first."><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span>
|
||||||
|
<span class='description'>Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor details ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== field details ========================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== method details ========================= -->
|
||||||
|
|
||||||
|
<div class="details section">
|
||||||
|
<div class="sectionTitle">
|
||||||
|
Method Detail
|
||||||
|
</div>
|
||||||
|
<div class="sectionItems">
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".text"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.text<span class="signature">(<span title="value">string</span>)</span>
|
||||||
|
<span class="light" title="returns string">: string</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Sets or retrieves the text content of the element
|
||||||
|
specified by the current selector. If a value is
|
||||||
|
passed, it will set that value on the current element,
|
||||||
|
otherwise it will return the value of the current element
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_DOM.js.html">DOM.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b><i class="help" title="Optional parameter">?</i>, Default: </i>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
value
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
string
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".css"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.css<span class="signature">(<span title="property">string</span>, <span title="value">string</span>)</span>
|
||||||
|
<span class="light" title="returns string">: string</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Sets or retrieves a css property of the element
|
||||||
|
specified by the current selector. If a value is
|
||||||
|
passed, it will set that value on the current element,
|
||||||
|
otherwise it will return the value of the css property
|
||||||
|
on the current element
|
||||||
|
|
||||||
|
<p class="fileName itemName"><i>Defined in: </i> <span class="icon"><a href="../symbols/src/kis-js_src_modules_DOM.js.html">DOM.js</a>.</span></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
property
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b><i class="help" title="Optional parameter">?</i>, Default: </i>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
value
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
string
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".object_keys"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.object_keys<span class="signature">(<span>object</span>)</span>
|
||||||
|
<span class="light" title="returns array">: array</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Retrieve the keys, or member names of an object
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
array
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".object_values"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.object_values<span class="signature">(<span>object</span>)</span>
|
||||||
|
<span class="light" title="returns array">: array</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Retrieves the values of an object, and returns
|
||||||
|
them as an array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
array
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".array_combine"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.array_combine<span class="signature">(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span>
|
||||||
|
<span class="light" title="returns object">: object</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Creates an object, with the property names of the first array,
|
||||||
|
and the values of the second. If objects are passed, the values
|
||||||
|
of the object are used. If the arrays or objects passed are
|
||||||
|
not the same size, the function will return false.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>array/object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
keys
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>array/object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
vals
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
object
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".object_merge"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.object_merge<span class="signature">(<span title="[as many as you wish to combine]">object</span>)</span>
|
||||||
|
<span class="light" title="returns object">: object</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Combines two or more objects/arrays. If the keys are numeric, the outputted
|
||||||
|
object will have re-indexed keys. If a key/value pair exists in both objects,
|
||||||
|
indentical values will be droped, but if a key exists with a different value,
|
||||||
|
with the same key, the value in the second array will replace the value in the
|
||||||
|
first
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>object</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
[as many as you wish to combine]
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
object
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='sectionItem classMethod '>
|
||||||
|
<a name=".str_trans"> </a>
|
||||||
|
<div class="itemTitle icon">
|
||||||
|
$_.util.str_trans<span class="signature">(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span>
|
||||||
|
<span class="light" title="returns string">: string</span>
|
||||||
|
</div>
|
||||||
|
<div class="full-description">
|
||||||
|
Replaces sections of strings in a greedy fashion,
|
||||||
|
starting with the longest replace pairs first. Accepts
|
||||||
|
one replace pair as two parameters, or an object, with
|
||||||
|
from => to replacements as key/value pairs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<pre class="prettyprint"></pre>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Parameters:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
input_string
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>mixed</b>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemName">
|
||||||
|
<b>string</b><i class="help" title="Optional parameter">?</i>, Default: </i>
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
to
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="heading">Returns:</div>
|
||||||
|
<table class="methodItem"><tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="methodItemType">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="methodItemDesc">
|
||||||
|
string
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ============================== footer ================================= -->
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
115
docs/symbols/_global_.html
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="JsDoc Toolkit" />
|
||||||
|
|
||||||
|
<title>JsDoc Reference - _global_</title>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../jproton.js"></script>
|
||||||
|
<script type="text/javascript" src="../ui.js"></script>
|
||||||
|
<script type="text/javascript" src="../sh.js"></script>
|
||||||
|
<link rel=stylesheet href="../sh.css" type="text/css">
|
||||||
|
<link rel=stylesheet href="../default.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="main-wrapper">
|
||||||
|
<div id="main">
|
||||||
|
<!-- ============================== classes index ============================ -->
|
||||||
|
<div id="index" class="fixed">
|
||||||
|
<div id="index-wrapper">
|
||||||
|
<div class="header">
|
||||||
|
<div id="index-close" title="Esconde o outline."> </div>
|
||||||
|
<div id="index-title">Project Outline</div>
|
||||||
|
</div>
|
||||||
|
<div id="index-menu"><a href="../index.html">Class Index</a>
|
||||||
|
| <a href="../files.html">File Index</a></div>
|
||||||
|
|
||||||
|
<div id="index-content">
|
||||||
|
|
||||||
|
<div class="classList">
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='DOM Dom manipulation module' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.dom.html">$_.dom</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds a class to the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.addClass">addClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes a class from the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.removeClass">removeClass</a></b><span class='signature'>(<span title="class">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Hides the element(s) specified by the current selector'><a href="../symbols/%24_.dom.html#.hide">hide</a></b><span class='signature'>()</span></div><div class='sectionItem classMethod'><b class='icon' title='Shows the element(s) specified by the current selector.'><a href="../symbols/%24_.dom.html#.show">show</a></b><span class='signature'>(<span title="type">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets attributes on element(s) specified by the current selector, or, if name is not specified, returns the value of the attribute of the element specified by the current selector.'><a href="../symbols/%24_.dom.html#.attr">attr</a></b><span class='signature'>(<span title="name">string</span>, <span title="value">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.event.html">$_.event</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Adds an event that returns a callback when triggered on the selected event and selector'><a href="../symbols/%24_.event.html#.add">add</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes an event bound the the specified selector, event type, and callback'><a href="../symbols/%24_.event.html#.remove">remove</a></b><span class='signature'>(<span title="event">string</span>, <span title="callback">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds a persistent, delegated event'><a href="../symbols/%24_.event.html#.live">live</a></b><span class='signature'>(<span title="target">string</span>, <span title="event">string</span>, <span title="callback">function</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Binds an event to a parent object'><a href="../symbols/%24_.event.html#.delegate">delegate</a></b><span class='signature'>(<span title="target">string</span>, <span title="event_type">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Wrapper for localstorage data serialization' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.store.html">$_.store</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Retrieves and deserializes a value from localstorage, based on the specified key'><a href="../symbols/%24_.store.html#.get">get</a></b><span class='signature'>(<span title="key">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Puts a value into localstorage at the specified key, and JSON-encodes the value if not a string'><a href="../symbols/%24_.store.html#.set">set</a></b><span class='signature'>(<span title="key">string</span>, <span title="value">mixed</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Removes the specified item from localstorage'><a href="../symbols/%24_.store.html#.remove">remove</a></b><span class='signature'>(<span title="key">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='String and object manipulation utilities' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><a href="../symbols/%24_.util.html">$_.util</a></span></div><div class='sectionItems'><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves the text content of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.text">text</a></b><span class='signature'>(<span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Sets or retrieves a css property of the element specified by the current selector.'><a href="../symbols/%24_.util.html#.css">css</a></b><span class='signature'>(<span title="property">string</span>, <span title="value">string</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieve the keys, or member names of an object'><a href="../symbols/%24_.util.html#.object_keys">object_keys</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Retrieves the values of an object, and returns them as an array'><a href="../symbols/%24_.util.html#.object_values">object_values</a></b><span class='signature'>(<span>object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Creates an object, with the property names of the first array, and the values of the second.'><a href="../symbols/%24_.util.html#.array_combine">array_combine</a></b><span class='signature'>(<span title="keys">array/object</span>, <span title="vals">array/object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Combines two or more objects/arrays.'><a href="../symbols/%24_.util.html#.object_merge">object_merge</a></b><span class='signature'>(<span title="[as many as you wish to combine]">object</span>)</span></div><div class='sectionItem classMethod'><b class='icon' title='Replaces sections of strings in a greedy fashion, starting with the longest replace pairs first.'><a href="../symbols/%24_.util.html#.str_trans">str_trans</a></b><span class='signature'>(<span title="input_string">string</span>, <span>mixed</span>, <span title="to">string</span>)</span></div></div></div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div title='Global namespace.' class='itemName namespace'>
|
||||||
|
<div class='method-toggler'> </div><span class='icon'><i><a href="../symbols/_global_.html">_global_</a></i></span></div><div class='sectionItems'></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="index-toggler" class="fixed">«</div>
|
||||||
|
|
||||||
|
<!-- ============================== header ================================= -->
|
||||||
|
<!-- begin static/header.html -->
|
||||||
|
<div class="header">
|
||||||
|
Framework jProton
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- end static/header.html -->
|
||||||
|
|
||||||
|
<div id="content">
|
||||||
|
<!-- ============================== class title ============================ -->
|
||||||
|
<h1 class="classTitle">
|
||||||
|
Built-In Namespace _global_
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<!-- ============================== class summary ========================== -->
|
||||||
|
<!--
|
||||||
|
|
||||||
|
-->
|
||||||
|
<div class="full-description">
|
||||||
|
<p></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor summary ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== properties summary ===================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== methods summary ======================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== constructor details ==================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== field details ========================== -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============================== method details ========================= -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ============================== footer ================================= -->
|
||||||
|
<div class="fineprint" style="clear:both">
|
||||||
|
|
||||||
|
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Tue Nov 01 2011 18:52:39 GMT-0400 (EDT)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
236
docs/symbols/src/kis-js_src_core_core.js.html
Executable file
@ -0,0 +1,236 @@
|
|||||||
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||||
|
.KEYW {color: #933;}
|
||||||
|
.COMM {color: #bbb; font-style: italic;}
|
||||||
|
.NUMB {color: #393;}
|
||||||
|
.STRN {color: #393;}
|
||||||
|
.REGX {color: #339;}
|
||||||
|
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||||
|
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||||
|
<span class='line'> 2</span> Kis JS Keep It Simple JS Library
|
||||||
|
<span class='line'> 3</span> Copyright Timothy J. Warren
|
||||||
|
<span class='line'> 4</span> License Public Domain
|
||||||
|
<span class='line'> 5</span> Version 0.5.0-pre
|
||||||
|
<span class='line'> 6</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 7</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 8</span>
|
||||||
|
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 10</span>
|
||||||
|
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="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'> 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'>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'>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'>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'>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'>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'>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="COMM">//console.log polyfill</span><span class="WHIT">
|
||||||
|
<span class='line'>209</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.console</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'>210</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">window.console</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">log</span><span class="PUNC">:</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>215</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>216</span> </span><span class="COMM">/**
|
||||||
|
<span class='line'>217</span> * String trim function polyfill
|
||||||
|
<span class='line'>218</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>219</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">String.prototype.trim</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'>220</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>222</span> * @private
|
||||||
|
<span class='line'>223</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="NAME">String.prototype.trim</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="WHIT">
|
||||||
|
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.replace</span><span class="PUNC">(</span><span class="REGX">/^\s+|\s+$/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>228</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>229</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>
|
485
docs/symbols/src/kis-js_src_modules_DOM.js.html
Executable file
@ -0,0 +1,485 @@
|
|||||||
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||||
|
.KEYW {color: #933;}
|
||||||
|
.COMM {color: #bbb; font-style: italic;}
|
||||||
|
.NUMB {color: #393;}
|
||||||
|
.STRN {color: #393;}
|
||||||
|
.REGX {color: #339;}
|
||||||
|
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||||
|
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/*
|
||||||
|
<span class='line'> 2</span> * classList.js: Cross-browser full element.classList implementation.
|
||||||
|
<span class='line'> 3</span> * 2011-06-15
|
||||||
|
<span class='line'> 4</span> *
|
||||||
|
<span class='line'> 5</span> * By Eli Grey, http://eligrey.com
|
||||||
|
<span class='line'> 6</span> * Public Domain.
|
||||||
|
<span class='line'> 7</span> * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||||
|
<span class='line'> 8</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 9</span>
|
||||||
|
<span class='line'> 10</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">document</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="PUNC">!</span><span class="PUNC">(</span><span class="STRN">"classList"</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"a"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 11</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">view</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 13</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 14</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">classListProp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"classList"</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">protoProp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"prototype"</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">elemCtrProto</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">view.HTMLElement</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">view.Element</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">objCtr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">strTrim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">trim</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">function</span><span class="WHIT"> </span><span class="PUNC">(</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><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.replace</span><span class="PUNC">(</span><span class="REGX">/^\s+|\s+$/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">arrIndexOf</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">indexOf</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
|
||||||
|
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
|
||||||
|
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</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">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">this</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="NAME">item</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">return</span><span class="WHIT"> </span><span class="NAME">i</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="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 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="COMM">// Vendors: please allow content code to instantiate DOMExceptions</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">/**
|
||||||
|
<span class='line'> 41</span> * @private
|
||||||
|
<span class='line'> 42</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">DOMEx</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">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</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="NAME">this.name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">this.code</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">DOMException</span><span class="PUNC">[</span><span class="NAME">type</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">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">message</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="COMM">/**
|
||||||
|
<span class='line'> 50</span> * @private
|
||||||
|
<span class='line'> 51</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">checkTokenAndGetIndex</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">classList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">token</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">token</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'> 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">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">DOMEx</span><span class="PUNC">(</span><span class="STRN">"SYNTAX_ERR"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"An invalid or illegal string was specified"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/\s/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">token</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">DOMEx</span><span class="PUNC">(</span><span class="STRN">"INVALID_CHARACTER_ERR"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"String contains an invalid character"</span><span class="PUNC">)</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">return</span><span class="WHIT"> </span><span class="NAME">arrIndexOf.call</span><span class="PUNC">(</span><span class="NAME">classList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">token</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 65</span> * @private
|
||||||
|
<span class='line'> 66</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">ClassList</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">elem</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
|
||||||
|
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">trimmedClasses</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">strTrim.call</span><span class="PUNC">(</span><span class="NAME">elem.className</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">classes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">trimmedClasses</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">trimmedClasses.split</span><span class="PUNC">(</span><span class="REGX">/\s+/</span><span class="PUNC">)</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'> 72</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">classes.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</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">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">this.push</span><span class="PUNC">(</span><span class="NAME">classes</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 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="NAME">this._updateClassName</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'> 79</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">elem.className</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">classListProto</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ClassList</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</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'> 84</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 85</span> * @private
|
||||||
|
<span class='line'> 86</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">classListGetter</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'> 88</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ClassList</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="COMM">// Most DOMException implementations don't allow calling DOMException's toString()</span><span class="WHIT">
|
||||||
|
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="COMM">// on non-DOMExceptions. Error's toString() is sufficient here.</span><span class="WHIT">
|
||||||
|
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">DOMEx</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">classListProto.item</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">i</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><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</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="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">classListProto.contains</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">token</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">token</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">checkTokenAndGetIndex</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">token</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>102</span> </span><span class="WHIT"> </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">classListProto.add</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">token</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">token</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">checkTokenAndGetIndex</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">token</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">this.push</span><span class="PUNC">(</span><span class="NAME">token</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">this._updateClassName</span><span class="PUNC">(</span><span class="PUNC">)</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="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">classListProto.remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">token</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">token</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">checkTokenAndGetIndex</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">token</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">this.splice</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">this._updateClassName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">classListProto.toggle</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">token</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">token</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">checkTokenAndGetIndex</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">token</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>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="NAME">this.add</span><span class="PUNC">(</span><span class="NAME">token</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">this.remove</span><span class="PUNC">(</span><span class="NAME">token</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="NAME">classListProto.toString</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'>135</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>138</span>
|
||||||
|
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">objCtr.defineProperty</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">classListPropDesc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">get</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">classListGetter</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">enumerable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">configurable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
|
||||||
|
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT">
|
||||||
|
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">objCtr.defineProperty</span><span class="PUNC">(</span><span class="NAME">elemCtrProto</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">classListProp</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">classListPropDesc</span><span class="PUNC">)</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="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// IE 8 doesn't support enumerable:true</span><span class="WHIT">
|
||||||
|
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ex.number</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">0x7FF5EC54</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">classListPropDesc.enumerable</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">objCtr.defineProperty</span><span class="PUNC">(</span><span class="NAME">elemCtrProto</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">classListProp</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">classListPropDesc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">objCtr</span><span class="PUNC">[</span><span class="NAME">protoProp</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">__defineGetter__</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="NAME">elemCtrProto.__defineGetter__</span><span class="PUNC">(</span><span class="NAME">classListProp</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">classListGetter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>163</span>
|
||||||
|
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>165</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>166</span>
|
||||||
|
<span class='line'>167</span> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||||
|
<span class='line'>168</span>
|
||||||
|
<span class='line'>169</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'>170</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tag_reg</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">class_reg</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>171</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>172</span> </span><span class="NAME">tag_reg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/^([\w\-]+)$/</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">class_reg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\.([\w\-]+)$/</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>174</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>175</span>
|
||||||
|
<span class='line'>176</span> </span><span class="COMM">//Private function for getting/setting attributes</span><span class="WHIT">
|
||||||
|
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</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="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldVal</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">doAttr</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>180</span>
|
||||||
|
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="COMM">//Get the value of the attribute, if it exists</span><span class="WHIT">
|
||||||
|
<span class='line'>182</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">sel.hasAttribute</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'>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="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.hasAttribute</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="NAME">oldVal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel.getAttribute</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>188</span>
|
||||||
|
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="NAME">doAttr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel</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">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="NAME">oldVal</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">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="NAME">doAttr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"class"</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">sel.className</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><span class="COMM">//className attribute</span><span class="WHIT">
|
||||||
|
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"className"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">oldVal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sel.className</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">doAttr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>202</span>
|
||||||
|
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="COMM">//Well, I guess that attribute doesn't exist</span><span class="WHIT">
|
||||||
|
<span class='line'>204</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">oldVal</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="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Element does not have the selected attribute"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>211</span>
|
||||||
|
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="COMM">//No value to set? Return the current value</span><span class="WHIT">
|
||||||
|
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">oldVal</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>217</span>
|
||||||
|
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="COMM">//Determine what to do with the attribute</span><span class="WHIT">
|
||||||
|
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">doAttr</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="NAME">sel.setAttribute</span><span class="PUNC">(</span><span class="NAME">name</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'>224</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>229</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">doAttr</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="NAME">sel.removeAttribute</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>240</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>241</span>
|
||||||
|
<span class='line'>242</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">value</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><span class="PUNC">?</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">oldVal</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>244</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>245</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_toCamel</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="REGX">/(\-[a-z])/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">$1</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">$1.toUpperCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="STRN">'-'</span><span class="PUNC">,</span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>251</span>
|
||||||
|
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">sel</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="WHIT">
|
||||||
|
<span class='line'>253</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">equi</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>255</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>256</span> </span><span class="COMM">//Camel-case</span><span class="WHIT">
|
||||||
|
<span class='line'>257</span> </span><span class="WHIT"> </span><span class="NAME">prop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_toCamel</span><span class="PUNC">(</span><span class="NAME">prop</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>258</span>
|
||||||
|
<span class='line'>259</span> </span><span class="WHIT"> </span><span class="COMM">//Equivalent properties for 'special' browsers</span><span class="WHIT">
|
||||||
|
<span class='line'>260</span> </span><span class="WHIT"> </span><span class="NAME">equi</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>261</span> </span><span class="WHIT"> </span><span class="NAME">outerHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"offsetHeight"</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="NAME">outerWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"offsetWidth"</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="NAME">top</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"posTop"</span><span class="WHIT">
|
||||||
|
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>265</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>266</span>
|
||||||
|
<span class='line'>267</span> </span><span class="COMM">//If you don't define a value, try returning the existing value</span><span class="WHIT">
|
||||||
|
<span class='line'>268</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">val</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.style</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</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'>269</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">sel.style</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="KEYW">else</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">val</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.style</span><span class="PUNC">[</span><span class="NAME">equi</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">]</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'>273</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">sel.style</span><span class="PUNC">[</span><span class="NAME">equi</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>276</span>
|
||||||
|
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="COMM">//Let's try the easy way first</span><span class="WHIT">
|
||||||
|
<span class='line'>278</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.style</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</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'>279</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="NAME">sel.style</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>281</span>
|
||||||
|
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="COMM">//Short circuit</span><span class="WHIT">
|
||||||
|
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">sel.style</span><span class="PUNC">[</span><span class="NAME">equi</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="NAME">sel.style</span><span class="PUNC">[</span><span class="NAME">equi</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>290</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>291</span> </span><span class="COMM">//No matches? Well, lets log it for now</span><span class="WHIT">
|
||||||
|
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Property "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" nor an equivalent seems to exist"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>294</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>295</span> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||||
|
<span class='line'>296</span>
|
||||||
|
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>298</span> * DOM
|
||||||
|
<span class='line'>299</span> *
|
||||||
|
<span class='line'>300</span> * Dom manipulation module
|
||||||
|
<span class='line'>301</span> * @namespace
|
||||||
|
<span class='line'>302</span> * @memberOf $_
|
||||||
|
<span class='line'>303</span> * @name dom
|
||||||
|
<span class='line'>304</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>306</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>307</span> * Adds a class to the element(s) specified by the current
|
||||||
|
<span class='line'>308</span> * selector
|
||||||
|
<span class='line'>309</span> *
|
||||||
|
<span class='line'>310</span> * @name addClass
|
||||||
|
<span class='line'>311</span> * @memberOf $_.dom
|
||||||
|
<span class='line'>312</span> * @function
|
||||||
|
<span class='line'>313</span> * @param string class
|
||||||
|
<span class='line'>314</span> * @return void
|
||||||
|
<span class='line'>315</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="NAME">addClass</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">c</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="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'>319</span> </span><span class="WHIT"> </span><span class="NAME">e.classList.add</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>323</span> * Removes a class from the element(s) specified by the current
|
||||||
|
<span class='line'>324</span> * selector
|
||||||
|
<span class='line'>325</span> *
|
||||||
|
<span class='line'>326</span> * @name removeClass
|
||||||
|
<span class='line'>327</span> * @memberOf $_.dom
|
||||||
|
<span class='line'>328</span> * @function
|
||||||
|
<span class='line'>329</span> * @param string class
|
||||||
|
<span class='line'>330</span> * @return void
|
||||||
|
<span class='line'>331</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>332</span> </span><span class="WHIT"> </span><span class="NAME">removeClass</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">c</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="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'>335</span> </span><span class="WHIT"> </span><span class="NAME">e.classList.remove</span><span class="PUNC">(</span><span class="NAME">c</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>338</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>339</span> * Hides the element(s) specified by the current selector
|
||||||
|
<span class='line'>340</span> *
|
||||||
|
<span class='line'>341</span> * @name hide
|
||||||
|
<span class='line'>342</span> * @memberOf $_.dom
|
||||||
|
<span class='line'>343</span> * @function
|
||||||
|
<span class='line'>344</span> * @return void
|
||||||
|
<span class='line'>345</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>346</span> </span><span class="WHIT"> </span><span class="NAME">hide</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'>347</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="NAME">this.css</span><span class="PUNC">(</span><span class="STRN">'display'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>351</span> * Shows the element(s) specified by the current selector.
|
||||||
|
<span class='line'>352</span> * if type is specified, the element will have it's style
|
||||||
|
<span class='line'>353</span> * property set to "display:[your type]". If type is not
|
||||||
|
<span class='line'>354</span> * specified, the element is set to "display:block".
|
||||||
|
<span class='line'>355</span> *
|
||||||
|
<span class='line'>356</span> * @name show
|
||||||
|
<span class='line'>357</span> * @memberOf $_.dom
|
||||||
|
<span class='line'>358</span> * @function
|
||||||
|
<span class='line'>359</span> * @param [string] type
|
||||||
|
<span class='line'>360</span> * @return void
|
||||||
|
<span class='line'>361</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">show</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">type</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>363</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>364</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">type</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'>365</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>366</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="STRN">"block"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>368</span>
|
||||||
|
<span class='line'>369</span> </span><span class="WHIT"> </span><span class="NAME">this.css</span><span class="PUNC">(</span><span class="STRN">"display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>370</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>371</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>372</span> * Sets attributes on element(s) specified by the current
|
||||||
|
<span class='line'>373</span> * selector, or, if name is not specified, returns the
|
||||||
|
<span class='line'>374</span> * value of the attribute of the element specified by the
|
||||||
|
<span class='line'>375</span> * current selector.
|
||||||
|
<span class='line'>376</span> *
|
||||||
|
<span class='line'>377</span> * @name attr
|
||||||
|
<span class='line'>378</span> * @memberOf $_.dom
|
||||||
|
<span class='line'>379</span> * @function
|
||||||
|
<span class='line'>380</span> * @param string name
|
||||||
|
<span class='line'>381</span> * @param string value
|
||||||
|
<span class='line'>382</span> * @return string
|
||||||
|
<span class='line'>383</span> * @type string
|
||||||
|
<span class='line'>384</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="NAME">attr</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">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>387</span> </span><span class="WHIT"> </span><span class="KEYW">var</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">this.el</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>388</span>
|
||||||
|
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="COMM">//Make sure you don't try to get a bunch of elements</span><span class="WHIT">
|
||||||
|
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</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">value</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'>391</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>393</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Must be a singular element"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">//You can set a bunch, though</span><span class="WHIT">
|
||||||
|
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>398</span> </span><span class="WHIT"> </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'>399</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</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'>400</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>401</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>402</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="COMM">//Normal behavior</span><span class="WHIT">
|
||||||
|
<span class='line'>403</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>404</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_attr</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</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'>405</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>406</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>407</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>408</span> * Sets or retrieves the text content of the element
|
||||||
|
<span class='line'>409</span> * specified by the current selector. If a value is
|
||||||
|
<span class='line'>410</span> * passed, it will set that value on the current element,
|
||||||
|
<span class='line'>411</span> * otherwise it will return the value of the current element
|
||||||
|
<span class='line'>412</span> *
|
||||||
|
<span class='line'>413</span> * @name text
|
||||||
|
<span class='line'>414</span> * @memberOf $_.util
|
||||||
|
<span class='line'>415</span> * @function
|
||||||
|
<span class='line'>416</span> * @param [string] value
|
||||||
|
<span class='line'>417</span> * @returns string
|
||||||
|
<span class='line'>418</span> * @type string
|
||||||
|
<span class='line'>419</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>420</span> </span><span class="WHIT"> </span><span class="NAME">text</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">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>421</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>422</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>423</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>424</span> </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.el</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>425</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>426</span> </span><span class="NAME">set</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">value</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><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>427</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>428</span> </span><span class="NAME">type</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">sel.innerText</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'>429</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"innerText"</span><span class="WHIT">
|
||||||
|
<span class='line'>430</span> </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">sel.textContent</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'>431</span> </span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"textContent"</span><span class="WHIT">
|
||||||
|
<span class='line'>432</span> </span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"innerHTML"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>433</span>
|
||||||
|
<span class='line'>434</span> </span><span class="WHIT"> </span><span class="NAME">oldValue</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">type</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>435</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>436</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">set</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>437</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>438</span> </span><span class="WHIT"> </span><span class="NAME">sel</span><span class="PUNC">[</span><span class="NAME">type</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>439</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>440</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>441</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>442</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>443</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>444</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>445</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>446</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>447</span> * Sets or retrieves a css property of the element
|
||||||
|
<span class='line'>448</span> * specified by the current selector. If a value is
|
||||||
|
<span class='line'>449</span> * passed, it will set that value on the current element,
|
||||||
|
<span class='line'>450</span> * otherwise it will return the value of the css property
|
||||||
|
<span class='line'>451</span> * on the current element
|
||||||
|
<span class='line'>452</span> *
|
||||||
|
<span class='line'>453</span> * @name css
|
||||||
|
<span class='line'>454</span> * @memberOf $_.util
|
||||||
|
<span class='line'>455</span> * @function
|
||||||
|
<span class='line'>456</span> * @param string property
|
||||||
|
<span class='line'>457</span> * @param [string] value
|
||||||
|
<span class='line'>458</span> * @returns string
|
||||||
|
<span class='line'>459</span> * @type string
|
||||||
|
<span class='line'>460</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>461</span> </span><span class="WHIT"> </span><span class="NAME">css</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">prop</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>462</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>463</span> </span><span class="WHIT"> </span><span class="COMM">//Return the current value if a value is not set</span><span class="WHIT">
|
||||||
|
<span class='line'>464</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">val</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'>465</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>466</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_css</span><span class="PUNC">(</span><span class="NAME">this.el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>467</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>468</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>469</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'>470</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'>471</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>472</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>473</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>474</span>
|
||||||
|
<span class='line'>475</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'>476</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>477</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'>478</span> </span></pre></body></html>
|
110
docs/symbols/src/kis-js_src_modules_ajax.js.html
Executable file
@ -0,0 +1,110 @@
|
|||||||
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||||
|
.KEYW {color: #933;}
|
||||||
|
.COMM {color: #bbb; font-style: italic;}
|
||||||
|
.NUMB {color: #393;}
|
||||||
|
.STRN {color: #393;}
|
||||||
|
.REGX {color: #339;}
|
||||||
|
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||||
|
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||||
|
<span class='line'> 2</span> * Ajax
|
||||||
|
<span class='line'> 3</span> *
|
||||||
|
<span class='line'> 4</span> * Module for making ajax requests
|
||||||
|
<span class='line'> 5</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 6</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="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="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'> 9</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'> 10</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">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'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 14</span> * @private
|
||||||
|
<span class='line'> 15</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 16</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'> 17</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 18</span>
|
||||||
|
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="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'> 20</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'> 21</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'> 22</span>
|
||||||
|
<span class='line'> 23</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'> 24</span>
|
||||||
|
<span class='line'> 25</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'> 26</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 27</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'> 28</span>
|
||||||
|
<span class='line'> 29</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'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">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'> 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="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'> 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="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 36</span>
|
||||||
|
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">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'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="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'> 40</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'> 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="KEYW">else</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="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'> 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="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 47</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'> 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">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'> 50</span>
|
||||||
|
<span class='line'> 51</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'> 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="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'> 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">continue</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">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'> 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">continue</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 61</span>
|
||||||
|
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="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'> 63</span>
|
||||||
|
<span class='line'> 64</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'> 65</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'> 66</span>
|
||||||
|
<span class='line'> 67</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'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 69</span>
|
||||||
|
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">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'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 73</span>
|
||||||
|
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 75</span> * Sends a GET type ajax request
|
||||||
|
<span class='line'> 76</span> *
|
||||||
|
<span class='line'> 77</span> * @name get
|
||||||
|
<span class='line'> 78</span> * @function
|
||||||
|
<span class='line'> 79</span> * @memberOf $_
|
||||||
|
<span class='line'> 80</span> * @param string url
|
||||||
|
<span class='line'> 81</span> * @param object data
|
||||||
|
<span class='line'> 82</span> * @param function callback
|
||||||
|
<span class='line'> 83</span> * @return void
|
||||||
|
<span class='line'> 84</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 85</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'> 86</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'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 88</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 89</span> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 90</span> * Sends a POST type ajax request
|
||||||
|
<span class='line'> 91</span> *
|
||||||
|
<span class='line'> 92</span> * @name post
|
||||||
|
<span class='line'> 93</span> * @function
|
||||||
|
<span class='line'> 94</span> * @memberOf $_
|
||||||
|
<span class='line'> 95</span> * @param string url
|
||||||
|
<span class='line'> 96</span> * @param object data
|
||||||
|
<span class='line'> 97</span> * @param function callback
|
||||||
|
<span class='line'> 98</span> * @return void
|
||||||
|
<span class='line'> 99</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'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'>101</span> </span><span class="WHIT"> </span><span class="NAME">ajax._do</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">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'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>103</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
263
docs/symbols/src/kis-js_src_modules_event.js.html
Executable file
@ -0,0 +1,263 @@
|
|||||||
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||||
|
.KEYW {color: #933;}
|
||||||
|
.COMM {color: #bbb; font-style: italic;}
|
||||||
|
.NUMB {color: #393;}
|
||||||
|
.STRN {color: #393;}
|
||||||
|
.REGX {color: #339;}
|
||||||
|
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||||
|
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||||
|
<span class='line'> 2</span> * Event
|
||||||
|
<span class='line'> 3</span> *
|
||||||
|
<span class='line'> 4</span> * Event api wrapper
|
||||||
|
<span class='line'> 5</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 6</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 7</span>
|
||||||
|
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 9</span>
|
||||||
|
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="COMM">// Property name for expandos on DOM objects</span><span class="WHIT">
|
||||||
|
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">kis_expando</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"KIS_0_5_0"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 12</span>
|
||||||
|
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_attach</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 14</span>
|
||||||
|
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="COMM">// Define the proper _attach and _remove functions</span><span class="WHIT">
|
||||||
|
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="COMM">// based on browser support</span><span class="WHIT">
|
||||||
|
<span class='line'> 17</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">document.addEventListener</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="COMM">/**
|
||||||
|
<span class='line'> 20</span> * @private
|
||||||
|
<span class='line'> 21</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">_attach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span 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="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.addEventListener</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'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="COMM">//Duplicated events are dropped, per the specification</span><span class="WHIT">
|
||||||
|
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">sel.addEventListener</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 31</span> * @private
|
||||||
|
<span class='line'> 32</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel.removeEventListener</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'> 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="NAME">sel.removeEventListener</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="COMM">//typeof function doesn't work in IE where _attachEvent is available: brute force it</span><span class="WHIT">
|
||||||
|
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">else</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">document.attachEvent</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'> 43</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 45</span> * @private
|
||||||
|
<span class='line'> 46</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">_attach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span 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">function</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="COMM">// Internet Explorer fails to correctly set the 'this' object</span><span class="WHIT">
|
||||||
|
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="COMM">// for event listeners, so we need to set it ourselves.</span><span class="WHIT">
|
||||||
|
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">callback.apply</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 54</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 55</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">sel.attachEvent</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'> 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="NAME">_remove</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// Make sure we don't have duplicate listeners</span><span class="WHIT">
|
||||||
|
<span class='line'> 58</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 59</span> </span><span class="NAME">sel.attachEvent</span><span class="PUNC">(</span><span class="STRN">"on"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="COMM">// Store our listener so we can _remove it later</span><span class="WHIT">
|
||||||
|
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expando</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">kis_expando</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">kis_expando</span><span class="PUNC">]</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'> 62</span> </span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expando.listeners</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'> 63</span> </span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</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'> 64</span> </span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">listener</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">listener</span><span class="WHIT">
|
||||||
|
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Failed to _attach event:"</span><span class="PUNC">+</span><span class="NAME">event</span><span class="PUNC">+</span><span class="STRN">" on "</span><span class="PUNC">+</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 75</span> * @private
|
||||||
|
<span class='line'> 76</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 79</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.detachEvent</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'> 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="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expando</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">kis_expando</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expando</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="WHIT">
|
||||||
|
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 86</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">listeners.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 87</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">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC"><</span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">listeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">sel.detachEvent</span><span class="PUNC">(</span><span class="STRN">"on"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">listener</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">listeners.splice</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">listeners.length</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'> 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">delete</span><span class="WHIT"> </span><span class="NAME">expando.listeners</span><span class="PUNC">[</span><span class="NAME">event</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">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>104</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>105</span> </span><span class="NAME">_add_remove</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>108</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>109</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">sel</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'>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="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>115</span>
|
||||||
|
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="COMM">//Multiple events? Run recursively!</span><span class="WHIT">
|
||||||
|
<span class='line'>117</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">event.match</span><span class="PUNC">(</span><span class="REGX">/^([\w\-]+)$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">event</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.split</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>120</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>121</span> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">event.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>122</span>
|
||||||
|
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>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="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>127</span>
|
||||||
|
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>130</span>
|
||||||
|
<span class='line'>131</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>132</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">add</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="NAME">_attach</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="NAME">_remove</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>141</span>
|
||||||
|
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="COMM">//_attach the listener to the parent object</span><span class="WHIT">
|
||||||
|
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>146</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>147</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>148</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>149</span> </span><span class="COMM">//Get the live version of the target selector</span><span class="WHIT">
|
||||||
|
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">$_.$</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>151</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>152</span> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">t</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">//Check each element to see if it matches the target</span><span class="WHIT">
|
||||||
|
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">t.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="COMM">//Fire target callback when event bubbles from target</span><span class="WHIT">
|
||||||
|
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">e.target</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="COMM">//Trigger the event callback</span><span class="WHIT">
|
||||||
|
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">callback.call</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>164</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>165</span> </span><span class="COMM">//Stop event propegation</span><span class="WHIT">
|
||||||
|
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>167</span> </span><span class="WHIT"> </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="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>170</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>171</span>
|
||||||
|
<span class='line'>172</span> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>174</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>175</span> </span><span class="COMM">// --------------------------------------------------------------------------</span><span class="WHIT">
|
||||||
|
<span class='line'>176</span>
|
||||||
|
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>178</span> * @namespace
|
||||||
|
<span class='line'>179</span> * @name event
|
||||||
|
<span class='line'>180</span> * @memberOf $_
|
||||||
|
<span class='line'>181</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>184</span> * Adds an event that returns a callback when triggered on the selected
|
||||||
|
<span class='line'>185</span> * event and selector
|
||||||
|
<span class='line'>186</span> *
|
||||||
|
<span class='line'>187</span> * @memberOf $_.event
|
||||||
|
<span class='line'>188</span> * @name add
|
||||||
|
<span class='line'>189</span> * @function
|
||||||
|
<span class='line'>190</span> * @example Eg. $_("#selector").event.add("click", do_something());
|
||||||
|
<span class='line'>191</span> * @param string event
|
||||||
|
<span class='line'>192</span> * @param function callback
|
||||||
|
<span class='line'>193</span> * @return void
|
||||||
|
<span class='line'>194</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">add</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>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="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>202</span> * Removes an event bound the the specified selector, event type, and callback
|
||||||
|
<span class='line'>203</span> *
|
||||||
|
<span class='line'>204</span> * @memberOf $_.event
|
||||||
|
<span class='line'>205</span> * @name remove
|
||||||
|
<span class='line'>206</span> * @function
|
||||||
|
<span class='line'>207</span> * @example Eg. $_("#selector").event.remove("click", do_something());
|
||||||
|
<span class='line'>208</span> * @param string event
|
||||||
|
<span class='line'>209</span> * @param string callback
|
||||||
|
<span class='line'>210</span> * @return void
|
||||||
|
<span class='line'>211</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="NAME">_add_remove</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>219</span> * Binds a persistent, delegated event
|
||||||
|
<span class='line'>220</span> *
|
||||||
|
<span class='line'>221</span> * @memberOf $_.event
|
||||||
|
<span class='line'>222</span> * @name live
|
||||||
|
<span class='line'>223</span> * @function
|
||||||
|
<span class='line'>224</span> * @example Eg. $_.event.live(".button", "click", do_something());
|
||||||
|
<span class='line'>225</span> * @param string target
|
||||||
|
<span class='line'>226</span> * @param string event
|
||||||
|
<span class='line'>227</span> * @param function callback
|
||||||
|
<span class='line'>228</span> * @return void
|
||||||
|
<span class='line'>229</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="NAME">live</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">document.documentElement</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>235</span> * Binds an event to a parent object
|
||||||
|
<span class='line'>236</span> *
|
||||||
|
<span class='line'>237</span> * @memberOf $_.event
|
||||||
|
<span class='line'>238</span> * @name delegate
|
||||||
|
<span class='line'>239</span> * @function
|
||||||
|
<span class='line'>240</span> * @example Eg. $_("#parent").delegate(".button", "click", do_something());
|
||||||
|
<span class='line'>241</span> * @param string target
|
||||||
|
<span class='line'>242</span> * @param string event_type
|
||||||
|
<span class='line'>243</span> * @parma function callback
|
||||||
|
<span class='line'>244</span> * @return void
|
||||||
|
<span class='line'>245</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="NAME">delegate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="NAME">$_.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="NAME">_attach_delegate</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>253</span>
|
||||||
|
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'event'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>255</span>
|
||||||
|
<span class='line'>256</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>
|
94
docs/symbols/src/kis-js_src_modules_store.js.html
Executable file
@ -0,0 +1,94 @@
|
|||||||
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||||
|
.KEYW {color: #933;}
|
||||||
|
.COMM {color: #bbb; font-style: italic;}
|
||||||
|
.NUMB {color: #393;}
|
||||||
|
.STRN {color: #393;}
|
||||||
|
.REGX {color: #339;}
|
||||||
|
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||||
|
</style></head><body><pre><span class='line'> 1</span> <span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 3</span>
|
||||||
|
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 5</span> * Wrapper for localstorage data serialization
|
||||||
|
<span class='line'> 6</span> *
|
||||||
|
<span class='line'> 7</span> * @name store
|
||||||
|
<span class='line'> 8</span> * @namespace
|
||||||
|
<span class='line'> 9</span> * @memberOf $_
|
||||||
|
<span class='line'> 10</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 13</span> * Retrieves and deserializes a value from localstorage,
|
||||||
|
<span class='line'> 14</span> * based on the specified key
|
||||||
|
<span class='line'> 15</span> *
|
||||||
|
<span class='line'> 16</span> * @param string key
|
||||||
|
<span class='line'> 17</span> * @name get
|
||||||
|
<span class='line'> 18</span> * @memberOf $_.store
|
||||||
|
<span class='line'> 19</span> * @function
|
||||||
|
<span class='line'> 20</span> * @return object
|
||||||
|
<span class='line'> 21</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">get</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 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="KEYW">return</span><span class="WHIT"> </span><span class="NAME">JSON.parse</span><span class="PUNC">(</span><span class="NAME">localStorage.getItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 27</span> * Puts a value into localstorage at the specified key,
|
||||||
|
<span class='line'> 28</span> * and JSON-encodes the value if not a string
|
||||||
|
<span class='line'> 29</span> *
|
||||||
|
<span class='line'> 30</span> * @param string key
|
||||||
|
<span class='line'> 31</span> * @param mixed value
|
||||||
|
<span class='line'> 32</span> * @name set
|
||||||
|
<span class='line'> 33</span> * @memberOf $_.store
|
||||||
|
<span class='line'> 34</span> * @function
|
||||||
|
<span class='line'> 35</span> * @return void
|
||||||
|
<span class='line'> 36</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 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">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">JSON.stringify</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">localStorage.setItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 46</span> * Removes the specified item from localstorage
|
||||||
|
<span class='line'> 47</span> *
|
||||||
|
<span class='line'> 48</span> * @param string key
|
||||||
|
<span class='line'> 49</span> * @name remove
|
||||||
|
<span class='line'> 50</span> * @memberOf $_.store
|
||||||
|
<span class='line'> 51</span> * @function
|
||||||
|
<span class='line'> 52</span> * @return void
|
||||||
|
<span class='line'> 53</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">remove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 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">localStorage.removeItem</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 59</span> * Returns an array of all the values in localstorage
|
||||||
|
<span class='line'> 60</span> * in their raw form
|
||||||
|
<span class='line'> 61</span> *
|
||||||
|
<span class='line'> 62</span> * @name getAll
|
||||||
|
<span class='line'> 63</span> * @member of $_.store
|
||||||
|
<span class='line'> 64</span> * @function
|
||||||
|
<span class='line'> 65</span> * @return object
|
||||||
|
<span class='line'> 66</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">getAll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 74</span>
|
||||||
|
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage.key</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">localStorage.getItem</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 81</span>
|
||||||
|
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 85</span>
|
||||||
|
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'store'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 87</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html>
|
369
docs/symbols/src/kis-js_src_modules_util.js.html
Executable file
@ -0,0 +1,369 @@
|
|||||||
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||||
|
.KEYW {color: #933;}
|
||||||
|
.COMM {color: #bbb; font-style: italic;}
|
||||||
|
.NUMB {color: #393;}
|
||||||
|
.STRN {color: #393;}
|
||||||
|
.REGX {color: #339;}
|
||||||
|
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||||
|
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||||
|
<span class='line'> 2</span> * Util Object
|
||||||
|
<span class='line'> 3</span> *
|
||||||
|
<span class='line'> 4</span> * Various object and string manipulation functions
|
||||||
|
<span class='line'> 5</span> * Note: these are based on similar phpjs functions: http://phpjs.org
|
||||||
|
<span class='line'> 6</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 7</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 8</span>
|
||||||
|
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="STRN">"use strict"</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 10</span>
|
||||||
|
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
|
||||||
|
<span class='line'> 12</span> </span><span class="NAME">reverse_key_sort</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 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="COMM">//Define some variables</span><span class="WHIT">
|
||||||
|
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">new_o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 19</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 20</span> </span><span class="COMM">//Extract the keys</span><span class="WHIT">
|
||||||
|
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">u.object_keys</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 22</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 23</span> </span><span class="COMM">//Sort the keys</span><span class="WHIT">
|
||||||
|
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">keys.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 25</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">bNumeric</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 29</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 30</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">bNumeric</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 31</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">aFloat</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">bFloat</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 34</span> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">bNumeric</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 35</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 38</span> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">aNumeric</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">bNumeric</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 39</span> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 42</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 43</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 45</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 46</span> </span><span class="COMM">//cache object/array size</span><span class="WHIT">
|
||||||
|
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">keys.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 48</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 49</span> </span><span class="COMM">//Recreate the object/array</span><span class="WHIT">
|
||||||
|
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">new_o</span><span class="PUNC">[</span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 54</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 55</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_o</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 57</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 58</span> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 59</span> * String and object manipulation utilities
|
||||||
|
<span class='line'> 60</span> *
|
||||||
|
<span class='line'> 61</span> * @namespace
|
||||||
|
<span class='line'> 62</span> * @name util
|
||||||
|
<span class='line'> 63</span> * @memberOf $_
|
||||||
|
<span class='line'> 64</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">u</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 67</span> * Retrieve the keys, or member names of an object
|
||||||
|
<span class='line'> 68</span> *
|
||||||
|
<span class='line'> 69</span> * @name object_keys
|
||||||
|
<span class='line'> 70</span> * @memberOf $_.util
|
||||||
|
<span class='line'> 71</span> * @function
|
||||||
|
<span class='line'> 72</span> * @param object
|
||||||
|
<span class='line'> 73</span> * @return array
|
||||||
|
<span class='line'> 74</span> * @type array
|
||||||
|
<span class='line'> 75</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">object_keys</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 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">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 80</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 81</span> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">k</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 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">if</span><span class="PUNC">(</span><span class="NAME">o.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">keys.push</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'> 88</span> </span><span class="WHIT">
|
||||||
|
<span class='line'> 89</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'> 92</span> * Retrieves the values of an object, and returns
|
||||||
|
<span class='line'> 93</span> * them as an array
|
||||||
|
<span class='line'> 94</span> *
|
||||||
|
<span class='line'> 95</span> * @name object_values
|
||||||
|
<span class='line'> 96</span> * @memberOf $_.util
|
||||||
|
<span class='line'> 97</span> * @function
|
||||||
|
<span class='line'> 98</span> * @param object
|
||||||
|
<span class='line'> 99</span> * @return array
|
||||||
|
<span class='line'>100</span> * @type array
|
||||||
|
<span class='line'>101</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">object_values</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">prop</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>106</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>107</span> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">prop</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">vals.push</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>111</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>112</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>115</span> * Creates an object, with the property names of the first array,
|
||||||
|
<span class='line'>116</span> * and the values of the second. If objects are passed, the values
|
||||||
|
<span class='line'>117</span> * of the object are used. If the arrays or objects passed are
|
||||||
|
<span class='line'>118</span> * not the same size, the function will return false.
|
||||||
|
<span class='line'>119</span> *
|
||||||
|
<span class='line'>120</span> * @name array_combine
|
||||||
|
<span class='line'>121</span> * @memberOf $_.util
|
||||||
|
<span class='line'>122</span> * @function
|
||||||
|
<span class='line'>123</span> * @param array/object keys
|
||||||
|
<span class='line'>124</span> * @param array/object vals
|
||||||
|
<span class='line'>125</span> * @return object
|
||||||
|
<span class='line'>126</span> * @type object
|
||||||
|
<span class='line'>127</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">array_combine</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">new_object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>133</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>134</span> </span><span class="COMM">//Extract the keys or values if needed</span><span class="WHIT">
|
||||||
|
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.object_values</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="NAME">vals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.object_values</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>142</span> </span><span class="WHIT"> </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="COMM">//cache the number of keys</span><span class="WHIT">
|
||||||
|
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">keys.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>146</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>147</span> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">num_keys</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">vals.length</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="STRN">"Object combine requires two arrays of the same size"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>152</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>153</span> </span><span class="COMM">//Create and return the new object</span><span class="WHIT">
|
||||||
|
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">num_keys</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="NAME">new_object</span><span class="PUNC">[</span><span class="NAME">keys</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>157</span> </span><span class="WHIT"> </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="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_object</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>162</span> * Combines two or more objects/arrays. If the keys are numeric, the outputted
|
||||||
|
<span class='line'>163</span> * object will have re-indexed keys. If a key/value pair exists in both objects,
|
||||||
|
<span class='line'>164</span> * indentical values will be droped, but if a key exists with a different value,
|
||||||
|
<span class='line'>165</span> * with the same key, the value in the second array will replace the value in the
|
||||||
|
<span class='line'>166</span> * first
|
||||||
|
<span class='line'>167</span> *
|
||||||
|
<span class='line'>168</span> * @name object_merge
|
||||||
|
<span class='line'>169</span> * @memberOf $_.util
|
||||||
|
<span class='line'>170</span> * @function
|
||||||
|
<span class='line'>171</span> * @param object [as many as you wish to combine]
|
||||||
|
<span class='line'>172</span> * @type object
|
||||||
|
<span class='line'>173</span> * @return object
|
||||||
|
<span class='line'>174</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="NAME">object_merge</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Array.prototype.slice.call</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="NAME">arg_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">iarg_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">is_array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>186</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>187</span> </span><span class="COMM">//Check for an array in the arguments</span><span class="WHIT">
|
||||||
|
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">arg_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="NAME">is_array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>196</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>197</span> </span><span class="COMM">//If all the arguments are javascript arrays</span><span class="WHIT">
|
||||||
|
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">is_array</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="COMM">//Let javascript do all the work!</span><span class="WHIT">
|
||||||
|
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">arg_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">new_obj.contact</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>206</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>207</span> </span><span class="COMM">//Return early</span><span class="WHIT">
|
||||||
|
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>210</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>211</span> </span><span class="COMM">//No, there's at least one object</span><span class="WHIT">
|
||||||
|
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">arg_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="NAME">arg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>215</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>216</span> </span><span class="COMM">// If the argument is an array, add the array items as</span><span class="WHIT">
|
||||||
|
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="COMM">// numeric object properties</span><span class="WHIT">
|
||||||
|
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">$_.type</span><span class="PUNC">(</span><span class="NAME">arg</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"array"</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iarg_len</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">iarg_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">j</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">arg.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="COMM">// If the key is numeric, add the property with</span><span class="WHIT">
|
||||||
|
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="COMM">// a numeric key</span><span class="WHIT">
|
||||||
|
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">++</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arg</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>241</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>244</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>245</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>246</span> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_obj</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||||
|
<span class='line'>249</span> * Replaces sections of strings in a greedy fashion,
|
||||||
|
<span class='line'>250</span> * starting with the longest replace pairs first. Accepts
|
||||||
|
<span class='line'>251</span> * one replace pair as two parameters, or an object, with
|
||||||
|
<span class='line'>252</span> * from => to replacements as key/value pairs
|
||||||
|
<span class='line'>253</span> *
|
||||||
|
<span class='line'>254</span> * @name str_trans
|
||||||
|
<span class='line'>255</span> * @memberOf $_.util
|
||||||
|
<span class='line'>256</span> * @function
|
||||||
|
<span class='line'>257</span> * @param string input_string
|
||||||
|
<span class='line'>258</span> * @param mixed
|
||||||
|
<span class='line'>259</span> * @param [string] to
|
||||||
|
<span class='line'>260</span> * @return string
|
||||||
|
<span class='line'>261</span> * @type string
|
||||||
|
<span class='line'>262</span> */</span><span class="WHIT">
|
||||||
|
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="NAME">str_trans</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">to</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>265</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">froms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="NAME">tos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>268</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>269</span> </span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="NAME">str_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="NAME">to_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="NAME">to_is_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="NAME">from_is_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">strx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="NAME">strw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="NAME">stry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="NAME">from_strx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT">
|
||||||
|
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>282</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>283</span> </span><span class="COMM">//Replace pairs? add them to the internal arrays</span><span class="WHIT">
|
||||||
|
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="COMM">// Sort the keys in descending order for better</span><span class="WHIT">
|
||||||
|
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="COMM">// replacement functionality</span><span class="WHIT">
|
||||||
|
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">reverse_key_sort</span><span class="PUNC">(</span><span class="NAME">from</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>289</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>290</span> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">f</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>291</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">from.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">f</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">froms.push</span><span class="PUNC">(</span><span class="NAME">f</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="NAME">tos.push</span><span class="PUNC">(</span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">f</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>298</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>299</span> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">froms</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>300</span> </span><span class="WHIT"> </span><span class="NAME">to</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tos</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>301</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>302</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>303</span> </span><span class="COMM">//Go through the string, and replace characters as needed</span><span class="WHIT">
|
||||||
|
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">str_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">from.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>306</span> </span><span class="WHIT"> </span><span class="NAME">to_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">to.length</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>307</span> </span><span class="WHIT"> </span><span class="NAME">to_is_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">to</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>308</span> </span><span class="WHIT"> </span><span class="NAME">from_is_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">from</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>309</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>310</span> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">str_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">from_is_str</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">strw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="NAME">strx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="NAME">stry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">strx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">from.charAt</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>325</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>329</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">from_len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>330</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>331</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">str.substr</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>332</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>333</span> </span><span class="WHIT"> </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>334</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>335</span> </span><span class="COMM">//Go past the current match</span><span class="WHIT">
|
||||||
|
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">from</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>338</span>
|
||||||
|
<span class='line'>339</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>340</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>342</span>
|
||||||
|
<span class='line'>343</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">)</span><span class="WHIT">
|
||||||
|
<span class='line'>344</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>345</span> </span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">to_is_str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">to.charAt</span><span class="PUNC">(</span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">to</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>346</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>347</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT">
|
||||||
|
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||||
|
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.charAt</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>352</span>
|
||||||
|
<span class='line'>353</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">new_str</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>354</span> </span><span class="WHIT">
|
||||||
|
<span class='line'>355</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||||
|
<span class='line'>356</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>357</span>
|
||||||
|
<span class='line'>358</span> </span><span class="WHIT"> </span><span class="COMM">//Add it to the $_ object</span><span class="WHIT">
|
||||||
|
<span class='line'>359</span> </span><span class="WHIT"> </span><span class="NAME">$_.ext</span><span class="PUNC">(</span><span class="STRN">'util'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">u</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||||
|
<span class='line'>360</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'>361</span>
|
||||||
|
<span class='line'>362</span> </span></pre></body></html>
|
113
docs/ui.js
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
ui = {
|
||||||
|
toggleIndex: function() {
|
||||||
|
$('body').toggleClass('index-collapsed');
|
||||||
|
var indexToggler = $('#index-toggler');
|
||||||
|
if (encodeURIComponent(indexToggler.html()) == '%C2%AB')
|
||||||
|
indexToggler.html('»');
|
||||||
|
else
|
||||||
|
indexToggler.html('«');
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleMethods: function() {
|
||||||
|
$.element.toggleClass(this, 'toggled');
|
||||||
|
$('.sectionItems', this.parentNode.parentNode).toggleClass('invisible');
|
||||||
|
},
|
||||||
|
|
||||||
|
toggleModule: function(module) {
|
||||||
|
if (module) {
|
||||||
|
var name = 'filter module-'+module;
|
||||||
|
|
||||||
|
if ($('body').toggleClass(name).hasClass(name)) {
|
||||||
|
createCookie("jProtonDocModule", module);
|
||||||
|
} else {
|
||||||
|
eraseCookie("jProtonDocModule");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ui.hideEmptySections();
|
||||||
|
ui.updateFragmentLocation();
|
||||||
|
},
|
||||||
|
|
||||||
|
hideEmptySections: function() {
|
||||||
|
var sections = $('.section');
|
||||||
|
sections.each(function(i){
|
||||||
|
|
||||||
|
var count = 0;
|
||||||
|
var sectionItems = $(this).find('.sectionItems');
|
||||||
|
|
||||||
|
sectionItems.find('.sectionItem').each(function(){
|
||||||
|
if ($.element.css(this, 'display') != 'none')
|
||||||
|
count++;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (sectionItems.e.length > 0 && count == 0)
|
||||||
|
$.element.addClass(this, 'invisible');
|
||||||
|
else
|
||||||
|
$.element.removeClass(this, 'invisible');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
updateFragmentLocation: function() {
|
||||||
|
if (window.location.hash)
|
||||||
|
window.location.hash = window.location.hash;
|
||||||
|
},
|
||||||
|
|
||||||
|
updateModuleState: function() {
|
||||||
|
var module = readCookie("jProtonDocModule");
|
||||||
|
if (module) {
|
||||||
|
$('body').addClass('filter module-'+module);
|
||||||
|
ui.hideEmptySections();
|
||||||
|
}
|
||||||
|
ui.updateFragmentLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
// Controle para alternar a exibição do outline
|
||||||
|
$('#index-toggler').attr('title', 'Alterna a exibição do outline');
|
||||||
|
$('#index-toggler, #index-close').on('click', ui.toggleIndex);
|
||||||
|
|
||||||
|
// Controle para alternar a exibição de métodos
|
||||||
|
$('.method-toggler').on('click', ui.toggleMethods);
|
||||||
|
|
||||||
|
// Controle para filtro de módulos
|
||||||
|
$('.module-filter').attr('title', 'Liga/Desliga filtro do módulo');
|
||||||
|
$.each(['core', 'css', 'dom', 'event', 'ajax'], function(i,e){
|
||||||
|
$('.module-' + e + ' .module-filter').on('click', function(){
|
||||||
|
ui.toggleModule(e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.updateModuleState();
|
||||||
|
|
||||||
|
if (typeof dp != 'undefined')
|
||||||
|
dp.SyntaxHighlighter.HighlightAll('code');
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onunload = function() {
|
||||||
|
$.event.removeAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
function createCookie(name,value,days) {
|
||||||
|
if (days) {
|
||||||
|
var date = new Date();
|
||||||
|
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||||
|
var expires = "; expires="+date.toGMTString();
|
||||||
|
}
|
||||||
|
else var expires = "";
|
||||||
|
document.cookie = name+"="+value+expires+"; path=/";
|
||||||
|
}
|
||||||
|
|
||||||
|
function readCookie(name) {
|
||||||
|
var nameEQ = name + "=";
|
||||||
|
var ca = document.cookie.split(';');
|
||||||
|
for(var i=0;i < ca.length;i++) {
|
||||||
|
var c = ca[i];
|
||||||
|
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||||
|
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function eraseCookie(name) {
|
||||||
|
createCookie(name,"",-1);
|
||||||
|
}
|
618
kis-all.js
@ -2,7 +2,7 @@
|
|||||||
Kis JS Keep It Simple JS Library
|
Kis JS Keep It Simple JS Library
|
||||||
Copyright Timothy J. Warren
|
Copyright Timothy J. Warren
|
||||||
License Public Domain
|
License Public Domain
|
||||||
Version 0.3.0
|
Version 0.5.0-pre
|
||||||
*/
|
*/
|
||||||
(function (){
|
(function (){
|
||||||
|
|
||||||
@ -14,42 +14,18 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $_, $, dcopy, sel;
|
var $_, $, dcopy, sel, sel_string;
|
||||||
|
|
||||||
/**
|
|
||||||
* $
|
|
||||||
*
|
|
||||||
* Simple DOM selector function
|
|
||||||
*/
|
|
||||||
$ = function (a, context)
|
|
||||||
{
|
|
||||||
var x, c;
|
|
||||||
|
|
||||||
if (typeof a != "string" || typeof a === "undefined"){ return a;}
|
|
||||||
|
|
||||||
//Check for a context of a specific element, otherwise, just run on the document
|
|
||||||
c = (context != null && context.nodeType === 1)
|
|
||||||
? context
|
|
||||||
: document;
|
|
||||||
|
|
||||||
//Pick the quickest method for each kind of selector
|
|
||||||
if (a.match(/^#([\w\-]+$)/))
|
|
||||||
{
|
|
||||||
return document.getElementById(a.split('#')[1]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
x = c.querySelectorAll(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Return the single object if applicable
|
|
||||||
return (x.length === 1) ? x[0] : x;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $_
|
* $_
|
||||||
*
|
*
|
||||||
* Constructor function
|
* Constructor function
|
||||||
|
*
|
||||||
|
* @constuctor
|
||||||
|
* @namespace
|
||||||
|
* @param string selector
|
||||||
|
* @return object
|
||||||
*/
|
*/
|
||||||
$_ = function(s)
|
$_ = function(s)
|
||||||
{
|
{
|
||||||
@ -86,8 +62,49 @@
|
|||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $
|
||||||
|
*
|
||||||
|
* Simple DOM selector function
|
||||||
|
*
|
||||||
|
* @memberOf $_
|
||||||
|
* @param string selector
|
||||||
|
* @param string context
|
||||||
|
* @return object
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
$ = function (a, context)
|
||||||
|
{
|
||||||
|
var x, c;
|
||||||
|
|
||||||
|
if (typeof a != "string" || typeof a === "undefined"){ return a;}
|
||||||
|
|
||||||
|
//Check for a context of a specific element, otherwise, just run on the document
|
||||||
|
c = (context != null && context.nodeType === 1)
|
||||||
|
? context
|
||||||
|
: document;
|
||||||
|
|
||||||
|
//Pick the quickest method for each kind of selector
|
||||||
|
if (a.match(/^#([\w\-]+$)/))
|
||||||
|
{
|
||||||
|
return document.getElementById(a.split('#')[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = c.querySelectorAll(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return the single object if applicable
|
||||||
|
return (x.length === 1) ? x[0] : x;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deep copy/prototypical constructor function
|
* Deep copy/prototypical constructor function
|
||||||
|
*
|
||||||
|
* @param object obj
|
||||||
|
* @private
|
||||||
|
* @return object
|
||||||
|
* @type object
|
||||||
*/
|
*/
|
||||||
dcopy = function(obj)
|
dcopy = function(obj)
|
||||||
{
|
{
|
||||||
@ -110,6 +127,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
F = function(){};
|
F = function(){};
|
||||||
|
|
||||||
F.prototype = obj;
|
F.prototype = obj;
|
||||||
@ -118,14 +138,27 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//Function to add to $_ object, and get sel
|
/**
|
||||||
|
* Adds the property `obj` to the $_ object, calling it `name`
|
||||||
|
*
|
||||||
|
* @param string name
|
||||||
|
* @param object obj
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext = function(name, obj)
|
$_.ext = function(name, obj)
|
||||||
{
|
{
|
||||||
obj.el = sel;
|
obj.el = sel;
|
||||||
$_[name] = obj;
|
$_[name] = obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Selector iteration
|
/**
|
||||||
|
* Iterates over a $_ object, applying a callback to each item
|
||||||
|
*
|
||||||
|
* @name $_.each
|
||||||
|
* @function
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext('each', function (callback)
|
$_.ext('each', function (callback)
|
||||||
{
|
{
|
||||||
if(typeof sel.length !== "undefined" && sel !== window)
|
if(typeof sel.length !== "undefined" && sel !== window)
|
||||||
@ -150,7 +183,13 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//Type retriever
|
/**
|
||||||
|
* Retrieves the type of the passed variable
|
||||||
|
*
|
||||||
|
* @param mixed obj
|
||||||
|
* @return string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
$_.type = function(obj)
|
$_.type = function(obj)
|
||||||
{
|
{
|
||||||
if((function() {return obj && (obj !== this)}).call(obj))
|
if((function() {return obj && (obj !== this)}).call(obj))
|
||||||
@ -179,6 +218,9 @@
|
|||||||
*/
|
*/
|
||||||
if(typeof String.prototype.trim === "undefined")
|
if(typeof String.prototype.trim === "undefined")
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
String.prototype.trim = function(){
|
String.prototype.trim = function(){
|
||||||
return this.replace(/^\s+|\s+$/g, "");
|
return this.replace(/^\s+|\s+$/g, "");
|
||||||
};
|
};
|
||||||
@ -227,12 +269,18 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
// Vendors: please allow content code to instantiate DOMExceptions
|
// Vendors: please allow content code to instantiate DOMExceptions
|
||||||
,
|
,
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
DOMEx = function (type, message)
|
DOMEx = function (type, message)
|
||||||
{
|
{
|
||||||
this.name = type;
|
this.name = type;
|
||||||
this.code = DOMException[type];
|
this.code = DOMException[type];
|
||||||
this.message = message;
|
this.message = message;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
checkTokenAndGetIndex = function (classList, token)
|
checkTokenAndGetIndex = function (classList, token)
|
||||||
{
|
{
|
||||||
if (token === "")
|
if (token === "")
|
||||||
@ -245,6 +293,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
return arrIndexOf.call(classList, token);
|
return arrIndexOf.call(classList, token);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
ClassList = function (elem)
|
ClassList = function (elem)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
@ -262,6 +313,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
classListProto = ClassList[protoProp] = [],
|
classListProto = ClassList[protoProp] = [],
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
classListGetter = function ()
|
classListGetter = function ()
|
||||||
{
|
{
|
||||||
return new ClassList(this);
|
return new ClassList(this);
|
||||||
@ -344,10 +398,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* Dom manipulation object
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
(function (){
|
(function (){
|
||||||
var d, tag_reg, class_reg;
|
var d, tag_reg, class_reg;
|
||||||
|
|
||||||
@ -476,23 +526,71 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOM
|
||||||
|
*
|
||||||
|
* Dom manipulation module
|
||||||
|
* @namespace
|
||||||
|
* @memberOf $_
|
||||||
|
* @name dom
|
||||||
|
*/
|
||||||
d = {
|
d = {
|
||||||
|
/**
|
||||||
|
* Adds a class to the element(s) specified by the current
|
||||||
|
* selector
|
||||||
|
*
|
||||||
|
* @name addClass
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param string class
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
addClass: function (c)
|
addClass: function (c)
|
||||||
{
|
{
|
||||||
$_.each(function (e){
|
$_.each(function (e){
|
||||||
e.classList.add(c);
|
e.classList.add(c);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Removes a class from the element(s) specified by the current
|
||||||
|
* selector
|
||||||
|
*
|
||||||
|
* @name removeClass
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param string class
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
removeClass: function (c)
|
removeClass: function (c)
|
||||||
{
|
{
|
||||||
$_.each(function (e){
|
$_.each(function (e){
|
||||||
e.classList.remove(c);
|
e.classList.remove(c);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Hides the element(s) specified by the current selector
|
||||||
|
*
|
||||||
|
* @name hide
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
hide: function ()
|
hide: function ()
|
||||||
{
|
{
|
||||||
this.css('display', 'none');
|
this.css('display', 'none');
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Shows the element(s) specified by the current selector.
|
||||||
|
* if type is specified, the element will have it's style
|
||||||
|
* property set to "display:[your type]". If type is not
|
||||||
|
* specified, the element is set to "display:block".
|
||||||
|
*
|
||||||
|
* @name show
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param [string] type
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
show: function (type)
|
show: function (type)
|
||||||
{
|
{
|
||||||
if (typeof type === "undefined")
|
if (typeof type === "undefined")
|
||||||
@ -502,6 +600,20 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
this.css("display", type);
|
this.css("display", type);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Sets attributes on element(s) specified by the current
|
||||||
|
* selector, or, if name is not specified, returns the
|
||||||
|
* value of the attribute of the element specified by the
|
||||||
|
* current selector.
|
||||||
|
*
|
||||||
|
* @name attr
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param string name
|
||||||
|
* @param string value
|
||||||
|
* @return string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
attr: function (name, value)
|
attr: function (name, value)
|
||||||
{
|
{
|
||||||
var sel = this.el;
|
var sel = this.el;
|
||||||
@ -524,6 +636,19 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
return _attr(sel, name, value);
|
return _attr(sel, name, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Sets or retrieves the text content of the element
|
||||||
|
* specified by the current selector. If a value is
|
||||||
|
* passed, it will set that value on the current element,
|
||||||
|
* otherwise it will return the value of the current element
|
||||||
|
*
|
||||||
|
* @name text
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param [string] value
|
||||||
|
* @returns string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
text: function (value)
|
text: function (value)
|
||||||
{
|
{
|
||||||
var oldValue, set, type, sel;
|
var oldValue, set, type, sel;
|
||||||
@ -550,6 +675,21 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
return oldValue;
|
return oldValue;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Sets or retrieves a css property of the element
|
||||||
|
* specified by the current selector. If a value is
|
||||||
|
* passed, it will set that value on the current element,
|
||||||
|
* otherwise it will return the value of the css property
|
||||||
|
* on the current element
|
||||||
|
*
|
||||||
|
* @name css
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param string property
|
||||||
|
* @param [string] value
|
||||||
|
* @returns string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
css: function (prop, val)
|
css: function (prop, val)
|
||||||
{
|
{
|
||||||
//Return the current value if a value is not set
|
//Return the current value if a value is not set
|
||||||
@ -570,17 +710,42 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* Store object
|
|
||||||
*
|
|
||||||
* Wrapper for localstorage data serialization
|
|
||||||
*/
|
|
||||||
(function (){
|
(function (){
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for localstorage data serialization
|
||||||
|
*
|
||||||
|
* @name store
|
||||||
|
* @namespace
|
||||||
|
* @memberOf $_
|
||||||
|
*/
|
||||||
var store = {
|
var store = {
|
||||||
|
/**
|
||||||
|
* Retrieves and deserializes a value from localstorage,
|
||||||
|
* based on the specified key
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @name get
|
||||||
|
* @memberOf $_.store
|
||||||
|
* @function
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
get: function (key)
|
get: function (key)
|
||||||
{
|
{
|
||||||
return JSON.parse(localStorage.getItem(key));
|
return JSON.parse(localStorage.getItem(key));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Puts a value into localstorage at the specified key,
|
||||||
|
* and JSON-encodes the value if not a string
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @param mixed value
|
||||||
|
* @name set
|
||||||
|
* @memberOf $_.store
|
||||||
|
* @function
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
set: function (key, value)
|
set: function (key, value)
|
||||||
{
|
{
|
||||||
if (typeof value !== "string")
|
if (typeof value !== "string")
|
||||||
@ -589,10 +754,28 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
localStorage.setItem(key, value);
|
localStorage.setItem(key, value);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Removes the specified item from localstorage
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @name remove
|
||||||
|
* @memberOf $_.store
|
||||||
|
* @function
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
remove: function (key)
|
remove: function (key)
|
||||||
{
|
{
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Returns an array of all the values in localstorage
|
||||||
|
* in their raw form
|
||||||
|
*
|
||||||
|
* @name getAll
|
||||||
|
* @member of $_.store
|
||||||
|
* @function
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
getAll: function ()
|
getAll: function ()
|
||||||
{
|
{
|
||||||
var i,
|
var i,
|
||||||
@ -617,104 +800,10 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* Qs
|
|
||||||
*
|
|
||||||
* Object for encoding and decoding querystrings and hashbang strings
|
|
||||||
*/
|
|
||||||
(function (){
|
|
||||||
|
|
||||||
$_.hb = (history.pushState) ? false : true;
|
|
||||||
|
|
||||||
var qs = {
|
|
||||||
parse: function (hb)
|
|
||||||
{
|
|
||||||
hb = hb || $_.hb;
|
|
||||||
|
|
||||||
var h, i, hString, pairs, pLen, data, y;
|
|
||||||
|
|
||||||
data = {};
|
|
||||||
|
|
||||||
if (hb === true)
|
|
||||||
{
|
|
||||||
h = location.hash.split('#!/');
|
|
||||||
hString = (h.length > 1) ? h[1] : '';
|
|
||||||
}
|
|
||||||
else if (hb === false || hb === undefined)
|
|
||||||
{
|
|
||||||
hString = window.location.search.substring(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
pairs = hString.split('&');
|
|
||||||
|
|
||||||
pLen = pairs.length;
|
|
||||||
|
|
||||||
for (i = 0; i < pLen; i++)
|
|
||||||
{
|
|
||||||
y = pairs[i].split('=');
|
|
||||||
|
|
||||||
if (y.length < 2)
|
|
||||||
{
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
data[y[0]] = y[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
set: function (key, value, hb)
|
|
||||||
{
|
|
||||||
hb = hb || $_.hb;
|
|
||||||
var pairs = this.parse(hb);
|
|
||||||
|
|
||||||
if (key !== undefined && value !== undefined)
|
|
||||||
{
|
|
||||||
pairs[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
var vars = [];
|
|
||||||
|
|
||||||
for (var x in pairs)
|
|
||||||
{
|
|
||||||
if (pairs.hasOwnProperty(x))
|
|
||||||
{
|
|
||||||
vars.push(x + '=' + pairs[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var qs = vars.join('&');
|
|
||||||
|
|
||||||
if (hb === true)
|
|
||||||
{
|
|
||||||
qs = '!/' + qs;
|
|
||||||
location.hash = qs;
|
|
||||||
}
|
|
||||||
|
|
||||||
return qs;
|
|
||||||
},
|
|
||||||
get: function (key, hb)
|
|
||||||
{
|
|
||||||
hb = hb || $_.hb;
|
|
||||||
var pairs = this.parse(hb);
|
|
||||||
return (pairs[key]) ? pairs[key] : '';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$_.ext('qs', qs);
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajax
|
* Ajax
|
||||||
*
|
*
|
||||||
* Object for making ajax requests
|
* Module for making ajax requests
|
||||||
*/
|
*/
|
||||||
(function (){
|
(function (){
|
||||||
|
|
||||||
@ -723,6 +812,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
{
|
{
|
||||||
if (typeof callback === "undefined")
|
if (typeof callback === "undefined")
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
callback = function (){};
|
callback = function (){};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -781,10 +873,32 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a GET type ajax request
|
||||||
|
*
|
||||||
|
* @name get
|
||||||
|
* @function
|
||||||
|
* @memberOf $_
|
||||||
|
* @param string url
|
||||||
|
* @param object data
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext('get', function (url, data, callback){
|
$_.ext('get', function (url, data, callback){
|
||||||
ajax._do(url, data, callback, false);
|
ajax._do(url, data, callback, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a POST type ajax request
|
||||||
|
*
|
||||||
|
* @name post
|
||||||
|
* @function
|
||||||
|
* @memberOf $_
|
||||||
|
* @param string url
|
||||||
|
* @param object data
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext('post', function (url, data, callback){
|
$_.ext('post', function (url, data, callback){
|
||||||
ajax._do(url, data, callback, true);
|
ajax._do(url, data, callback, true);
|
||||||
});
|
});
|
||||||
@ -848,7 +962,25 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
return new_o;
|
return new_o;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String and object manipulation utilities
|
||||||
|
*
|
||||||
|
* @namespace
|
||||||
|
* @name util
|
||||||
|
* @memberOf $_
|
||||||
|
*/
|
||||||
u = {
|
u = {
|
||||||
|
/**
|
||||||
|
* Retrieve the keys, or member names of an object
|
||||||
|
*
|
||||||
|
* @name object_keys
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param object
|
||||||
|
* @return array
|
||||||
|
* @type array
|
||||||
|
*/
|
||||||
object_keys: function(o)
|
object_keys: function(o)
|
||||||
{
|
{
|
||||||
var keys = [],
|
var keys = [],
|
||||||
@ -864,6 +996,17 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
return keys;
|
return keys;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Retrieves the values of an object, and returns
|
||||||
|
* them as an array
|
||||||
|
*
|
||||||
|
* @name object_values
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param object
|
||||||
|
* @return array
|
||||||
|
* @type array
|
||||||
|
*/
|
||||||
object_values: function(o)
|
object_values: function(o)
|
||||||
{
|
{
|
||||||
var vals = [],
|
var vals = [],
|
||||||
@ -876,6 +1019,20 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
return vals;
|
return vals;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Creates an object, with the property names of the first array,
|
||||||
|
* and the values of the second. If objects are passed, the values
|
||||||
|
* of the object are used. If the arrays or objects passed are
|
||||||
|
* not the same size, the function will return false.
|
||||||
|
*
|
||||||
|
* @name array_combine
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param array/object keys
|
||||||
|
* @param array/object vals
|
||||||
|
* @return object
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
array_combine: function(keys, vals)
|
array_combine: function(keys, vals)
|
||||||
{
|
{
|
||||||
var new_object = {},
|
var new_object = {},
|
||||||
@ -909,6 +1066,20 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
return new_object;
|
return new_object;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Combines two or more objects/arrays. If the keys are numeric, the outputted
|
||||||
|
* object will have re-indexed keys. If a key/value pair exists in both objects,
|
||||||
|
* indentical values will be droped, but if a key exists with a different value,
|
||||||
|
* with the same key, the value in the second array will replace the value in the
|
||||||
|
* first
|
||||||
|
*
|
||||||
|
* @name object_merge
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param object [as many as you wish to combine]
|
||||||
|
* @type object
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
object_merge: function()
|
object_merge: function()
|
||||||
{
|
{
|
||||||
var args = Array.prototype.slice.call(arguments),
|
var args = Array.prototype.slice.call(arguments),
|
||||||
@ -982,6 +1153,21 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
return new_obj;
|
return new_obj;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Replaces sections of strings in a greedy fashion,
|
||||||
|
* starting with the longest replace pairs first. Accepts
|
||||||
|
* one replace pair as two parameters, or an object, with
|
||||||
|
* from => to replacements as key/value pairs
|
||||||
|
*
|
||||||
|
* @name str_trans
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param string input_string
|
||||||
|
* @param mixed
|
||||||
|
* @param [string] to
|
||||||
|
* @return string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
str_trans: function(str, from, to)
|
str_trans: function(str, from, to)
|
||||||
{
|
{
|
||||||
var froms = [],
|
var froms = [],
|
||||||
@ -1085,7 +1271,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event object
|
* Event
|
||||||
*
|
*
|
||||||
* Event api wrapper
|
* Event api wrapper
|
||||||
*/
|
*/
|
||||||
@ -1094,28 +1280,43 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Property name for expandos on DOM objects
|
// Property name for expandos on DOM objects
|
||||||
var kis_expando = "KIS_0_3_0";
|
var kis_expando = "KIS_0_5_0";
|
||||||
|
|
||||||
var attach, remove, add_remove, e, attach_delegate, attach_live;
|
var _attach, _remove, _add_remove, e, _attach_delegate;
|
||||||
|
|
||||||
// Define the proper attach and remove functions
|
// Define the proper _attach and _remove functions
|
||||||
// based on browser support
|
// based on browser support
|
||||||
if(typeof document.addEventListener !== "undefined")
|
if(typeof document.addEventListener !== "undefined")
|
||||||
{
|
{
|
||||||
attach = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_attach = function (sel, event, callback)
|
||||||
{
|
{
|
||||||
sel.removeEventListener(event, callback, false);
|
if(typeof sel.addEventListener !== "undefined")
|
||||||
|
{
|
||||||
|
//Duplicated events are dropped, per the specification
|
||||||
sel.addEventListener(event, callback, false);
|
sel.addEventListener(event, callback, false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
remove = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_remove = function (sel, event, callback)
|
||||||
|
{
|
||||||
|
if(typeof sel.removeEventListener !== "undefined")
|
||||||
{
|
{
|
||||||
sel.removeEventListener(event, callback, false);
|
sel.removeEventListener(event, callback, false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//typeof function doesn't work in IE where attachEvent is available: brute force it
|
//typeof function doesn't work in IE where _attachEvent is available: brute force it
|
||||||
else if(typeof document.attachEvent !== "undefined")
|
else if(typeof document.attachEvent !== "undefined")
|
||||||
{
|
{
|
||||||
attach = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_attach = function (sel, event, callback)
|
||||||
{
|
{
|
||||||
function listener () {
|
function listener () {
|
||||||
// Internet Explorer fails to correctly set the 'this' object
|
// Internet Explorer fails to correctly set the 'this' object
|
||||||
@ -1125,10 +1326,10 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
if (typeof sel.attachEvent !== "undefined")
|
if (typeof sel.attachEvent !== "undefined")
|
||||||
{
|
{
|
||||||
remove(event, callback); // Make sure we don't have duplicate listeners
|
_remove(event, callback); // Make sure we don't have duplicate listeners
|
||||||
|
|
||||||
sel.attachEvent("on" + event, listener);
|
sel.attachEvent("on" + event, listener);
|
||||||
// Store our listener so we can remove it later
|
// Store our listener so we can _remove it later
|
||||||
var expando = sel[kis_expando] = sel[kis_expando] || {};
|
var expando = sel[kis_expando] = sel[kis_expando] || {};
|
||||||
expando.listeners = expando.listeners || {};
|
expando.listeners = expando.listeners || {};
|
||||||
expando.listeners[event] = expando.listeners[event] || [];
|
expando.listeners[event] = expando.listeners[event] || [];
|
||||||
@ -1139,10 +1340,13 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("Failed to attach event:"+event+" on "+sel);
|
console.log("Failed to _attach event:"+event+" on "+sel);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
remove = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_remove = function (sel, event, callback)
|
||||||
{
|
{
|
||||||
if(typeof sel.detachEvent !== "undefined")
|
if(typeof sel.detachEvent !== "undefined")
|
||||||
{
|
{
|
||||||
@ -1170,7 +1374,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
add_remove = function (sel, event, callback, add)
|
_add_remove = function (sel, event, callback, add)
|
||||||
{
|
{
|
||||||
var i, len;
|
var i, len;
|
||||||
|
|
||||||
@ -1190,7 +1394,7 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
add_remove(sel, event[i], callback, add);
|
_add_remove(sel, event[i], callback, add);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -1199,60 +1403,124 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
if(add === true)
|
if(add === true)
|
||||||
{
|
{
|
||||||
attach(sel, event, callback);
|
_attach(sel, event, callback);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
remove(sel, event, callback);
|
_remove(sel, event, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
attach_delegate = function(sel, target, event, callback)
|
_attach_delegate = function(sel, target, event, callback)
|
||||||
{
|
{
|
||||||
|
//_attach the listener to the parent object
|
||||||
|
_add_remove(target, event, function(e){
|
||||||
|
|
||||||
//Attach the listener to the parent object
|
var i, t;
|
||||||
add_remove(sel, event, function(e){
|
|
||||||
|
|
||||||
//Get the live version of the target selector
|
//Get the live version of the target selector
|
||||||
sel = $_.$(sel);
|
t = $_.$(target);
|
||||||
|
|
||||||
|
console.log(t);
|
||||||
|
|
||||||
//todo: fire target callback when event bubbles from target
|
//Check each element to see if it matches the target
|
||||||
}, true);
|
for(i in t)
|
||||||
};
|
|
||||||
|
|
||||||
attach_live = function(target, event, callback)
|
|
||||||
{
|
{
|
||||||
attach_delegate(document.documentElement, target, event, callback);
|
if(t.hasOwnProperty(i))
|
||||||
|
{
|
||||||
|
//Fire target callback when event bubbles from target
|
||||||
|
if(e.target == i)
|
||||||
|
{
|
||||||
|
//Trigger the event callback
|
||||||
|
callback.call(i, e);
|
||||||
|
|
||||||
|
//Stop event propegation
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @namespace
|
||||||
|
* @name event
|
||||||
|
* @memberOf $_
|
||||||
|
*/
|
||||||
e = {
|
e = {
|
||||||
|
/**
|
||||||
|
* Adds an event that returns a callback when triggered on the selected
|
||||||
|
* event and selector
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name add
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_("#selector").event.add("click", do_something());
|
||||||
|
* @param string event
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
add: function (event, callback)
|
add: function (event, callback)
|
||||||
{
|
{
|
||||||
$_.each(function(e){
|
$_.each(function(e){
|
||||||
add_remove(e, event, callback, true);
|
_add_remove(e, event, callback, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Removes an event bound the the specified selector, event type, and callback
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name remove
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_("#selector").event.remove("click", do_something());
|
||||||
|
* @param string event
|
||||||
|
* @param string callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
remove: function (event, callback)
|
remove: function (event, callback)
|
||||||
{
|
{
|
||||||
$_.each(function(e){
|
$_.each(function(e){
|
||||||
add_remove(e, event, callback, false);
|
_add_remove(e, event, callback, false);
|
||||||
});
|
|
||||||
}/*,
|
|
||||||
live: function (event, callback)
|
|
||||||
{
|
|
||||||
$_.each(function(e){
|
|
||||||
attach_live(e, event, callback);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Binds a persistent, delegated event
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name live
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_.event.live(".button", "click", do_something());
|
||||||
|
* @param string target
|
||||||
|
* @param string event
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
live: function (target, event, callback)
|
||||||
|
{
|
||||||
|
_attach_delegate(document.documentElement, target, event, callback);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Binds an event to a parent object
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name delegate
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_("#parent").delegate(".button", "click", do_something());
|
||||||
|
* @param string target
|
||||||
|
* @param string event_type
|
||||||
|
* @parma function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
delegate: function(target, event, callback)
|
delegate: function(target, event, callback)
|
||||||
{
|
{
|
||||||
$_.each(function(e){
|
$_.each(function(e){
|
||||||
attach_delegate(e, target, event, callback);
|
_attach_delegate(e, target, event, callback);
|
||||||
});
|
});
|
||||||
}*/
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$_.ext('event', e);
|
$_.ext('event', e);
|
||||||
|
42
kis-min.js
vendored
@ -1,22 +1,20 @@
|
|||||||
(function(){if(document.querySelectorAll){var c,f,g,a;f=function(b,a){var e;if(typeof b!="string"||typeof b==="undefined")return b;e=a!=null&&a.nodeType===1?a:document;if(b.match(/^#([\w\-]+$)/))return document.getElementById(b.split("#")[1]);else e=e.querySelectorAll(b);return e.length===1?e[0]:e};c=function(b){a=typeof b==="undefined"?typeof c.el!=="undefined"?c.el:document.documentElement:typeof b!=="object"?f(b):b;c.prototype.el=a;var b=g(c),d;for(d in b)if(typeof b[d]==="object")b[d].el=a;b.el=
|
(function(){if(document.querySelectorAll){var d,h,f,b;d=function(a){b=typeof a==="undefined"?typeof d.el!=="undefined"?d.el:document.documentElement:typeof a!=="object"?h(a):a;d.prototype.el=b;var a=f(d),c;for(c in a)if(typeof a[c]==="object")a[c].el=b;a.el=b;return a};h=function(a,c){var b;if(typeof a!="string"||typeof a==="undefined")return a;b=c!=null&&c.nodeType===1?c:document;if(a.match(/^#([\w\-]+$)/))return document.getElementById(a.split("#")[1]);else b=b.querySelectorAll(a);return b.length===
|
||||||
a;return b};g=function(a){var d;if(typeof a!=="undefined"){if(typeof Object.create!=="undefined")return Object.create(a);d=typeof a;if(!(d!=="object"&&d!=="function"))return d=function(){},d.prototype=a,new d}};c.ext=function(b,d){d.el=a;c[b]=d};c.ext("each",function(b){if(typeof a.length!=="undefined"&&a!==window){var d=a.length;if(d!==0)for(var e,c=0;c<d;c++)e=a.item(c)?a.item(c):a[c],b(e)}else b(a)});c.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};
|
1?b[0]:b};f=function(a){var c;if(typeof a!=="undefined"){if(typeof Object.create!=="undefined")return Object.create(a);c=typeof a;if(!(c!=="object"&&c!=="function"))return c=function(){},c.prototype=a,new c}};d.ext=function(a,c){c.el=b;d[a]=c};d.ext("each",function(a){if(typeof b.length!=="undefined"&&b!==window){var c=b.length;if(c!==0)for(var e,g=0;g<c;g++)e=b.item(g)?b.item(g):b[g],a(e)}else a(b)});d.type=function(a){return function(){return a&&a!==this}.call(a)?(typeof a).toLowerCase():{}.toString.call(a).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};
|
||||||
c=window.$_=window.$_||c;c.$=f;if(typeof window.console==="undefined")window.console={log:function(){}};if(typeof String.prototype.trim==="undefined")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}})();
|
d=window.$_=window.$_||d;d.$=h;if(typeof window.console==="undefined")window.console={log:function(){}};if(typeof String.prototype.trim==="undefined")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}})();
|
||||||
typeof document!=="undefined"&&!("classList"in document.createElement("a"))&&function(c){var c=(c.HTMLElement||c.Element).prototype,f=Object,g=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array.prototype.indexOf||function(a){for(var b=0,d=this.length;b<d;b++)if(b in this&&this[b]===a)return b;return-1},b=function(a,b){this.name=a;this.code=DOMException[a];this.message=b},d=function(d,e){if(e==="")throw new b("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new b("INVALID_CHARACTER_ERR",
|
typeof document!=="undefined"&&!("classList"in document.createElement("a"))&&function(d){var d=(d.HTMLElement||d.Element).prototype,h=Object,f=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},b=Array.prototype.indexOf||function(a){for(var c=0,b=this.length;c<b;c++)if(c in this&&this[c]===a)return c;return-1},a=function(a,c){this.name=a;this.code=DOMException[a];this.message=c},c=function(c,e){if(e==="")throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR",
|
||||||
"String contains an invalid character");return a.call(d,e)},e=function(a){for(var b=g.call(a.className),b=b?b.split(/\s+/):[],d=0,e=b.length;d<e;d++)this.push(b[d]);this._updateClassName=function(){a.className=this.toString()}},i=e.prototype=[],h=function(){return new e(this)};b.prototype=Error.prototype;i.item=function(a){return this[a]||null};i.contains=function(a){a+="";return d(this,a)!==-1};i.add=function(a){a+="";d(this,a)===-1&&(this.push(a),this._updateClassName())};i.remove=function(a){a+=
|
"String contains an invalid character");return b.call(c,e)},e=function(a){for(var c=f.call(a.className),c=c?c.split(/\s+/):[],b=0,e=c.length;b<e;b++)this.push(c[b]);this._updateClassName=function(){a.className=this.toString()}},g=e.prototype=[],j=function(){return new e(this)};a.prototype=Error.prototype;g.item=function(a){return this[a]||null};g.contains=function(a){a+="";return c(this,a)!==-1};g.add=function(a){a+="";c(this,a)===-1&&(this.push(a),this._updateClassName())};g.remove=function(a){a+=
|
||||||
"";a=d(this,a);a!==-1&&(this.splice(a,1),this._updateClassName())};i.toggle=function(a){a+="";d(this,a)===-1?this.add(a):this.remove(a)};i.toString=function(){return this.join(" ")};if(f.defineProperty){i={get:h,enumerable:true,configurable:true};try{f.defineProperty(c,"classList",i)}catch(j){if(j.number===-2146823252)i.enumerable=false,f.defineProperty(c,"classList",i)}}else f.prototype.__defineGetter__&&c.__defineGetter__("classList",h)}(self);
|
"";a=c(this,a);a!==-1&&(this.splice(a,1),this._updateClassName())};g.toggle=function(a){a+="";c(this,a)===-1?this.add(a):this.remove(a)};g.toString=function(){return this.join(" ")};if(h.defineProperty){g={get:j,enumerable:true,configurable:true};try{h.defineProperty(d,"classList",g)}catch(k){if(k.number===-2146823252)g.enumerable=false,h.defineProperty(d,"classList",g)}}else h.prototype.__defineGetter__&&d.__defineGetter__("classList",j)}(self);
|
||||||
(function(){function c(a,b,d){var e,c;if(typeof a.hasAttribute!=="undefined")a.hasAttribute(b)&&(e=a.getAttribute(b)),c=true;else if(typeof a[b]!=="undefined")e=a[b],c=false;else if(b==="class"&&typeof a.className!=="undefined")b="className",e=a.className,c=false;if(typeof e==="undefined"&&(typeof d==="undefined"||d===null))console.log(d),console.log(a),console.log("Element does not have the selected attribute");else{if(typeof d==="undefined")return e;typeof d!=="undefined"&&d!==null?c===true?a.setAttribute(b,
|
(function(){function d(b,a,c){var e,g;if(typeof b.hasAttribute!=="undefined")b.hasAttribute(a)&&(e=b.getAttribute(a)),g=true;else if(typeof b[a]!=="undefined")e=b[a],g=false;else if(a==="class"&&typeof b.className!=="undefined")a="className",e=b.className,g=false;if(typeof e==="undefined"&&(typeof c==="undefined"||c===null))console.log(c),console.log(b),console.log("Element does not have the selected attribute");else{if(typeof c==="undefined")return e;typeof c!=="undefined"&&c!==null?g===true?b.setAttribute(a,
|
||||||
d):a[b]=d:d===null&&(c===true?a.removeAttribute(b):delete a[b]);return typeof d!=="undefined"?d:e}}function f(a){return a.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function g(a,b,d){var e,b=f(b);e={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof d==="undefined"&&a.style[b]!=="undefined")return a.style[b];else if(typeof d==="undefined"&&a.style[e[b]]!=="undefined")return a.style[e[b]];typeof a.style[b]!=="undefined"?a.style[b]=d:a.style[e[b]]?
|
c):b[a]=c:c===null&&(g===true?b.removeAttribute(a):delete b[a]);return typeof c!=="undefined"?c:e}}function h(b){return b.replace(/(\-[a-z])/g,function(a){return a.toUpperCase().replace("-","")})}function f(b,a,c){var e,a=h(a);e={outerHeight:"offsetHeight",outerWidth:"offsetWidth",top:"posTop"};if(typeof c==="undefined"&&b.style[a]!=="undefined")return b.style[a];else if(typeof c==="undefined"&&b.style[e[a]]!=="undefined")return b.style[e[a]];typeof b.style[a]!=="undefined"?b.style[a]=c:b.style[e[a]]?
|
||||||
a.style[e[b]]=d:console.log("Property "+b+" nor an equivalent seems to exist")}$_.ext("dom",{addClass:function(a){$_.each(function(b){b.classList.add(a)})},removeClass:function(a){$_.each(function(b){b.classList.remove(a)})},hide:function(){this.css("display","none")},show:function(a){typeof a==="undefined"&&(a="block");this.css("display",a)},attr:function(a,b){var d=this.el;if(d.length>1&&typeof b==="undefined")console.log(d),console.log("Must be a singular element");else if(d.length>1&&typeof b!==
|
b.style[e[a]]=c:console.log("Property "+a+" nor an equivalent seems to exist")}$_.ext("dom",{addClass:function(b){$_.each(function(a){a.classList.add(b)})},removeClass:function(b){$_.each(function(a){a.classList.remove(b)})},hide:function(){this.css("display","none")},show:function(b){typeof b==="undefined"&&(b="block");this.css("display",b)},attr:function(b,a){var c=this.el;if(c.length>1&&typeof a==="undefined")console.log(c),console.log("Must be a singular element");else if(c.length>1&&typeof a!==
|
||||||
"undefined")$_.each(function(d){return c(d,a,b)});else return c(d,a,b)},text:function(a){var b,d,c;c=this.el;d=typeof c.innerText!=="undefined"?"innerText":typeof c.textContent!=="undefined"?"textContent":"innerHTML";b=c[d];return typeof a!=="undefined"?c[d]=a:b},css:function(a,b){if(typeof b==="undefined")return g(this.el,a);$_.each(function(d){g(d,a,b)})}})})();
|
"undefined")$_.each(function(c){return d(c,b,a)});else return d(c,b,a)},text:function(b){var a,c,e;e=this.el;c=typeof e.innerText!=="undefined"?"innerText":typeof e.textContent!=="undefined"?"textContent":"innerHTML";a=e[c];return typeof b!=="undefined"?e[c]=b:a},css:function(b,a){if(typeof a==="undefined")return f(this.el,b);$_.each(function(c){f(c,b,a)})}})})();
|
||||||
(function(){$_.ext("store",{get:function(c){return JSON.parse(localStorage.getItem(c))},set:function(c,f){typeof f!=="string"&&(f=JSON.stringify(f));localStorage.setItem(c,f)},remove:function(c){localStorage.removeItem(c)},getAll:function(){var c,f,g;f=localStorage.length;g={};for(c=0;c<f;c++){var a=localStorage.key(c),b=localStorage.getItem(a);g[a]=b}return g}})})();
|
(function(){$_.ext("store",{get:function(d){return JSON.parse(localStorage.getItem(d))},set:function(d,h){typeof h!=="string"&&(h=JSON.stringify(h));localStorage.setItem(d,h)},remove:function(d){localStorage.removeItem(d)},getAll:function(){var d,h,f;h=localStorage.length;f={};for(d=0;d<h;d++){var b=localStorage.key(d),a=localStorage.getItem(b);f[b]=a}return f}})})();
|
||||||
(function(){$_.hb=history.pushState?false:true;$_.ext("qs",{parse:function(c){var c=c||$_.hb,f,g,a,b;a={};if(c===true)c=location.hash.split("#!/"),c=c.length>1?c[1]:"";else if(c===false||c===void 0)c=window.location.search.substring(1);else return false;f=c.split("&");g=f.length;for(c=0;c<g;c++){b=f[c].split("=");if(b.length<2)break;a[b[0]]=b[1]}return a},set:function(c,f,g){var g=g||$_.hb,a=this.parse(g);c!==void 0&&f!==void 0&&(a[c]=f);var c=[],b;for(b in a)a.hasOwnProperty(b)&&c.push(b+"="+a[b]);
|
(function(){var d={_do:function(d,f,b,a){typeof b==="undefined"&&(b=function(){});var c=typeof window.XMLHttpRequest!=="undefined"?new XMLHttpRequest:false,a=a?"POST":"GET";d+=a==="GET"?"?"+this._serialize(f):"";c.open(a,d);c.onreadystatechange=function(){c.readyState===4&&b(c.responseText)};a==="POST"?(c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(this._serialize(f))):c.send(null)},_serialize:function(d){var f=[],b;for(b in d)if(d.hasOwnProperty(b)&&typeof d[b]!==
|
||||||
a=c.join("&");if(g===true)a="!/"+a,location.hash=a;return a},get:function(c,f){var f=f||$_.hb,g=this.parse(f);return g[c]?g[c]:""}})})();
|
"function"){var a=d[b].toString();b=encodeURIComponent(b);a=encodeURIComponent(a);f.push(b+"="+a)}return f.join("&")}};$_.ext("get",function(h,f,b){d._do(h,f,b,false)});$_.ext("post",function(h,f,b){d._do(h,f,b,true)})})();
|
||||||
(function(){var c={_do:function(c,g,a,b){typeof a==="undefined"&&(a=function(){});var d=typeof window.XMLHttpRequest!=="undefined"?new XMLHttpRequest:false,b=b?"POST":"GET";c+=b==="GET"?"?"+this._serialize(g):"";d.open(b,c);d.onreadystatechange=function(){d.readyState===4&&a(d.responseText)};b==="POST"?(d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.send(this._serialize(g))):d.send(null)},_serialize:function(c){var g=[],a;for(a in c)if(c.hasOwnProperty(a)&&typeof c[a]!==
|
(function(){var d=function(f){var b=[],a=0,c={},e,b=h.object_keys(f);b.sort(function(a,c){var b=parseFloat(c),e=parseFloat(a),f=b+""===c,d=e+""===a;if(f&&d)return b>e?1:b<e?-1:0;else if(f&&!d)return 1;else if(!f&&d)return-1;return c>a?1:c<a?-1:0});a=b.length;for(e=0;e<a;e++)c[b[e]]=f[b[e]];return c},h={object_keys:function(f){var b=[],a;for(a in f)f.hasOwnProperty(a)&&b.push(a);return b},object_values:function(f){var b=[],a;for(a in f)b.push(f[a]);return b},array_combine:function(f,b){var a={},c,
|
||||||
"function"){var b=c[a].toString();a=encodeURIComponent(a);b=encodeURIComponent(b);g.push(a+"="+b)}return g.join("&")}};$_.ext("get",function(f,g,a){c._do(f,g,a,false)});$_.ext("post",function(f,g,a){c._do(f,g,a,true)})})();
|
e=0;$_.type(f)!=="array"&&(f=this.object_values(f));$_.type(b)!=="array"&&(b=this.object_values(b));c=f.length;if(c!==b.length)return console.log("Object combine requires two arrays of the same size"),false;for(e=0;e<c;e++)a[f[e]]=b[e];return a},object_merge:function(){var f=Array.prototype.slice.call(arguments),b=f.length,a={},c,e=0,g,d,h;c=true;for(g=0;g<b;g++)if($_.type(f[g])!=="array"){c=false;break}if(c){a=[];for(g=0;g<b;g++)a=a.contact(f[g]);return a}for(g=0,h=0;g<b;g++)if(c=f[g],$_.type(c)==
|
||||||
(function(){var c=function(c){var a=[],b=0,d={},e,a=f.object_keys(c);a.sort(function(a,b){var d=parseFloat(b),c=parseFloat(a),e=d+""===b,g=c+""===a;if(e&&g)return d>c?1:d<c?-1:0;else if(e&&!g)return 1;else if(!e&&g)return-1;return b>a?1:b<a?-1:0});b=a.length;for(e=0;e<b;e++)d[a[e]]=c[a[e]];return d},f={object_keys:function(c){var a=[],b;for(b in c)c.hasOwnProperty(b)&&a.push(b);return a},object_values:function(c){var a=[],b;for(b in c)a.push(c[b]);return a},array_combine:function(c,a){var b={},d,
|
"array")for(d=0,e=c.length;d<e;d++)a[h++]=c[d];else for(d in c)c.hasOwnProperty(d)&&(parseInt(d,10)+""===d?a[h++]=c[d]:a[d]=c[d]);return a},str_trans:function(f,b,a){var c=[],e=[],g=false,h=0,k=0,i="",m="",n="",o="",l;if(typeof b==="object"){b=d(b);for(l in b)b.hasOwnProperty(l)&&(c.push(l),e.push(b[l]));b=c;a=e}k=f.length;h=b.length;i=typeof a==="string";m=typeof b==="string";for(c=0;c<k;c++){g=false;if(m){f.charAt(c-1);n=f.charAt(c);f.charAt(c+1);for(e=0;e<h;e++)if(n==b.charAt(e)){g=true;break}}else for(e=
|
||||||
e=0;$_.type(c)!=="array"&&(c=this.object_values(c));$_.type(a)!=="array"&&(a=this.object_values(a));d=c.length;if(d!==a.length)return console.log("Object combine requires two arrays of the same size"),false;for(e=0;e<d;e++)b[c[e]]=a[e];return b},object_merge:function(){var c=Array.prototype.slice.call(arguments),a=c.length,b={},d,e=0,f,h,j;d=true;for(f=0;f<a;f++)if($_.type(c[f])!=="array"){d=false;break}if(d){b=[];for(f=0;f<a;f++)b=b.contact(c[f]);return b}for(f=0,j=0;f<a;f++)if(d=c[f],$_.type(d)==
|
0;e<h;e++)if(f.substr(c,b[e].length)==b[e]){g=true;c=c+b[e].length-1;break}o+=g?i?a.charAt(e):a[e]:f.charAt(c)}return o}};$_.ext("util",h)})();
|
||||||
"array")for(h=0,e=d.length;h<e;h++)b[j++]=d[h];else for(h in d)d.hasOwnProperty(h)&&(parseInt(h,10)+""===h?b[j++]=d[h]:b[h]=d[h]);return b},str_trans:function(f,a,b){var d=[],e=[],i=false,h=0,j=0,l="",m="",n="",o="",k;if(typeof a==="object"){a=c(a);for(k in a)a.hasOwnProperty(k)&&(d.push(k),e.push(a[k]));a=d;b=e}j=f.length;h=a.length;l=typeof b==="string";m=typeof a==="string";for(d=0;d<j;d++){i=false;if(m){f.charAt(d-1);n=f.charAt(d);f.charAt(d+1);for(e=0;e<h;e++)if(n==a.charAt(e)){i=true;break}}else for(e=
|
(function(){var d,h,f,b;typeof document.addEventListener!=="undefined"?(d=function(a,c,b){typeof a.addEventListener!=="undefined"&&a.addEventListener(c,b,false)},h=function(a,c,b){typeof a.removeEventListener!=="undefined"&&a.removeEventListener(c,b,false)}):typeof document.attachEvent!=="undefined"&&(d=function(a,c,b){var e;function d(a){b.apply(a)}typeof a.attachEvent!=="undefined"?(h(c,b),a.attachEvent("on"+c,d),e=a.KIS_0_5_0=a.KIS_0_5_0||{},a=e,a.listeners=a.listeners||{},a.listeners[c]=a.listeners[c]||
|
||||||
0;e<h;e++)if(f.substr(d,a[e].length)==a[e]){i=true;d=d+a[e].length-1;break}o+=i?l?b.charAt(e):b[e]:f.charAt(d)}return o}};$_.ext("util",f)})();
|
[],a.listeners[c].push({callback:b,listener:d})):console.log("Failed to _attach event:"+c+" on "+a)},h=function(a,c,b){if(typeof a.detachEvent!=="undefined"){var d=a.KIS_0_5_0;if(d&&d.listeners&&d.listeners[c])for(var f=d.listeners[c],h=f.length,i=0;i<h;i++)if(f[i].callback===b){a.detachEvent("on"+c,f[i].listener);f.splice(i,1);f.length===0&&delete d.listeners[c];break}}});f=function(a,c,b,g){var j,k;if(typeof a==="undefined")return console.log(arguments),console.log(c),false;if(c.match(/^([\w\-]+)$/))g===
|
||||||
(function(){var c,f,g;typeof document.addEventListener!=="undefined"?(c=function(a,b,d){a.removeEventListener(b,d,false);a.addEventListener(b,d,false)},f=function(a,b,d){a.removeEventListener(b,d,false)}):typeof document.attachEvent!=="undefined"&&(c=function(a,b,d){var e;function c(a){d.apply(a)}typeof a.attachEvent!=="undefined"?(f(b,d),a.attachEvent("on"+b,c),e=a.KIS_0_3_0=a.KIS_0_3_0||{},a=e,a.listeners=a.listeners||{},a.listeners[b]=a.listeners[b]||[],a.listeners[b].push({callback:d,listener:c})):
|
true?d(a,c,b):h(a,c,b);else{c=c.split(" ");k=c.length;for(j=0;j<k;j++)f(a,c[j],b,g)}};b=function(a,c,b,d){f(c,b,function(a){var b,e;e=$_.$(c);console.log(e);for(b in e)e.hasOwnProperty(b)&&a.target==b&&(d.call(b,a),a.stopPropagation())},true)};$_.ext("event",{add:function(a,b){$_.each(function(d){f(d,a,b,true)})},remove:function(a,b){$_.each(function(d){f(d,a,b,false)})},live:function(a,c,d){b(document.documentElement,a,c,d)},delegate:function(a,c,d){$_.each(function(f){b(f,a,c,d)})}})})();
|
||||||
console.log("Failed to attach event:"+b+" on "+a)},f=function(a,b,d){if(typeof a.detachEvent!=="undefined"){var c=a.KIS_0_3_0;if(c&&c.listeners&&c.listeners[b])for(var f=c.listeners[b],g=f.length,j=0;j<g;j++)if(f[j].callback===d){a.detachEvent("on"+b,f[j].listener);f.splice(j,1);f.length===0&&delete c.listeners[b];break}}});g=function(a,b,d,e){var i,h;if(typeof a==="undefined")return console.log(arguments),console.log(b),false;if(b.match(/^([\w\-]+)$/))e===true?c(a,b,d):f(a,b,d);else{b=b.split(" ");
|
|
||||||
h=b.length;for(i=0;i<h;i++)g(a,b[i],d,e)}};$_.ext("event",{add:function(a,b){$_.each(function(c){g(c,a,b,true)})},remove:function(a,b){$_.each(function(c){g(c,a,b,false)})}})})();
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Kis JS Keep It Simple JS Library
|
Kis JS Keep It Simple JS Library
|
||||||
Copyright Timothy J. Warren
|
Copyright Timothy J. Warren
|
||||||
License Public Domain
|
License Public Domain
|
||||||
Version 0.3.0
|
Version 0.5.0-pre
|
||||||
*/
|
*/
|
||||||
(function (){
|
(function (){
|
||||||
|
|
||||||
@ -14,42 +14,18 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $_, $, dcopy, sel;
|
var $_, $, dcopy, sel, sel_string;
|
||||||
|
|
||||||
/**
|
|
||||||
* $
|
|
||||||
*
|
|
||||||
* Simple DOM selector function
|
|
||||||
*/
|
|
||||||
$ = function (a, context)
|
|
||||||
{
|
|
||||||
var x, c;
|
|
||||||
|
|
||||||
if (typeof a != "string" || typeof a === "undefined"){ return a;}
|
|
||||||
|
|
||||||
//Check for a context of a specific element, otherwise, just run on the document
|
|
||||||
c = (context != null && context.nodeType === 1)
|
|
||||||
? context
|
|
||||||
: document;
|
|
||||||
|
|
||||||
//Pick the quickest method for each kind of selector
|
|
||||||
if (a.match(/^#([\w\-]+$)/))
|
|
||||||
{
|
|
||||||
return document.getElementById(a.split('#')[1]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
x = c.querySelectorAll(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Return the single object if applicable
|
|
||||||
return (x.length === 1) ? x[0] : x;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $_
|
* $_
|
||||||
*
|
*
|
||||||
* Constructor function
|
* Constructor function
|
||||||
|
*
|
||||||
|
* @constuctor
|
||||||
|
* @namespace
|
||||||
|
* @param string selector
|
||||||
|
* @return object
|
||||||
*/
|
*/
|
||||||
$_ = function(s)
|
$_ = function(s)
|
||||||
{
|
{
|
||||||
@ -86,8 +62,49 @@
|
|||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $
|
||||||
|
*
|
||||||
|
* Simple DOM selector function
|
||||||
|
*
|
||||||
|
* @memberOf $_
|
||||||
|
* @param string selector
|
||||||
|
* @param string context
|
||||||
|
* @return object
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
$ = function (a, context)
|
||||||
|
{
|
||||||
|
var x, c;
|
||||||
|
|
||||||
|
if (typeof a != "string" || typeof a === "undefined"){ return a;}
|
||||||
|
|
||||||
|
//Check for a context of a specific element, otherwise, just run on the document
|
||||||
|
c = (context != null && context.nodeType === 1)
|
||||||
|
? context
|
||||||
|
: document;
|
||||||
|
|
||||||
|
//Pick the quickest method for each kind of selector
|
||||||
|
if (a.match(/^#([\w\-]+$)/))
|
||||||
|
{
|
||||||
|
return document.getElementById(a.split('#')[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = c.querySelectorAll(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Return the single object if applicable
|
||||||
|
return (x.length === 1) ? x[0] : x;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deep copy/prototypical constructor function
|
* Deep copy/prototypical constructor function
|
||||||
|
*
|
||||||
|
* @param object obj
|
||||||
|
* @private
|
||||||
|
* @return object
|
||||||
|
* @type object
|
||||||
*/
|
*/
|
||||||
dcopy = function(obj)
|
dcopy = function(obj)
|
||||||
{
|
{
|
||||||
@ -110,6 +127,9 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
F = function(){};
|
F = function(){};
|
||||||
|
|
||||||
F.prototype = obj;
|
F.prototype = obj;
|
||||||
@ -118,14 +138,27 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//Function to add to $_ object, and get sel
|
/**
|
||||||
|
* Adds the property `obj` to the $_ object, calling it `name`
|
||||||
|
*
|
||||||
|
* @param string name
|
||||||
|
* @param object obj
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext = function(name, obj)
|
$_.ext = function(name, obj)
|
||||||
{
|
{
|
||||||
obj.el = sel;
|
obj.el = sel;
|
||||||
$_[name] = obj;
|
$_[name] = obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Selector iteration
|
/**
|
||||||
|
* Iterates over a $_ object, applying a callback to each item
|
||||||
|
*
|
||||||
|
* @name $_.each
|
||||||
|
* @function
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext('each', function (callback)
|
$_.ext('each', function (callback)
|
||||||
{
|
{
|
||||||
if(typeof sel.length !== "undefined" && sel !== window)
|
if(typeof sel.length !== "undefined" && sel !== window)
|
||||||
@ -150,7 +183,13 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//Type retriever
|
/**
|
||||||
|
* Retrieves the type of the passed variable
|
||||||
|
*
|
||||||
|
* @param mixed obj
|
||||||
|
* @return string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
$_.type = function(obj)
|
$_.type = function(obj)
|
||||||
{
|
{
|
||||||
if((function() {return obj && (obj !== this)}).call(obj))
|
if((function() {return obj && (obj !== this)}).call(obj))
|
||||||
@ -179,6 +218,9 @@
|
|||||||
*/
|
*/
|
||||||
if(typeof String.prototype.trim === "undefined")
|
if(typeof String.prototype.trim === "undefined")
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
String.prototype.trim = function(){
|
String.prototype.trim = function(){
|
||||||
return this.replace(/^\s+|\s+$/g, "");
|
return this.replace(/^\s+|\s+$/g, "");
|
||||||
};
|
};
|
@ -37,12 +37,18 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
// Vendors: please allow content code to instantiate DOMExceptions
|
// Vendors: please allow content code to instantiate DOMExceptions
|
||||||
,
|
,
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
DOMEx = function (type, message)
|
DOMEx = function (type, message)
|
||||||
{
|
{
|
||||||
this.name = type;
|
this.name = type;
|
||||||
this.code = DOMException[type];
|
this.code = DOMException[type];
|
||||||
this.message = message;
|
this.message = message;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
checkTokenAndGetIndex = function (classList, token)
|
checkTokenAndGetIndex = function (classList, token)
|
||||||
{
|
{
|
||||||
if (token === "")
|
if (token === "")
|
||||||
@ -55,6 +61,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
}
|
}
|
||||||
return arrIndexOf.call(classList, token);
|
return arrIndexOf.call(classList, token);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
ClassList = function (elem)
|
ClassList = function (elem)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
@ -72,6 +81,9 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
classListProto = ClassList[protoProp] = [],
|
classListProto = ClassList[protoProp] = [],
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
classListGetter = function ()
|
classListGetter = function ()
|
||||||
{
|
{
|
||||||
return new ClassList(this);
|
return new ClassList(this);
|
||||||
@ -154,10 +166,6 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
|
||||||
* Dom manipulation object
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
(function (){
|
(function (){
|
||||||
var d, tag_reg, class_reg;
|
var d, tag_reg, class_reg;
|
||||||
|
|
||||||
@ -286,23 +294,71 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOM
|
||||||
|
*
|
||||||
|
* Dom manipulation module
|
||||||
|
* @namespace
|
||||||
|
* @memberOf $_
|
||||||
|
* @name dom
|
||||||
|
*/
|
||||||
d = {
|
d = {
|
||||||
|
/**
|
||||||
|
* Adds a class to the element(s) specified by the current
|
||||||
|
* selector
|
||||||
|
*
|
||||||
|
* @name addClass
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param string class
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
addClass: function (c)
|
addClass: function (c)
|
||||||
{
|
{
|
||||||
$_.each(function (e){
|
$_.each(function (e){
|
||||||
e.classList.add(c);
|
e.classList.add(c);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Removes a class from the element(s) specified by the current
|
||||||
|
* selector
|
||||||
|
*
|
||||||
|
* @name removeClass
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param string class
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
removeClass: function (c)
|
removeClass: function (c)
|
||||||
{
|
{
|
||||||
$_.each(function (e){
|
$_.each(function (e){
|
||||||
e.classList.remove(c);
|
e.classList.remove(c);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Hides the element(s) specified by the current selector
|
||||||
|
*
|
||||||
|
* @name hide
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
hide: function ()
|
hide: function ()
|
||||||
{
|
{
|
||||||
this.css('display', 'none');
|
this.css('display', 'none');
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Shows the element(s) specified by the current selector.
|
||||||
|
* if type is specified, the element will have it's style
|
||||||
|
* property set to "display:[your type]". If type is not
|
||||||
|
* specified, the element is set to "display:block".
|
||||||
|
*
|
||||||
|
* @name show
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param [string] type
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
show: function (type)
|
show: function (type)
|
||||||
{
|
{
|
||||||
if (typeof type === "undefined")
|
if (typeof type === "undefined")
|
||||||
@ -312,6 +368,20 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
|
|
||||||
this.css("display", type);
|
this.css("display", type);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Sets attributes on element(s) specified by the current
|
||||||
|
* selector, or, if name is not specified, returns the
|
||||||
|
* value of the attribute of the element specified by the
|
||||||
|
* current selector.
|
||||||
|
*
|
||||||
|
* @name attr
|
||||||
|
* @memberOf $_.dom
|
||||||
|
* @function
|
||||||
|
* @param string name
|
||||||
|
* @param string value
|
||||||
|
* @return string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
attr: function (name, value)
|
attr: function (name, value)
|
||||||
{
|
{
|
||||||
var sel = this.el;
|
var sel = this.el;
|
||||||
@ -334,6 +404,19 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
return _attr(sel, name, value);
|
return _attr(sel, name, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Sets or retrieves the text content of the element
|
||||||
|
* specified by the current selector. If a value is
|
||||||
|
* passed, it will set that value on the current element,
|
||||||
|
* otherwise it will return the value of the current element
|
||||||
|
*
|
||||||
|
* @name text
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param [string] value
|
||||||
|
* @returns string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
text: function (value)
|
text: function (value)
|
||||||
{
|
{
|
||||||
var oldValue, set, type, sel;
|
var oldValue, set, type, sel;
|
||||||
@ -360,6 +443,21 @@ if (typeof document !== "undefined" && !("classList" in document.createElement("
|
|||||||
return oldValue;
|
return oldValue;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Sets or retrieves a css property of the element
|
||||||
|
* specified by the current selector. If a value is
|
||||||
|
* passed, it will set that value on the current element,
|
||||||
|
* otherwise it will return the value of the css property
|
||||||
|
* on the current element
|
||||||
|
*
|
||||||
|
* @name css
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param string property
|
||||||
|
* @param [string] value
|
||||||
|
* @returns string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
css: function (prop, val)
|
css: function (prop, val)
|
||||||
{
|
{
|
||||||
//Return the current value if a value is not set
|
//Return the current value if a value is not set
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
/**
|
|
||||||
* Qs
|
|
||||||
*
|
|
||||||
* Object for encoding and decoding querystrings and hashbang strings
|
|
||||||
*/
|
|
||||||
(function (){
|
|
||||||
|
|
||||||
$_.hb = (history.pushState) ? false : true;
|
|
||||||
|
|
||||||
var qs = {
|
|
||||||
parse: function (hb)
|
|
||||||
{
|
|
||||||
hb = hb || $_.hb;
|
|
||||||
|
|
||||||
var h, i, hString, pairs, pLen, data, y;
|
|
||||||
|
|
||||||
data = {};
|
|
||||||
|
|
||||||
if (hb === true)
|
|
||||||
{
|
|
||||||
h = location.hash.split('#!/');
|
|
||||||
hString = (h.length > 1) ? h[1] : '';
|
|
||||||
}
|
|
||||||
else if (hb === false || hb === undefined)
|
|
||||||
{
|
|
||||||
hString = window.location.search.substring(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
pairs = hString.split('&');
|
|
||||||
|
|
||||||
pLen = pairs.length;
|
|
||||||
|
|
||||||
for (i = 0; i < pLen; i++)
|
|
||||||
{
|
|
||||||
y = pairs[i].split('=');
|
|
||||||
|
|
||||||
if (y.length < 2)
|
|
||||||
{
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
data[y[0]] = y[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
set: function (key, value, hb)
|
|
||||||
{
|
|
||||||
hb = hb || $_.hb;
|
|
||||||
var pairs = this.parse(hb);
|
|
||||||
|
|
||||||
if (key !== undefined && value !== undefined)
|
|
||||||
{
|
|
||||||
pairs[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
var vars = [];
|
|
||||||
|
|
||||||
for (var x in pairs)
|
|
||||||
{
|
|
||||||
if (pairs.hasOwnProperty(x))
|
|
||||||
{
|
|
||||||
vars.push(x + '=' + pairs[x]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var qs = vars.join('&');
|
|
||||||
|
|
||||||
if (hb === true)
|
|
||||||
{
|
|
||||||
qs = '!/' + qs;
|
|
||||||
location.hash = qs;
|
|
||||||
}
|
|
||||||
|
|
||||||
return qs;
|
|
||||||
},
|
|
||||||
get: function (key, hb)
|
|
||||||
{
|
|
||||||
hb = hb || $_.hb;
|
|
||||||
var pairs = this.parse(hb);
|
|
||||||
return (pairs[key]) ? pairs[key] : '';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$_.ext('qs', qs);
|
|
||||||
|
|
||||||
}());
|
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Ajax
|
* Ajax
|
||||||
*
|
*
|
||||||
* Object for making ajax requests
|
* Module for making ajax requests
|
||||||
*/
|
*/
|
||||||
(function (){
|
(function (){
|
||||||
|
|
||||||
@ -10,6 +10,9 @@
|
|||||||
{
|
{
|
||||||
if (typeof callback === "undefined")
|
if (typeof callback === "undefined")
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
callback = function (){};
|
callback = function (){};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,10 +71,32 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a GET type ajax request
|
||||||
|
*
|
||||||
|
* @name get
|
||||||
|
* @function
|
||||||
|
* @memberOf $_
|
||||||
|
* @param string url
|
||||||
|
* @param object data
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext('get', function (url, data, callback){
|
$_.ext('get', function (url, data, callback){
|
||||||
ajax._do(url, data, callback, false);
|
ajax._do(url, data, callback, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends a POST type ajax request
|
||||||
|
*
|
||||||
|
* @name post
|
||||||
|
* @function
|
||||||
|
* @memberOf $_
|
||||||
|
* @param string url
|
||||||
|
* @param object data
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
$_.ext('post', function (url, data, callback){
|
$_.ext('post', function (url, data, callback){
|
||||||
ajax._do(url, data, callback, true);
|
ajax._do(url, data, callback, true);
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Event object
|
* Event
|
||||||
*
|
*
|
||||||
* Event api wrapper
|
* Event api wrapper
|
||||||
*/
|
*/
|
||||||
@ -8,28 +8,43 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Property name for expandos on DOM objects
|
// Property name for expandos on DOM objects
|
||||||
var kis_expando = "KIS_0_3_0";
|
var kis_expando = "KIS_0_5_0";
|
||||||
|
|
||||||
var attach, remove, add_remove, e, attach_delegate, attach_live;
|
var _attach, _remove, _add_remove, e, _attach_delegate;
|
||||||
|
|
||||||
// Define the proper attach and remove functions
|
// Define the proper _attach and _remove functions
|
||||||
// based on browser support
|
// based on browser support
|
||||||
if(typeof document.addEventListener !== "undefined")
|
if(typeof document.addEventListener !== "undefined")
|
||||||
{
|
{
|
||||||
attach = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_attach = function (sel, event, callback)
|
||||||
{
|
{
|
||||||
sel.removeEventListener(event, callback, false);
|
if(typeof sel.addEventListener !== "undefined")
|
||||||
|
{
|
||||||
|
//Duplicated events are dropped, per the specification
|
||||||
sel.addEventListener(event, callback, false);
|
sel.addEventListener(event, callback, false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
remove = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_remove = function (sel, event, callback)
|
||||||
|
{
|
||||||
|
if(typeof sel.removeEventListener !== "undefined")
|
||||||
{
|
{
|
||||||
sel.removeEventListener(event, callback, false);
|
sel.removeEventListener(event, callback, false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
//typeof function doesn't work in IE where attachEvent is available: brute force it
|
//typeof function doesn't work in IE where _attachEvent is available: brute force it
|
||||||
else if(typeof document.attachEvent !== "undefined")
|
else if(typeof document.attachEvent !== "undefined")
|
||||||
{
|
{
|
||||||
attach = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_attach = function (sel, event, callback)
|
||||||
{
|
{
|
||||||
function listener () {
|
function listener () {
|
||||||
// Internet Explorer fails to correctly set the 'this' object
|
// Internet Explorer fails to correctly set the 'this' object
|
||||||
@ -39,10 +54,10 @@
|
|||||||
|
|
||||||
if (typeof sel.attachEvent !== "undefined")
|
if (typeof sel.attachEvent !== "undefined")
|
||||||
{
|
{
|
||||||
remove(event, callback); // Make sure we don't have duplicate listeners
|
_remove(event, callback); // Make sure we don't have duplicate listeners
|
||||||
|
|
||||||
sel.attachEvent("on" + event, listener);
|
sel.attachEvent("on" + event, listener);
|
||||||
// Store our listener so we can remove it later
|
// Store our listener so we can _remove it later
|
||||||
var expando = sel[kis_expando] = sel[kis_expando] || {};
|
var expando = sel[kis_expando] = sel[kis_expando] || {};
|
||||||
expando.listeners = expando.listeners || {};
|
expando.listeners = expando.listeners || {};
|
||||||
expando.listeners[event] = expando.listeners[event] || [];
|
expando.listeners[event] = expando.listeners[event] || [];
|
||||||
@ -53,10 +68,13 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("Failed to attach event:"+event+" on "+sel);
|
console.log("Failed to _attach event:"+event+" on "+sel);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
remove = function (sel, event, callback)
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
_remove = function (sel, event, callback)
|
||||||
{
|
{
|
||||||
if(typeof sel.detachEvent !== "undefined")
|
if(typeof sel.detachEvent !== "undefined")
|
||||||
{
|
{
|
||||||
@ -84,7 +102,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
add_remove = function (sel, event, callback, add)
|
_add_remove = function (sel, event, callback, add)
|
||||||
{
|
{
|
||||||
var i, len;
|
var i, len;
|
||||||
|
|
||||||
@ -104,7 +122,7 @@
|
|||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
add_remove(sel, event[i], callback, add);
|
_add_remove(sel, event[i], callback, add);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -113,60 +131,124 @@
|
|||||||
|
|
||||||
if(add === true)
|
if(add === true)
|
||||||
{
|
{
|
||||||
attach(sel, event, callback);
|
_attach(sel, event, callback);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
remove(sel, event, callback);
|
_remove(sel, event, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
attach_delegate = function(sel, target, event, callback)
|
_attach_delegate = function(sel, target, event, callback)
|
||||||
{
|
{
|
||||||
|
//_attach the listener to the parent object
|
||||||
|
_add_remove(target, event, function(e){
|
||||||
|
|
||||||
//Attach the listener to the parent object
|
var i, t;
|
||||||
add_remove(sel, event, function(e){
|
|
||||||
|
|
||||||
//Get the live version of the target selector
|
//Get the live version of the target selector
|
||||||
sel = $_.$(sel);
|
t = $_.$(target);
|
||||||
|
|
||||||
|
console.log(t);
|
||||||
|
|
||||||
//todo: fire target callback when event bubbles from target
|
//Check each element to see if it matches the target
|
||||||
}, true);
|
for(i in t)
|
||||||
};
|
|
||||||
|
|
||||||
attach_live = function(target, event, callback)
|
|
||||||
{
|
{
|
||||||
attach_delegate(document.documentElement, target, event, callback);
|
if(t.hasOwnProperty(i))
|
||||||
|
{
|
||||||
|
//Fire target callback when event bubbles from target
|
||||||
|
if(e.target == i)
|
||||||
|
{
|
||||||
|
//Trigger the event callback
|
||||||
|
callback.call(i, e);
|
||||||
|
|
||||||
|
//Stop event propegation
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @namespace
|
||||||
|
* @name event
|
||||||
|
* @memberOf $_
|
||||||
|
*/
|
||||||
e = {
|
e = {
|
||||||
|
/**
|
||||||
|
* Adds an event that returns a callback when triggered on the selected
|
||||||
|
* event and selector
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name add
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_("#selector").event.add("click", do_something());
|
||||||
|
* @param string event
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
add: function (event, callback)
|
add: function (event, callback)
|
||||||
{
|
{
|
||||||
$_.each(function(e){
|
$_.each(function(e){
|
||||||
add_remove(e, event, callback, true);
|
_add_remove(e, event, callback, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Removes an event bound the the specified selector, event type, and callback
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name remove
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_("#selector").event.remove("click", do_something());
|
||||||
|
* @param string event
|
||||||
|
* @param string callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
remove: function (event, callback)
|
remove: function (event, callback)
|
||||||
{
|
{
|
||||||
$_.each(function(e){
|
$_.each(function(e){
|
||||||
add_remove(e, event, callback, false);
|
_add_remove(e, event, callback, false);
|
||||||
});
|
|
||||||
}/*,
|
|
||||||
live: function (event, callback)
|
|
||||||
{
|
|
||||||
$_.each(function(e){
|
|
||||||
attach_live(e, event, callback);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Binds a persistent, delegated event
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name live
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_.event.live(".button", "click", do_something());
|
||||||
|
* @param string target
|
||||||
|
* @param string event
|
||||||
|
* @param function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
live: function (target, event, callback)
|
||||||
|
{
|
||||||
|
_attach_delegate(document.documentElement, target, event, callback);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Binds an event to a parent object
|
||||||
|
*
|
||||||
|
* @memberOf $_.event
|
||||||
|
* @name delegate
|
||||||
|
* @function
|
||||||
|
* @example Eg. $_("#parent").delegate(".button", "click", do_something());
|
||||||
|
* @param string target
|
||||||
|
* @param string event_type
|
||||||
|
* @parma function callback
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
delegate: function(target, event, callback)
|
delegate: function(target, event, callback)
|
||||||
{
|
{
|
||||||
$_.each(function(e){
|
$_.each(function(e){
|
||||||
attach_delegate(e, target, event, callback);
|
_attach_delegate(e, target, event, callback);
|
||||||
});
|
});
|
||||||
}*/
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$_.ext('event', e);
|
$_.ext('event', e);
|
||||||
|
@ -1,14 +1,39 @@
|
|||||||
/**
|
|
||||||
* Store object
|
|
||||||
*
|
|
||||||
* Wrapper for localstorage data serialization
|
|
||||||
*/
|
|
||||||
(function (){
|
(function (){
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for localstorage data serialization
|
||||||
|
*
|
||||||
|
* @name store
|
||||||
|
* @namespace
|
||||||
|
* @memberOf $_
|
||||||
|
*/
|
||||||
var store = {
|
var store = {
|
||||||
|
/**
|
||||||
|
* Retrieves and deserializes a value from localstorage,
|
||||||
|
* based on the specified key
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @name get
|
||||||
|
* @memberOf $_.store
|
||||||
|
* @function
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
get: function (key)
|
get: function (key)
|
||||||
{
|
{
|
||||||
return JSON.parse(localStorage.getItem(key));
|
return JSON.parse(localStorage.getItem(key));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Puts a value into localstorage at the specified key,
|
||||||
|
* and JSON-encodes the value if not a string
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @param mixed value
|
||||||
|
* @name set
|
||||||
|
* @memberOf $_.store
|
||||||
|
* @function
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
set: function (key, value)
|
set: function (key, value)
|
||||||
{
|
{
|
||||||
if (typeof value !== "string")
|
if (typeof value !== "string")
|
||||||
@ -17,10 +42,28 @@
|
|||||||
}
|
}
|
||||||
localStorage.setItem(key, value);
|
localStorage.setItem(key, value);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Removes the specified item from localstorage
|
||||||
|
*
|
||||||
|
* @param string key
|
||||||
|
* @name remove
|
||||||
|
* @memberOf $_.store
|
||||||
|
* @function
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
remove: function (key)
|
remove: function (key)
|
||||||
{
|
{
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Returns an array of all the values in localstorage
|
||||||
|
* in their raw form
|
||||||
|
*
|
||||||
|
* @name getAll
|
||||||
|
* @member of $_.store
|
||||||
|
* @function
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
getAll: function ()
|
getAll: function ()
|
||||||
{
|
{
|
||||||
var i,
|
var i,
|
||||||
|
@ -54,7 +54,25 @@
|
|||||||
|
|
||||||
return new_o;
|
return new_o;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* String and object manipulation utilities
|
||||||
|
*
|
||||||
|
* @namespace
|
||||||
|
* @name util
|
||||||
|
* @memberOf $_
|
||||||
|
*/
|
||||||
u = {
|
u = {
|
||||||
|
/**
|
||||||
|
* Retrieve the keys, or member names of an object
|
||||||
|
*
|
||||||
|
* @name object_keys
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param object
|
||||||
|
* @return array
|
||||||
|
* @type array
|
||||||
|
*/
|
||||||
object_keys: function(o)
|
object_keys: function(o)
|
||||||
{
|
{
|
||||||
var keys = [],
|
var keys = [],
|
||||||
@ -70,6 +88,17 @@
|
|||||||
|
|
||||||
return keys;
|
return keys;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Retrieves the values of an object, and returns
|
||||||
|
* them as an array
|
||||||
|
*
|
||||||
|
* @name object_values
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param object
|
||||||
|
* @return array
|
||||||
|
* @type array
|
||||||
|
*/
|
||||||
object_values: function(o)
|
object_values: function(o)
|
||||||
{
|
{
|
||||||
var vals = [],
|
var vals = [],
|
||||||
@ -82,6 +111,20 @@
|
|||||||
|
|
||||||
return vals;
|
return vals;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Creates an object, with the property names of the first array,
|
||||||
|
* and the values of the second. If objects are passed, the values
|
||||||
|
* of the object are used. If the arrays or objects passed are
|
||||||
|
* not the same size, the function will return false.
|
||||||
|
*
|
||||||
|
* @name array_combine
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param array/object keys
|
||||||
|
* @param array/object vals
|
||||||
|
* @return object
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
array_combine: function(keys, vals)
|
array_combine: function(keys, vals)
|
||||||
{
|
{
|
||||||
var new_object = {},
|
var new_object = {},
|
||||||
@ -115,6 +158,20 @@
|
|||||||
|
|
||||||
return new_object;
|
return new_object;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Combines two or more objects/arrays. If the keys are numeric, the outputted
|
||||||
|
* object will have re-indexed keys. If a key/value pair exists in both objects,
|
||||||
|
* indentical values will be droped, but if a key exists with a different value,
|
||||||
|
* with the same key, the value in the second array will replace the value in the
|
||||||
|
* first
|
||||||
|
*
|
||||||
|
* @name object_merge
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param object [as many as you wish to combine]
|
||||||
|
* @type object
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
object_merge: function()
|
object_merge: function()
|
||||||
{
|
{
|
||||||
var args = Array.prototype.slice.call(arguments),
|
var args = Array.prototype.slice.call(arguments),
|
||||||
@ -188,6 +245,21 @@
|
|||||||
|
|
||||||
return new_obj;
|
return new_obj;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Replaces sections of strings in a greedy fashion,
|
||||||
|
* starting with the longest replace pairs first. Accepts
|
||||||
|
* one replace pair as two parameters, or an object, with
|
||||||
|
* from => to replacements as key/value pairs
|
||||||
|
*
|
||||||
|
* @name str_trans
|
||||||
|
* @memberOf $_.util
|
||||||
|
* @function
|
||||||
|
* @param string input_string
|
||||||
|
* @param mixed
|
||||||
|
* @param [string] to
|
||||||
|
* @return string
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
str_trans: function(str, from, to)
|
str_trans: function(str, from, to)
|
||||||
{
|
{
|
||||||
var froms = [],
|
var froms = [],
|
||||||
|
@ -53,9 +53,9 @@
|
|||||||
|
|
||||||
test("Sub-modules", function(){
|
test("Sub-modules", function(){
|
||||||
expect(4);
|
expect(4);
|
||||||
ok($_.qs, "Query String module");
|
|
||||||
ok($_().event, "Event module");
|
ok($_().event, "Event module");
|
||||||
ok($_.store, "Local Storage module");
|
ok($_.store, "Local Storage module");
|
||||||
ok($_().dom, "Dom manipulation module");
|
ok($_().dom, "Dom manipulation module");
|
||||||
|
ok($_.util, "Utilities module");
|
||||||
});
|
});
|
||||||
}());
|
}());
|