김동진

remove ignore file

Showing 264 changed files with 0 additions and 4841 deletions
1 -#### 9.0.0
2 -* 27/05/2019
3 -* For compatibility with legacy browsers, remove `Symbol` references.
4 -
5 -#### 8.1.1
6 -* 24/02/2019
7 -* [BUGFIX] #222 Restore missing `var` to `export BigNumber`.
8 -* Allow any key in BigNumber.Instance in *bignumber.d.ts*.
9 -
10 -#### 8.1.0
11 -* 23/02/2019
12 -* [NEW FEATURE] #220 Create a BigNumber using `{s, e, c}`.
13 -* [NEW FEATURE] `isBigNumber`: if `BigNumber.DEBUG` is `true`, also check that the BigNumber instance is well-formed.
14 -* Remove `instanceof` checks; just use `_isBigNumber` to identify a BigNumber instance.
15 -* Add `_isBigNumber` to prototype in *bignumber.mjs*.
16 -* Add tests for BigNumber creation from object.
17 -* Update *API.html*.
18 -
19 -#### 8.0.2
20 -* 13/01/2019
21 -* #209 `toPrecision` without argument should follow `toString`.
22 -* Improve *Use* section of *README*.
23 -* Optimise `toString(10)`.
24 -* Add verson number to API doc.
25 -
26 -#### 8.0.1
27 -* 01/11/2018
28 -* Rest parameter must be array type in *bignumber.d.ts*.
29 -
30 -#### 8.0.0
31 -* 01/11/2018
32 -* [NEW FEATURE] Add `BigNumber.sum` method.
33 -* [NEW FEATURE]`toFormat`: add `prefix` and `suffix` options.
34 -* [NEW FEATURE] #178 Pass custom formatting to `toFormat`.
35 -* [BREAKING CHANGE] #184 `toFraction`: return array of BigNumbers not strings.
36 -* [NEW FEATURE] #185 Enable overwrite of `valueOf` to prevent accidental addition to string.
37 -* #183 Add Node.js `crypto` requirement to documentation.
38 -* [BREAKING CHANGE] #198 Disallow signs and whitespace in custom alphabet.
39 -* [NEW FEATURE] #188 Implement `util.inspect.custom` for Node.js REPL.
40 -* #170 Make `isBigNumber` a type guard in *bignumber.d.ts*.
41 -* [BREAKING CHANGE] `BigNumber.min` and `BigNumber.max`: don't accept an array.
42 -* Update *.travis.yml*.
43 -* Remove *bower.json*.
44 -
45 -#### 7.2.1
46 -* 24/05/2018
47 -* Add `browser` field to *package.json*.
48 -
49 -#### 7.2.0
50 -* 22/05/2018
51 -* #166 Correct *.mjs* file. Remove extension from `main` field in *package.json*.
52 -
53 -#### 7.1.0
54 -* 18/05/2018
55 -* Add `module` field to *package.json* for *bignumber.mjs*.
56 -
57 -#### 7.0.2
58 -* 17/05/2018
59 -* #165 Bugfix: upper-case letters for bases 11-36 in a custom alphabet.
60 -* Add note to *README* regarding creating BigNumbers from Number values.
61 -
62 -#### 7.0.1
63 -* 26/04/2018
64 -* #158 Fix global object variable name typo.
65 -
66 -#### 7.0.0
67 -* 26/04/2018
68 -* #143 Remove global BigNumber from typings.
69 -* #144 Enable compatibility with `Object.freeze(Object.prototype)`.
70 -* #148 #123 #11 Only throw on a number primitive with more than 15 significant digits if `BigNumber.DEBUG` is `true`.
71 -* Only throw on an invalid BigNumber value if `BigNumber.DEBUG` is `true`. Return BigNumber `NaN` instead.
72 -* #154 `exponentiatedBy`: allow BigNumber exponent.
73 -* #156 Prevent Content Security Policy *unsafe-eval* issue.
74 -* `toFraction`: allow `Infinity` maximum denominator.
75 -* Comment-out some excess tests to reduce test time.
76 -* Amend indentation and other spacing.
77 -
78 -#### 6.0.0
79 -* 26/01/2018
80 -* #137 Implement `APLHABET` configuration option.
81 -* Remove `ERRORS` configuration option.
82 -* Remove `toDigits` method; extend `precision` method accordingly.
83 -* Remove s`round` method; extend `decimalPlaces` method accordingly.
84 -* Remove methods: `ceil`, `floor`, and `truncated`.
85 -* Remove method aliases: `add`, `cmp`, `isInt`, `isNeg`, `trunc`, `mul`, `neg` and `sub`.
86 -* Rename methods: `shift` to `shiftedBy`, `another` to `clone`, `toPower` to `exponentiatedBy`, and `equals` to `isEqualTo`.
87 -* Rename methods: add `is` prefix to `greaterThan`, `greaterThanOrEqualTo`, `lessThan` and `lessThanOrEqualTo`.
88 -* Add methods: `multipliedBy`, `isBigNumber`, `isPositive`, `integerValue`, `maximum` and `minimum`.
89 -* Refactor test suite.
90 -* Add *CHANGELOG.md*.
91 -* Rewrite *bignumber.d.ts*.
92 -* Redo API image.
93 -
94 -#### 5.0.0
95 -* 27/11/2017
96 -* #81 Don't throw on constructor call without `new`.
97 -
98 -#### 4.1.0
99 -* 26/09/2017
100 -* Remove node 0.6 from *.travis.yml*.
101 -* Add *bignumber.mjs*.
102 -
103 -#### 4.0.4
104 -* 03/09/2017
105 -* Add missing aliases to *bignumber.d.ts*.
106 -
107 -#### 4.0.3
108 -* 30/08/2017
109 -* Add types: *bignumber.d.ts*.
110 -
111 -#### 4.0.2
112 -* 03/05/2017
113 -* #120 Workaround Safari/Webkit bug.
114 -
115 -#### 4.0.1
116 -* 05/04/2017
117 -* #121 BigNumber.default to BigNumber['default'].
118 -
119 -#### 4.0.0
120 -* 09/01/2017
121 -* Replace BigNumber.isBigNumber method with isBigNumber prototype property.
122 -
123 -#### 3.1.2
124 -* 08/01/2017
125 -* Minor documentation edit.
126 -
127 -#### 3.1.1
128 -* 08/01/2017
129 -* Uncomment `isBigNumber` tests.
130 -* Ignore dot files.
131 -
132 -#### 3.1.0
133 -* 08/01/2017
134 -* Add `isBigNumber` method.
135 -
136 -#### 3.0.2
137 -* 08/01/2017
138 -* Bugfix: Possible incorrect value of `ERRORS` after a `BigNumber.another` call (due to `parseNumeric` declaration in outer scope).
139 -
140 -#### 3.0.1
141 -* 23/11/2016
142 -* Apply fix for old ipads with `%` issue, see #57 and #102.
143 -* Correct error message.
144 -
145 -#### 3.0.0
146 -* 09/11/2016
147 -* Remove `require('crypto')` - leave it to the user.
148 -* Add `BigNumber.set` as `BigNumber.config` alias.
149 -* Default `POW_PRECISION` to `0`.
150 -
151 -#### 2.4.0
152 -* 14/07/2016
153 -* #97 Add exports to support ES6 imports.
154 -
155 -#### 2.3.0
156 -* 07/03/2016
157 -* #86 Add modulus parameter to `toPower`.
158 -
159 -#### 2.2.0
160 -* 03/03/2016
161 -* #91 Permit larger JS integers.
162 -
163 -#### 2.1.4
164 -* 15/12/2015
165 -* Correct UMD.
166 -
167 -#### 2.1.3
168 -* 13/12/2015
169 -* Refactor re global object and crypto availability when bundling.
170 -
171 -#### 2.1.2
172 -* 10/12/2015
173 -* Bugfix: `window.crypto` not assigned to `crypto`.
174 -
175 -#### 2.1.1
176 -* 09/12/2015
177 -* Prevent code bundler from adding `crypto` shim.
178 -
179 -#### 2.1.0
180 -* 26/10/2015
181 -* For `valueOf` and `toJSON`, include the minus sign with negative zero.
182 -
183 -#### 2.0.8
184 -* 2/10/2015
185 -* Internal round function bugfix.
186 -
187 -#### 2.0.6
188 -* 31/03/2015
189 -* Add bower.json. Tweak division after in-depth review.
190 -
191 -#### 2.0.5
192 -* 25/03/2015
193 -* Amend README. Remove bitcoin address.
194 -
195 -#### 2.0.4
196 -* 25/03/2015
197 -* Critical bugfix #58: division.
198 -
199 -#### 2.0.3
200 -* 18/02/2015
201 -* Amend README. Add source map.
202 -
203 -#### 2.0.2
204 -* 18/02/2015
205 -* Correct links.
206 -
207 -#### 2.0.1
208 -* 18/02/2015
209 -* Add `max`, `min`, `precision`, `random`, `shiftedBy`, `toDigits` and `truncated` methods.
210 -* Add the short-forms: `add`, `mul`, `sd`, `sub` and `trunc`.
211 -* Add an `another` method to enable multiple independent constructors to be created.
212 -* Add support for the base 2, 8 and 16 prefixes `0b`, `0o` and `0x`.
213 -* Enable a rounding mode to be specified as a second parameter to `toExponential`, `toFixed`, `toFormat` and `toPrecision`.
214 -* Add a `CRYPTO` configuration property so cryptographically-secure pseudo-random number generation can be specified.
215 -* Add a `MODULO_MODE` configuration property to enable the rounding mode used by the `modulo` operation to be specified.
216 -* Add a `POW_PRECISION` configuration property to enable the number of significant digits calculated by the power operation to be limited.
217 -* Improve code quality.
218 -* Improve documentation.
219 -
220 -#### 2.0.0
221 -* 29/12/2014
222 -* Add `dividedToIntegerBy`, `isInteger` and `toFormat` methods.
223 -* Remove the following short-forms: `isF`, `isZ`, `toE`, `toF`, `toFr`, `toN`, `toP`, `toS`.
224 -* Store a BigNumber's coefficient in base 1e14, rather than base 10.
225 -* Add fast path for integers to BigNumber constructor.
226 -* Incorporate the library into the online documentation.
227 -
228 -#### 1.5.0
229 -* 13/11/2014
230 -* Add `toJSON` and `decimalPlaces` methods.
231 -
232 -#### 1.4.1
233 -* 08/06/2014
234 -* Amend README.
235 -
236 -#### 1.4.0
237 -* 08/05/2014
238 -* Add `toNumber`.
239 -
240 -#### 1.3.0
241 -* 08/11/2013
242 -* Ensure correct rounding of `sqrt` in all, rather than almost all, cases.
243 -* Maximum radix to 64.
244 -
245 -#### 1.2.1
246 -* 17/10/2013
247 -* Sign of zero when x < 0 and x + (-x) = 0.
248 -
249 -#### 1.2.0
250 -* 19/9/2013
251 -* Throw Error objects for stack.
252 -
253 -#### 1.1.1
254 -* 22/8/2013
255 -* Show original value in constructor error message.
256 -
257 -#### 1.1.0
258 -* 1/8/2013
259 -* Allow numbers with trailing radix point.
260 -
261 -#### 1.0.1
262 -* Bugfix: error messages with incorrect method name
263 -
264 -#### 1.0.0
265 -* 8/11/2012
266 -* Initial release
1 -The MIT Licence.
2 -
3 -Copyright (c) 2019 Michael Mclaughlin
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining
6 -a copy of this software and associated documentation files (the
7 -'Software'), to deal in the Software without restriction, including
8 -without limitation the rights to use, copy, modify, merge, publish,
9 -distribute, sublicense, and/or sell copies of the Software, and to
10 -permit persons to whom the Software is furnished to do so, subject to
11 -the following conditions:
12 -
13 -The above copyright notice and this permission notice shall be
14 -included in all copies or substantial portions of the Software.
15 -
16 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 -
1 -![bignumber.js](https://raw.githubusercontent.com/MikeMcl/bignumber.js/gh-pages/bignumberjs.png)
2 -
3 -A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic.
4 -
5 -[![Build Status](https://travis-ci.org/MikeMcl/bignumber.js.svg)](https://travis-ci.org/MikeMcl/bignumber.js)
6 -
7 -<br />
8 -
9 -## Features
10 -
11 - - Integers and decimals
12 - - Simple API but full-featured
13 - - Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal
14 - - 8 KB minified and gzipped
15 - - Replicates the `toExponential`, `toFixed`, `toPrecision` and `toString` methods of JavaScript's Number type
16 - - Includes a `toFraction` and a correctly-rounded `squareRoot` method
17 - - Supports cryptographically-secure pseudo-random number generation
18 - - No dependencies
19 - - Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only
20 - - Comprehensive [documentation](http://mikemcl.github.io/bignumber.js/) and test set
21 -
22 -![API](https://raw.githubusercontent.com/MikeMcl/bignumber.js/gh-pages/API.png)
23 -
24 -If a smaller and simpler library is required see [big.js](https://github.com/MikeMcl/big.js/).
25 -It's less than half the size but only works with decimal numbers and only has half the methods.
26 -It also does not allow `NaN` or `Infinity`, or have the configuration options of this library.
27 -
28 -See also [decimal.js](https://github.com/MikeMcl/decimal.js/), which among other things adds support for non-integer powers, and performs all operations to a specified number of significant digits.
29 -
30 -## Load
31 -
32 -The library is the single JavaScript file *bignumber.js* (or minified, *bignumber.min.js*).
33 -
34 -Browser:
35 -
36 -```html
37 -<script src='path/to/bignumber.js'></script>
38 -```
39 -
40 -[Node.js](http://nodejs.org):
41 -
42 -```bash
43 -$ npm install bignumber.js
44 -```
45 -
46 -```javascript
47 -const BigNumber = require('bignumber.js');
48 -```
49 -
50 -ES6 module:
51 -
52 -```javascript
53 -import BigNumber from "./bignumber.mjs"
54 -```
55 -
56 -AMD loader libraries such as [requireJS](http://requirejs.org/):
57 -
58 -```javascript
59 -require(['bignumber'], function(BigNumber) {
60 - // Use BigNumber here in local scope. No global BigNumber.
61 -});
62 -```
63 -
64 -## Use
65 -
66 -The library exports a single constructor function, [`BigNumber`](http://mikemcl.github.io/bignumber.js/#bignumber), which accepts a value of type Number, String or BigNumber,
67 -
68 -```javascript
69 -let x = new BigNumber(123.4567);
70 -let y = BigNumber('123456.7e-3');
71 -let z = new BigNumber(x);
72 -x.isEqualTo(y) && y.isEqualTo(z) && x.isEqualTo(z); // true
73 -```
74 -
75 -To get the string value of a BigNumber use [`toString()`](http://mikemcl.github.io/bignumber.js/#toS) or [`toFixed()`](http://mikemcl.github.io/bignumber.js/#toFix). Using `toFixed()` prevents exponential notation being returned, no matter how large or small the value.
76 -
77 -```javascript
78 -let x = new BigNumber('1111222233334444555566');
79 -x.toString(); // "1.111222233334444555566e+21"
80 -x.toFixed(); // "1111222233334444555566"
81 -```
82 -
83 -If the limited precision of Number values is not well understood, it is recommended to create BigNumbers from String values rather than Number values to avoid a potential loss of precision.
84 -
85 -*In all further examples below, `let`, semicolons and `toString` calls are not shown. If a commented-out value is in quotes it means `toString` has been called on the preceding expression.*
86 -
87 -```javascript
88 -// Precision loss from using numeric literals with more than 15 significant digits.
89 -new BigNumber(1.0000000000000001) // '1'
90 -new BigNumber(88259496234518.57) // '88259496234518.56'
91 -new BigNumber(99999999999999999999) // '100000000000000000000'
92 -
93 -// Precision loss from using numeric literals outside the range of Number values.
94 -new BigNumber(2e+308) // 'Infinity'
95 -new BigNumber(1e-324) // '0'
96 -
97 -// Precision loss from the unexpected result of arithmetic with Number values.
98 -new BigNumber(0.7 + 0.1) // '0.7999999999999999'
99 -```
100 -
101 -When creating a BigNumber from a Number, note that a BigNumber is created from a Number's decimal `toString()` value not from its underlying binary value. If the latter is required, then pass the Number's `toString(2)` value and specify base 2.
102 -
103 -```javascript
104 -new BigNumber(Number.MAX_VALUE.toString(2), 2)
105 -```
106 -
107 -BigNumbers can be created from values in bases from 2 to 36. See [`ALPHABET`](http://mikemcl.github.io/bignumber.js/#alphabet) to extend this range.
108 -
109 -```javascript
110 -a = new BigNumber(1011, 2) // "11"
111 -b = new BigNumber('zz.9', 36) // "1295.25"
112 -c = a.plus(b) // "1306.25"
113 -```
114 -
115 -Performance is better if base 10 is NOT specified for decimal values. Only specify base 10 when it is desired that the number of decimal places of the input value be limited to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting.
116 -
117 -A BigNumber is immutable in the sense that it is not changed by its methods.
118 -
119 -```javascript
120 -0.3 - 0.1 // 0.19999999999999998
121 -x = new BigNumber(0.3)
122 -x.minus(0.1) // "0.2"
123 -x // "0.3"
124 -```
125 -
126 -The methods that return a BigNumber can be chained.
127 -
128 -```javascript
129 -x.dividedBy(y).plus(z).times(9)
130 -x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').integerValue()
131 -```
132 -
133 -Some of the longer method names have a shorter alias.
134 -
135 -```javascript
136 -x.squareRoot().dividedBy(y).exponentiatedBy(3).isEqualTo(x.sqrt().div(y).pow(3)) // true
137 -x.modulo(y).multipliedBy(z).eq(x.mod(y).times(z)) // true
138 -```
139 -
140 -As with JavaScript's Number type, there are [`toExponential`](http://mikemcl.github.io/bignumber.js/#toE), [`toFixed`](http://mikemcl.github.io/bignumber.js/#toFix) and [`toPrecision`](http://mikemcl.github.io/bignumber.js/#toP) methods.
141 -
142 -```javascript
143 -x = new BigNumber(255.5)
144 -x.toExponential(5) // "2.55500e+2"
145 -x.toFixed(5) // "255.50000"
146 -x.toPrecision(5) // "255.50"
147 -x.toNumber() // 255.5
148 -```
149 -
150 - A base can be specified for [`toString`](http://mikemcl.github.io/bignumber.js/#toS). Performance is better if base 10 is NOT specified, i.e. use `toString()` not `toString(10)`. Only specify base 10 when it is desired that the number of decimal places be limited to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting.
151 -
152 - ```javascript
153 - x.toString(16) // "ff.8"
154 - ```
155 -
156 -There is a [`toFormat`](http://mikemcl.github.io/bignumber.js/#toFor) method which may be useful for internationalisation.
157 -
158 -```javascript
159 -y = new BigNumber('1234567.898765')
160 -y.toFormat(2) // "1,234,567.90"
161 -```
162 -
163 -The maximum number of decimal places of the result of an operation involving division (i.e. a division, square root, base conversion or negative power operation) is set using the `set` or `config` method of the `BigNumber` constructor.
164 -
165 -The other arithmetic operations always give the exact result.
166 -
167 -```javascript
168 -BigNumber.set({ DECIMAL_PLACES: 10, ROUNDING_MODE: 4 })
169 -
170 -x = new BigNumber(2)
171 -y = new BigNumber(3)
172 -z = x.dividedBy(y) // "0.6666666667"
173 -z.squareRoot() // "0.8164965809"
174 -z.exponentiatedBy(-3) // "3.3749999995"
175 -z.toString(2) // "0.1010101011"
176 -z.multipliedBy(z) // "0.44444444448888888889"
177 -z.multipliedBy(z).decimalPlaces(10) // "0.4444444445"
178 -```
179 -
180 -There is a [`toFraction`](http://mikemcl.github.io/bignumber.js/#toFr) method with an optional *maximum denominator* argument
181 -
182 -```javascript
183 -y = new BigNumber(355)
184 -pi = y.dividedBy(113) // "3.1415929204"
185 -pi.toFraction() // [ "7853982301", "2500000000" ]
186 -pi.toFraction(1000) // [ "355", "113" ]
187 -```
188 -
189 -and [`isNaN`](http://mikemcl.github.io/bignumber.js/#isNaN) and [`isFinite`](http://mikemcl.github.io/bignumber.js/#isF) methods, as `NaN` and `Infinity` are valid `BigNumber` values.
190 -
191 -```javascript
192 -x = new BigNumber(NaN) // "NaN"
193 -y = new BigNumber(Infinity) // "Infinity"
194 -x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite() // true
195 -```
196 -
197 -The value of a BigNumber is stored in a decimal floating point format in terms of a coefficient, exponent and sign.
198 -
199 -```javascript
200 -x = new BigNumber(-123.456);
201 -x.c // [ 123, 45600000000000 ] coefficient (i.e. significand)
202 -x.e // 2 exponent
203 -x.s // -1 sign
204 -```
205 -
206 -For advanced usage, multiple BigNumber constructors can be created, each with their own independent configuration.
207 -
208 -```javascript
209 -// Set DECIMAL_PLACES for the original BigNumber constructor
210 -BigNumber.set({ DECIMAL_PLACES: 10 })
211 -
212 -// Create another BigNumber constructor, optionally passing in a configuration object
213 -BN = BigNumber.clone({ DECIMAL_PLACES: 5 })
214 -
215 -x = new BigNumber(1)
216 -y = new BN(1)
217 -
218 -x.div(3) // '0.3333333333'
219 -y.div(3) // '0.33333'
220 -```
221 -
222 -For further information see the [API](http://mikemcl.github.io/bignumber.js/) reference in the *doc* directory.
223 -
224 -## Test
225 -
226 -The *test/modules* directory contains the test scripts for each method.
227 -
228 -The tests can be run with Node.js or a browser. For Node.js use
229 -
230 - $ npm test
231 -
232 -or
233 -
234 - $ node test/test
235 -
236 -To test a single method, use, for example
237 -
238 - $ node test/methods/toFraction
239 -
240 -For the browser, open *test/test.html*.
241 -
242 -## Build
243 -
244 -For Node, if [uglify-js](https://github.com/mishoo/UglifyJS2) is installed
245 -
246 - npm install uglify-js -g
247 -
248 -then
249 -
250 - npm run build
251 -
252 -will create *bignumber.min.js*.
253 -
254 -A source map will also be created in the root directory.
255 -
256 -## Feedback
257 -
258 -Open an issue, or email
259 -
260 -Michael
261 -
262 -<a href="mailto:M8ch88l@gmail.com">M8ch88l@gmail.com</a>
263 -
264 -## Licence
265 -
266 -The MIT Licence.
267 -
268 -See [LICENCE](https://github.com/MikeMcl/bignumber.js/blob/master/LICENCE).
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -{
2 - "_from": "bignumber.js@9.0.0",
3 - "_id": "bignumber.js@9.0.0",
4 - "_inBundle": false,
5 - "_integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==",
6 - "_location": "/bignumber.js",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "version",
10 - "registry": true,
11 - "raw": "bignumber.js@9.0.0",
12 - "name": "bignumber.js",
13 - "escapedName": "bignumber.js",
14 - "rawSpec": "9.0.0",
15 - "saveSpec": null,
16 - "fetchSpec": "9.0.0"
17 - },
18 - "_requiredBy": [
19 - "/mysql"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz",
22 - "_shasum": "805880f84a329b5eac6e7cb6f8274b6d82bdf075",
23 - "_spec": "bignumber.js@9.0.0",
24 - "_where": "C:\\Users\\daou\\Desktop\\HealthProtector\\node_modules\\mysql",
25 - "author": {
26 - "name": "Michael Mclaughlin",
27 - "email": "M8ch88l@gmail.com"
28 - },
29 - "browser": "bignumber.js",
30 - "bugs": {
31 - "url": "https://github.com/MikeMcl/bignumber.js/issues"
32 - },
33 - "bundleDependencies": false,
34 - "dependencies": {},
35 - "deprecated": false,
36 - "description": "A library for arbitrary-precision decimal and non-decimal arithmetic",
37 - "engines": {
38 - "node": "*"
39 - },
40 - "homepage": "https://github.com/MikeMcl/bignumber.js#readme",
41 - "keywords": [
42 - "arbitrary",
43 - "precision",
44 - "arithmetic",
45 - "big",
46 - "number",
47 - "decimal",
48 - "float",
49 - "biginteger",
50 - "bigdecimal",
51 - "bignumber",
52 - "bigint",
53 - "bignum"
54 - ],
55 - "license": "MIT",
56 - "main": "bignumber",
57 - "module": "bignumber.mjs",
58 - "name": "bignumber.js",
59 - "repository": {
60 - "type": "git",
61 - "url": "git+https://github.com/MikeMcl/bignumber.js.git"
62 - },
63 - "scripts": {
64 - "build": "uglifyjs bignumber.js --source-map -c -m -o bignumber.min.js",
65 - "test": "node test/test"
66 - },
67 - "types": "bignumber.d.ts",
68 - "version": "9.0.0"
69 -}
1 -Copyright Node.js contributors. All rights reserved.
2 -
3 -Permission is hereby granted, free of charge, to any person obtaining a copy
4 -of this software and associated documentation files (the "Software"), to
5 -deal in the Software without restriction, including without limitation the
6 -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 -sell copies of the Software, and to permit persons to whom the Software is
8 -furnished to do so, subject to the following conditions:
9 -
10 -The above copyright notice and this permission notice shall be included in
11 -all copies or substantial portions of the Software.
12 -
13 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 -IN THE SOFTWARE.
1 -# core-util-is
2 -
3 -The `util.is*` functions introduced in Node v0.12.
This diff is collapsed. Click to expand it.
1 -// Copyright Joyent, Inc. and other Node contributors.
2 -//
3 -// Permission is hereby granted, free of charge, to any person obtaining a
4 -// copy of this software and associated documentation files (the
5 -// "Software"), to deal in the Software without restriction, including
6 -// without limitation the rights to use, copy, modify, merge, publish,
7 -// distribute, sublicense, and/or sell copies of the Software, and to permit
8 -// persons to whom the Software is furnished to do so, subject to the
9 -// following conditions:
10 -//
11 -// The above copyright notice and this permission notice shall be included
12 -// in all copies or substantial portions of the Software.
13 -//
14 -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 -// USE OR OTHER DEALINGS IN THE SOFTWARE.
21 -
22 -// NOTE: These type checking functions intentionally don't use `instanceof`
23 -// because it is fragile and can be easily faked with `Object.create()`.
24 -
25 -function isArray(arg) {
26 - if (Array.isArray) {
27 - return Array.isArray(arg);
28 - }
29 - return objectToString(arg) === '[object Array]';
30 -}
31 -exports.isArray = isArray;
32 -
33 -function isBoolean(arg) {
34 - return typeof arg === 'boolean';
35 -}
36 -exports.isBoolean = isBoolean;
37 -
38 -function isNull(arg) {
39 - return arg === null;
40 -}
41 -exports.isNull = isNull;
42 -
43 -function isNullOrUndefined(arg) {
44 - return arg == null;
45 -}
46 -exports.isNullOrUndefined = isNullOrUndefined;
47 -
48 -function isNumber(arg) {
49 - return typeof arg === 'number';
50 -}
51 -exports.isNumber = isNumber;
52 -
53 -function isString(arg) {
54 - return typeof arg === 'string';
55 -}
56 -exports.isString = isString;
57 -
58 -function isSymbol(arg) {
59 - return typeof arg === 'symbol';
60 -}
61 -exports.isSymbol = isSymbol;
62 -
63 -function isUndefined(arg) {
64 - return arg === void 0;
65 -}
66 -exports.isUndefined = isUndefined;
67 -
68 -function isRegExp(re) {
69 - return objectToString(re) === '[object RegExp]';
70 -}
71 -exports.isRegExp = isRegExp;
72 -
73 -function isObject(arg) {
74 - return typeof arg === 'object' && arg !== null;
75 -}
76 -exports.isObject = isObject;
77 -
78 -function isDate(d) {
79 - return objectToString(d) === '[object Date]';
80 -}
81 -exports.isDate = isDate;
82 -
83 -function isError(e) {
84 - return (objectToString(e) === '[object Error]' || e instanceof Error);
85 -}
86 -exports.isError = isError;
87 -
88 -function isFunction(arg) {
89 - return typeof arg === 'function';
90 -}
91 -exports.isFunction = isFunction;
92 -
93 -function isPrimitive(arg) {
94 - return arg === null ||
95 - typeof arg === 'boolean' ||
96 - typeof arg === 'number' ||
97 - typeof arg === 'string' ||
98 - typeof arg === 'symbol' || // ES6 symbol
99 - typeof arg === 'undefined';
100 -}
101 -exports.isPrimitive = isPrimitive;
102 -
103 -exports.isBuffer = Buffer.isBuffer;
104 -
105 -function objectToString(o) {
106 - return Object.prototype.toString.call(o);
107 -}
1 -{
2 - "_from": "core-util-is@~1.0.0",
3 - "_id": "core-util-is@1.0.2",
4 - "_inBundle": false,
5 - "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
6 - "_location": "/core-util-is",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "core-util-is@~1.0.0",
12 - "name": "core-util-is",
13 - "escapedName": "core-util-is",
14 - "rawSpec": "~1.0.0",
15 - "saveSpec": null,
16 - "fetchSpec": "~1.0.0"
17 - },
18 - "_requiredBy": [
19 - "/readable-stream"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
22 - "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
23 - "_spec": "core-util-is@~1.0.0",
24 - "_where": "C:\\Users\\daou\\Desktop\\HealthProtector\\node_modules\\readable-stream",
25 - "author": {
26 - "name": "Isaac Z. Schlueter",
27 - "email": "i@izs.me",
28 - "url": "http://blog.izs.me/"
29 - },
30 - "bugs": {
31 - "url": "https://github.com/isaacs/core-util-is/issues"
32 - },
33 - "bundleDependencies": false,
34 - "deprecated": false,
35 - "description": "The `util.is*` functions introduced in Node v0.12.",
36 - "devDependencies": {
37 - "tap": "^2.3.0"
38 - },
39 - "homepage": "https://github.com/isaacs/core-util-is#readme",
40 - "keywords": [
41 - "util",
42 - "isBuffer",
43 - "isArray",
44 - "isNumber",
45 - "isString",
46 - "isRegExp",
47 - "isThis",
48 - "isThat",
49 - "polyfill"
50 - ],
51 - "license": "MIT",
52 - "main": "lib/util.js",
53 - "name": "core-util-is",
54 - "repository": {
55 - "type": "git",
56 - "url": "git://github.com/isaacs/core-util-is.git"
57 - },
58 - "scripts": {
59 - "test": "tap test.js"
60 - },
61 - "version": "1.0.2"
62 -}
1 -var assert = require('tap');
2 -
3 -var t = require('./lib/util');
4 -
5 -assert.equal(t.isArray([]), true);
6 -assert.equal(t.isArray({}), false);
7 -
8 -assert.equal(t.isBoolean(null), false);
9 -assert.equal(t.isBoolean(true), true);
10 -assert.equal(t.isBoolean(false), true);
11 -
12 -assert.equal(t.isNull(null), true);
13 -assert.equal(t.isNull(undefined), false);
14 -assert.equal(t.isNull(false), false);
15 -assert.equal(t.isNull(), false);
16 -
17 -assert.equal(t.isNullOrUndefined(null), true);
18 -assert.equal(t.isNullOrUndefined(undefined), true);
19 -assert.equal(t.isNullOrUndefined(false), false);
20 -assert.equal(t.isNullOrUndefined(), true);
21 -
22 -assert.equal(t.isNumber(null), false);
23 -assert.equal(t.isNumber('1'), false);
24 -assert.equal(t.isNumber(1), true);
25 -
26 -assert.equal(t.isString(null), false);
27 -assert.equal(t.isString('1'), true);
28 -assert.equal(t.isString(1), false);
29 -
30 -assert.equal(t.isSymbol(null), false);
31 -assert.equal(t.isSymbol('1'), false);
32 -assert.equal(t.isSymbol(1), false);
33 -assert.equal(t.isSymbol(Symbol()), true);
34 -
35 -assert.equal(t.isUndefined(null), false);
36 -assert.equal(t.isUndefined(undefined), true);
37 -assert.equal(t.isUndefined(false), false);
38 -assert.equal(t.isUndefined(), true);
39 -
40 -assert.equal(t.isRegExp(null), false);
41 -assert.equal(t.isRegExp('1'), false);
42 -assert.equal(t.isRegExp(new RegExp()), true);
43 -
44 -assert.equal(t.isObject({}), true);
45 -assert.equal(t.isObject([]), true);
46 -assert.equal(t.isObject(new RegExp()), true);
47 -assert.equal(t.isObject(new Date()), true);
48 -
49 -assert.equal(t.isDate(null), false);
50 -assert.equal(t.isDate('1'), false);
51 -assert.equal(t.isDate(new Date()), true);
52 -
53 -assert.equal(t.isError(null), false);
54 -assert.equal(t.isError({ err: true }), false);
55 -assert.equal(t.isError(new Error()), true);
56 -
57 -assert.equal(t.isFunction(null), false);
58 -assert.equal(t.isFunction({ }), false);
59 -assert.equal(t.isFunction(function() {}), true);
60 -
61 -assert.equal(t.isPrimitive(null), true);
62 -assert.equal(t.isPrimitive(''), true);
63 -assert.equal(t.isPrimitive(0), true);
64 -assert.equal(t.isPrimitive(new Date()), false);
65 -
66 -assert.equal(t.isBuffer(null), false);
67 -assert.equal(t.isBuffer({}), false);
68 -assert.equal(t.isBuffer(new Buffer(0)), true);
1 -The ISC License
2 -
3 -Copyright (c) Isaac Z. Schlueter
4 -
5 -Permission to use, copy, modify, and/or distribute this software for any
6 -purpose with or without fee is hereby granted, provided that the above
7 -copyright notice and this permission notice appear in all copies.
8 -
9 -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10 -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
11 -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12 -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14 -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 -PERFORMANCE OF THIS SOFTWARE.
16 -
1 -Browser-friendly inheritance fully compatible with standard node.js
2 -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
3 -
4 -This package exports standard `inherits` from node.js `util` module in
5 -node environment, but also provides alternative browser-friendly
6 -implementation through [browser
7 -field](https://gist.github.com/shtylman/4339901). Alternative
8 -implementation is a literal copy of standard one located in standalone
9 -module to avoid requiring of `util`. It also has a shim for old
10 -browsers with no `Object.create` support.
11 -
12 -While keeping you sure you are using standard `inherits`
13 -implementation in node.js environment, it allows bundlers such as
14 -[browserify](https://github.com/substack/node-browserify) to not
15 -include full `util` package to your client code if all you need is
16 -just `inherits` function. It worth, because browser shim for `util`
17 -package is large and `inherits` is often the single function you need
18 -from it.
19 -
20 -It's recommended to use this package instead of
21 -`require('util').inherits` for any code that has chances to be used
22 -not only in node.js but in browser too.
23 -
24 -## usage
25 -
26 -```js
27 -var inherits = require('inherits');
28 -// then use exactly as the standard one
29 -```
30 -
31 -## note on version ~1.0
32 -
33 -Version ~1.0 had completely different motivation and is not compatible
34 -neither with 2.0 nor with standard node.js `inherits`.
35 -
36 -If you are using version ~1.0 and planning to switch to ~2.0, be
37 -careful:
38 -
39 -* new version uses `super_` instead of `super` for referencing
40 - superclass
41 -* new version overwrites current prototype while old one preserves any
42 - existing fields on it
1 -try {
2 - var util = require('util');
3 - /* istanbul ignore next */
4 - if (typeof util.inherits !== 'function') throw '';
5 - module.exports = util.inherits;
6 -} catch (e) {
7 - /* istanbul ignore next */
8 - module.exports = require('./inherits_browser.js');
9 -}
1 -if (typeof Object.create === 'function') {
2 - // implementation from standard node.js 'util' module
3 - module.exports = function inherits(ctor, superCtor) {
4 - if (superCtor) {
5 - ctor.super_ = superCtor
6 - ctor.prototype = Object.create(superCtor.prototype, {
7 - constructor: {
8 - value: ctor,
9 - enumerable: false,
10 - writable: true,
11 - configurable: true
12 - }
13 - })
14 - }
15 - };
16 -} else {
17 - // old school shim for old browsers
18 - module.exports = function inherits(ctor, superCtor) {
19 - if (superCtor) {
20 - ctor.super_ = superCtor
21 - var TempCtor = function () {}
22 - TempCtor.prototype = superCtor.prototype
23 - ctor.prototype = new TempCtor()
24 - ctor.prototype.constructor = ctor
25 - }
26 - }
27 -}
1 -{
2 - "_from": "inherits@~2.0.3",
3 - "_id": "inherits@2.0.4",
4 - "_inBundle": false,
5 - "_integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
6 - "_location": "/inherits",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "inherits@~2.0.3",
12 - "name": "inherits",
13 - "escapedName": "inherits",
14 - "rawSpec": "~2.0.3",
15 - "saveSpec": null,
16 - "fetchSpec": "~2.0.3"
17 - },
18 - "_requiredBy": [
19 - "/readable-stream"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
22 - "_shasum": "0fa2c64f932917c3433a0ded55363aae37416b7c",
23 - "_spec": "inherits@~2.0.3",
24 - "_where": "C:\\Users\\daou\\Desktop\\HealthProtector\\node_modules\\readable-stream",
25 - "browser": "./inherits_browser.js",
26 - "bugs": {
27 - "url": "https://github.com/isaacs/inherits/issues"
28 - },
29 - "bundleDependencies": false,
30 - "deprecated": false,
31 - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
32 - "devDependencies": {
33 - "tap": "^14.2.4"
34 - },
35 - "files": [
36 - "inherits.js",
37 - "inherits_browser.js"
38 - ],
39 - "homepage": "https://github.com/isaacs/inherits#readme",
40 - "keywords": [
41 - "inheritance",
42 - "class",
43 - "klass",
44 - "oop",
45 - "object-oriented",
46 - "inherits",
47 - "browser",
48 - "browserify"
49 - ],
50 - "license": "ISC",
51 - "main": "./inherits.js",
52 - "name": "inherits",
53 - "repository": {
54 - "type": "git",
55 - "url": "git://github.com/isaacs/inherits.git"
56 - },
57 - "scripts": {
58 - "test": "tap"
59 - },
60 - "version": "2.0.4"
61 -}
1 -language: node_js
2 -node_js:
3 - - "0.8"
4 - - "0.10"
1 -
2 -test:
3 - @node_modules/.bin/tape test.js
4 -
5 -.PHONY: test
6 -
1 -
2 -# isarray
3 -
4 -`Array#isArray` for older browsers.
5 -
6 -[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
7 -[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
8 -
9 -[![browser support](https://ci.testling.com/juliangruber/isarray.png)
10 -](https://ci.testling.com/juliangruber/isarray)
11 -
12 -## Usage
13 -
14 -```js
15 -var isArray = require('isarray');
16 -
17 -console.log(isArray([])); // => true
18 -console.log(isArray({})); // => false
19 -```
20 -
21 -## Installation
22 -
23 -With [npm](http://npmjs.org) do
24 -
25 -```bash
26 -$ npm install isarray
27 -```
28 -
29 -Then bundle for the browser with
30 -[browserify](https://github.com/substack/browserify).
31 -
32 -With [component](http://component.io) do
33 -
34 -```bash
35 -$ component install juliangruber/isarray
36 -```
37 -
38 -## License
39 -
40 -(MIT)
41 -
42 -Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
43 -
44 -Permission is hereby granted, free of charge, to any person obtaining a copy of
45 -this software and associated documentation files (the "Software"), to deal in
46 -the Software without restriction, including without limitation the rights to
47 -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
48 -of the Software, and to permit persons to whom the Software is furnished to do
49 -so, subject to the following conditions:
50 -
51 -The above copyright notice and this permission notice shall be included in all
52 -copies or substantial portions of the Software.
53 -
54 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55 -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56 -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
57 -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58 -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
59 -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
60 -SOFTWARE.
1 -{
2 - "name" : "isarray",
3 - "description" : "Array#isArray for older browsers",
4 - "version" : "0.0.1",
5 - "repository" : "juliangruber/isarray",
6 - "homepage": "https://github.com/juliangruber/isarray",
7 - "main" : "index.js",
8 - "scripts" : [
9 - "index.js"
10 - ],
11 - "dependencies" : {},
12 - "keywords": ["browser","isarray","array"],
13 - "author": {
14 - "name": "Julian Gruber",
15 - "email": "mail@juliangruber.com",
16 - "url": "http://juliangruber.com"
17 - },
18 - "license": "MIT"
19 -}
1 -var toString = {}.toString;
2 -
3 -module.exports = Array.isArray || function (arr) {
4 - return toString.call(arr) == '[object Array]';
5 -};
1 -{
2 - "_from": "isarray@~1.0.0",
3 - "_id": "isarray@1.0.0",
4 - "_inBundle": false,
5 - "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
6 - "_location": "/isarray",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "range",
10 - "registry": true,
11 - "raw": "isarray@~1.0.0",
12 - "name": "isarray",
13 - "escapedName": "isarray",
14 - "rawSpec": "~1.0.0",
15 - "saveSpec": null,
16 - "fetchSpec": "~1.0.0"
17 - },
18 - "_requiredBy": [
19 - "/readable-stream"
20 - ],
21 - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
22 - "_shasum": "bb935d48582cba168c06834957a54a3e07124f11",
23 - "_spec": "isarray@~1.0.0",
24 - "_where": "C:\\Users\\daou\\Desktop\\HealthProtector\\node_modules\\readable-stream",
25 - "author": {
26 - "name": "Julian Gruber",
27 - "email": "mail@juliangruber.com",
28 - "url": "http://juliangruber.com"
29 - },
30 - "bugs": {
31 - "url": "https://github.com/juliangruber/isarray/issues"
32 - },
33 - "bundleDependencies": false,
34 - "dependencies": {},
35 - "deprecated": false,
36 - "description": "Array#isArray for older browsers",
37 - "devDependencies": {
38 - "tape": "~2.13.4"
39 - },
40 - "homepage": "https://github.com/juliangruber/isarray",
41 - "keywords": [
42 - "browser",
43 - "isarray",
44 - "array"
45 - ],
46 - "license": "MIT",
47 - "main": "index.js",
48 - "name": "isarray",
49 - "repository": {
50 - "type": "git",
51 - "url": "git://github.com/juliangruber/isarray.git"
52 - },
53 - "scripts": {
54 - "test": "tape test.js"
55 - },
56 - "testling": {
57 - "files": "test.js",
58 - "browsers": [
59 - "ie/8..latest",
60 - "firefox/17..latest",
61 - "firefox/nightly",
62 - "chrome/22..latest",
63 - "chrome/canary",
64 - "opera/12..latest",
65 - "opera/next",
66 - "safari/5.1..latest",
67 - "ipad/6.0..latest",
68 - "iphone/6.0..latest",
69 - "android-browser/4.2..latest"
70 - ]
71 - },
72 - "version": "1.0.0"
73 -}
1 -var isArray = require('./');
2 -var test = require('tape');
3 -
4 -test('is array', function(t){
5 - t.ok(isArray([]));
6 - t.notOk(isArray({}));
7 - t.notOk(isArray(null));
8 - t.notOk(isArray(false));
9 -
10 - var obj = {};
11 - obj[0] = true;
12 - t.notOk(isArray(obj));
13 -
14 - var arr = [];
15 - arr.foo = 'bar';
16 - t.ok(isArray(arr));
17 -
18 - t.end();
19 -});
20 -
This diff is collapsed. Click to expand it.
1 -Copyright JS Foundation and other contributors, https://js.foundation/
2 -
3 -Permission is hereby granted, free of charge, to any person obtaining
4 -a copy of this software and associated documentation files (the
5 -"Software"), to deal in the Software without restriction, including
6 -without limitation the rights to use, copy, modify, merge, publish,
7 -distribute, sublicense, and/or sell copies of the Software, and to
8 -permit persons to whom the Software is furnished to do so, subject to
9 -the following conditions:
10 -
11 -The above copyright notice and this permission notice shall be
12 -included in all copies or substantial portions of the Software.
13 -
14 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 -# jQuery
2 -
3 -> jQuery is a fast, small, and feature-rich JavaScript library.
4 -
5 -For information on how to get started and how to use jQuery, please see [jQuery's documentation](https://api.jquery.com/).
6 -For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).
7 -
8 -If upgrading, please see the [blog post for 3.5.1](https://blog.jquery.com/2020/05/04/jquery-3-5-1-released-fixing-a-regression/). This includes notable differences from the previous version and a more readable changelog.
9 -
10 -## Including jQuery
11 -
12 -Below are some of the most common ways to include jQuery.
13 -
14 -### Browser
15 -
16 -#### Script tag
17 -
18 -```html
19 -<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
20 -```
21 -
22 -#### Babel
23 -
24 -[Babel](https://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.
25 -
26 -```js
27 -import $ from "jquery";
28 -```
29 -
30 -#### Browserify/Webpack
31 -
32 -There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documentation. In the script, including jQuery will usually look like this...
33 -
34 -```js
35 -var $ = require( "jquery" );
36 -```
37 -
38 -#### AMD (Asynchronous Module Definition)
39 -
40 -AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](https://requirejs.org/docs/whyamd.html).
41 -
42 -```js
43 -define( [ "jquery" ], function( $ ) {
44 -
45 -} );
46 -```
47 -
48 -### Node
49 -
50 -To include jQuery in [Node](https://nodejs.org/), first install with npm.
51 -
52 -```sh
53 -npm install jquery
54 -```
55 -
56 -For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/jsdom/jsdom). This can be useful for testing purposes.
57 -
58 -```js
59 -const { JSDOM } = require( "jsdom" );
60 -const { window } = new JSDOM( "" );
61 -const $ = require( "jquery" )( window );
62 -```
1 -{
2 - "name": "jquery",
3 - "main": "dist/jquery.js",
4 - "license": "MIT",
5 - "ignore": [
6 - "package.json"
7 - ],
8 - "keywords": [
9 - "jquery",
10 - "javascript",
11 - "browser",
12 - "library"
13 - ]
14 -}
...\ No newline at end of file ...\ No newline at end of file
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
1 -Copyright JS Foundation and other contributors, https://js.foundation/
2 -
3 -This software consists of voluntary contributions made by many
4 -individuals. For exact contribution history, see the revision history
5 -available at https://github.com/jquery/sizzle
6 -
7 -The following license applies to all parts of this software except as
8 -documented below:
9 -
10 -====
11 -
12 -Permission is hereby granted, free of charge, to any person obtaining
13 -a copy of this software and associated documentation files (the
14 -"Software"), to deal in the Software without restriction, including
15 -without limitation the rights to use, copy, modify, merge, publish,
16 -distribute, sublicense, and/or sell copies of the Software, and to
17 -permit persons to whom the Software is furnished to do so, subject to
18 -the following conditions:
19 -
20 -The above copyright notice and this permission notice shall be
21 -included in all copies or substantial portions of the Software.
22 -
23 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 -
31 -====
32 -
33 -All files located in the node_modules and external directories are
34 -externally maintained libraries used by this software which have their
35 -own licenses; we recommend you read them, as their terms may differ from
36 -the terms above.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -{
2 - "_from": "jquery",
3 - "_id": "jquery@3.5.1",
4 - "_inBundle": false,
5 - "_integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==",
6 - "_location": "/jquery",
7 - "_phantomChildren": {},
8 - "_requested": {
9 - "type": "tag",
10 - "registry": true,
11 - "raw": "jquery",
12 - "name": "jquery",
13 - "escapedName": "jquery",
14 - "rawSpec": "",
15 - "saveSpec": null,
16 - "fetchSpec": "latest"
17 - },
18 - "_requiredBy": [
19 - "#USER",
20 - "/"
21 - ],
22 - "_resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
23 - "_shasum": "d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5",
24 - "_spec": "jquery",
25 - "_where": "C:\\Users\\daou\\Desktop\\HealthProtector",
26 - "author": {
27 - "name": "JS Foundation and other contributors",
28 - "url": "https://github.com/jquery/jquery/blob/3.5.1/AUTHORS.txt"
29 - },
30 - "bugs": {
31 - "url": "https://github.com/jquery/jquery/issues"
32 - },
33 - "bundleDependencies": false,
34 - "commitplease": {
35 - "nohook": true,
36 - "components": [
37 - "Docs",
38 - "Tests",
39 - "Build",
40 - "Support",
41 - "Release",
42 - "Core",
43 - "Ajax",
44 - "Attributes",
45 - "Callbacks",
46 - "CSS",
47 - "Data",
48 - "Deferred",
49 - "Deprecated",
50 - "Dimensions",
51 - "Effects",
52 - "Event",
53 - "Manipulation",
54 - "Offset",
55 - "Queue",
56 - "Selector",
57 - "Serialize",
58 - "Traversing",
59 - "Wrap"
60 - ],
61 - "markerPattern": "^((clos|fix|resolv)(e[sd]|ing))|^(refs?)",
62 - "ticketPattern": "^((Closes|Fixes) ([a-zA-Z]{2,}-)[0-9]+)|^(Refs? [^#])"
63 - },
64 - "dependencies": {},
65 - "deprecated": false,
66 - "description": "JavaScript library for DOM operations",
67 - "devDependencies": {
68 - "@babel/core": "7.3.3",
69 - "@babel/plugin-transform-for-of": "7.2.0",
70 - "commitplease": "3.2.0",
71 - "core-js": "2.6.5",
72 - "eslint-config-jquery": "2.0.0",
73 - "grunt": "1.0.3",
74 - "grunt-babel": "8.0.0",
75 - "grunt-cli": "1.3.2",
76 - "grunt-compare-size": "0.4.2",
77 - "grunt-contrib-uglify": "3.4.0",
78 - "grunt-contrib-watch": "1.1.0",
79 - "grunt-eslint": "22.0.0",
80 - "grunt-git-authors": "3.2.0",
81 - "grunt-jsonlint": "1.1.0",
82 - "grunt-karma": "3.0.1",
83 - "grunt-newer": "1.3.0",
84 - "grunt-npmcopy": "0.1.0",
85 - "gzip-js": "0.3.2",
86 - "husky": "1.3.1",
87 - "insight": "0.10.1",
88 - "jsdom": "13.2.0",
89 - "karma": "4.0.1",
90 - "karma-browserstack-launcher": "1.4.0",
91 - "karma-chrome-launcher": "2.2.0",
92 - "karma-firefox-launcher": "1.1.0",
93 - "karma-ie-launcher": "1.0.0",
94 - "karma-jsdom-launcher": "7.1.0",
95 - "karma-qunit": "3.0.0",
96 - "load-grunt-tasks": "4.0.0",
97 - "native-promise-only": "0.8.1",
98 - "promises-aplus-tests": "2.1.2",
99 - "q": "1.5.1",
100 - "qunit": "2.9.2",
101 - "raw-body": "2.3.3",
102 - "requirejs": "2.3.6",
103 - "sinon": "2.3.7",
104 - "sizzle": "2.3.5",
105 - "strip-json-comments": "2.0.1",
106 - "testswarm": "1.1.0",
107 - "uglify-js": "3.4.7"
108 - },
109 - "homepage": "https://jquery.com",
110 - "husky": {
111 - "hooks": {
112 - "commit-msg": "node node_modules/commitplease",
113 - "pre-commit": "grunt lint:newer qunit_fixture"
114 - }
115 - },
116 - "keywords": [
117 - "jquery",
118 - "javascript",
119 - "browser",
120 - "library"
121 - ],
122 - "license": "MIT",
123 - "main": "dist/jquery.js",
124 - "name": "jquery",
125 - "repository": {
126 - "type": "git",
127 - "url": "git+https://github.com/jquery/jquery.git"
128 - },
129 - "scripts": {
130 - "build": "npm install && grunt",
131 - "jenkins": "npm run test:browserless",
132 - "start": "grunt watch",
133 - "test": "npm run test:slim && npm run test:no-deprecated && npm run test:no-sizzle && grunt && grunt test:slow && grunt karma:main && grunt karma:amd",
134 - "test:amd": "grunt && grunt karma:amd",
135 - "test:browser": "grunt && grunt karma:main",
136 - "test:browserless": "grunt && grunt test:slow",
137 - "test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main",
138 - "test:no-sizzle": "grunt test:prepare && grunt custom:-sizzle && grunt karma:main",
139 - "test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main"
140 - },
141 - "title": "jQuery",
142 - "version": "3.5.1"
143 -}
This diff is collapsed. Click to expand it.
1 -define( [
2 - "../core",
3 - "../var/isFunction",
4 - "./var/nonce",
5 - "./var/rquery",
6 - "../ajax"
7 -], function( jQuery, isFunction, nonce, rquery ) {
8 -
9 -"use strict";
10 -
11 -var oldCallbacks = [],
12 - rjsonp = /(=)\?(?=&|$)|\?\?/;
13 -
14 -// Default jsonp settings
15 -jQuery.ajaxSetup( {
16 - jsonp: "callback",
17 - jsonpCallback: function() {
18 - var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
19 - this[ callback ] = true;
20 - return callback;
21 - }
22 -} );
23 -
24 -// Detect, normalize options and install callbacks for jsonp requests
25 -jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
26 -
27 - var callbackName, overwritten, responseContainer,
28 - jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
29 - "url" :
30 - typeof s.data === "string" &&
31 - ( s.contentType || "" )
32 - .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
33 - rjsonp.test( s.data ) && "data"
34 - );
35 -
36 - // Handle iff the expected data type is "jsonp" or we have a parameter to set
37 - if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
38 -
39 - // Get callback name, remembering preexisting value associated with it
40 - callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
41 - s.jsonpCallback() :
42 - s.jsonpCallback;
43 -
44 - // Insert callback into url or form data
45 - if ( jsonProp ) {
46 - s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
47 - } else if ( s.jsonp !== false ) {
48 - s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
49 - }
50 -
51 - // Use data converter to retrieve json after script execution
52 - s.converters[ "script json" ] = function() {
53 - if ( !responseContainer ) {
54 - jQuery.error( callbackName + " was not called" );
55 - }
56 - return responseContainer[ 0 ];
57 - };
58 -
59 - // Force json dataType
60 - s.dataTypes[ 0 ] = "json";
61 -
62 - // Install callback
63 - overwritten = window[ callbackName ];
64 - window[ callbackName ] = function() {
65 - responseContainer = arguments;
66 - };
67 -
68 - // Clean-up function (fires after converters)
69 - jqXHR.always( function() {
70 -
71 - // If previous value didn't exist - remove it
72 - if ( overwritten === undefined ) {
73 - jQuery( window ).removeProp( callbackName );
74 -
75 - // Otherwise restore preexisting value
76 - } else {
77 - window[ callbackName ] = overwritten;
78 - }
79 -
80 - // Save back as free
81 - if ( s[ callbackName ] ) {
82 -
83 - // Make sure that re-using the options doesn't screw things around
84 - s.jsonpCallback = originalSettings.jsonpCallback;
85 -
86 - // Save the callback name for future use
87 - oldCallbacks.push( callbackName );
88 - }
89 -
90 - // Call if it was a function and we have a response
91 - if ( responseContainer && isFunction( overwritten ) ) {
92 - overwritten( responseContainer[ 0 ] );
93 - }
94 -
95 - responseContainer = overwritten = undefined;
96 - } );
97 -
98 - // Delegate to script
99 - return "script";
100 - }
101 -} );
102 -
103 -} );
1 -define( [
2 - "../core",
3 - "../core/stripAndCollapse",
4 - "../var/isFunction",
5 - "../core/parseHTML",
6 - "../ajax",
7 - "../traversing",
8 - "../manipulation",
9 - "../selector"
10 -], function( jQuery, stripAndCollapse, isFunction ) {
11 -
12 -"use strict";
13 -
14 -/**
15 - * Load a url into a page
16 - */
17 -jQuery.fn.load = function( url, params, callback ) {
18 - var selector, type, response,
19 - self = this,
20 - off = url.indexOf( " " );
21 -
22 - if ( off > -1 ) {
23 - selector = stripAndCollapse( url.slice( off ) );
24 - url = url.slice( 0, off );
25 - }
26 -
27 - // If it's a function
28 - if ( isFunction( params ) ) {
29 -
30 - // We assume that it's the callback
31 - callback = params;
32 - params = undefined;
33 -
34 - // Otherwise, build a param string
35 - } else if ( params && typeof params === "object" ) {
36 - type = "POST";
37 - }
38 -
39 - // If we have elements to modify, make the request
40 - if ( self.length > 0 ) {
41 - jQuery.ajax( {
42 - url: url,
43 -
44 - // If "type" variable is undefined, then "GET" method will be used.
45 - // Make value of this field explicit since
46 - // user can override it through ajaxSetup method
47 - type: type || "GET",
48 - dataType: "html",
49 - data: params
50 - } ).done( function( responseText ) {
51 -
52 - // Save response for use in complete callback
53 - response = arguments;
54 -
55 - self.html( selector ?
56 -
57 - // If a selector was specified, locate the right elements in a dummy div
58 - // Exclude scripts to avoid IE 'Permission Denied' errors
59 - jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
60 -
61 - // Otherwise use the full result
62 - responseText );
63 -
64 - // If the request succeeds, this function gets "data", "status", "jqXHR"
65 - // but they are ignored because response was set above.
66 - // If it fails, this function gets "jqXHR", "status", "error"
67 - } ).always( callback && function( jqXHR, status ) {
68 - self.each( function() {
69 - callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
70 - } );
71 - } );
72 - }
73 -
74 - return this;
75 -};
76 -
77 -} );
1 -define( [
2 - "../core",
3 - "../var/document",
4 - "../ajax"
5 -], function( jQuery, document ) {
6 -
7 -"use strict";
8 -
9 -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
10 -jQuery.ajaxPrefilter( function( s ) {
11 - if ( s.crossDomain ) {
12 - s.contents.script = false;
13 - }
14 -} );
15 -
16 -// Install script dataType
17 -jQuery.ajaxSetup( {
18 - accepts: {
19 - script: "text/javascript, application/javascript, " +
20 - "application/ecmascript, application/x-ecmascript"
21 - },
22 - contents: {
23 - script: /\b(?:java|ecma)script\b/
24 - },
25 - converters: {
26 - "text script": function( text ) {
27 - jQuery.globalEval( text );
28 - return text;
29 - }
30 - }
31 -} );
32 -
33 -// Handle cache's special case and crossDomain
34 -jQuery.ajaxPrefilter( "script", function( s ) {
35 - if ( s.cache === undefined ) {
36 - s.cache = false;
37 - }
38 - if ( s.crossDomain ) {
39 - s.type = "GET";
40 - }
41 -} );
42 -
43 -// Bind script tag hack transport
44 -jQuery.ajaxTransport( "script", function( s ) {
45 -
46 - // This transport only deals with cross domain or forced-by-attrs requests
47 - if ( s.crossDomain || s.scriptAttrs ) {
48 - var script, callback;
49 - return {
50 - send: function( _, complete ) {
51 - script = jQuery( "<script>" )
52 - .attr( s.scriptAttrs || {} )
53 - .prop( { charset: s.scriptCharset, src: s.url } )
54 - .on( "load error", callback = function( evt ) {
55 - script.remove();
56 - callback = null;
57 - if ( evt ) {
58 - complete( evt.type === "error" ? 404 : 200, evt.type );
59 - }
60 - } );
61 -
62 - // Use native DOM manipulation to avoid our domManip AJAX trickery
63 - document.head.appendChild( script[ 0 ] );
64 - },
65 - abort: function() {
66 - if ( callback ) {
67 - callback();
68 - }
69 - }
70 - };
71 - }
72 -} );
73 -
74 -} );
1 -define( function() {
2 - "use strict";
3 -
4 - return window.location;
5 -} );
1 -define( function() {
2 - "use strict";
3 -
4 - return { guid: Date.now() };
5 -} );
1 -define( function() {
2 - "use strict";
3 -
4 - return ( /\?/ );
5 -} );
1 -define( [
2 - "../core",
3 - "../var/support",
4 - "../ajax"
5 -], function( jQuery, support ) {
6 -
7 -"use strict";
8 -
9 -jQuery.ajaxSettings.xhr = function() {
10 - try {
11 - return new window.XMLHttpRequest();
12 - } catch ( e ) {}
13 -};
14 -
15 -var xhrSuccessStatus = {
16 -
17 - // File protocol always yields status code 0, assume 200
18 - 0: 200,
19 -
20 - // Support: IE <=9 only
21 - // #1450: sometimes IE returns 1223 when it should be 204
22 - 1223: 204
23 - },
24 - xhrSupported = jQuery.ajaxSettings.xhr();
25 -
26 -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
27 -support.ajax = xhrSupported = !!xhrSupported;
28 -
29 -jQuery.ajaxTransport( function( options ) {
30 - var callback, errorCallback;
31 -
32 - // Cross domain only allowed if supported through XMLHttpRequest
33 - if ( support.cors || xhrSupported && !options.crossDomain ) {
34 - return {
35 - send: function( headers, complete ) {
36 - var i,
37 - xhr = options.xhr();
38 -
39 - xhr.open(
40 - options.type,
41 - options.url,
42 - options.async,
43 - options.username,
44 - options.password
45 - );
46 -
47 - // Apply custom fields if provided
48 - if ( options.xhrFields ) {
49 - for ( i in options.xhrFields ) {
50 - xhr[ i ] = options.xhrFields[ i ];
51 - }
52 - }
53 -
54 - // Override mime type if needed
55 - if ( options.mimeType && xhr.overrideMimeType ) {
56 - xhr.overrideMimeType( options.mimeType );
57 - }
58 -
59 - // X-Requested-With header
60 - // For cross-domain requests, seeing as conditions for a preflight are
61 - // akin to a jigsaw puzzle, we simply never set it to be sure.
62 - // (it can always be set on a per-request basis or even using ajaxSetup)
63 - // For same-domain requests, won't change header if already provided.
64 - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
65 - headers[ "X-Requested-With" ] = "XMLHttpRequest";
66 - }
67 -
68 - // Set headers
69 - for ( i in headers ) {
70 - xhr.setRequestHeader( i, headers[ i ] );
71 - }
72 -
73 - // Callback
74 - callback = function( type ) {
75 - return function() {
76 - if ( callback ) {
77 - callback = errorCallback = xhr.onload =
78 - xhr.onerror = xhr.onabort = xhr.ontimeout =
79 - xhr.onreadystatechange = null;
80 -
81 - if ( type === "abort" ) {
82 - xhr.abort();
83 - } else if ( type === "error" ) {
84 -
85 - // Support: IE <=9 only
86 - // On a manual native abort, IE9 throws
87 - // errors on any property access that is not readyState
88 - if ( typeof xhr.status !== "number" ) {
89 - complete( 0, "error" );
90 - } else {
91 - complete(
92 -
93 - // File: protocol always yields status 0; see #8605, #14207
94 - xhr.status,
95 - xhr.statusText
96 - );
97 - }
98 - } else {
99 - complete(
100 - xhrSuccessStatus[ xhr.status ] || xhr.status,
101 - xhr.statusText,
102 -
103 - // Support: IE <=9 only
104 - // IE9 has no XHR2 but throws on binary (trac-11426)
105 - // For XHR2 non-text, let the caller handle it (gh-2498)
106 - ( xhr.responseType || "text" ) !== "text" ||
107 - typeof xhr.responseText !== "string" ?
108 - { binary: xhr.response } :
109 - { text: xhr.responseText },
110 - xhr.getAllResponseHeaders()
111 - );
112 - }
113 - }
114 - };
115 - };
116 -
117 - // Listen to events
118 - xhr.onload = callback();
119 - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
120 -
121 - // Support: IE 9 only
122 - // Use onreadystatechange to replace onabort
123 - // to handle uncaught aborts
124 - if ( xhr.onabort !== undefined ) {
125 - xhr.onabort = errorCallback;
126 - } else {
127 - xhr.onreadystatechange = function() {
128 -
129 - // Check readyState before timeout as it changes
130 - if ( xhr.readyState === 4 ) {
131 -
132 - // Allow onerror to be called first,
133 - // but that will not handle a native abort
134 - // Also, save errorCallback to a variable
135 - // as xhr.onerror cannot be accessed
136 - window.setTimeout( function() {
137 - if ( callback ) {
138 - errorCallback();
139 - }
140 - } );
141 - }
142 - };
143 - }
144 -
145 - // Create the abort callback
146 - callback = callback( "abort" );
147 -
148 - try {
149 -
150 - // Do send the request (this may raise an exception)
151 - xhr.send( options.hasContent && options.data || null );
152 - } catch ( e ) {
153 -
154 - // #14683: Only rethrow if this hasn't been notified as an error yet
155 - if ( callback ) {
156 - throw e;
157 - }
158 - }
159 - },
160 -
161 - abort: function() {
162 - if ( callback ) {
163 - callback();
164 - }
165 - }
166 - };
167 - }
168 -} );
169 -
170 -} );
1 -define( [
2 - "./core",
3 - "./attributes/attr",
4 - "./attributes/prop",
5 - "./attributes/classes",
6 - "./attributes/val"
7 -], function( jQuery ) {
8 -
9 -"use strict";
10 -
11 -// Return jQuery for attributes-only inclusion
12 -return jQuery;
13 -} );
1 -define( [
2 - "../core",
3 - "../core/access",
4 - "../core/nodeName",
5 - "./support",
6 - "../var/rnothtmlwhite",
7 - "../selector"
8 -], function( jQuery, access, nodeName, support, rnothtmlwhite ) {
9 -
10 -"use strict";
11 -
12 -var boolHook,
13 - attrHandle = jQuery.expr.attrHandle;
14 -
15 -jQuery.fn.extend( {
16 - attr: function( name, value ) {
17 - return access( this, jQuery.attr, name, value, arguments.length > 1 );
18 - },
19 -
20 - removeAttr: function( name ) {
21 - return this.each( function() {
22 - jQuery.removeAttr( this, name );
23 - } );
24 - }
25 -} );
26 -
27 -jQuery.extend( {
28 - attr: function( elem, name, value ) {
29 - var ret, hooks,
30 - nType = elem.nodeType;
31 -
32 - // Don't get/set attributes on text, comment and attribute nodes
33 - if ( nType === 3 || nType === 8 || nType === 2 ) {
34 - return;
35 - }
36 -
37 - // Fallback to prop when attributes are not supported
38 - if ( typeof elem.getAttribute === "undefined" ) {
39 - return jQuery.prop( elem, name, value );
40 - }
41 -
42 - // Attribute hooks are determined by the lowercase version
43 - // Grab necessary hook if one is defined
44 - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
45 - hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
46 - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
47 - }
48 -
49 - if ( value !== undefined ) {
50 - if ( value === null ) {
51 - jQuery.removeAttr( elem, name );
52 - return;
53 - }
54 -
55 - if ( hooks && "set" in hooks &&
56 - ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
57 - return ret;
58 - }
59 -
60 - elem.setAttribute( name, value + "" );
61 - return value;
62 - }
63 -
64 - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
65 - return ret;
66 - }
67 -
68 - ret = jQuery.find.attr( elem, name );
69 -
70 - // Non-existent attributes return null, we normalize to undefined
71 - return ret == null ? undefined : ret;
72 - },
73 -
74 - attrHooks: {
75 - type: {
76 - set: function( elem, value ) {
77 - if ( !support.radioValue && value === "radio" &&
78 - nodeName( elem, "input" ) ) {
79 - var val = elem.value;
80 - elem.setAttribute( "type", value );
81 - if ( val ) {
82 - elem.value = val;
83 - }
84 - return value;
85 - }
86 - }
87 - }
88 - },
89 -
90 - removeAttr: function( elem, value ) {
91 - var name,
92 - i = 0,
93 -
94 - // Attribute names can contain non-HTML whitespace characters
95 - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
96 - attrNames = value && value.match( rnothtmlwhite );
97 -
98 - if ( attrNames && elem.nodeType === 1 ) {
99 - while ( ( name = attrNames[ i++ ] ) ) {
100 - elem.removeAttribute( name );
101 - }
102 - }
103 - }
104 -} );
105 -
106 -// Hooks for boolean attributes
107 -boolHook = {
108 - set: function( elem, value, name ) {
109 - if ( value === false ) {
110 -
111 - // Remove boolean attributes when set to false
112 - jQuery.removeAttr( elem, name );
113 - } else {
114 - elem.setAttribute( name, name );
115 - }
116 - return name;
117 - }
118 -};
119 -
120 -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
121 - var getter = attrHandle[ name ] || jQuery.find.attr;
122 -
123 - attrHandle[ name ] = function( elem, name, isXML ) {
124 - var ret, handle,
125 - lowercaseName = name.toLowerCase();
126 -
127 - if ( !isXML ) {
128 -
129 - // Avoid an infinite loop by temporarily removing this function from the getter
130 - handle = attrHandle[ lowercaseName ];
131 - attrHandle[ lowercaseName ] = ret;
132 - ret = getter( elem, name, isXML ) != null ?
133 - lowercaseName :
134 - null;
135 - attrHandle[ lowercaseName ] = handle;
136 - }
137 - return ret;
138 - };
139 -} );
140 -
141 -} );
1 -define( [
2 - "../core",
3 - "../core/stripAndCollapse",
4 - "../var/isFunction",
5 - "../var/rnothtmlwhite",
6 - "../data/var/dataPriv",
7 - "../core/init"
8 -], function( jQuery, stripAndCollapse, isFunction, rnothtmlwhite, dataPriv ) {
9 -
10 -"use strict";
11 -
12 -function getClass( elem ) {
13 - return elem.getAttribute && elem.getAttribute( "class" ) || "";
14 -}
15 -
16 -function classesToArray( value ) {
17 - if ( Array.isArray( value ) ) {
18 - return value;
19 - }
20 - if ( typeof value === "string" ) {
21 - return value.match( rnothtmlwhite ) || [];
22 - }
23 - return [];
24 -}
25 -
26 -jQuery.fn.extend( {
27 - addClass: function( value ) {
28 - var classes, elem, cur, curValue, clazz, j, finalValue,
29 - i = 0;
30 -
31 - if ( isFunction( value ) ) {
32 - return this.each( function( j ) {
33 - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
34 - } );
35 - }
36 -
37 - classes = classesToArray( value );
38 -
39 - if ( classes.length ) {
40 - while ( ( elem = this[ i++ ] ) ) {
41 - curValue = getClass( elem );
42 - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
43 -
44 - if ( cur ) {
45 - j = 0;
46 - while ( ( clazz = classes[ j++ ] ) ) {
47 - if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
48 - cur += clazz + " ";
49 - }
50 - }
51 -
52 - // Only assign if different to avoid unneeded rendering.
53 - finalValue = stripAndCollapse( cur );
54 - if ( curValue !== finalValue ) {
55 - elem.setAttribute( "class", finalValue );
56 - }
57 - }
58 - }
59 - }
60 -
61 - return this;
62 - },
63 -
64 - removeClass: function( value ) {
65 - var classes, elem, cur, curValue, clazz, j, finalValue,
66 - i = 0;
67 -
68 - if ( isFunction( value ) ) {
69 - return this.each( function( j ) {
70 - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
71 - } );
72 - }
73 -
74 - if ( !arguments.length ) {
75 - return this.attr( "class", "" );
76 - }
77 -
78 - classes = classesToArray( value );
79 -
80 - if ( classes.length ) {
81 - while ( ( elem = this[ i++ ] ) ) {
82 - curValue = getClass( elem );
83 -
84 - // This expression is here for better compressibility (see addClass)
85 - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
86 -
87 - if ( cur ) {
88 - j = 0;
89 - while ( ( clazz = classes[ j++ ] ) ) {
90 -
91 - // Remove *all* instances
92 - while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
93 - cur = cur.replace( " " + clazz + " ", " " );
94 - }
95 - }
96 -
97 - // Only assign if different to avoid unneeded rendering.
98 - finalValue = stripAndCollapse( cur );
99 - if ( curValue !== finalValue ) {
100 - elem.setAttribute( "class", finalValue );
101 - }
102 - }
103 - }
104 - }
105 -
106 - return this;
107 - },
108 -
109 - toggleClass: function( value, stateVal ) {
110 - var type = typeof value,
111 - isValidValue = type === "string" || Array.isArray( value );
112 -
113 - if ( typeof stateVal === "boolean" && isValidValue ) {
114 - return stateVal ? this.addClass( value ) : this.removeClass( value );
115 - }
116 -
117 - if ( isFunction( value ) ) {
118 - return this.each( function( i ) {
119 - jQuery( this ).toggleClass(
120 - value.call( this, i, getClass( this ), stateVal ),
121 - stateVal
122 - );
123 - } );
124 - }
125 -
126 - return this.each( function() {
127 - var className, i, self, classNames;
128 -
129 - if ( isValidValue ) {
130 -
131 - // Toggle individual class names
132 - i = 0;
133 - self = jQuery( this );
134 - classNames = classesToArray( value );
135 -
136 - while ( ( className = classNames[ i++ ] ) ) {
137 -
138 - // Check each className given, space separated list
139 - if ( self.hasClass( className ) ) {
140 - self.removeClass( className );
141 - } else {
142 - self.addClass( className );
143 - }
144 - }
145 -
146 - // Toggle whole class name
147 - } else if ( value === undefined || type === "boolean" ) {
148 - className = getClass( this );
149 - if ( className ) {
150 -
151 - // Store className if set
152 - dataPriv.set( this, "__className__", className );
153 - }
154 -
155 - // If the element has a class name or if we're passed `false`,
156 - // then remove the whole classname (if there was one, the above saved it).
157 - // Otherwise bring back whatever was previously saved (if anything),
158 - // falling back to the empty string if nothing was stored.
159 - if ( this.setAttribute ) {
160 - this.setAttribute( "class",
161 - className || value === false ?
162 - "" :
163 - dataPriv.get( this, "__className__" ) || ""
164 - );
165 - }
166 - }
167 - } );
168 - },
169 -
170 - hasClass: function( selector ) {
171 - var className, elem,
172 - i = 0;
173 -
174 - className = " " + selector + " ";
175 - while ( ( elem = this[ i++ ] ) ) {
176 - if ( elem.nodeType === 1 &&
177 - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
178 - return true;
179 - }
180 - }
181 -
182 - return false;
183 - }
184 -} );
185 -
186 -} );
1 -define( [
2 - "../core",
3 - "../core/access",
4 - "./support",
5 - "../selector"
6 -], function( jQuery, access, support ) {
7 -
8 -"use strict";
9 -
10 -var rfocusable = /^(?:input|select|textarea|button)$/i,
11 - rclickable = /^(?:a|area)$/i;
12 -
13 -jQuery.fn.extend( {
14 - prop: function( name, value ) {
15 - return access( this, jQuery.prop, name, value, arguments.length > 1 );
16 - },
17 -
18 - removeProp: function( name ) {
19 - return this.each( function() {
20 - delete this[ jQuery.propFix[ name ] || name ];
21 - } );
22 - }
23 -} );
24 -
25 -jQuery.extend( {
26 - prop: function( elem, name, value ) {
27 - var ret, hooks,
28 - nType = elem.nodeType;
29 -
30 - // Don't get/set properties on text, comment and attribute nodes
31 - if ( nType === 3 || nType === 8 || nType === 2 ) {
32 - return;
33 - }
34 -
35 - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
36 -
37 - // Fix name and attach hooks
38 - name = jQuery.propFix[ name ] || name;
39 - hooks = jQuery.propHooks[ name ];
40 - }
41 -
42 - if ( value !== undefined ) {
43 - if ( hooks && "set" in hooks &&
44 - ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
45 - return ret;
46 - }
47 -
48 - return ( elem[ name ] = value );
49 - }
50 -
51 - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
52 - return ret;
53 - }
54 -
55 - return elem[ name ];
56 - },
57 -
58 - propHooks: {
59 - tabIndex: {
60 - get: function( elem ) {
61 -
62 - // Support: IE <=9 - 11 only
63 - // elem.tabIndex doesn't always return the
64 - // correct value when it hasn't been explicitly set
65 - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
66 - // Use proper attribute retrieval(#12072)
67 - var tabindex = jQuery.find.attr( elem, "tabindex" );
68 -
69 - if ( tabindex ) {
70 - return parseInt( tabindex, 10 );
71 - }
72 -
73 - if (
74 - rfocusable.test( elem.nodeName ) ||
75 - rclickable.test( elem.nodeName ) &&
76 - elem.href
77 - ) {
78 - return 0;
79 - }
80 -
81 - return -1;
82 - }
83 - }
84 - },
85 -
86 - propFix: {
87 - "for": "htmlFor",
88 - "class": "className"
89 - }
90 -} );
91 -
92 -// Support: IE <=11 only
93 -// Accessing the selectedIndex property
94 -// forces the browser to respect setting selected
95 -// on the option
96 -// The getter ensures a default option is selected
97 -// when in an optgroup
98 -// eslint rule "no-unused-expressions" is disabled for this code
99 -// since it considers such accessions noop
100 -if ( !support.optSelected ) {
101 - jQuery.propHooks.selected = {
102 - get: function( elem ) {
103 -
104 - /* eslint no-unused-expressions: "off" */
105 -
106 - var parent = elem.parentNode;
107 - if ( parent && parent.parentNode ) {
108 - parent.parentNode.selectedIndex;
109 - }
110 - return null;
111 - },
112 - set: function( elem ) {
113 -
114 - /* eslint no-unused-expressions: "off" */
115 -
116 - var parent = elem.parentNode;
117 - if ( parent ) {
118 - parent.selectedIndex;
119 -
120 - if ( parent.parentNode ) {
121 - parent.parentNode.selectedIndex;
122 - }
123 - }
124 - }
125 - };
126 -}
127 -
128 -jQuery.each( [
129 - "tabIndex",
130 - "readOnly",
131 - "maxLength",
132 - "cellSpacing",
133 - "cellPadding",
134 - "rowSpan",
135 - "colSpan",
136 - "useMap",
137 - "frameBorder",
138 - "contentEditable"
139 -], function() {
140 - jQuery.propFix[ this.toLowerCase() ] = this;
141 -} );
142 -
143 -} );
1 -define( [
2 - "../var/document",
3 - "../var/support"
4 -], function( document, support ) {
5 -
6 -"use strict";
7 -
8 -( function() {
9 - var input = document.createElement( "input" ),
10 - select = document.createElement( "select" ),
11 - opt = select.appendChild( document.createElement( "option" ) );
12 -
13 - input.type = "checkbox";
14 -
15 - // Support: Android <=4.3 only
16 - // Default value for a checkbox should be "on"
17 - support.checkOn = input.value !== "";
18 -
19 - // Support: IE <=11 only
20 - // Must access selectedIndex to make default options select
21 - support.optSelected = opt.selected;
22 -
23 - // Support: IE <=11 only
24 - // An input loses its value after becoming a radio
25 - input = document.createElement( "input" );
26 - input.value = "t";
27 - input.type = "radio";
28 - support.radioValue = input.value === "t";
29 -} )();
30 -
31 -return support;
32 -
33 -} );
1 -define( [
2 - "../core",
3 - "../core/stripAndCollapse",
4 - "./support",
5 - "../core/nodeName",
6 - "../var/isFunction",
7 -
8 - "../core/init"
9 -], function( jQuery, stripAndCollapse, support, nodeName, isFunction ) {
10 -
11 -"use strict";
12 -
13 -var rreturn = /\r/g;
14 -
15 -jQuery.fn.extend( {
16 - val: function( value ) {
17 - var hooks, ret, valueIsFunction,
18 - elem = this[ 0 ];
19 -
20 - if ( !arguments.length ) {
21 - if ( elem ) {
22 - hooks = jQuery.valHooks[ elem.type ] ||
23 - jQuery.valHooks[ elem.nodeName.toLowerCase() ];
24 -
25 - if ( hooks &&
26 - "get" in hooks &&
27 - ( ret = hooks.get( elem, "value" ) ) !== undefined
28 - ) {
29 - return ret;
30 - }
31 -
32 - ret = elem.value;
33 -
34 - // Handle most common string cases
35 - if ( typeof ret === "string" ) {
36 - return ret.replace( rreturn, "" );
37 - }
38 -
39 - // Handle cases where value is null/undef or number
40 - return ret == null ? "" : ret;
41 - }
42 -
43 - return;
44 - }
45 -
46 - valueIsFunction = isFunction( value );
47 -
48 - return this.each( function( i ) {
49 - var val;
50 -
51 - if ( this.nodeType !== 1 ) {
52 - return;
53 - }
54 -
55 - if ( valueIsFunction ) {
56 - val = value.call( this, i, jQuery( this ).val() );
57 - } else {
58 - val = value;
59 - }
60 -
61 - // Treat null/undefined as ""; convert numbers to string
62 - if ( val == null ) {
63 - val = "";
64 -
65 - } else if ( typeof val === "number" ) {
66 - val += "";
67 -
68 - } else if ( Array.isArray( val ) ) {
69 - val = jQuery.map( val, function( value ) {
70 - return value == null ? "" : value + "";
71 - } );
72 - }
73 -
74 - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
75 -
76 - // If set returns undefined, fall back to normal setting
77 - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
78 - this.value = val;
79 - }
80 - } );
81 - }
82 -} );
83 -
84 -jQuery.extend( {
85 - valHooks: {
86 - option: {
87 - get: function( elem ) {
88 -
89 - var val = jQuery.find.attr( elem, "value" );
90 - return val != null ?
91 - val :
92 -
93 - // Support: IE <=10 - 11 only
94 - // option.text throws exceptions (#14686, #14858)
95 - // Strip and collapse whitespace
96 - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
97 - stripAndCollapse( jQuery.text( elem ) );
98 - }
99 - },
100 - select: {
101 - get: function( elem ) {
102 - var value, option, i,
103 - options = elem.options,
104 - index = elem.selectedIndex,
105 - one = elem.type === "select-one",
106 - values = one ? null : [],
107 - max = one ? index + 1 : options.length;
108 -
109 - if ( index < 0 ) {
110 - i = max;
111 -
112 - } else {
113 - i = one ? index : 0;
114 - }
115 -
116 - // Loop through all the selected options
117 - for ( ; i < max; i++ ) {
118 - option = options[ i ];
119 -
120 - // Support: IE <=9 only
121 - // IE8-9 doesn't update selected after form reset (#2551)
122 - if ( ( option.selected || i === index ) &&
123 -
124 - // Don't return options that are disabled or in a disabled optgroup
125 - !option.disabled &&
126 - ( !option.parentNode.disabled ||
127 - !nodeName( option.parentNode, "optgroup" ) ) ) {
128 -
129 - // Get the specific value for the option
130 - value = jQuery( option ).val();
131 -
132 - // We don't need an array for one selects
133 - if ( one ) {
134 - return value;
135 - }
136 -
137 - // Multi-Selects return an array
138 - values.push( value );
139 - }
140 - }
141 -
142 - return values;
143 - },
144 -
145 - set: function( elem, value ) {
146 - var optionSet, option,
147 - options = elem.options,
148 - values = jQuery.makeArray( value ),
149 - i = options.length;
150 -
151 - while ( i-- ) {
152 - option = options[ i ];
153 -
154 - /* eslint-disable no-cond-assign */
155 -
156 - if ( option.selected =
157 - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
158 - ) {
159 - optionSet = true;
160 - }
161 -
162 - /* eslint-enable no-cond-assign */
163 - }
164 -
165 - // Force browsers to behave consistently when non-matching value is set
166 - if ( !optionSet ) {
167 - elem.selectedIndex = -1;
168 - }
169 - return values;
170 - }
171 - }
172 - }
173 -} );
174 -
175 -// Radios and checkboxes getter/setter
176 -jQuery.each( [ "radio", "checkbox" ], function() {
177 - jQuery.valHooks[ this ] = {
178 - set: function( elem, value ) {
179 - if ( Array.isArray( value ) ) {
180 - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
181 - }
182 - }
183 - };
184 - if ( !support.checkOn ) {
185 - jQuery.valHooks[ this ].get = function( elem ) {
186 - return elem.getAttribute( "value" ) === null ? "on" : elem.value;
187 - };
188 - }
189 -} );
190 -
191 -} );
1 -define( [
2 - "./core",
3 - "./core/toType",
4 - "./var/isFunction",
5 - "./var/rnothtmlwhite"
6 -], function( jQuery, toType, isFunction, rnothtmlwhite ) {
7 -
8 -"use strict";
9 -
10 -// Convert String-formatted options into Object-formatted ones
11 -function createOptions( options ) {
12 - var object = {};
13 - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
14 - object[ flag ] = true;
15 - } );
16 - return object;
17 -}
18 -
19 -/*
20 - * Create a callback list using the following parameters:
21 - *
22 - * options: an optional list of space-separated options that will change how
23 - * the callback list behaves or a more traditional option object
24 - *
25 - * By default a callback list will act like an event callback list and can be
26 - * "fired" multiple times.
27 - *
28 - * Possible options:
29 - *
30 - * once: will ensure the callback list can only be fired once (like a Deferred)
31 - *
32 - * memory: will keep track of previous values and will call any callback added
33 - * after the list has been fired right away with the latest "memorized"
34 - * values (like a Deferred)
35 - *
36 - * unique: will ensure a callback can only be added once (no duplicate in the list)
37 - *
38 - * stopOnFalse: interrupt callings when a callback returns false
39 - *
40 - */
41 -jQuery.Callbacks = function( options ) {
42 -
43 - // Convert options from String-formatted to Object-formatted if needed
44 - // (we check in cache first)
45 - options = typeof options === "string" ?
46 - createOptions( options ) :
47 - jQuery.extend( {}, options );
48 -
49 - var // Flag to know if list is currently firing
50 - firing,
51 -
52 - // Last fire value for non-forgettable lists
53 - memory,
54 -
55 - // Flag to know if list was already fired
56 - fired,
57 -
58 - // Flag to prevent firing
59 - locked,
60 -
61 - // Actual callback list
62 - list = [],
63 -
64 - // Queue of execution data for repeatable lists
65 - queue = [],
66 -
67 - // Index of currently firing callback (modified by add/remove as needed)
68 - firingIndex = -1,
69 -
70 - // Fire callbacks
71 - fire = function() {
72 -
73 - // Enforce single-firing
74 - locked = locked || options.once;
75 -
76 - // Execute callbacks for all pending executions,
77 - // respecting firingIndex overrides and runtime changes
78 - fired = firing = true;
79 - for ( ; queue.length; firingIndex = -1 ) {
80 - memory = queue.shift();
81 - while ( ++firingIndex < list.length ) {
82 -
83 - // Run callback and check for early termination
84 - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
85 - options.stopOnFalse ) {
86 -
87 - // Jump to end and forget the data so .add doesn't re-fire
88 - firingIndex = list.length;
89 - memory = false;
90 - }
91 - }
92 - }
93 -
94 - // Forget the data if we're done with it
95 - if ( !options.memory ) {
96 - memory = false;
97 - }
98 -
99 - firing = false;
100 -
101 - // Clean up if we're done firing for good
102 - if ( locked ) {
103 -
104 - // Keep an empty list if we have data for future add calls
105 - if ( memory ) {
106 - list = [];
107 -
108 - // Otherwise, this object is spent
109 - } else {
110 - list = "";
111 - }
112 - }
113 - },
114 -
115 - // Actual Callbacks object
116 - self = {
117 -
118 - // Add a callback or a collection of callbacks to the list
119 - add: function() {
120 - if ( list ) {
121 -
122 - // If we have memory from a past run, we should fire after adding
123 - if ( memory && !firing ) {
124 - firingIndex = list.length - 1;
125 - queue.push( memory );
126 - }
127 -
128 - ( function add( args ) {
129 - jQuery.each( args, function( _, arg ) {
130 - if ( isFunction( arg ) ) {
131 - if ( !options.unique || !self.has( arg ) ) {
132 - list.push( arg );
133 - }
134 - } else if ( arg && arg.length && toType( arg ) !== "string" ) {
135 -
136 - // Inspect recursively
137 - add( arg );
138 - }
139 - } );
140 - } )( arguments );
141 -
142 - if ( memory && !firing ) {
143 - fire();
144 - }
145 - }
146 - return this;
147 - },
148 -
149 - // Remove a callback from the list
150 - remove: function() {
151 - jQuery.each( arguments, function( _, arg ) {
152 - var index;
153 - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
154 - list.splice( index, 1 );
155 -
156 - // Handle firing indexes
157 - if ( index <= firingIndex ) {
158 - firingIndex--;
159 - }
160 - }
161 - } );
162 - return this;
163 - },
164 -
165 - // Check if a given callback is in the list.
166 - // If no argument is given, return whether or not list has callbacks attached.
167 - has: function( fn ) {
168 - return fn ?
169 - jQuery.inArray( fn, list ) > -1 :
170 - list.length > 0;
171 - },
172 -
173 - // Remove all callbacks from the list
174 - empty: function() {
175 - if ( list ) {
176 - list = [];
177 - }
178 - return this;
179 - },
180 -
181 - // Disable .fire and .add
182 - // Abort any current/pending executions
183 - // Clear all callbacks and values
184 - disable: function() {
185 - locked = queue = [];
186 - list = memory = "";
187 - return this;
188 - },
189 - disabled: function() {
190 - return !list;
191 - },
192 -
193 - // Disable .fire
194 - // Also disable .add unless we have memory (since it would have no effect)
195 - // Abort any pending executions
196 - lock: function() {
197 - locked = queue = [];
198 - if ( !memory && !firing ) {
199 - list = memory = "";
200 - }
201 - return this;
202 - },
203 - locked: function() {
204 - return !!locked;
205 - },
206 -
207 - // Call all callbacks with the given context and arguments
208 - fireWith: function( context, args ) {
209 - if ( !locked ) {
210 - args = args || [];
211 - args = [ context, args.slice ? args.slice() : args ];
212 - queue.push( args );
213 - if ( !firing ) {
214 - fire();
215 - }
216 - }
217 - return this;
218 - },
219 -
220 - // Call all the callbacks with the given arguments
221 - fire: function() {
222 - self.fireWith( this, arguments );
223 - return this;
224 - },
225 -
226 - // To know if the callbacks have already been called at least once
227 - fired: function() {
228 - return !!fired;
229 - }
230 - };
231 -
232 - return self;
233 -};
234 -
235 -return jQuery;
236 -} );
1 -/* global Symbol */
2 -// Defining this global in .eslintrc.json would create a danger of using the global
3 -// unguarded in another place, it seems safer to define global only for this module
4 -
5 -define( [
6 - "./var/arr",
7 - "./var/getProto",
8 - "./var/slice",
9 - "./var/flat",
10 - "./var/push",
11 - "./var/indexOf",
12 - "./var/class2type",
13 - "./var/toString",
14 - "./var/hasOwn",
15 - "./var/fnToString",
16 - "./var/ObjectFunctionString",
17 - "./var/support",
18 - "./var/isFunction",
19 - "./var/isWindow",
20 - "./core/DOMEval",
21 - "./core/toType"
22 -], function( arr, getProto, slice, flat, push, indexOf,
23 - class2type, toString, hasOwn, fnToString, ObjectFunctionString,
24 - support, isFunction, isWindow, DOMEval, toType ) {
25 -
26 -"use strict";
27 -
28 -var
29 - version = "3.5.1",
30 -
31 - // Define a local copy of jQuery
32 - jQuery = function( selector, context ) {
33 -
34 - // The jQuery object is actually just the init constructor 'enhanced'
35 - // Need init if jQuery is called (just allow error to be thrown if not included)
36 - return new jQuery.fn.init( selector, context );
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 - // The default length of a jQuery object is 0
47 - length: 0,
48 -
49 - toArray: function() {
50 - return slice.call( this );
51 - },
52 -
53 - // Get the Nth element in the matched element set OR
54 - // Get the whole matched element set as a clean array
55 - get: function( num ) {
56 -
57 - // Return all the elements in a clean array
58 - if ( num == null ) {
59 - return slice.call( this );
60 - }
61 -
62 - // Return just the one element from the set
63 - return num < 0 ? this[ num + this.length ] : this[ num ];
64 - },
65 -
66 - // Take an array of elements and push it onto the stack
67 - // (returning the new matched element set)
68 - pushStack: function( elems ) {
69 -
70 - // Build a new jQuery matched element set
71 - var ret = jQuery.merge( this.constructor(), elems );
72 -
73 - // Add the old object onto the stack (as a reference)
74 - ret.prevObject = this;
75 -
76 - // Return the newly-formed element set
77 - return ret;
78 - },
79 -
80 - // Execute a callback for every element in the matched set.
81 - each: function( callback ) {
82 - return jQuery.each( this, callback );
83 - },
84 -
85 - map: function( callback ) {
86 - return this.pushStack( jQuery.map( this, function( elem, i ) {
87 - return callback.call( elem, i, elem );
88 - } ) );
89 - },
90 -
91 - slice: function() {
92 - return this.pushStack( slice.apply( this, arguments ) );
93 - },
94 -
95 - first: function() {
96 - return this.eq( 0 );
97 - },
98 -
99 - last: function() {
100 - return this.eq( -1 );
101 - },
102 -
103 - even: function() {
104 - return this.pushStack( jQuery.grep( this, function( _elem, i ) {
105 - return ( i + 1 ) % 2;
106 - } ) );
107 - },
108 -
109 - odd: function() {
110 - return this.pushStack( jQuery.grep( this, function( _elem, i ) {
111 - return i % 2;
112 - } ) );
113 - },
114 -
115 - eq: function( i ) {
116 - var len = this.length,
117 - j = +i + ( i < 0 ? len : 0 );
118 - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
119 - },
120 -
121 - end: function() {
122 - return this.prevObject || this.constructor();
123 - },
124 -
125 - // For internal use only.
126 - // Behaves like an Array's method, not like a jQuery method.
127 - push: push,
128 - sort: arr.sort,
129 - splice: arr.splice
130 -};
131 -
132 -jQuery.extend = jQuery.fn.extend = function() {
133 - var options, name, src, copy, copyIsArray, clone,
134 - target = arguments[ 0 ] || {},
135 - i = 1,
136 - length = arguments.length,
137 - deep = false;
138 -
139 - // Handle a deep copy situation
140 - if ( typeof target === "boolean" ) {
141 - deep = target;
142 -
143 - // Skip the boolean and the target
144 - target = arguments[ i ] || {};
145 - i++;
146 - }
147 -
148 - // Handle case when target is a string or something (possible in deep copy)
149 - if ( typeof target !== "object" && !isFunction( target ) ) {
150 - target = {};
151 - }
152 -
153 - // Extend jQuery itself if only one argument is passed
154 - if ( i === length ) {
155 - target = this;
156 - i--;
157 - }
158 -
159 - for ( ; i < length; i++ ) {
160 -
161 - // Only deal with non-null/undefined values
162 - if ( ( options = arguments[ i ] ) != null ) {
163 -
164 - // Extend the base object
165 - for ( name in options ) {
166 - copy = options[ name ];
167 -
168 - // Prevent Object.prototype pollution
169 - // Prevent never-ending loop
170 - if ( name === "__proto__" || target === copy ) {
171 - continue;
172 - }
173 -
174 - // Recurse if we're merging plain objects or arrays
175 - if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
176 - ( copyIsArray = Array.isArray( copy ) ) ) ) {
177 - src = target[ name ];
178 -
179 - // Ensure proper type for the source value
180 - if ( copyIsArray && !Array.isArray( src ) ) {
181 - clone = [];
182 - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
183 - clone = {};
184 - } else {
185 - clone = src;
186 - }
187 - copyIsArray = false;
188 -
189 - // Never move original objects, clone them
190 - target[ name ] = jQuery.extend( deep, clone, copy );
191 -
192 - // Don't bring in undefined values
193 - } else if ( copy !== undefined ) {
194 - target[ name ] = copy;
195 - }
196 - }
197 - }
198 - }
199 -
200 - // Return the modified object
201 - return target;
202 -};
203 -
204 -jQuery.extend( {
205 -
206 - // Unique for each copy of jQuery on the page
207 - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
208 -
209 - // Assume jQuery is ready without the ready module
210 - isReady: true,
211 -
212 - error: function( msg ) {
213 - throw new Error( msg );
214 - },
215 -
216 - noop: function() {},
217 -
218 - isPlainObject: function( obj ) {
219 - var proto, Ctor;
220 -
221 - // Detect obvious negatives
222 - // Use toString instead of jQuery.type to catch host objects
223 - if ( !obj || toString.call( obj ) !== "[object Object]" ) {
224 - return false;
225 - }
226 -
227 - proto = getProto( obj );
228 -
229 - // Objects with no prototype (e.g., `Object.create( null )`) are plain
230 - if ( !proto ) {
231 - return true;
232 - }
233 -
234 - // Objects with prototype are plain iff they were constructed by a global Object function
235 - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
236 - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
237 - },
238 -
239 - isEmptyObject: function( obj ) {
240 - var name;
241 -
242 - for ( name in obj ) {
243 - return false;
244 - }
245 - return true;
246 - },
247 -
248 - // Evaluates a script in a provided context; falls back to the global one
249 - // if not specified.
250 - globalEval: function( code, options, doc ) {
251 - DOMEval( code, { nonce: options && options.nonce }, doc );
252 - },
253 -
254 - each: function( obj, callback ) {
255 - var length, i = 0;
256 -
257 - if ( isArrayLike( obj ) ) {
258 - length = obj.length;
259 - for ( ; i < length; i++ ) {
260 - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
261 - break;
262 - }
263 - }
264 - } else {
265 - for ( i in obj ) {
266 - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
267 - break;
268 - }
269 - }
270 - }
271 -
272 - return obj;
273 - },
274 -
275 - // results is for internal usage only
276 - makeArray: function( arr, results ) {
277 - var ret = results || [];
278 -
279 - if ( arr != null ) {
280 - if ( isArrayLike( Object( arr ) ) ) {
281 - jQuery.merge( ret,
282 - typeof arr === "string" ?
283 - [ arr ] : arr
284 - );
285 - } else {
286 - push.call( ret, arr );
287 - }
288 - }
289 -
290 - return ret;
291 - },
292 -
293 - inArray: function( elem, arr, i ) {
294 - return arr == null ? -1 : indexOf.call( arr, elem, i );
295 - },
296 -
297 - // Support: Android <=4.0 only, PhantomJS 1 only
298 - // push.apply(_, arraylike) throws on ancient WebKit
299 - merge: function( first, second ) {
300 - var len = +second.length,
301 - j = 0,
302 - i = first.length;
303 -
304 - for ( ; j < len; j++ ) {
305 - first[ i++ ] = second[ j ];
306 - }
307 -
308 - first.length = i;
309 -
310 - return first;
311 - },
312 -
313 - grep: function( elems, callback, invert ) {
314 - var callbackInverse,
315 - matches = [],
316 - i = 0,
317 - length = elems.length,
318 - callbackExpect = !invert;
319 -
320 - // Go through the array, only saving the items
321 - // that pass the validator function
322 - for ( ; i < length; i++ ) {
323 - callbackInverse = !callback( elems[ i ], i );
324 - if ( callbackInverse !== callbackExpect ) {
325 - matches.push( elems[ i ] );
326 - }
327 - }
328 -
329 - return matches;
330 - },
331 -
332 - // arg is for internal usage only
333 - map: function( elems, callback, arg ) {
334 - var length, value,
335 - i = 0,
336 - ret = [];
337 -
338 - // Go through the array, translating each of the items to their new values
339 - if ( isArrayLike( elems ) ) {
340 - length = elems.length;
341 - for ( ; i < length; i++ ) {
342 - value = callback( elems[ i ], i, arg );
343 -
344 - if ( value != null ) {
345 - ret.push( value );
346 - }
347 - }
348 -
349 - // Go through every key on the object,
350 - } else {
351 - for ( i in elems ) {
352 - value = callback( elems[ i ], i, arg );
353 -
354 - if ( value != null ) {
355 - ret.push( value );
356 - }
357 - }
358 - }
359 -
360 - // Flatten any nested arrays
361 - return flat( ret );
362 - },
363 -
364 - // A global GUID counter for objects
365 - guid: 1,
366 -
367 - // jQuery.support is not used in Core but other projects attach their
368 - // properties to it so it needs to exist.
369 - support: support
370 -} );
371 -
372 -if ( typeof Symbol === "function" ) {
373 - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
374 -}
375 -
376 -// Populate the class2type map
377 -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
378 -function( _i, name ) {
379 - class2type[ "[object " + name + "]" ] = name.toLowerCase();
380 -} );
381 -
382 -function isArrayLike( obj ) {
383 -
384 - // Support: real iOS 8.2 only (not reproducible in simulator)
385 - // `in` check used to prevent JIT error (gh-2145)
386 - // hasOwn isn't used here due to false negatives
387 - // regarding Nodelist length in IE
388 - var length = !!obj && "length" in obj && obj.length,
389 - type = toType( obj );
390 -
391 - if ( isFunction( obj ) || isWindow( obj ) ) {
392 - return false;
393 - }
394 -
395 - return type === "array" || length === 0 ||
396 - typeof length === "number" && length > 0 && ( length - 1 ) in obj;
397 -}
398 -
399 -return jQuery;
400 -} );
1 -define( [
2 - "../var/document"
3 -], function( document ) {
4 - "use strict";
5 -
6 - var preservedScriptAttributes = {
7 - type: true,
8 - src: true,
9 - nonce: true,
10 - noModule: true
11 - };
12 -
13 - function DOMEval( code, node, doc ) {
14 - doc = doc || document;
15 -
16 - var i, val,
17 - script = doc.createElement( "script" );
18 -
19 - script.text = code;
20 - if ( node ) {
21 - for ( i in preservedScriptAttributes ) {
22 -
23 - // Support: Firefox 64+, Edge 18+
24 - // Some browsers don't support the "nonce" property on scripts.
25 - // On the other hand, just using `getAttribute` is not enough as
26 - // the `nonce` attribute is reset to an empty string whenever it
27 - // becomes browsing-context connected.
28 - // See https://github.com/whatwg/html/issues/2369
29 - // See https://html.spec.whatwg.org/#nonce-attributes
30 - // The `node.getAttribute` check was added for the sake of
31 - // `jQuery.globalEval` so that it can fake a nonce-containing node
32 - // via an object.
33 - val = node[ i ] || node.getAttribute && node.getAttribute( i );
34 - if ( val ) {
35 - script.setAttribute( i, val );
36 - }
37 - }
38 - }
39 - doc.head.appendChild( script ).parentNode.removeChild( script );
40 - }
41 -
42 - return DOMEval;
43 -} );
1 -define( [
2 - "../core",
3 - "../core/toType",
4 - "../var/isFunction"
5 -], function( jQuery, toType, isFunction ) {
6 -
7 -"use strict";
8 -
9 -// Multifunctional method to get and set values of a collection
10 -// The value/s can optionally be executed if it's a function
11 -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
12 - var i = 0,
13 - len = elems.length,
14 - bulk = key == null;
15 -
16 - // Sets many values
17 - if ( toType( key ) === "object" ) {
18 - chainable = true;
19 - for ( i in key ) {
20 - access( elems, fn, i, key[ i ], true, emptyGet, raw );
21 - }
22 -
23 - // Sets one value
24 - } else if ( value !== undefined ) {
25 - chainable = true;
26 -
27 - if ( !isFunction( value ) ) {
28 - raw = true;
29 - }
30 -
31 - if ( bulk ) {
32 -
33 - // Bulk operations run against the entire set
34 - if ( raw ) {
35 - fn.call( elems, value );
36 - fn = null;
37 -
38 - // ...except when executing function values
39 - } else {
40 - bulk = fn;
41 - fn = function( elem, _key, value ) {
42 - return bulk.call( jQuery( elem ), value );
43 - };
44 - }
45 - }
46 -
47 - if ( fn ) {
48 - for ( ; i < len; i++ ) {
49 - fn(
50 - elems[ i ], key, raw ?
51 - value :
52 - value.call( elems[ i ], i, fn( elems[ i ], key ) )
53 - );
54 - }
55 - }
56 - }
57 -
58 - if ( chainable ) {
59 - return elems;
60 - }
61 -
62 - // Gets
63 - if ( bulk ) {
64 - return fn.call( elems );
65 - }
66 -
67 - return len ? fn( elems[ 0 ], key ) : emptyGet;
68 -};
69 -
70 -return access;
71 -
72 -} );
1 -define( [], function() {
2 -
3 -"use strict";
4 -
5 -// Matches dashed string for camelizing
6 -var rmsPrefix = /^-ms-/,
7 - rdashAlpha = /-([a-z])/g;
8 -
9 -// Used by camelCase as callback to replace()
10 -function fcamelCase( _all, letter ) {
11 - return letter.toUpperCase();
12 -}
13 -
14 -// Convert dashed to camelCase; used by the css and data modules
15 -// Support: IE <=9 - 11, Edge 12 - 15
16 -// Microsoft forgot to hump their vendor prefix (#9572)
17 -function camelCase( string ) {
18 - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
19 -}
20 -
21 -return camelCase;
22 -
23 -} );
1 -// Initialize a jQuery object
2 -define( [
3 - "../core",
4 - "../var/document",
5 - "../var/isFunction",
6 - "./var/rsingleTag",
7 -
8 - "../traversing/findFilter"
9 -], function( jQuery, document, isFunction, rsingleTag ) {
10 -
11 -"use strict";
12 -
13 -// A central reference to the root jQuery(document)
14 -var rootjQuery,
15 -
16 - // A simple way to check for HTML strings
17 - // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
18 - // Strict HTML recognition (#11290: must start with <)
19 - // Shortcut simple #id case for speed
20 - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
21 -
22 - init = jQuery.fn.init = function( selector, context, root ) {
23 - var match, elem;
24 -
25 - // HANDLE: $(""), $(null), $(undefined), $(false)
26 - if ( !selector ) {
27 - return this;
28 - }
29 -
30 - // Method init() accepts an alternate rootjQuery
31 - // so migrate can support jQuery.sub (gh-2101)
32 - root = root || rootjQuery;
33 -
34 - // Handle HTML strings
35 - if ( typeof selector === "string" ) {
36 - if ( selector[ 0 ] === "<" &&
37 - selector[ selector.length - 1 ] === ">" &&
38 - selector.length >= 3 ) {
39 -
40 - // Assume that strings that start and end with <> are HTML and skip the regex check
41 - match = [ null, selector, null ];
42 -
43 - } else {
44 - match = rquickExpr.exec( selector );
45 - }
46 -
47 - // Match html or make sure no context is specified for #id
48 - if ( match && ( match[ 1 ] || !context ) ) {
49 -
50 - // HANDLE: $(html) -> $(array)
51 - if ( match[ 1 ] ) {
52 - context = context instanceof jQuery ? context[ 0 ] : context;
53 -
54 - // Option to run scripts is true for back-compat
55 - // Intentionally let the error be thrown if parseHTML is not present
56 - jQuery.merge( this, jQuery.parseHTML(
57 - match[ 1 ],
58 - context && context.nodeType ? context.ownerDocument || context : document,
59 - true
60 - ) );
61 -
62 - // HANDLE: $(html, props)
63 - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
64 - for ( match in context ) {
65 -
66 - // Properties of context are called as methods if possible
67 - if ( isFunction( this[ match ] ) ) {
68 - this[ match ]( context[ match ] );
69 -
70 - // ...and otherwise set as attributes
71 - } else {
72 - this.attr( match, context[ match ] );
73 - }
74 - }
75 - }
76 -
77 - return this;
78 -
79 - // HANDLE: $(#id)
80 - } else {
81 - elem = document.getElementById( match[ 2 ] );
82 -
83 - if ( elem ) {
84 -
85 - // Inject the element directly into the jQuery object
86 - this[ 0 ] = elem;
87 - this.length = 1;
88 - }
89 - return this;
90 - }
91 -
92 - // HANDLE: $(expr, $(...))
93 - } else if ( !context || context.jquery ) {
94 - return ( context || root ).find( selector );
95 -
96 - // HANDLE: $(expr, context)
97 - // (which is just equivalent to: $(context).find(expr)
98 - } else {
99 - return this.constructor( context ).find( selector );
100 - }
101 -
102 - // HANDLE: $(DOMElement)
103 - } else if ( selector.nodeType ) {
104 - this[ 0 ] = selector;
105 - this.length = 1;
106 - return this;
107 -
108 - // HANDLE: $(function)
109 - // Shortcut for document ready
110 - } else if ( isFunction( selector ) ) {
111 - return root.ready !== undefined ?
112 - root.ready( selector ) :
113 -
114 - // Execute immediately if ready is not present
115 - selector( jQuery );
116 - }
117 -
118 - return jQuery.makeArray( selector, this );
119 - };
120 -
121 -// Give the init function the jQuery prototype for later instantiation
122 -init.prototype = jQuery.fn;
123 -
124 -// Initialize central reference
125 -rootjQuery = jQuery( document );
126 -
127 -return init;
128 -
129 -} );
1 -define( [
2 - "../core",
3 - "../var/documentElement",
4 - "../selector" // jQuery.contains
5 -], function( jQuery, documentElement ) {
6 - "use strict";
7 -
8 - var isAttached = function( elem ) {
9 - return jQuery.contains( elem.ownerDocument, elem );
10 - },
11 - composed = { composed: true };
12 -
13 - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
14 - // Check attachment across shadow DOM boundaries when possible (gh-3504)
15 - // Support: iOS 10.0-10.2 only
16 - // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
17 - // leading to errors. We need to check for `getRootNode`.
18 - if ( documentElement.getRootNode ) {
19 - isAttached = function( elem ) {
20 - return jQuery.contains( elem.ownerDocument, elem ) ||
21 - elem.getRootNode( composed ) === elem.ownerDocument;
22 - };
23 - }
24 -
25 - return isAttached;
26 -} );
1 -define( function() {
2 -
3 -"use strict";
4 -
5 -function nodeName( elem, name ) {
6 -
7 - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
8 -
9 -};
10 -
11 -return nodeName;
12 -
13 -} );
1 -define( [
2 - "../core",
3 - "../var/document",
4 - "./var/rsingleTag",
5 - "../manipulation/buildFragment",
6 -
7 - // This is the only module that needs core/support
8 - "./support"
9 -], function( jQuery, document, rsingleTag, buildFragment, support ) {
10 -
11 -"use strict";
12 -
13 -// Argument "data" should be string of html
14 -// context (optional): If specified, the fragment will be created in this context,
15 -// defaults to document
16 -// keepScripts (optional): If true, will include scripts passed in the html string
17 -jQuery.parseHTML = function( data, context, keepScripts ) {
18 - if ( typeof data !== "string" ) {
19 - return [];
20 - }
21 - if ( typeof context === "boolean" ) {
22 - keepScripts = context;
23 - context = false;
24 - }
25 -
26 - var base, parsed, scripts;
27 -
28 - if ( !context ) {
29 -
30 - // Stop scripts or inline event handlers from being executed immediately
31 - // by using document.implementation
32 - if ( support.createHTMLDocument ) {
33 - context = document.implementation.createHTMLDocument( "" );
34 -
35 - // Set the base href for the created document
36 - // so any parsed elements with URLs
37 - // are based on the document's URL (gh-2965)
38 - base = context.createElement( "base" );
39 - base.href = document.location.href;
40 - context.head.appendChild( base );
41 - } else {
42 - context = document;
43 - }
44 - }
45 -
46 - parsed = rsingleTag.exec( data );
47 - scripts = !keepScripts && [];
48 -
49 - // Single tag
50 - if ( parsed ) {
51 - return [ context.createElement( parsed[ 1 ] ) ];
52 - }
53 -
54 - parsed = buildFragment( [ data ], context, scripts );
55 -
56 - if ( scripts && scripts.length ) {
57 - jQuery( scripts ).remove();
58 - }
59 -
60 - return jQuery.merge( [], parsed.childNodes );
61 -};
62 -
63 -return jQuery.parseHTML;
64 -
65 -} );
1 -define( [
2 - "../core"
3 -], function( jQuery ) {
4 -
5 -"use strict";
6 -
7 -// Cross-browser xml parsing
8 -jQuery.parseXML = function( data ) {
9 - var xml;
10 - if ( !data || typeof data !== "string" ) {
11 - return null;
12 - }
13 -
14 - // Support: IE 9 - 11 only
15 - // IE throws on parseFromString with invalid input.
16 - try {
17 - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
18 - } catch ( e ) {
19 - xml = undefined;
20 - }
21 -
22 - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
23 - jQuery.error( "Invalid XML: " + data );
24 - }
25 - return xml;
26 -};
27 -
28 -return jQuery.parseXML;
29 -
30 -} );
1 -define( [
2 - "../core",
3 - "../var/document",
4 - "../var/isFunction"
5 -], function( jQuery, document, isFunction ) {
6 -
7 -"use strict";
8 -
9 -var readyCallbacks = [],
10 - whenReady = function( fn ) {
11 - readyCallbacks.push( fn );
12 - },
13 - executeReady = function( fn ) {
14 -
15 - // Prevent errors from freezing future callback execution (gh-1823)
16 - // Not backwards-compatible as this does not execute sync
17 - window.setTimeout( function() {
18 - fn.call( document, jQuery );
19 - } );
20 - };
21 -
22 -jQuery.fn.ready = function( fn ) {
23 - whenReady( fn );
24 - return this;
25 -};
26 -
27 -jQuery.extend( {
28 -
29 - // Is the DOM ready to be used? Set to true once it occurs.
30 - isReady: false,
31 -
32 - // A counter to track how many items to wait for before
33 - // the ready event fires. See #6781
34 - readyWait: 1,
35 -
36 - ready: function( wait ) {
37 -
38 - // Abort if there are pending holds or we're already ready
39 - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
40 - return;
41 - }
42 -
43 - // Remember that the DOM is ready
44 - jQuery.isReady = true;
45 -
46 - // If a normal DOM Ready event fired, decrement, and wait if need be
47 - if ( wait !== true && --jQuery.readyWait > 0 ) {
48 - return;
49 - }
50 -
51 - whenReady = function( fn ) {
52 - readyCallbacks.push( fn );
53 -
54 - while ( readyCallbacks.length ) {
55 - fn = readyCallbacks.shift();
56 - if ( isFunction( fn ) ) {
57 - executeReady( fn );
58 - }
59 - }
60 - };
61 -
62 - whenReady();
63 - }
64 -} );
65 -
66 -// Make jQuery.ready Promise consumable (gh-1778)
67 -jQuery.ready.then = jQuery.fn.ready;
68 -
69 -/**
70 - * The ready event handler and self cleanup method
71 - */
72 -function completed() {
73 - document.removeEventListener( "DOMContentLoaded", completed );
74 - window.removeEventListener( "load", completed );
75 - jQuery.ready();
76 -}
77 -
78 -// Catch cases where $(document).ready() is called
79 -// after the browser event has already occurred.
80 -// Support: IE9-10 only
81 -// Older IE sometimes signals "interactive" too soon
82 -if ( document.readyState === "complete" ||
83 - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
84 -
85 - // Handle it asynchronously to allow scripts the opportunity to delay ready
86 - window.setTimeout( jQuery.ready );
87 -
88 -} else {
89 -
90 - // Use the handy event callback
91 - document.addEventListener( "DOMContentLoaded", completed );
92 -
93 - // A fallback to window.onload, that will always work
94 - window.addEventListener( "load", completed );
95 -}
96 -
97 -} );
1 -define( [
2 - "../core",
3 - "../var/document",
4 - "../core/readyException",
5 - "../deferred"
6 -], function( jQuery, document ) {
7 -
8 -"use strict";
9 -
10 -// The deferred used on DOM ready
11 -var readyList = jQuery.Deferred();
12 -
13 -jQuery.fn.ready = function( fn ) {
14 -
15 - readyList
16 - .then( fn )
17 -
18 - // Wrap jQuery.readyException in a function so that the lookup
19 - // happens at the time of error handling instead of callback
20 - // registration.
21 - .catch( function( error ) {
22 - jQuery.readyException( error );
23 - } );
24 -
25 - return this;
26 -};
27 -
28 -jQuery.extend( {
29 -
30 - // Is the DOM ready to be used? Set to true once it occurs.
31 - isReady: false,
32 -
33 - // A counter to track how many items to wait for before
34 - // the ready event fires. See #6781
35 - readyWait: 1,
36 -
37 - // Handle when the DOM is ready
38 - ready: function( wait ) {
39 -
40 - // Abort if there are pending holds or we're already ready
41 - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
42 - return;
43 - }
44 -
45 - // Remember that the DOM is ready
46 - jQuery.isReady = true;
47 -
48 - // If a normal DOM Ready event fired, decrement, and wait if need be
49 - if ( wait !== true && --jQuery.readyWait > 0 ) {
50 - return;
51 - }
52 -
53 - // If there are functions bound, to execute
54 - readyList.resolveWith( document, [ jQuery ] );
55 - }
56 -} );
57 -
58 -jQuery.ready.then = readyList.then;
59 -
60 -// The ready event handler and self cleanup method
61 -function completed() {
62 - document.removeEventListener( "DOMContentLoaded", completed );
63 - window.removeEventListener( "load", completed );
64 - jQuery.ready();
65 -}
66 -
67 -// Catch cases where $(document).ready() is called
68 -// after the browser event has already occurred.
69 -// Support: IE <=9 - 10 only
70 -// Older IE sometimes signals "interactive" too soon
71 -if ( document.readyState === "complete" ||
72 - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
73 -
74 - // Handle it asynchronously to allow scripts the opportunity to delay ready
75 - window.setTimeout( jQuery.ready );
76 -
77 -} else {
78 -
79 - // Use the handy event callback
80 - document.addEventListener( "DOMContentLoaded", completed );
81 -
82 - // A fallback to window.onload, that will always work
83 - window.addEventListener( "load", completed );
84 -}
85 -
86 -} );
1 -define( [
2 - "../core"
3 -], function( jQuery ) {
4 -
5 -"use strict";
6 -
7 -jQuery.readyException = function( error ) {
8 - window.setTimeout( function() {
9 - throw error;
10 - } );
11 -};
12 -
13 -} );
1 -define( [
2 - "../var/rnothtmlwhite"
3 -], function( rnothtmlwhite ) {
4 - "use strict";
5 -
6 - // Strip and collapse whitespace according to HTML spec
7 - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
8 - function stripAndCollapse( value ) {
9 - var tokens = value.match( rnothtmlwhite ) || [];
10 - return tokens.join( " " );
11 - }
12 -
13 - return stripAndCollapse;
14 -} );
1 -define( [
2 - "../var/document",
3 - "../var/support"
4 -], function( document, support ) {
5 -
6 -"use strict";
7 -
8 -// Support: Safari 8 only
9 -// In Safari 8 documents created via document.implementation.createHTMLDocument
10 -// collapse sibling forms: the second one becomes a child of the first one.
11 -// Because of that, this security measure has to be disabled in Safari 8.
12 -// https://bugs.webkit.org/show_bug.cgi?id=137337
13 -support.createHTMLDocument = ( function() {
14 - var body = document.implementation.createHTMLDocument( "" ).body;
15 - body.innerHTML = "<form></form><form></form>";
16 - return body.childNodes.length === 2;
17 -} )();
18 -
19 -return support;
20 -} );
1 -define( [
2 - "../var/class2type",
3 - "../var/toString"
4 -], function( class2type, toString ) {
5 -
6 -"use strict";
7 -
8 -function toType( obj ) {
9 - if ( obj == null ) {
10 - return obj + "";
11 - }
12 -
13 - // Support: Android <=2.3 only (functionish RegExp)
14 - return typeof obj === "object" || typeof obj === "function" ?
15 - class2type[ toString.call( obj ) ] || "object" :
16 - typeof obj;
17 -}
18 -
19 -return toType;
20 -} );
1 -define( function() {
2 - "use strict";
3 -
4 - // rsingleTag matches a string consisting of a single HTML element with no attributes
5 - // and captures the element's name
6 - return ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
7 -} );
This diff is collapsed. Click to expand it.
1 -define( function() {
2 -
3 -"use strict";
4 -
5 -function addGetHookIf( conditionFn, hookFn ) {
6 -
7 - // Define the hook, we'll check on the first run if it's really needed.
8 - return {
9 - get: function() {
10 - if ( conditionFn() ) {
11 -
12 - // Hook not needed (or it's not possible to use it due
13 - // to missing dependency), remove it.
14 - delete this.get;
15 - return;
16 - }
17 -
18 - // Hook needed; redefine it so that the support test is not executed again.
19 - return ( this.get = hookFn ).apply( this, arguments );
20 - }
21 - };
22 -}
23 -
24 -return addGetHookIf;
25 -
26 -} );
1 -define( [
2 - "../core",
3 - "../var/rcssNum"
4 -], function( jQuery, rcssNum ) {
5 -
6 -"use strict";
7 -
8 -function adjustCSS( elem, prop, valueParts, tween ) {
9 - var adjusted, scale,
10 - maxIterations = 20,
11 - currentValue = tween ?
12 - function() {
13 - return tween.cur();
14 - } :
15 - function() {
16 - return jQuery.css( elem, prop, "" );
17 - },
18 - initial = currentValue(),
19 - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
20 -
21 - // Starting value computation is required for potential unit mismatches
22 - initialInUnit = elem.nodeType &&
23 - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
24 - rcssNum.exec( jQuery.css( elem, prop ) );
25 -
26 - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
27 -
28 - // Support: Firefox <=54
29 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
30 - initial = initial / 2;
31 -
32 - // Trust units reported by jQuery.css
33 - unit = unit || initialInUnit[ 3 ];
34 -
35 - // Iteratively approximate from a nonzero starting point
36 - initialInUnit = +initial || 1;
37 -
38 - while ( maxIterations-- ) {
39 -
40 - // Evaluate and update our best guess (doubling guesses that zero out).
41 - // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
42 - jQuery.style( elem, prop, initialInUnit + unit );
43 - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
44 - maxIterations = 0;
45 - }
46 - initialInUnit = initialInUnit / scale;
47 -
48 - }
49 -
50 - initialInUnit = initialInUnit * 2;
51 - jQuery.style( elem, prop, initialInUnit + unit );
52 -
53 - // Make sure we update the tween properties later on
54 - valueParts = valueParts || [];
55 - }
56 -
57 - if ( valueParts ) {
58 - initialInUnit = +initialInUnit || +initial || 0;
59 -
60 - // Apply relative offset (+=/-=) if specified
61 - adjusted = valueParts[ 1 ] ?
62 - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
63 - +valueParts[ 2 ];
64 - if ( tween ) {
65 - tween.unit = unit;
66 - tween.start = initialInUnit;
67 - tween.end = adjusted;
68 - }
69 - }
70 - return adjusted;
71 -}
72 -
73 -return adjustCSS;
74 -} );
1 -define( [
2 - "../core",
3 - "../core/isAttached",
4 - "./var/rboxStyle",
5 - "./var/rnumnonpx",
6 - "./var/getStyles",
7 - "./support"
8 -], function( jQuery, isAttached, rboxStyle, rnumnonpx, getStyles, support ) {
9 -
10 -"use strict";
11 -
12 -function curCSS( elem, name, computed ) {
13 - var width, minWidth, maxWidth, ret,
14 -
15 - // Support: Firefox 51+
16 - // Retrieving style before computed somehow
17 - // fixes an issue with getting wrong values
18 - // on detached elements
19 - style = elem.style;
20 -
21 - computed = computed || getStyles( elem );
22 -
23 - // getPropertyValue is needed for:
24 - // .css('filter') (IE 9 only, #12537)
25 - // .css('--customProperty) (#3144)
26 - if ( computed ) {
27 - ret = computed.getPropertyValue( name ) || computed[ name ];
28 -
29 - if ( ret === "" && !isAttached( elem ) ) {
30 - ret = jQuery.style( elem, name );
31 - }
32 -
33 - // A tribute to the "awesome hack by Dean Edwards"
34 - // Android Browser returns percentage for some values,
35 - // but width seems to be reliably pixels.
36 - // This is against the CSSOM draft spec:
37 - // https://drafts.csswg.org/cssom/#resolved-values
38 - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
39 -
40 - // Remember the original values
41 - width = style.width;
42 - minWidth = style.minWidth;
43 - maxWidth = style.maxWidth;
44 -
45 - // Put in the new values to get a computed value out
46 - style.minWidth = style.maxWidth = style.width = ret;
47 - ret = computed.width;
48 -
49 - // Revert the changed values
50 - style.width = width;
51 - style.minWidth = minWidth;
52 - style.maxWidth = maxWidth;
53 - }
54 - }
55 -
56 - return ret !== undefined ?
57 -
58 - // Support: IE <=9 - 11 only
59 - // IE returns zIndex value as an integer.
60 - ret + "" :
61 - ret;
62 -}
63 -
64 -return curCSS;
65 -} );
1 -define( [
2 - "../var/document",
3 - "../core"
4 -], function( document, jQuery ) {
5 -
6 -"use strict";
7 -
8 -var cssPrefixes = [ "Webkit", "Moz", "ms" ],
9 - emptyStyle = document.createElement( "div" ).style,
10 - vendorProps = {};
11 -
12 -// Return a vendor-prefixed property or undefined
13 -function vendorPropName( name ) {
14 -
15 - // Check for vendor prefixed names
16 - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
17 - i = cssPrefixes.length;
18 -
19 - while ( i-- ) {
20 - name = cssPrefixes[ i ] + capName;
21 - if ( name in emptyStyle ) {
22 - return name;
23 - }
24 - }
25 -}
26 -
27 -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
28 -function finalPropName( name ) {
29 - var final = jQuery.cssProps[ name ] || vendorProps[ name ];
30 -
31 - if ( final ) {
32 - return final;
33 - }
34 - if ( name in emptyStyle ) {
35 - return name;
36 - }
37 - return vendorProps[ name ] = vendorPropName( name ) || name;
38 -}
39 -
40 -return finalPropName;
41 -
42 -} );
1 -define( [
2 - "../core",
3 - "../selector"
4 -], function( jQuery ) {
5 -
6 -"use strict";
7 -
8 -jQuery.expr.pseudos.hidden = function( elem ) {
9 - return !jQuery.expr.pseudos.visible( elem );
10 -};
11 -jQuery.expr.pseudos.visible = function( elem ) {
12 - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
13 -};
14 -
15 -} );
1 -define( [
2 - "../core",
3 - "../data/var/dataPriv",
4 - "../css/var/isHiddenWithinTree"
5 -], function( jQuery, dataPriv, isHiddenWithinTree ) {
6 -
7 -"use strict";
8 -
9 -var defaultDisplayMap = {};
10 -
11 -function getDefaultDisplay( elem ) {
12 - var temp,
13 - doc = elem.ownerDocument,
14 - nodeName = elem.nodeName,
15 - display = defaultDisplayMap[ nodeName ];
16 -
17 - if ( display ) {
18 - return display;
19 - }
20 -
21 - temp = doc.body.appendChild( doc.createElement( nodeName ) );
22 - display = jQuery.css( temp, "display" );
23 -
24 - temp.parentNode.removeChild( temp );
25 -
26 - if ( display === "none" ) {
27 - display = "block";
28 - }
29 - defaultDisplayMap[ nodeName ] = display;
30 -
31 - return display;
32 -}
33 -
34 -function showHide( elements, show ) {
35 - var display, elem,
36 - values = [],
37 - index = 0,
38 - length = elements.length;
39 -
40 - // Determine new display value for elements that need to change
41 - for ( ; index < length; index++ ) {
42 - elem = elements[ index ];
43 - if ( !elem.style ) {
44 - continue;
45 - }
46 -
47 - display = elem.style.display;
48 - if ( show ) {
49 -
50 - // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
51 - // check is required in this first loop unless we have a nonempty display value (either
52 - // inline or about-to-be-restored)
53 - if ( display === "none" ) {
54 - values[ index ] = dataPriv.get( elem, "display" ) || null;
55 - if ( !values[ index ] ) {
56 - elem.style.display = "";
57 - }
58 - }
59 - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
60 - values[ index ] = getDefaultDisplay( elem );
61 - }
62 - } else {
63 - if ( display !== "none" ) {
64 - values[ index ] = "none";
65 -
66 - // Remember what we're overwriting
67 - dataPriv.set( elem, "display", display );
68 - }
69 - }
70 - }
71 -
72 - // Set the display of the elements in a second loop to avoid constant reflow
73 - for ( index = 0; index < length; index++ ) {
74 - if ( values[ index ] != null ) {
75 - elements[ index ].style.display = values[ index ];
76 - }
77 - }
78 -
79 - return elements;
80 -}
81 -
82 -jQuery.fn.extend( {
83 - show: function() {
84 - return showHide( this, true );
85 - },
86 - hide: function() {
87 - return showHide( this );
88 - },
89 - toggle: function( state ) {
90 - if ( typeof state === "boolean" ) {
91 - return state ? this.show() : this.hide();
92 - }
93 -
94 - return this.each( function() {
95 - if ( isHiddenWithinTree( this ) ) {
96 - jQuery( this ).show();
97 - } else {
98 - jQuery( this ).hide();
99 - }
100 - } );
101 - }
102 -} );
103 -
104 -return showHide;
105 -} );
1 -define( [
2 - "../core",
3 - "../var/document",
4 - "../var/documentElement",
5 - "../var/support"
6 -], function( jQuery, document, documentElement, support ) {
7 -
8 -"use strict";
9 -
10 -( function() {
11 -
12 - // Executing both pixelPosition & boxSizingReliable tests require only one layout
13 - // so they're executed at the same time to save the second computation.
14 - function computeStyleTests() {
15 -
16 - // This is a singleton, we need to execute it only once
17 - if ( !div ) {
18 - return;
19 - }
20 -
21 - container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
22 - "margin-top:1px;padding:0;border:0";
23 - div.style.cssText =
24 - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
25 - "margin:auto;border:1px;padding:1px;" +
26 - "width:60%;top:1%";
27 - documentElement.appendChild( container ).appendChild( div );
28 -
29 - var divStyle = window.getComputedStyle( div );
30 - pixelPositionVal = divStyle.top !== "1%";
31 -
32 - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
33 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
34 -
35 - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
36 - // Some styles come back with percentage values, even though they shouldn't
37 - div.style.right = "60%";
38 - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
39 -
40 - // Support: IE 9 - 11 only
41 - // Detect misreporting of content dimensions for box-sizing:border-box elements
42 - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
43 -
44 - // Support: IE 9 only
45 - // Detect overflow:scroll screwiness (gh-3699)
46 - // Support: Chrome <=64
47 - // Don't get tricked when zoom affects offsetWidth (gh-4029)
48 - div.style.position = "absolute";
49 - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
50 -
51 - documentElement.removeChild( container );
52 -
53 - // Nullify the div so it wouldn't be stored in the memory and
54 - // it will also be a sign that checks already performed
55 - div = null;
56 - }
57 -
58 - function roundPixelMeasures( measure ) {
59 - return Math.round( parseFloat( measure ) );
60 - }
61 -
62 - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
63 - reliableTrDimensionsVal, reliableMarginLeftVal,
64 - container = document.createElement( "div" ),
65 - div = document.createElement( "div" );
66 -
67 - // Finish early in limited (non-browser) environments
68 - if ( !div.style ) {
69 - return;
70 - }
71 -
72 - // Support: IE <=9 - 11 only
73 - // Style of cloned element affects source element cloned (#8908)
74 - div.style.backgroundClip = "content-box";
75 - div.cloneNode( true ).style.backgroundClip = "";
76 - support.clearCloneStyle = div.style.backgroundClip === "content-box";
77 -
78 - jQuery.extend( support, {
79 - boxSizingReliable: function() {
80 - computeStyleTests();
81 - return boxSizingReliableVal;
82 - },
83 - pixelBoxStyles: function() {
84 - computeStyleTests();
85 - return pixelBoxStylesVal;
86 - },
87 - pixelPosition: function() {
88 - computeStyleTests();
89 - return pixelPositionVal;
90 - },
91 - reliableMarginLeft: function() {
92 - computeStyleTests();
93 - return reliableMarginLeftVal;
94 - },
95 - scrollboxSize: function() {
96 - computeStyleTests();
97 - return scrollboxSizeVal;
98 - },
99 -
100 - // Support: IE 9 - 11+, Edge 15 - 18+
101 - // IE/Edge misreport `getComputedStyle` of table rows with width/height
102 - // set in CSS while `offset*` properties report correct values.
103 - // Behavior in IE 9 is more subtle than in newer versions & it passes
104 - // some versions of this test; make sure not to make it pass there!
105 - reliableTrDimensions: function() {
106 - var table, tr, trChild, trStyle;
107 - if ( reliableTrDimensionsVal == null ) {
108 - table = document.createElement( "table" );
109 - tr = document.createElement( "tr" );
110 - trChild = document.createElement( "div" );
111 -
112 - table.style.cssText = "position:absolute;left:-11111px";
113 - tr.style.height = "1px";
114 - trChild.style.height = "9px";
115 -
116 - documentElement
117 - .appendChild( table )
118 - .appendChild( tr )
119 - .appendChild( trChild );
120 -
121 - trStyle = window.getComputedStyle( tr );
122 - reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
123 -
124 - documentElement.removeChild( table );
125 - }
126 - return reliableTrDimensionsVal;
127 - }
128 - } );
129 -} )();
130 -
131 -return support;
132 -
133 -} );
1 -define( function() {
2 - "use strict";
3 -
4 - return [ "Top", "Right", "Bottom", "Left" ];
5 -} );
1 -define( function() {
2 - "use strict";
3 -
4 - return function( elem ) {
5 -
6 - // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
7 - // IE throws on elements created in popups
8 - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
9 - var view = elem.ownerDocument.defaultView;
10 -
11 - if ( !view || !view.opener ) {
12 - view = window;
13 - }
14 -
15 - return view.getComputedStyle( elem );
16 - };
17 -} );
1 -define( [
2 - "../../core",
3 - "../../core/isAttached"
4 -
5 - // css is assumed
6 -], function( jQuery, isAttached ) {
7 - "use strict";
8 -
9 - // isHiddenWithinTree reports if an element has a non-"none" display style (inline and/or
10 - // through the CSS cascade), which is useful in deciding whether or not to make it visible.
11 - // It differs from the :hidden selector (jQuery.expr.pseudos.hidden) in two important ways:
12 - // * A hidden ancestor does not force an element to be classified as hidden.
13 - // * Being disconnected from the document does not force an element to be classified as hidden.
14 - // These differences improve the behavior of .toggle() et al. when applied to elements that are
15 - // detached or contained within hidden ancestors (gh-2404, gh-2863).
16 - return function( elem, el ) {
17 -
18 - // isHiddenWithinTree might be called from jQuery#filter function;
19 - // in that case, element will be second argument
20 - elem = el || elem;
21 -
22 - // Inline style trumps all
23 - return elem.style.display === "none" ||
24 - elem.style.display === "" &&
25 -
26 - // Otherwise, check computed style
27 - // Support: Firefox <=43 - 45
28 - // Disconnected elements can have computed display: none, so first confirm that elem is
29 - // in the document.
30 - isAttached( elem ) &&
31 -
32 - jQuery.css( elem, "display" ) === "none";
33 - };
34 -} );
1 -define( [
2 - "./cssExpand"
3 -], function( cssExpand ) {
4 - "use strict";
5 -
6 - return new RegExp( cssExpand.join( "|" ), "i" );
7 -} );
1 -define( [
2 - "../../var/pnum"
3 -], function( pnum ) {
4 - "use strict";
5 -
6 - return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
7 -} );
1 -define( function() {
2 -
3 -"use strict";
4 -
5 -// A method for quickly swapping in/out CSS properties to get correct calculations.
6 -return function( elem, options, callback ) {
7 - var ret, name,
8 - old = {};
9 -
10 - // Remember the old values, and insert the new ones
11 - for ( name in options ) {
12 - old[ name ] = elem.style[ name ];
13 - elem.style[ name ] = options[ name ];
14 - }
15 -
16 - ret = callback.call( elem );
17 -
18 - // Revert the old values
19 - for ( name in options ) {
20 - elem.style[ name ] = old[ name ];
21 - }
22 -
23 - return ret;
24 -};
25 -
26 -} );
1 -define( [
2 - "./core",
3 - "./core/access",
4 - "./core/camelCase",
5 - "./data/var/dataPriv",
6 - "./data/var/dataUser"
7 -], function( jQuery, access, camelCase, dataPriv, dataUser ) {
8 -
9 -"use strict";
10 -
11 -// Implementation Summary
12 -//
13 -// 1. Enforce API surface and semantic compatibility with 1.9.x branch
14 -// 2. Improve the module's maintainability by reducing the storage
15 -// paths to a single mechanism.
16 -// 3. Use the same single mechanism to support "private" and "user" data.
17 -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
18 -// 5. Avoid exposing implementation details on user objects (eg. expando properties)
19 -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
20 -
21 -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
22 - rmultiDash = /[A-Z]/g;
23 -
24 -function getData( data ) {
25 - if ( data === "true" ) {
26 - return true;
27 - }
28 -
29 - if ( data === "false" ) {
30 - return false;
31 - }
32 -
33 - if ( data === "null" ) {
34 - return null;
35 - }
36 -
37 - // Only convert to a number if it doesn't change the string
38 - if ( data === +data + "" ) {
39 - return +data;
40 - }
41 -
42 - if ( rbrace.test( data ) ) {
43 - return JSON.parse( data );
44 - }
45 -
46 - return data;
47 -}
48 -
49 -function dataAttr( elem, key, data ) {
50 - var name;
51 -
52 - // If nothing was found internally, try to fetch any
53 - // data from the HTML5 data-* attribute
54 - if ( data === undefined && elem.nodeType === 1 ) {
55 - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
56 - data = elem.getAttribute( name );
57 -
58 - if ( typeof data === "string" ) {
59 - try {
60 - data = getData( data );
61 - } catch ( e ) {}
62 -
63 - // Make sure we set the data so it isn't changed later
64 - dataUser.set( elem, key, data );
65 - } else {
66 - data = undefined;
67 - }
68 - }
69 - return data;
70 -}
71 -
72 -jQuery.extend( {
73 - hasData: function( elem ) {
74 - return dataUser.hasData( elem ) || dataPriv.hasData( elem );
75 - },
76 -
77 - data: function( elem, name, data ) {
78 - return dataUser.access( elem, name, data );
79 - },
80 -
81 - removeData: function( elem, name ) {
82 - dataUser.remove( elem, name );
83 - },
84 -
85 - // TODO: Now that all calls to _data and _removeData have been replaced
86 - // with direct calls to dataPriv methods, these can be deprecated.
87 - _data: function( elem, name, data ) {
88 - return dataPriv.access( elem, name, data );
89 - },
90 -
91 - _removeData: function( elem, name ) {
92 - dataPriv.remove( elem, name );
93 - }
94 -} );
95 -
96 -jQuery.fn.extend( {
97 - data: function( key, value ) {
98 - var i, name, data,
99 - elem = this[ 0 ],
100 - attrs = elem && elem.attributes;
101 -
102 - // Gets all values
103 - if ( key === undefined ) {
104 - if ( this.length ) {
105 - data = dataUser.get( elem );
106 -
107 - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
108 - i = attrs.length;
109 - while ( i-- ) {
110 -
111 - // Support: IE 11 only
112 - // The attrs elements can be null (#14894)
113 - if ( attrs[ i ] ) {
114 - name = attrs[ i ].name;
115 - if ( name.indexOf( "data-" ) === 0 ) {
116 - name = camelCase( name.slice( 5 ) );
117 - dataAttr( elem, name, data[ name ] );
118 - }
119 - }
120 - }
121 - dataPriv.set( elem, "hasDataAttrs", true );
122 - }
123 - }
124 -
125 - return data;
126 - }
127 -
128 - // Sets multiple values
129 - if ( typeof key === "object" ) {
130 - return this.each( function() {
131 - dataUser.set( this, key );
132 - } );
133 - }
134 -
135 - return access( this, function( value ) {
136 - var data;
137 -
138 - // The calling jQuery object (element matches) is not empty
139 - // (and therefore has an element appears at this[ 0 ]) and the
140 - // `value` parameter was not undefined. An empty jQuery object
141 - // will result in `undefined` for elem = this[ 0 ] which will
142 - // throw an exception if an attempt to read a data cache is made.
143 - if ( elem && value === undefined ) {
144 -
145 - // Attempt to get data from the cache
146 - // The key will always be camelCased in Data
147 - data = dataUser.get( elem, key );
148 - if ( data !== undefined ) {
149 - return data;
150 - }
151 -
152 - // Attempt to "discover" the data in
153 - // HTML5 custom data-* attrs
154 - data = dataAttr( elem, key );
155 - if ( data !== undefined ) {
156 - return data;
157 - }
158 -
159 - // We tried really hard, but the data doesn't exist.
160 - return;
161 - }
162 -
163 - // Set the data...
164 - this.each( function() {
165 -
166 - // We always store the camelCased key
167 - dataUser.set( this, key, value );
168 - } );
169 - }, null, value, arguments.length > 1, null, true );
170 - },
171 -
172 - removeData: function( key ) {
173 - return this.each( function() {
174 - dataUser.remove( this, key );
175 - } );
176 - }
177 -} );
178 -
179 -return jQuery;
180 -} );
1 -define( [
2 - "../core",
3 - "../core/camelCase",
4 - "../var/rnothtmlwhite",
5 - "./var/acceptData"
6 -], function( jQuery, camelCase, rnothtmlwhite, acceptData ) {
7 -
8 -"use strict";
9 -
10 -function Data() {
11 - this.expando = jQuery.expando + Data.uid++;
12 -}
13 -
14 -Data.uid = 1;
15 -
16 -Data.prototype = {
17 -
18 - cache: function( owner ) {
19 -
20 - // Check if the owner object already has a cache
21 - var value = owner[ this.expando ];
22 -
23 - // If not, create one
24 - if ( !value ) {
25 - value = {};
26 -
27 - // We can accept data for non-element nodes in modern browsers,
28 - // but we should not, see #8335.
29 - // Always return an empty object.
30 - if ( acceptData( owner ) ) {
31 -
32 - // If it is a node unlikely to be stringify-ed or looped over
33 - // use plain assignment
34 - if ( owner.nodeType ) {
35 - owner[ this.expando ] = value;
36 -
37 - // Otherwise secure it in a non-enumerable property
38 - // configurable must be true to allow the property to be
39 - // deleted when data is removed
40 - } else {
41 - Object.defineProperty( owner, this.expando, {
42 - value: value,
43 - configurable: true
44 - } );
45 - }
46 - }
47 - }
48 -
49 - return value;
50 - },
51 - set: function( owner, data, value ) {
52 - var prop,
53 - cache = this.cache( owner );
54 -
55 - // Handle: [ owner, key, value ] args
56 - // Always use camelCase key (gh-2257)
57 - if ( typeof data === "string" ) {
58 - cache[ camelCase( data ) ] = value;
59 -
60 - // Handle: [ owner, { properties } ] args
61 - } else {
62 -
63 - // Copy the properties one-by-one to the cache object
64 - for ( prop in data ) {
65 - cache[ camelCase( prop ) ] = data[ prop ];
66 - }
67 - }
68 - return cache;
69 - },
70 - get: function( owner, key ) {
71 - return key === undefined ?
72 - this.cache( owner ) :
73 -
74 - // Always use camelCase key (gh-2257)
75 - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
76 - },
77 - access: function( owner, key, value ) {
78 -
79 - // In cases where either:
80 - //
81 - // 1. No key was specified
82 - // 2. A string key was specified, but no value provided
83 - //
84 - // Take the "read" path and allow the get method to determine
85 - // which value to return, respectively either:
86 - //
87 - // 1. The entire cache object
88 - // 2. The data stored at the key
89 - //
90 - if ( key === undefined ||
91 - ( ( key && typeof key === "string" ) && value === undefined ) ) {
92 -
93 - return this.get( owner, key );
94 - }
95 -
96 - // When the key is not a string, or both a key and value
97 - // are specified, set or extend (existing objects) with either:
98 - //
99 - // 1. An object of properties
100 - // 2. A key and value
101 - //
102 - this.set( owner, key, value );
103 -
104 - // Since the "set" path can have two possible entry points
105 - // return the expected data based on which path was taken[*]
106 - return value !== undefined ? value : key;
107 - },
108 - remove: function( owner, key ) {
109 - var i,
110 - cache = owner[ this.expando ];
111 -
112 - if ( cache === undefined ) {
113 - return;
114 - }
115 -
116 - if ( key !== undefined ) {
117 -
118 - // Support array or space separated string of keys
119 - if ( Array.isArray( key ) ) {
120 -
121 - // If key is an array of keys...
122 - // We always set camelCase keys, so remove that.
123 - key = key.map( camelCase );
124 - } else {
125 - key = camelCase( key );
126 -
127 - // If a key with the spaces exists, use it.
128 - // Otherwise, create an array by matching non-whitespace
129 - key = key in cache ?
130 - [ key ] :
131 - ( key.match( rnothtmlwhite ) || [] );
132 - }
133 -
134 - i = key.length;
135 -
136 - while ( i-- ) {
137 - delete cache[ key[ i ] ];
138 - }
139 - }
140 -
141 - // Remove the expando if there's no more data
142 - if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
143 -
144 - // Support: Chrome <=35 - 45
145 - // Webkit & Blink performance suffers when deleting properties
146 - // from DOM nodes, so set to undefined instead
147 - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
148 - if ( owner.nodeType ) {
149 - owner[ this.expando ] = undefined;
150 - } else {
151 - delete owner[ this.expando ];
152 - }
153 - }
154 - },
155 - hasData: function( owner ) {
156 - var cache = owner[ this.expando ];
157 - return cache !== undefined && !jQuery.isEmptyObject( cache );
158 - }
159 -};
160 -
161 -return Data;
162 -} );
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.