kanpachi 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bowerrc +3 -0
- data/.travis.yml +3 -1
- data/bower.json +22 -0
- data/kanpachi.gemspec +6 -6
- data/lib/kanpachi/doc/template/components/html5shiv/.bower.json +26 -0
- data/lib/kanpachi/doc/template/components/html5shiv/dist/html5shiv-printshiv.js +11 -0
- data/lib/kanpachi/doc/template/{source/javascripts → components/html5shiv/dist}/html5shiv.js +4 -5
- data/lib/kanpachi/doc/template/components/html5shiv/readme.md +143 -0
- data/lib/kanpachi/doc/template/components/jquery/.bower.json +37 -0
- data/lib/kanpachi/doc/template/components/jquery/MIT-LICENSE.txt +21 -0
- data/lib/kanpachi/doc/template/components/jquery/bower.json +27 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.js +10337 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.min.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/dist/jquery.min.map +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax.js +807 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/jsonp.js +89 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/load.js +75 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/parseJSON.js +51 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/parseXML.js +31 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/script.js +93 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/ajax/xhr.js +196 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes.js +11 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/attr.js +271 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/classes.js +157 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/prop.js +134 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/support.js +64 -0
- data/lib/kanpachi/doc/template/components/jquery/src/attributes/val.js +176 -0
- data/lib/kanpachi/doc/template/components/jquery/src/callbacks.js +205 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core.js +542 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/access.js +60 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/init.js +132 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/parseHTML.js +39 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/ready.js +151 -0
- data/lib/kanpachi/doc/template/components/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css.js +508 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/addGetHookIf.js +32 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/curCSS.js +117 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/defaultDisplay.js +68 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/hiddenVisibleSelectors.js +20 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/support.js +193 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/swap.js +28 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/isHidden.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/rmargin.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data.js +332 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data/accepts.js +21 -0
- data/lib/kanpachi/doc/template/components/jquery/src/data/support.js +25 -0
- data/lib/kanpachi/doc/template/components/jquery/src/deferred.js +150 -0
- data/lib/kanpachi/doc/template/components/jquery/src/deprecated.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/dimensions.js +50 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects.js +648 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/Tween.js +114 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/kanpachi/doc/template/components/jquery/src/effects/support.js +76 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event.js +1029 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event/alias.js +39 -0
- data/lib/kanpachi/doc/template/components/jquery/src/event/support.js +26 -0
- data/lib/kanpachi/doc/template/components/jquery/src/exports/amd.js +18 -0
- data/lib/kanpachi/doc/template/components/jquery/src/exports/global.js +32 -0
- data/lib/kanpachi/doc/template/components/jquery/src/intro.js +44 -0
- data/lib/kanpachi/doc/template/components/jquery/src/jquery.js +37 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation.js +744 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/support.js +79 -0
- data/lib/kanpachi/doc/template/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/offset.js +211 -0
- data/lib/kanpachi/doc/template/components/jquery/src/outro.js +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/queue.js +142 -0
- data/lib/kanpachi/doc/template/components/jquery/src/queue/delay.js +22 -0
- data/lib/kanpachi/doc/template/components/jquery/src/selector-sizzle.js +14 -0
- data/lib/kanpachi/doc/template/components/jquery/src/selector.js +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/serialize.js +110 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.js +2015 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/kanpachi/doc/template/components/jquery/src/support.js +62 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing.js +200 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing/findFilter.js +100 -0
- data/lib/kanpachi/doc/template/components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/class2type.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/concat.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/deletedIds.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/hasOwn.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/indexOf.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/pnum.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/push.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/rnotwhite.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/slice.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/strundefined.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/support.js +4 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/toString.js +5 -0
- data/lib/kanpachi/doc/template/components/jquery/src/var/trim.js +3 -0
- data/lib/kanpachi/doc/template/components/jquery/src/wrap.js +75 -0
- data/lib/kanpachi/doc/template/components/respond/.bower.json +20 -0
- data/lib/kanpachi/doc/template/components/respond/Gruntfile.js +90 -0
- data/lib/kanpachi/doc/template/components/respond/LICENSE-MIT +22 -0
- data/lib/kanpachi/doc/template/components/respond/README.md +114 -0
- data/lib/kanpachi/doc/template/components/respond/bower.json +10 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/example.html +24 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond-proxy.html +96 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond.proxy.gif +0 -0
- data/lib/kanpachi/doc/template/components/respond/cross-domain/respond.proxy.js +127 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.matchmedia.addListener.min.js +5 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.matchmedia.addListener.src.js +273 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.min.js +5 -0
- data/lib/kanpachi/doc/template/components/respond/dest/respond.src.js +224 -0
- data/lib/kanpachi/doc/template/components/respond/package.json +32 -0
- data/lib/kanpachi/doc/template/components/respond/src/matchmedia.addListener.js +76 -0
- data/lib/kanpachi/doc/template/components/respond/src/matchmedia.polyfill.js +36 -0
- data/lib/kanpachi/doc/template/components/respond/src/respond.js +341 -0
- data/lib/kanpachi/doc/template/config.rb +4 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.svg +201 -200
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/kanpachi/doc/template/source/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/kanpachi/doc/template/source/javascripts/all.coffee +2 -0
- data/lib/kanpachi/doc/template/source/javascripts/bootstrap.js +271 -319
- data/lib/kanpachi/doc/template/source/javascripts/bootstrap.min.js +6 -6
- data/lib/kanpachi/doc/template/source/javascripts/ie.coffee +2 -0
- data/lib/kanpachi/doc/template/source/layouts/layout.slim +4 -6
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css +192 -229
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.css.map +1 -0
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap-theme.min.css +7 -1
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.css +2036 -3056
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.css.map +1 -0
- data/lib/kanpachi/doc/template/source/stylesheets/bootstrap.min.css +6 -8
- data/lib/kanpachi/version.rb +1 -1
- data/wercker.yml +27 -0
- metadata +143 -31
- data/lib/kanpachi/doc/template/source/javascripts/all.js +0 -1
- data/lib/kanpachi/doc/template/source/javascripts/jquery-1.10.2.min.js +0 -6
- data/lib/kanpachi/doc/template/source/javascripts/respond.min.js +0 -7
@@ -0,0 +1,64 @@
|
|
1
|
+
define([
|
2
|
+
"../var/support"
|
3
|
+
], function( support ) {
|
4
|
+
|
5
|
+
(function() {
|
6
|
+
var a, input, select, opt,
|
7
|
+
div = document.createElement("div" );
|
8
|
+
|
9
|
+
// Setup
|
10
|
+
div.setAttribute( "className", "t" );
|
11
|
+
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
12
|
+
a = div.getElementsByTagName("a")[ 0 ];
|
13
|
+
|
14
|
+
// First batch of tests.
|
15
|
+
select = document.createElement("select");
|
16
|
+
opt = select.appendChild( document.createElement("option") );
|
17
|
+
input = div.getElementsByTagName("input")[ 0 ];
|
18
|
+
|
19
|
+
a.style.cssText = "top:1px";
|
20
|
+
|
21
|
+
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
22
|
+
support.getSetAttribute = div.className !== "t";
|
23
|
+
|
24
|
+
// Get the style information from getAttribute
|
25
|
+
// (IE uses .cssText instead)
|
26
|
+
support.style = /top/.test( a.getAttribute("style") );
|
27
|
+
|
28
|
+
// Make sure that URLs aren't manipulated
|
29
|
+
// (IE normalizes it by default)
|
30
|
+
support.hrefNormalized = a.getAttribute("href") === "/a";
|
31
|
+
|
32
|
+
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
|
33
|
+
support.checkOn = !!input.value;
|
34
|
+
|
35
|
+
// Make sure that a selected-by-default option has a working selected property.
|
36
|
+
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
37
|
+
support.optSelected = opt.selected;
|
38
|
+
|
39
|
+
// Tests for enctype support on a form (#6743)
|
40
|
+
support.enctype = !!document.createElement("form").enctype;
|
41
|
+
|
42
|
+
// Make sure that the options inside disabled selects aren't marked as disabled
|
43
|
+
// (WebKit marks them as disabled)
|
44
|
+
select.disabled = true;
|
45
|
+
support.optDisabled = !opt.disabled;
|
46
|
+
|
47
|
+
// Support: IE8 only
|
48
|
+
// Check if we can trust getAttribute("value")
|
49
|
+
input = document.createElement( "input" );
|
50
|
+
input.setAttribute( "value", "" );
|
51
|
+
support.input = input.getAttribute( "value" ) === "";
|
52
|
+
|
53
|
+
// Check if an input maintains its value after becoming a radio
|
54
|
+
input.value = "t";
|
55
|
+
input.setAttribute( "type", "radio" );
|
56
|
+
support.radioValue = input.value === "t";
|
57
|
+
|
58
|
+
// Null elements to avoid leaks in IE.
|
59
|
+
a = input = select = opt = div = null;
|
60
|
+
})();
|
61
|
+
|
62
|
+
return support;
|
63
|
+
|
64
|
+
});
|
@@ -0,0 +1,176 @@
|
|
1
|
+
define([
|
2
|
+
"../core",
|
3
|
+
"./support",
|
4
|
+
"../core/init"
|
5
|
+
], function( jQuery, support ) {
|
6
|
+
|
7
|
+
var rreturn = /\r/g;
|
8
|
+
|
9
|
+
jQuery.fn.extend({
|
10
|
+
val: function( value ) {
|
11
|
+
var hooks, ret, isFunction,
|
12
|
+
elem = this[0];
|
13
|
+
|
14
|
+
if ( !arguments.length ) {
|
15
|
+
if ( elem ) {
|
16
|
+
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
|
17
|
+
|
18
|
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
19
|
+
return ret;
|
20
|
+
}
|
21
|
+
|
22
|
+
ret = elem.value;
|
23
|
+
|
24
|
+
return typeof ret === "string" ?
|
25
|
+
// handle most common string cases
|
26
|
+
ret.replace(rreturn, "") :
|
27
|
+
// handle cases where value is null/undef or number
|
28
|
+
ret == null ? "" : ret;
|
29
|
+
}
|
30
|
+
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
|
34
|
+
isFunction = jQuery.isFunction( value );
|
35
|
+
|
36
|
+
return this.each(function( i ) {
|
37
|
+
var val;
|
38
|
+
|
39
|
+
if ( this.nodeType !== 1 ) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
if ( isFunction ) {
|
44
|
+
val = value.call( this, i, jQuery( this ).val() );
|
45
|
+
} else {
|
46
|
+
val = value;
|
47
|
+
}
|
48
|
+
|
49
|
+
// Treat null/undefined as ""; convert numbers to string
|
50
|
+
if ( val == null ) {
|
51
|
+
val = "";
|
52
|
+
} else if ( typeof val === "number" ) {
|
53
|
+
val += "";
|
54
|
+
} else if ( jQuery.isArray( val ) ) {
|
55
|
+
val = jQuery.map( val, function( value ) {
|
56
|
+
return value == null ? "" : value + "";
|
57
|
+
});
|
58
|
+
}
|
59
|
+
|
60
|
+
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
|
61
|
+
|
62
|
+
// If set returns undefined, fall back to normal setting
|
63
|
+
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
64
|
+
this.value = val;
|
65
|
+
}
|
66
|
+
});
|
67
|
+
}
|
68
|
+
});
|
69
|
+
|
70
|
+
jQuery.extend({
|
71
|
+
valHooks: {
|
72
|
+
option: {
|
73
|
+
get: function( elem ) {
|
74
|
+
var val = jQuery.find.attr( elem, "value" );
|
75
|
+
return val != null ?
|
76
|
+
val :
|
77
|
+
jQuery.text( elem );
|
78
|
+
}
|
79
|
+
},
|
80
|
+
select: {
|
81
|
+
get: function( elem ) {
|
82
|
+
var value, option,
|
83
|
+
options = elem.options,
|
84
|
+
index = elem.selectedIndex,
|
85
|
+
one = elem.type === "select-one" || index < 0,
|
86
|
+
values = one ? null : [],
|
87
|
+
max = one ? index + 1 : options.length,
|
88
|
+
i = index < 0 ?
|
89
|
+
max :
|
90
|
+
one ? index : 0;
|
91
|
+
|
92
|
+
// Loop through all the selected options
|
93
|
+
for ( ; i < max; i++ ) {
|
94
|
+
option = options[ i ];
|
95
|
+
|
96
|
+
// oldIE doesn't update selected after form reset (#2551)
|
97
|
+
if ( ( option.selected || i === index ) &&
|
98
|
+
// Don't return options that are disabled or in a disabled optgroup
|
99
|
+
( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
|
100
|
+
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
|
101
|
+
|
102
|
+
// Get the specific value for the option
|
103
|
+
value = jQuery( option ).val();
|
104
|
+
|
105
|
+
// We don't need an array for one selects
|
106
|
+
if ( one ) {
|
107
|
+
return value;
|
108
|
+
}
|
109
|
+
|
110
|
+
// Multi-Selects return an array
|
111
|
+
values.push( value );
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
return values;
|
116
|
+
},
|
117
|
+
|
118
|
+
set: function( elem, value ) {
|
119
|
+
var optionSet, option,
|
120
|
+
options = elem.options,
|
121
|
+
values = jQuery.makeArray( value ),
|
122
|
+
i = options.length;
|
123
|
+
|
124
|
+
while ( i-- ) {
|
125
|
+
option = options[ i ];
|
126
|
+
|
127
|
+
if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
|
128
|
+
|
129
|
+
// Support: IE6
|
130
|
+
// When new option element is added to select box we need to
|
131
|
+
// force reflow of newly added node in order to workaround delay
|
132
|
+
// of initialization properties
|
133
|
+
try {
|
134
|
+
option.selected = optionSet = true;
|
135
|
+
|
136
|
+
} catch ( _ ) {
|
137
|
+
|
138
|
+
// Will be executed only in IE6
|
139
|
+
option.scrollHeight;
|
140
|
+
}
|
141
|
+
|
142
|
+
} else {
|
143
|
+
option.selected = false;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
// Force browsers to behave consistently when non-matching value is set
|
148
|
+
if ( !optionSet ) {
|
149
|
+
elem.selectedIndex = -1;
|
150
|
+
}
|
151
|
+
|
152
|
+
return options;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
});
|
157
|
+
|
158
|
+
// Radios and checkboxes getter/setter
|
159
|
+
jQuery.each([ "radio", "checkbox" ], function() {
|
160
|
+
jQuery.valHooks[ this ] = {
|
161
|
+
set: function( elem, value ) {
|
162
|
+
if ( jQuery.isArray( value ) ) {
|
163
|
+
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
|
164
|
+
}
|
165
|
+
}
|
166
|
+
};
|
167
|
+
if ( !support.checkOn ) {
|
168
|
+
jQuery.valHooks[ this ].get = function( elem ) {
|
169
|
+
// Support: Webkit
|
170
|
+
// "" is returned instead of "on" if a value isn't specified
|
171
|
+
return elem.getAttribute("value") === null ? "on" : elem.value;
|
172
|
+
};
|
173
|
+
}
|
174
|
+
});
|
175
|
+
|
176
|
+
});
|
@@ -0,0 +1,205 @@
|
|
1
|
+
define([
|
2
|
+
"./core",
|
3
|
+
"./var/rnotwhite"
|
4
|
+
], function( jQuery, rnotwhite ) {
|
5
|
+
|
6
|
+
// String to Object options format cache
|
7
|
+
var optionsCache = {};
|
8
|
+
|
9
|
+
// Convert String-formatted options into Object-formatted ones and store in cache
|
10
|
+
function createOptions( options ) {
|
11
|
+
var object = optionsCache[ options ] = {};
|
12
|
+
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
|
13
|
+
object[ flag ] = true;
|
14
|
+
});
|
15
|
+
return object;
|
16
|
+
}
|
17
|
+
|
18
|
+
/*
|
19
|
+
* Create a callback list using the following parameters:
|
20
|
+
*
|
21
|
+
* options: an optional list of space-separated options that will change how
|
22
|
+
* the callback list behaves or a more traditional option object
|
23
|
+
*
|
24
|
+
* By default a callback list will act like an event callback list and can be
|
25
|
+
* "fired" multiple times.
|
26
|
+
*
|
27
|
+
* Possible options:
|
28
|
+
*
|
29
|
+
* once: will ensure the callback list can only be fired once (like a Deferred)
|
30
|
+
*
|
31
|
+
* memory: will keep track of previous values and will call any callback added
|
32
|
+
* after the list has been fired right away with the latest "memorized"
|
33
|
+
* values (like a Deferred)
|
34
|
+
*
|
35
|
+
* unique: will ensure a callback can only be added once (no duplicate in the list)
|
36
|
+
*
|
37
|
+
* stopOnFalse: interrupt callings when a callback returns false
|
38
|
+
*
|
39
|
+
*/
|
40
|
+
jQuery.Callbacks = function( options ) {
|
41
|
+
|
42
|
+
// Convert options from String-formatted to Object-formatted if needed
|
43
|
+
// (we check in cache first)
|
44
|
+
options = typeof options === "string" ?
|
45
|
+
( optionsCache[ options ] || createOptions( options ) ) :
|
46
|
+
jQuery.extend( {}, options );
|
47
|
+
|
48
|
+
var // Flag to know if list is currently firing
|
49
|
+
firing,
|
50
|
+
// Last fire value (for non-forgettable lists)
|
51
|
+
memory,
|
52
|
+
// Flag to know if list was already fired
|
53
|
+
fired,
|
54
|
+
// End of the loop when firing
|
55
|
+
firingLength,
|
56
|
+
// Index of currently firing callback (modified by remove if needed)
|
57
|
+
firingIndex,
|
58
|
+
// First callback to fire (used internally by add and fireWith)
|
59
|
+
firingStart,
|
60
|
+
// Actual callback list
|
61
|
+
list = [],
|
62
|
+
// Stack of fire calls for repeatable lists
|
63
|
+
stack = !options.once && [],
|
64
|
+
// Fire callbacks
|
65
|
+
fire = function( data ) {
|
66
|
+
memory = options.memory && data;
|
67
|
+
fired = true;
|
68
|
+
firingIndex = firingStart || 0;
|
69
|
+
firingStart = 0;
|
70
|
+
firingLength = list.length;
|
71
|
+
firing = true;
|
72
|
+
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
73
|
+
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
|
74
|
+
memory = false; // To prevent further calls using add
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
firing = false;
|
79
|
+
if ( list ) {
|
80
|
+
if ( stack ) {
|
81
|
+
if ( stack.length ) {
|
82
|
+
fire( stack.shift() );
|
83
|
+
}
|
84
|
+
} else if ( memory ) {
|
85
|
+
list = [];
|
86
|
+
} else {
|
87
|
+
self.disable();
|
88
|
+
}
|
89
|
+
}
|
90
|
+
},
|
91
|
+
// Actual Callbacks object
|
92
|
+
self = {
|
93
|
+
// Add a callback or a collection of callbacks to the list
|
94
|
+
add: function() {
|
95
|
+
if ( list ) {
|
96
|
+
// First, we save the current length
|
97
|
+
var start = list.length;
|
98
|
+
(function add( args ) {
|
99
|
+
jQuery.each( args, function( _, arg ) {
|
100
|
+
var type = jQuery.type( arg );
|
101
|
+
if ( type === "function" ) {
|
102
|
+
if ( !options.unique || !self.has( arg ) ) {
|
103
|
+
list.push( arg );
|
104
|
+
}
|
105
|
+
} else if ( arg && arg.length && type !== "string" ) {
|
106
|
+
// Inspect recursively
|
107
|
+
add( arg );
|
108
|
+
}
|
109
|
+
});
|
110
|
+
})( arguments );
|
111
|
+
// Do we need to add the callbacks to the
|
112
|
+
// current firing batch?
|
113
|
+
if ( firing ) {
|
114
|
+
firingLength = list.length;
|
115
|
+
// With memory, if we're not firing then
|
116
|
+
// we should call right away
|
117
|
+
} else if ( memory ) {
|
118
|
+
firingStart = start;
|
119
|
+
fire( memory );
|
120
|
+
}
|
121
|
+
}
|
122
|
+
return this;
|
123
|
+
},
|
124
|
+
// Remove a callback from the list
|
125
|
+
remove: function() {
|
126
|
+
if ( list ) {
|
127
|
+
jQuery.each( arguments, function( _, arg ) {
|
128
|
+
var index;
|
129
|
+
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
|
130
|
+
list.splice( index, 1 );
|
131
|
+
// Handle firing indexes
|
132
|
+
if ( firing ) {
|
133
|
+
if ( index <= firingLength ) {
|
134
|
+
firingLength--;
|
135
|
+
}
|
136
|
+
if ( index <= firingIndex ) {
|
137
|
+
firingIndex--;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
});
|
142
|
+
}
|
143
|
+
return this;
|
144
|
+
},
|
145
|
+
// Check if a given callback is in the list.
|
146
|
+
// If no argument is given, return whether or not list has callbacks attached.
|
147
|
+
has: function( fn ) {
|
148
|
+
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
|
149
|
+
},
|
150
|
+
// Remove all callbacks from the list
|
151
|
+
empty: function() {
|
152
|
+
list = [];
|
153
|
+
firingLength = 0;
|
154
|
+
return this;
|
155
|
+
},
|
156
|
+
// Have the list do nothing anymore
|
157
|
+
disable: function() {
|
158
|
+
list = stack = memory = undefined;
|
159
|
+
return this;
|
160
|
+
},
|
161
|
+
// Is it disabled?
|
162
|
+
disabled: function() {
|
163
|
+
return !list;
|
164
|
+
},
|
165
|
+
// Lock the list in its current state
|
166
|
+
lock: function() {
|
167
|
+
stack = undefined;
|
168
|
+
if ( !memory ) {
|
169
|
+
self.disable();
|
170
|
+
}
|
171
|
+
return this;
|
172
|
+
},
|
173
|
+
// Is it locked?
|
174
|
+
locked: function() {
|
175
|
+
return !stack;
|
176
|
+
},
|
177
|
+
// Call all callbacks with the given context and arguments
|
178
|
+
fireWith: function( context, args ) {
|
179
|
+
if ( list && ( !fired || stack ) ) {
|
180
|
+
args = args || [];
|
181
|
+
args = [ context, args.slice ? args.slice() : args ];
|
182
|
+
if ( firing ) {
|
183
|
+
stack.push( args );
|
184
|
+
} else {
|
185
|
+
fire( args );
|
186
|
+
}
|
187
|
+
}
|
188
|
+
return this;
|
189
|
+
},
|
190
|
+
// Call all the callbacks with the given arguments
|
191
|
+
fire: function() {
|
192
|
+
self.fireWith( this, arguments );
|
193
|
+
return this;
|
194
|
+
},
|
195
|
+
// To know if the callbacks have already been called at least once
|
196
|
+
fired: function() {
|
197
|
+
return !!fired;
|
198
|
+
}
|
199
|
+
};
|
200
|
+
|
201
|
+
return self;
|
202
|
+
};
|
203
|
+
|
204
|
+
return jQuery;
|
205
|
+
});
|
@@ -0,0 +1,542 @@
|
|
1
|
+
define([
|
2
|
+
"./var/deletedIds",
|
3
|
+
"./var/slice",
|
4
|
+
"./var/concat",
|
5
|
+
"./var/push",
|
6
|
+
"./var/indexOf",
|
7
|
+
"./var/class2type",
|
8
|
+
"./var/toString",
|
9
|
+
"./var/hasOwn",
|
10
|
+
"./var/trim",
|
11
|
+
"./var/support"
|
12
|
+
], function( deletedIds, slice, concat, push, indexOf, class2type, toString, hasOwn, trim, support ) {
|
13
|
+
|
14
|
+
var
|
15
|
+
version = "@VERSION",
|
16
|
+
|
17
|
+
// Define a local copy of jQuery
|
18
|
+
jQuery = function( selector, context ) {
|
19
|
+
// The jQuery object is actually just the init constructor 'enhanced'
|
20
|
+
// Need init if jQuery is called (just allow error to be thrown if not included)
|
21
|
+
return new jQuery.fn.init( selector, context );
|
22
|
+
},
|
23
|
+
|
24
|
+
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
|
25
|
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
26
|
+
|
27
|
+
// Matches dashed string for camelizing
|
28
|
+
rmsPrefix = /^-ms-/,
|
29
|
+
rdashAlpha = /-([\da-z])/gi,
|
30
|
+
|
31
|
+
// Used by jQuery.camelCase as callback to replace()
|
32
|
+
fcamelCase = function( all, letter ) {
|
33
|
+
return letter.toUpperCase();
|
34
|
+
};
|
35
|
+
|
36
|
+
jQuery.fn = jQuery.prototype = {
|
37
|
+
// The current version of jQuery being used
|
38
|
+
jquery: version,
|
39
|
+
|
40
|
+
constructor: jQuery,
|
41
|
+
|
42
|
+
// Start with an empty selector
|
43
|
+
selector: "",
|
44
|
+
|
45
|
+
// The default length of a jQuery object is 0
|
46
|
+
length: 0,
|
47
|
+
|
48
|
+
toArray: function() {
|
49
|
+
return slice.call( this );
|
50
|
+
},
|
51
|
+
|
52
|
+
// Get the Nth element in the matched element set OR
|
53
|
+
// Get the whole matched element set as a clean array
|
54
|
+
get: function( num ) {
|
55
|
+
return num != null ?
|
56
|
+
|
57
|
+
// Return a 'clean' array
|
58
|
+
( num < 0 ? this[ num + this.length ] : this[ num ] ) :
|
59
|
+
|
60
|
+
// Return just the object
|
61
|
+
slice.call( this );
|
62
|
+
},
|
63
|
+
|
64
|
+
// Take an array of elements and push it onto the stack
|
65
|
+
// (returning the new matched element set)
|
66
|
+
pushStack: function( elems ) {
|
67
|
+
|
68
|
+
// Build a new jQuery matched element set
|
69
|
+
var ret = jQuery.merge( this.constructor(), elems );
|
70
|
+
|
71
|
+
// Add the old object onto the stack (as a reference)
|
72
|
+
ret.prevObject = this;
|
73
|
+
ret.context = this.context;
|
74
|
+
|
75
|
+
// Return the newly-formed element set
|
76
|
+
return ret;
|
77
|
+
},
|
78
|
+
|
79
|
+
// Execute a callback for every element in the matched set.
|
80
|
+
// (You can seed the arguments with an array of args, but this is
|
81
|
+
// only used internally.)
|
82
|
+
each: function( callback, args ) {
|
83
|
+
return jQuery.each( this, callback, args );
|
84
|
+
},
|
85
|
+
|
86
|
+
map: function( callback ) {
|
87
|
+
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
88
|
+
return callback.call( elem, i, elem );
|
89
|
+
}));
|
90
|
+
},
|
91
|
+
|
92
|
+
slice: function() {
|
93
|
+
return this.pushStack( slice.apply( this, arguments ) );
|
94
|
+
},
|
95
|
+
|
96
|
+
first: function() {
|
97
|
+
return this.eq( 0 );
|
98
|
+
},
|
99
|
+
|
100
|
+
last: function() {
|
101
|
+
return this.eq( -1 );
|
102
|
+
},
|
103
|
+
|
104
|
+
eq: function( i ) {
|
105
|
+
var len = this.length,
|
106
|
+
j = +i + ( i < 0 ? len : 0 );
|
107
|
+
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
|
108
|
+
},
|
109
|
+
|
110
|
+
end: function() {
|
111
|
+
return this.prevObject || this.constructor(null);
|
112
|
+
},
|
113
|
+
|
114
|
+
// For internal use only.
|
115
|
+
// Behaves like an Array's method, not like a jQuery method.
|
116
|
+
push: push,
|
117
|
+
sort: deletedIds.sort,
|
118
|
+
splice: deletedIds.splice
|
119
|
+
};
|
120
|
+
|
121
|
+
jQuery.extend = jQuery.fn.extend = function() {
|
122
|
+
var src, copyIsArray, copy, name, options, clone,
|
123
|
+
target = arguments[0] || {},
|
124
|
+
i = 1,
|
125
|
+
length = arguments.length,
|
126
|
+
deep = false;
|
127
|
+
|
128
|
+
// Handle a deep copy situation
|
129
|
+
if ( typeof target === "boolean" ) {
|
130
|
+
deep = target;
|
131
|
+
|
132
|
+
// skip the boolean and the target
|
133
|
+
target = arguments[ i ] || {};
|
134
|
+
i++;
|
135
|
+
}
|
136
|
+
|
137
|
+
// Handle case when target is a string or something (possible in deep copy)
|
138
|
+
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
139
|
+
target = {};
|
140
|
+
}
|
141
|
+
|
142
|
+
// extend jQuery itself if only one argument is passed
|
143
|
+
if ( i === length ) {
|
144
|
+
target = this;
|
145
|
+
i--;
|
146
|
+
}
|
147
|
+
|
148
|
+
for ( ; i < length; i++ ) {
|
149
|
+
// Only deal with non-null/undefined values
|
150
|
+
if ( (options = arguments[ i ]) != null ) {
|
151
|
+
// Extend the base object
|
152
|
+
for ( name in options ) {
|
153
|
+
src = target[ name ];
|
154
|
+
copy = options[ name ];
|
155
|
+
|
156
|
+
// Prevent never-ending loop
|
157
|
+
if ( target === copy ) {
|
158
|
+
continue;
|
159
|
+
}
|
160
|
+
|
161
|
+
// Recurse if we're merging plain objects or arrays
|
162
|
+
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
163
|
+
if ( copyIsArray ) {
|
164
|
+
copyIsArray = false;
|
165
|
+
clone = src && jQuery.isArray(src) ? src : [];
|
166
|
+
|
167
|
+
} else {
|
168
|
+
clone = src && jQuery.isPlainObject(src) ? src : {};
|
169
|
+
}
|
170
|
+
|
171
|
+
// Never move original objects, clone them
|
172
|
+
target[ name ] = jQuery.extend( deep, clone, copy );
|
173
|
+
|
174
|
+
// Don't bring in undefined values
|
175
|
+
} else if ( copy !== undefined ) {
|
176
|
+
target[ name ] = copy;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
// Return the modified object
|
183
|
+
return target;
|
184
|
+
};
|
185
|
+
|
186
|
+
jQuery.extend({
|
187
|
+
// Unique for each copy of jQuery on the page
|
188
|
+
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
|
189
|
+
|
190
|
+
// Assume jQuery is ready without the ready module
|
191
|
+
isReady: true,
|
192
|
+
|
193
|
+
error: function( msg ) {
|
194
|
+
throw new Error( msg );
|
195
|
+
},
|
196
|
+
|
197
|
+
noop: function() {},
|
198
|
+
|
199
|
+
// See test/unit/core.js for details concerning isFunction.
|
200
|
+
// Since version 1.3, DOM methods and functions like alert
|
201
|
+
// aren't supported. They return false on IE (#2968).
|
202
|
+
isFunction: function( obj ) {
|
203
|
+
return jQuery.type(obj) === "function";
|
204
|
+
},
|
205
|
+
|
206
|
+
isArray: Array.isArray || function( obj ) {
|
207
|
+
return jQuery.type(obj) === "array";
|
208
|
+
},
|
209
|
+
|
210
|
+
isWindow: function( obj ) {
|
211
|
+
/* jshint eqeqeq: false */
|
212
|
+
return obj != null && obj == obj.window;
|
213
|
+
},
|
214
|
+
|
215
|
+
isNumeric: function( obj ) {
|
216
|
+
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
217
|
+
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
218
|
+
// subtraction forces infinities to NaN
|
219
|
+
return obj - parseFloat( obj ) >= 0;
|
220
|
+
},
|
221
|
+
|
222
|
+
isEmptyObject: function( obj ) {
|
223
|
+
var name;
|
224
|
+
for ( name in obj ) {
|
225
|
+
return false;
|
226
|
+
}
|
227
|
+
return true;
|
228
|
+
},
|
229
|
+
|
230
|
+
isPlainObject: function( obj ) {
|
231
|
+
var key;
|
232
|
+
|
233
|
+
// Must be an Object.
|
234
|
+
// Because of IE, we also have to check the presence of the constructor property.
|
235
|
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
236
|
+
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
237
|
+
return false;
|
238
|
+
}
|
239
|
+
|
240
|
+
try {
|
241
|
+
// Not own constructor property must be Object
|
242
|
+
if ( obj.constructor &&
|
243
|
+
!hasOwn.call(obj, "constructor") &&
|
244
|
+
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
245
|
+
return false;
|
246
|
+
}
|
247
|
+
} catch ( e ) {
|
248
|
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
249
|
+
return false;
|
250
|
+
}
|
251
|
+
|
252
|
+
// Support: IE<9
|
253
|
+
// Handle iteration over inherited properties before own properties.
|
254
|
+
if ( support.ownLast ) {
|
255
|
+
for ( key in obj ) {
|
256
|
+
return hasOwn.call( obj, key );
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
// Own properties are enumerated firstly, so to speed up,
|
261
|
+
// if last one is own, then all properties are own.
|
262
|
+
for ( key in obj ) {}
|
263
|
+
|
264
|
+
return key === undefined || hasOwn.call( obj, key );
|
265
|
+
},
|
266
|
+
|
267
|
+
type: function( obj ) {
|
268
|
+
if ( obj == null ) {
|
269
|
+
return obj + "";
|
270
|
+
}
|
271
|
+
return typeof obj === "object" || typeof obj === "function" ?
|
272
|
+
class2type[ toString.call(obj) ] || "object" :
|
273
|
+
typeof obj;
|
274
|
+
},
|
275
|
+
|
276
|
+
// Evaluates a script in a global context
|
277
|
+
// Workarounds based on findings by Jim Driscoll
|
278
|
+
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
279
|
+
globalEval: function( data ) {
|
280
|
+
if ( data && jQuery.trim( data ) ) {
|
281
|
+
// We use execScript on Internet Explorer
|
282
|
+
// We use an anonymous function so that context is window
|
283
|
+
// rather than jQuery in Firefox
|
284
|
+
( window.execScript || function( data ) {
|
285
|
+
window[ "eval" ].call( window, data );
|
286
|
+
} )( data );
|
287
|
+
}
|
288
|
+
},
|
289
|
+
|
290
|
+
// Convert dashed to camelCase; used by the css and data modules
|
291
|
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
292
|
+
camelCase: function( string ) {
|
293
|
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
294
|
+
},
|
295
|
+
|
296
|
+
nodeName: function( elem, name ) {
|
297
|
+
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
298
|
+
},
|
299
|
+
|
300
|
+
// args is for internal usage only
|
301
|
+
each: function( obj, callback, args ) {
|
302
|
+
var value,
|
303
|
+
i = 0,
|
304
|
+
length = obj.length,
|
305
|
+
isArray = isArraylike( obj );
|
306
|
+
|
307
|
+
if ( args ) {
|
308
|
+
if ( isArray ) {
|
309
|
+
for ( ; i < length; i++ ) {
|
310
|
+
value = callback.apply( obj[ i ], args );
|
311
|
+
|
312
|
+
if ( value === false ) {
|
313
|
+
break;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
} else {
|
317
|
+
for ( i in obj ) {
|
318
|
+
value = callback.apply( obj[ i ], args );
|
319
|
+
|
320
|
+
if ( value === false ) {
|
321
|
+
break;
|
322
|
+
}
|
323
|
+
}
|
324
|
+
}
|
325
|
+
|
326
|
+
// A special, fast, case for the most common use of each
|
327
|
+
} else {
|
328
|
+
if ( isArray ) {
|
329
|
+
for ( ; i < length; i++ ) {
|
330
|
+
value = callback.call( obj[ i ], i, obj[ i ] );
|
331
|
+
|
332
|
+
if ( value === false ) {
|
333
|
+
break;
|
334
|
+
}
|
335
|
+
}
|
336
|
+
} else {
|
337
|
+
for ( i in obj ) {
|
338
|
+
value = callback.call( obj[ i ], i, obj[ i ] );
|
339
|
+
|
340
|
+
if ( value === false ) {
|
341
|
+
break;
|
342
|
+
}
|
343
|
+
}
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
return obj;
|
348
|
+
},
|
349
|
+
|
350
|
+
// Use native String.trim function wherever possible
|
351
|
+
trim: trim && !trim.call("\uFEFF\xA0") ?
|
352
|
+
function( text ) {
|
353
|
+
return text == null ?
|
354
|
+
"" :
|
355
|
+
trim.call( text );
|
356
|
+
} :
|
357
|
+
|
358
|
+
// Otherwise use our own trimming functionality
|
359
|
+
function( text ) {
|
360
|
+
return text == null ?
|
361
|
+
"" :
|
362
|
+
( text + "" ).replace( rtrim, "" );
|
363
|
+
},
|
364
|
+
|
365
|
+
// results is for internal usage only
|
366
|
+
makeArray: function( arr, results ) {
|
367
|
+
var ret = results || [];
|
368
|
+
|
369
|
+
if ( arr != null ) {
|
370
|
+
if ( isArraylike( Object(arr) ) ) {
|
371
|
+
jQuery.merge( ret,
|
372
|
+
typeof arr === "string" ?
|
373
|
+
[ arr ] : arr
|
374
|
+
);
|
375
|
+
} else {
|
376
|
+
push.call( ret, arr );
|
377
|
+
}
|
378
|
+
}
|
379
|
+
|
380
|
+
return ret;
|
381
|
+
},
|
382
|
+
|
383
|
+
inArray: function( elem, arr, i ) {
|
384
|
+
var len;
|
385
|
+
|
386
|
+
if ( arr ) {
|
387
|
+
if ( indexOf ) {
|
388
|
+
return indexOf.call( arr, elem, i );
|
389
|
+
}
|
390
|
+
|
391
|
+
len = arr.length;
|
392
|
+
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
393
|
+
|
394
|
+
for ( ; i < len; i++ ) {
|
395
|
+
// Skip accessing in sparse arrays
|
396
|
+
if ( i in arr && arr[ i ] === elem ) {
|
397
|
+
return i;
|
398
|
+
}
|
399
|
+
}
|
400
|
+
}
|
401
|
+
|
402
|
+
return -1;
|
403
|
+
},
|
404
|
+
|
405
|
+
merge: function( first, second ) {
|
406
|
+
var len = +second.length,
|
407
|
+
j = 0,
|
408
|
+
i = first.length;
|
409
|
+
|
410
|
+
while ( j < len ) {
|
411
|
+
first[ i++ ] = second[ j++ ];
|
412
|
+
}
|
413
|
+
|
414
|
+
// Support: IE<9
|
415
|
+
// Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
|
416
|
+
if ( len !== len ) {
|
417
|
+
while ( second[j] !== undefined ) {
|
418
|
+
first[ i++ ] = second[ j++ ];
|
419
|
+
}
|
420
|
+
}
|
421
|
+
|
422
|
+
first.length = i;
|
423
|
+
|
424
|
+
return first;
|
425
|
+
},
|
426
|
+
|
427
|
+
grep: function( elems, callback, invert ) {
|
428
|
+
var callbackInverse,
|
429
|
+
matches = [],
|
430
|
+
i = 0,
|
431
|
+
length = elems.length,
|
432
|
+
callbackExpect = !invert;
|
433
|
+
|
434
|
+
// Go through the array, only saving the items
|
435
|
+
// that pass the validator function
|
436
|
+
for ( ; i < length; i++ ) {
|
437
|
+
callbackInverse = !callback( elems[ i ], i );
|
438
|
+
if ( callbackInverse !== callbackExpect ) {
|
439
|
+
matches.push( elems[ i ] );
|
440
|
+
}
|
441
|
+
}
|
442
|
+
|
443
|
+
return matches;
|
444
|
+
},
|
445
|
+
|
446
|
+
// arg is for internal usage only
|
447
|
+
map: function( elems, callback, arg ) {
|
448
|
+
var value,
|
449
|
+
i = 0,
|
450
|
+
length = elems.length,
|
451
|
+
isArray = isArraylike( elems ),
|
452
|
+
ret = [];
|
453
|
+
|
454
|
+
// Go through the array, translating each of the items to their new values
|
455
|
+
if ( isArray ) {
|
456
|
+
for ( ; i < length; i++ ) {
|
457
|
+
value = callback( elems[ i ], i, arg );
|
458
|
+
|
459
|
+
if ( value != null ) {
|
460
|
+
ret.push( value );
|
461
|
+
}
|
462
|
+
}
|
463
|
+
|
464
|
+
// Go through every key on the object,
|
465
|
+
} else {
|
466
|
+
for ( i in elems ) {
|
467
|
+
value = callback( elems[ i ], i, arg );
|
468
|
+
|
469
|
+
if ( value != null ) {
|
470
|
+
ret.push( value );
|
471
|
+
}
|
472
|
+
}
|
473
|
+
}
|
474
|
+
|
475
|
+
// Flatten any nested arrays
|
476
|
+
return concat.apply( [], ret );
|
477
|
+
},
|
478
|
+
|
479
|
+
// A global GUID counter for objects
|
480
|
+
guid: 1,
|
481
|
+
|
482
|
+
// Bind a function to a context, optionally partially applying any
|
483
|
+
// arguments.
|
484
|
+
proxy: function( fn, context ) {
|
485
|
+
var args, proxy, tmp;
|
486
|
+
|
487
|
+
if ( typeof context === "string" ) {
|
488
|
+
tmp = fn[ context ];
|
489
|
+
context = fn;
|
490
|
+
fn = tmp;
|
491
|
+
}
|
492
|
+
|
493
|
+
// Quick check to determine if target is callable, in the spec
|
494
|
+
// this throws a TypeError, but we will just return undefined.
|
495
|
+
if ( !jQuery.isFunction( fn ) ) {
|
496
|
+
return undefined;
|
497
|
+
}
|
498
|
+
|
499
|
+
// Simulated bind
|
500
|
+
args = slice.call( arguments, 2 );
|
501
|
+
proxy = function() {
|
502
|
+
return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
|
503
|
+
};
|
504
|
+
|
505
|
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
506
|
+
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
507
|
+
|
508
|
+
return proxy;
|
509
|
+
},
|
510
|
+
|
511
|
+
now: function() {
|
512
|
+
return +( new Date() );
|
513
|
+
},
|
514
|
+
|
515
|
+
// jQuery.support is not used in Core but other projects attach their
|
516
|
+
// properties to it so it needs to exist.
|
517
|
+
support: support
|
518
|
+
});
|
519
|
+
|
520
|
+
// Populate the class2type map
|
521
|
+
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
|
522
|
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
523
|
+
});
|
524
|
+
|
525
|
+
function isArraylike( obj ) {
|
526
|
+
var length = obj.length,
|
527
|
+
type = jQuery.type( obj );
|
528
|
+
|
529
|
+
if ( type === "function" || jQuery.isWindow( obj ) ) {
|
530
|
+
return false;
|
531
|
+
}
|
532
|
+
|
533
|
+
if ( obj.nodeType === 1 && length ) {
|
534
|
+
return true;
|
535
|
+
}
|
536
|
+
|
537
|
+
return type === "array" || length === 0 ||
|
538
|
+
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
|
539
|
+
}
|
540
|
+
|
541
|
+
return jQuery;
|
542
|
+
});
|