govuk_publishing_components 18.1.1 → 18.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +11 -5
- data/app/views/govuk_publishing_components/components/docs/share_links.yml +10 -7
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/jquery/AUTHORS.txt +266 -0
- data/node_modules/jquery/LICENSE.txt +36 -0
- data/node_modules/jquery/README.md +65 -0
- data/node_modules/jquery/bower.json +14 -0
- data/node_modules/jquery/dist/jquery.js +11008 -0
- data/node_modules/jquery/dist/jquery.min.js +5 -0
- data/node_modules/jquery/dist/jquery.min.map +1 -0
- data/node_modules/jquery/external/sizzle/LICENSE.txt +36 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.js +2143 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/node_modules/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/node_modules/jquery/package.json +157 -0
- data/node_modules/jquery/src/ajax.js +842 -0
- data/node_modules/jquery/src/ajax/jsonp.js +100 -0
- data/node_modules/jquery/src/ajax/load.js +83 -0
- data/node_modules/jquery/src/ajax/parseJSON.js +53 -0
- data/node_modules/jquery/src/ajax/parseXML.js +31 -0
- data/node_modules/jquery/src/ajax/script.js +95 -0
- data/node_modules/jquery/src/ajax/var/location.js +3 -0
- data/node_modules/jquery/src/ajax/var/nonce.js +5 -0
- data/node_modules/jquery/src/ajax/var/rquery.js +3 -0
- data/node_modules/jquery/src/ajax/xhr.js +229 -0
- data/node_modules/jquery/src/attributes.js +11 -0
- data/node_modules/jquery/src/attributes/attr.js +281 -0
- data/node_modules/jquery/src/attributes/classes.js +174 -0
- data/node_modules/jquery/src/attributes/prop.js +156 -0
- data/node_modules/jquery/src/attributes/support.js +70 -0
- data/node_modules/jquery/src/attributes/val.js +191 -0
- data/node_modules/jquery/src/callbacks.js +232 -0
- data/node_modules/jquery/src/core.js +529 -0
- data/node_modules/jquery/src/core/access.js +65 -0
- data/node_modules/jquery/src/core/init.js +140 -0
- data/node_modules/jquery/src/core/parseHTML.js +41 -0
- data/node_modules/jquery/src/core/ready.js +163 -0
- data/node_modules/jquery/src/core/var/rsingleTag.js +5 -0
- data/node_modules/jquery/src/css.js +563 -0
- data/node_modules/jquery/src/css/addGetHookIf.js +24 -0
- data/node_modules/jquery/src/css/adjustCSS.js +65 -0
- data/node_modules/jquery/src/css/curCSS.js +137 -0
- data/node_modules/jquery/src/css/defaultDisplay.js +72 -0
- data/node_modules/jquery/src/css/hiddenVisibleSelectors.js +42 -0
- data/node_modules/jquery/src/css/showHide.js +45 -0
- data/node_modules/jquery/src/css/support.js +184 -0
- data/node_modules/jquery/src/css/var/cssExpand.js +3 -0
- data/node_modules/jquery/src/css/var/isHidden.js +16 -0
- data/node_modules/jquery/src/css/var/rmargin.js +3 -0
- data/node_modules/jquery/src/css/var/rnumnonpx.js +5 -0
- data/node_modules/jquery/src/css/var/swap.js +24 -0
- data/node_modules/jquery/src/data.js +342 -0
- data/node_modules/jquery/src/data/support.js +23 -0
- data/node_modules/jquery/src/data/var/acceptData.js +20 -0
- data/node_modules/jquery/src/deferred.js +159 -0
- data/node_modules/jquery/src/deprecated.js +34 -0
- data/node_modules/jquery/src/dimensions.js +56 -0
- data/node_modules/jquery/src/effects.js +640 -0
- data/node_modules/jquery/src/effects/Tween.js +121 -0
- data/node_modules/jquery/src/effects/animatedSelector.js +13 -0
- data/node_modules/jquery/src/effects/support.js +58 -0
- data/node_modules/jquery/src/event.js +1134 -0
- data/node_modules/jquery/src/event/ajax.js +20 -0
- data/node_modules/jquery/src/event/alias.js +25 -0
- data/node_modules/jquery/src/event/support.js +28 -0
- data/node_modules/jquery/src/exports/amd.js +24 -0
- data/node_modules/jquery/src/exports/global.js +26 -0
- data/node_modules/jquery/src/intro.js +44 -0
- data/node_modules/jquery/src/jquery.js +37 -0
- data/node_modules/jquery/src/manipulation.js +585 -0
- data/node_modules/jquery/src/manipulation/_evalUrl.js +21 -0
- data/node_modules/jquery/src/manipulation/buildFragment.js +157 -0
- data/node_modules/jquery/src/manipulation/createSafeFragment.js +20 -0
- data/node_modules/jquery/src/manipulation/getAll.js +33 -0
- data/node_modules/jquery/src/manipulation/setGlobalEval.js +19 -0
- data/node_modules/jquery/src/manipulation/support.js +72 -0
- data/node_modules/jquery/src/manipulation/var/nodeNames.js +5 -0
- data/node_modules/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rscriptType.js +3 -0
- data/node_modules/jquery/src/manipulation/var/rtagName.js +3 -0
- data/node_modules/jquery/src/manipulation/wrapMap.js +30 -0
- data/node_modules/jquery/src/offset.js +219 -0
- data/node_modules/jquery/src/outro.js +2 -0
- data/node_modules/jquery/src/queue.js +144 -0
- data/node_modules/jquery/src/queue/delay.js +22 -0
- data/node_modules/jquery/src/selector-sizzle.js +14 -0
- data/node_modules/jquery/src/selector.js +1 -0
- data/node_modules/jquery/src/serialize.js +125 -0
- data/node_modules/jquery/src/support.js +63 -0
- data/node_modules/jquery/src/traversing.js +179 -0
- data/node_modules/jquery/src/traversing/findFilter.js +100 -0
- data/node_modules/jquery/src/traversing/var/dir.js +20 -0
- data/node_modules/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/node_modules/jquery/src/traversing/var/siblings.js +15 -0
- data/node_modules/jquery/src/var/class2type.js +5 -0
- data/node_modules/jquery/src/var/concat.js +5 -0
- data/node_modules/jquery/src/var/deletedIds.js +3 -0
- data/node_modules/jquery/src/var/document.js +3 -0
- data/node_modules/jquery/src/var/documentElement.js +5 -0
- data/node_modules/jquery/src/var/hasOwn.js +5 -0
- data/node_modules/jquery/src/var/indexOf.js +5 -0
- data/node_modules/jquery/src/var/pnum.js +3 -0
- data/node_modules/jquery/src/var/push.js +5 -0
- data/node_modules/jquery/src/var/rcssNum.js +7 -0
- data/node_modules/jquery/src/var/rnotwhite.js +3 -0
- data/node_modules/jquery/src/var/slice.js +5 -0
- data/node_modules/jquery/src/var/support.js +5 -0
- data/node_modules/jquery/src/var/toString.js +5 -0
- data/node_modules/jquery/src/wrap.js +77 -0
- metadata +109 -2
@@ -0,0 +1,529 @@
|
|
1
|
+
define( [
|
2
|
+
"./var/deletedIds",
|
3
|
+
"./var/document",
|
4
|
+
"./var/slice",
|
5
|
+
"./var/concat",
|
6
|
+
"./var/push",
|
7
|
+
"./var/indexOf",
|
8
|
+
"./var/class2type",
|
9
|
+
"./var/toString",
|
10
|
+
"./var/hasOwn",
|
11
|
+
"./var/support"
|
12
|
+
], function( deletedIds, document, slice, concat, push, indexOf,
|
13
|
+
class2type, toString, hasOwn, support ) {
|
14
|
+
|
15
|
+
var
|
16
|
+
version = "@VERSION",
|
17
|
+
|
18
|
+
// Define a local copy of jQuery
|
19
|
+
jQuery = function( selector, context ) {
|
20
|
+
|
21
|
+
// The jQuery object is actually just the init constructor 'enhanced'
|
22
|
+
// Need init if jQuery is called (just allow error to be thrown if not included)
|
23
|
+
return new jQuery.fn.init( selector, context );
|
24
|
+
},
|
25
|
+
|
26
|
+
// Support: Android<4.1, IE<9
|
27
|
+
// Make sure we trim BOM and NBSP
|
28
|
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
29
|
+
|
30
|
+
// Matches dashed string for camelizing
|
31
|
+
rmsPrefix = /^-ms-/,
|
32
|
+
rdashAlpha = /-([\da-z])/gi,
|
33
|
+
|
34
|
+
// Used by jQuery.camelCase as callback to replace()
|
35
|
+
fcamelCase = function( all, letter ) {
|
36
|
+
return letter.toUpperCase();
|
37
|
+
};
|
38
|
+
|
39
|
+
jQuery.fn = jQuery.prototype = {
|
40
|
+
|
41
|
+
// The current version of jQuery being used
|
42
|
+
jquery: version,
|
43
|
+
|
44
|
+
constructor: jQuery,
|
45
|
+
|
46
|
+
// Start with an empty selector
|
47
|
+
selector: "",
|
48
|
+
|
49
|
+
// The default length of a jQuery object is 0
|
50
|
+
length: 0,
|
51
|
+
|
52
|
+
toArray: function() {
|
53
|
+
return slice.call( this );
|
54
|
+
},
|
55
|
+
|
56
|
+
// Get the Nth element in the matched element set OR
|
57
|
+
// Get the whole matched element set as a clean array
|
58
|
+
get: function( num ) {
|
59
|
+
return num != null ?
|
60
|
+
|
61
|
+
// Return just the one element from the set
|
62
|
+
( num < 0 ? this[ num + this.length ] : this[ num ] ) :
|
63
|
+
|
64
|
+
// Return all the elements in a clean array
|
65
|
+
slice.call( this );
|
66
|
+
},
|
67
|
+
|
68
|
+
// Take an array of elements and push it onto the stack
|
69
|
+
// (returning the new matched element set)
|
70
|
+
pushStack: function( elems ) {
|
71
|
+
|
72
|
+
// Build a new jQuery matched element set
|
73
|
+
var ret = jQuery.merge( this.constructor(), elems );
|
74
|
+
|
75
|
+
// Add the old object onto the stack (as a reference)
|
76
|
+
ret.prevObject = this;
|
77
|
+
ret.context = this.context;
|
78
|
+
|
79
|
+
// Return the newly-formed element set
|
80
|
+
return ret;
|
81
|
+
},
|
82
|
+
|
83
|
+
// Execute a callback for every element in the matched set.
|
84
|
+
each: function( callback ) {
|
85
|
+
return jQuery.each( this, callback );
|
86
|
+
},
|
87
|
+
|
88
|
+
map: function( callback ) {
|
89
|
+
return this.pushStack( jQuery.map( this, function( elem, i ) {
|
90
|
+
return callback.call( elem, i, elem );
|
91
|
+
} ) );
|
92
|
+
},
|
93
|
+
|
94
|
+
slice: function() {
|
95
|
+
return this.pushStack( slice.apply( this, arguments ) );
|
96
|
+
},
|
97
|
+
|
98
|
+
first: function() {
|
99
|
+
return this.eq( 0 );
|
100
|
+
},
|
101
|
+
|
102
|
+
last: function() {
|
103
|
+
return this.eq( -1 );
|
104
|
+
},
|
105
|
+
|
106
|
+
eq: function( i ) {
|
107
|
+
var len = this.length,
|
108
|
+
j = +i + ( i < 0 ? len : 0 );
|
109
|
+
return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
|
110
|
+
},
|
111
|
+
|
112
|
+
end: function() {
|
113
|
+
return this.prevObject || this.constructor();
|
114
|
+
},
|
115
|
+
|
116
|
+
// For internal use only.
|
117
|
+
// Behaves like an Array's method, not like a jQuery method.
|
118
|
+
push: push,
|
119
|
+
sort: deletedIds.sort,
|
120
|
+
splice: deletedIds.splice
|
121
|
+
};
|
122
|
+
|
123
|
+
jQuery.extend = jQuery.fn.extend = function() {
|
124
|
+
var src, copyIsArray, copy, name, options, clone,
|
125
|
+
target = arguments[ 0 ] || {},
|
126
|
+
i = 1,
|
127
|
+
length = arguments.length,
|
128
|
+
deep = false;
|
129
|
+
|
130
|
+
// Handle a deep copy situation
|
131
|
+
if ( typeof target === "boolean" ) {
|
132
|
+
deep = target;
|
133
|
+
|
134
|
+
// skip the boolean and the target
|
135
|
+
target = arguments[ i ] || {};
|
136
|
+
i++;
|
137
|
+
}
|
138
|
+
|
139
|
+
// Handle case when target is a string or something (possible in deep copy)
|
140
|
+
if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
|
141
|
+
target = {};
|
142
|
+
}
|
143
|
+
|
144
|
+
// extend jQuery itself if only one argument is passed
|
145
|
+
if ( i === length ) {
|
146
|
+
target = this;
|
147
|
+
i--;
|
148
|
+
}
|
149
|
+
|
150
|
+
for ( ; i < length; i++ ) {
|
151
|
+
|
152
|
+
// Only deal with non-null/undefined values
|
153
|
+
if ( ( options = arguments[ i ] ) != null ) {
|
154
|
+
|
155
|
+
// Extend the base object
|
156
|
+
for ( name in options ) {
|
157
|
+
src = target[ name ];
|
158
|
+
copy = options[ name ];
|
159
|
+
|
160
|
+
// Prevent never-ending loop
|
161
|
+
if ( target === copy ) {
|
162
|
+
continue;
|
163
|
+
}
|
164
|
+
|
165
|
+
// Recurse if we're merging plain objects or arrays
|
166
|
+
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
|
167
|
+
( copyIsArray = jQuery.isArray( copy ) ) ) ) {
|
168
|
+
|
169
|
+
if ( copyIsArray ) {
|
170
|
+
copyIsArray = false;
|
171
|
+
clone = src && jQuery.isArray( src ) ? src : [];
|
172
|
+
|
173
|
+
} else {
|
174
|
+
clone = src && jQuery.isPlainObject( src ) ? src : {};
|
175
|
+
}
|
176
|
+
|
177
|
+
// Never move original objects, clone them
|
178
|
+
target[ name ] = jQuery.extend( deep, clone, copy );
|
179
|
+
|
180
|
+
// Don't bring in undefined values
|
181
|
+
} else if ( copy !== undefined ) {
|
182
|
+
target[ name ] = copy;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
// Return the modified object
|
189
|
+
return target;
|
190
|
+
};
|
191
|
+
|
192
|
+
jQuery.extend( {
|
193
|
+
|
194
|
+
// Unique for each copy of jQuery on the page
|
195
|
+
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
|
196
|
+
|
197
|
+
// Assume jQuery is ready without the ready module
|
198
|
+
isReady: true,
|
199
|
+
|
200
|
+
error: function( msg ) {
|
201
|
+
throw new Error( msg );
|
202
|
+
},
|
203
|
+
|
204
|
+
noop: function() {},
|
205
|
+
|
206
|
+
// See test/unit/core.js for details concerning isFunction.
|
207
|
+
// Since version 1.3, DOM methods and functions like alert
|
208
|
+
// aren't supported. They return false on IE (#2968).
|
209
|
+
isFunction: function( obj ) {
|
210
|
+
return jQuery.type( obj ) === "function";
|
211
|
+
},
|
212
|
+
|
213
|
+
isArray: Array.isArray || function( obj ) {
|
214
|
+
return jQuery.type( obj ) === "array";
|
215
|
+
},
|
216
|
+
|
217
|
+
isWindow: function( obj ) {
|
218
|
+
/* jshint eqeqeq: false */
|
219
|
+
return obj != null && obj == obj.window;
|
220
|
+
},
|
221
|
+
|
222
|
+
isNumeric: function( obj ) {
|
223
|
+
|
224
|
+
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
225
|
+
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
226
|
+
// subtraction forces infinities to NaN
|
227
|
+
// adding 1 corrects loss of precision from parseFloat (#15100)
|
228
|
+
var realStringObj = obj && obj.toString();
|
229
|
+
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
|
230
|
+
},
|
231
|
+
|
232
|
+
isEmptyObject: function( obj ) {
|
233
|
+
var name;
|
234
|
+
for ( name in obj ) {
|
235
|
+
return false;
|
236
|
+
}
|
237
|
+
return true;
|
238
|
+
},
|
239
|
+
|
240
|
+
isPlainObject: function( obj ) {
|
241
|
+
var key;
|
242
|
+
|
243
|
+
// Must be an Object.
|
244
|
+
// Because of IE, we also have to check the presence of the constructor property.
|
245
|
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
246
|
+
if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
247
|
+
return false;
|
248
|
+
}
|
249
|
+
|
250
|
+
try {
|
251
|
+
|
252
|
+
// Not own constructor property must be Object
|
253
|
+
if ( obj.constructor &&
|
254
|
+
!hasOwn.call( obj, "constructor" ) &&
|
255
|
+
!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
|
256
|
+
return false;
|
257
|
+
}
|
258
|
+
} catch ( e ) {
|
259
|
+
|
260
|
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
261
|
+
return false;
|
262
|
+
}
|
263
|
+
|
264
|
+
// Support: IE<9
|
265
|
+
// Handle iteration over inherited properties before own properties.
|
266
|
+
if ( !support.ownFirst ) {
|
267
|
+
for ( key in obj ) {
|
268
|
+
return hasOwn.call( obj, key );
|
269
|
+
}
|
270
|
+
}
|
271
|
+
|
272
|
+
// Own properties are enumerated firstly, so to speed up,
|
273
|
+
// if last one is own, then all properties are own.
|
274
|
+
for ( key in obj ) {}
|
275
|
+
|
276
|
+
return key === undefined || hasOwn.call( obj, key );
|
277
|
+
},
|
278
|
+
|
279
|
+
type: function( obj ) {
|
280
|
+
if ( obj == null ) {
|
281
|
+
return obj + "";
|
282
|
+
}
|
283
|
+
return typeof obj === "object" || typeof obj === "function" ?
|
284
|
+
class2type[ toString.call( obj ) ] || "object" :
|
285
|
+
typeof obj;
|
286
|
+
},
|
287
|
+
|
288
|
+
// Workarounds based on findings by Jim Driscoll
|
289
|
+
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
290
|
+
globalEval: function( data ) {
|
291
|
+
if ( data && jQuery.trim( data ) ) {
|
292
|
+
|
293
|
+
// We use execScript on Internet Explorer
|
294
|
+
// We use an anonymous function so that context is window
|
295
|
+
// rather than jQuery in Firefox
|
296
|
+
( window.execScript || function( data ) {
|
297
|
+
window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation
|
298
|
+
} )( data );
|
299
|
+
}
|
300
|
+
},
|
301
|
+
|
302
|
+
// Convert dashed to camelCase; used by the css and data modules
|
303
|
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
304
|
+
camelCase: function( string ) {
|
305
|
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
306
|
+
},
|
307
|
+
|
308
|
+
nodeName: function( elem, name ) {
|
309
|
+
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
310
|
+
},
|
311
|
+
|
312
|
+
each: function( obj, callback ) {
|
313
|
+
var length, i = 0;
|
314
|
+
|
315
|
+
if ( isArrayLike( obj ) ) {
|
316
|
+
length = obj.length;
|
317
|
+
for ( ; i < length; i++ ) {
|
318
|
+
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
|
319
|
+
break;
|
320
|
+
}
|
321
|
+
}
|
322
|
+
} else {
|
323
|
+
for ( i in obj ) {
|
324
|
+
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
|
325
|
+
break;
|
326
|
+
}
|
327
|
+
}
|
328
|
+
}
|
329
|
+
|
330
|
+
return obj;
|
331
|
+
},
|
332
|
+
|
333
|
+
// Support: Android<4.1, IE<9
|
334
|
+
trim: function( text ) {
|
335
|
+
return text == null ?
|
336
|
+
"" :
|
337
|
+
( text + "" ).replace( rtrim, "" );
|
338
|
+
},
|
339
|
+
|
340
|
+
// results is for internal usage only
|
341
|
+
makeArray: function( arr, results ) {
|
342
|
+
var ret = results || [];
|
343
|
+
|
344
|
+
if ( arr != null ) {
|
345
|
+
if ( isArrayLike( Object( arr ) ) ) {
|
346
|
+
jQuery.merge( ret,
|
347
|
+
typeof arr === "string" ?
|
348
|
+
[ arr ] : arr
|
349
|
+
);
|
350
|
+
} else {
|
351
|
+
push.call( ret, arr );
|
352
|
+
}
|
353
|
+
}
|
354
|
+
|
355
|
+
return ret;
|
356
|
+
},
|
357
|
+
|
358
|
+
inArray: function( elem, arr, i ) {
|
359
|
+
var len;
|
360
|
+
|
361
|
+
if ( arr ) {
|
362
|
+
if ( indexOf ) {
|
363
|
+
return indexOf.call( arr, elem, i );
|
364
|
+
}
|
365
|
+
|
366
|
+
len = arr.length;
|
367
|
+
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
368
|
+
|
369
|
+
for ( ; i < len; i++ ) {
|
370
|
+
|
371
|
+
// Skip accessing in sparse arrays
|
372
|
+
if ( i in arr && arr[ i ] === elem ) {
|
373
|
+
return i;
|
374
|
+
}
|
375
|
+
}
|
376
|
+
}
|
377
|
+
|
378
|
+
return -1;
|
379
|
+
},
|
380
|
+
|
381
|
+
merge: function( first, second ) {
|
382
|
+
var len = +second.length,
|
383
|
+
j = 0,
|
384
|
+
i = first.length;
|
385
|
+
|
386
|
+
while ( j < len ) {
|
387
|
+
first[ i++ ] = second[ j++ ];
|
388
|
+
}
|
389
|
+
|
390
|
+
// Support: IE<9
|
391
|
+
// Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
|
392
|
+
if ( len !== len ) {
|
393
|
+
while ( second[ j ] !== undefined ) {
|
394
|
+
first[ i++ ] = second[ j++ ];
|
395
|
+
}
|
396
|
+
}
|
397
|
+
|
398
|
+
first.length = i;
|
399
|
+
|
400
|
+
return first;
|
401
|
+
},
|
402
|
+
|
403
|
+
grep: function( elems, callback, invert ) {
|
404
|
+
var callbackInverse,
|
405
|
+
matches = [],
|
406
|
+
i = 0,
|
407
|
+
length = elems.length,
|
408
|
+
callbackExpect = !invert;
|
409
|
+
|
410
|
+
// Go through the array, only saving the items
|
411
|
+
// that pass the validator function
|
412
|
+
for ( ; i < length; i++ ) {
|
413
|
+
callbackInverse = !callback( elems[ i ], i );
|
414
|
+
if ( callbackInverse !== callbackExpect ) {
|
415
|
+
matches.push( elems[ i ] );
|
416
|
+
}
|
417
|
+
}
|
418
|
+
|
419
|
+
return matches;
|
420
|
+
},
|
421
|
+
|
422
|
+
// arg is for internal usage only
|
423
|
+
map: function( elems, callback, arg ) {
|
424
|
+
var length, value,
|
425
|
+
i = 0,
|
426
|
+
ret = [];
|
427
|
+
|
428
|
+
// Go through the array, translating each of the items to their new values
|
429
|
+
if ( isArrayLike( elems ) ) {
|
430
|
+
length = elems.length;
|
431
|
+
for ( ; i < length; i++ ) {
|
432
|
+
value = callback( elems[ i ], i, arg );
|
433
|
+
|
434
|
+
if ( value != null ) {
|
435
|
+
ret.push( value );
|
436
|
+
}
|
437
|
+
}
|
438
|
+
|
439
|
+
// Go through every key on the object,
|
440
|
+
} else {
|
441
|
+
for ( i in elems ) {
|
442
|
+
value = callback( elems[ i ], i, arg );
|
443
|
+
|
444
|
+
if ( value != null ) {
|
445
|
+
ret.push( value );
|
446
|
+
}
|
447
|
+
}
|
448
|
+
}
|
449
|
+
|
450
|
+
// Flatten any nested arrays
|
451
|
+
return concat.apply( [], ret );
|
452
|
+
},
|
453
|
+
|
454
|
+
// A global GUID counter for objects
|
455
|
+
guid: 1,
|
456
|
+
|
457
|
+
// Bind a function to a context, optionally partially applying any
|
458
|
+
// arguments.
|
459
|
+
proxy: function( fn, context ) {
|
460
|
+
var args, proxy, tmp;
|
461
|
+
|
462
|
+
if ( typeof context === "string" ) {
|
463
|
+
tmp = fn[ context ];
|
464
|
+
context = fn;
|
465
|
+
fn = tmp;
|
466
|
+
}
|
467
|
+
|
468
|
+
// Quick check to determine if target is callable, in the spec
|
469
|
+
// this throws a TypeError, but we will just return undefined.
|
470
|
+
if ( !jQuery.isFunction( fn ) ) {
|
471
|
+
return undefined;
|
472
|
+
}
|
473
|
+
|
474
|
+
// Simulated bind
|
475
|
+
args = slice.call( arguments, 2 );
|
476
|
+
proxy = function() {
|
477
|
+
return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
|
478
|
+
};
|
479
|
+
|
480
|
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
481
|
+
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
482
|
+
|
483
|
+
return proxy;
|
484
|
+
},
|
485
|
+
|
486
|
+
now: function() {
|
487
|
+
return +( new Date() );
|
488
|
+
},
|
489
|
+
|
490
|
+
// jQuery.support is not used in Core but other projects attach their
|
491
|
+
// properties to it so it needs to exist.
|
492
|
+
support: support
|
493
|
+
} );
|
494
|
+
|
495
|
+
// JSHint would error on this code due to the Symbol not being defined in ES5.
|
496
|
+
// Defining this global in .jshintrc would create a danger of using the global
|
497
|
+
// unguarded in another place, it seems safer to just disable JSHint for these
|
498
|
+
// three lines.
|
499
|
+
/* jshint ignore: start */
|
500
|
+
if ( typeof Symbol === "function" ) {
|
501
|
+
jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ];
|
502
|
+
}
|
503
|
+
/* jshint ignore: end */
|
504
|
+
|
505
|
+
// Populate the class2type map
|
506
|
+
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
|
507
|
+
function( i, name ) {
|
508
|
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
509
|
+
} );
|
510
|
+
|
511
|
+
function isArrayLike( obj ) {
|
512
|
+
|
513
|
+
// Support: iOS 8.2 (not reproducible in simulator)
|
514
|
+
// `in` check used to prevent JIT error (gh-2145)
|
515
|
+
// hasOwn isn't used here due to false negatives
|
516
|
+
// regarding Nodelist length in IE
|
517
|
+
var length = !!obj && "length" in obj && obj.length,
|
518
|
+
type = jQuery.type( obj );
|
519
|
+
|
520
|
+
if ( type === "function" || jQuery.isWindow( obj ) ) {
|
521
|
+
return false;
|
522
|
+
}
|
523
|
+
|
524
|
+
return type === "array" || length === 0 ||
|
525
|
+
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
|
526
|
+
}
|
527
|
+
|
528
|
+
return jQuery;
|
529
|
+
} );
|