Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
todomvc
Commits
038fc12d
Commit
038fc12d
authored
Feb 08, 2015
by
Pascal Hartig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flight: Upgrade transient dependencies
parent
3ed634b9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1332 additions
and
536 deletions
+1332
-536
examples/flight/node_modules/es5-shim/es5-sham.js
examples/flight/node_modules/es5-shim/es5-sham.js
+131
-11
examples/flight/node_modules/es5-shim/es5-shim.js
examples/flight/node_modules/es5-shim/es5-shim.js
+695
-113
examples/flight/node_modules/jquery/dist/jquery.js
examples/flight/node_modules/jquery/dist/jquery.js
+506
-412
No files found.
examples/flight/node_modules/es5-shim/es5-sham.js
View file @
038fc12d
// Copyright 2009-2012 by contributors, MIT License
// vim: ts=4 sts=4 sw=4 expandtab
//Add semicolon to prevent IIFE from being passed as argument to concated code.
;
// Module systems magic dance
(
function
(
definition
)
{
// RequireJS
...
...
@@ -15,10 +17,28 @@
}
})(
function
()
{
var
call
=
Function
.
prototype
.
call
;
var
prototypeOfObject
=
Object
.
prototype
;
var
owns
=
call
.
bind
(
prototypeOfObject
.
hasOwnProperty
);
// If JS engine supports accessors creating shortcuts.
var
defineGetter
;
var
defineSetter
;
var
lookupGetter
;
var
lookupSetter
;
var
supportsAccessors
;
if
((
supportsAccessors
=
owns
(
prototypeOfObject
,
"
__defineGetter__
"
)))
{
defineGetter
=
call
.
bind
(
prototypeOfObject
.
__defineGetter__
);
defineSetter
=
call
.
bind
(
prototypeOfObject
.
__defineSetter__
);
lookupGetter
=
call
.
bind
(
prototypeOfObject
.
__lookupGetter__
);
lookupSetter
=
call
.
bind
(
prototypeOfObject
.
__lookupSetter__
);
}
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if
(
!
Object
.
getPrototypeOf
)
{
// https://github.com/
kriskowal
/es5-shim/issues#issue/2
// https://github.com/
es-shims
/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// recommended by fschaefer on github
Object
.
getPrototypeOf
=
function
getPrototypeOf
(
object
)
{
...
...
@@ -30,15 +50,53 @@ if (!Object.getPrototypeOf) {
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
if
(
!
Object
.
getOwnPropertyDescriptor
)
{
//ES5 15.2.3.3
//http://es5.github.com/#x15.2.3.3
function
doesGetOwnPropertyDescriptorWork
(
object
)
{
try
{
object
.
sentinel
=
0
;
return
Object
.
getOwnPropertyDescriptor
(
object
,
"
sentinel
"
).
value
===
0
;
}
catch
(
exception
)
{
// returns falsy
}
}
//check whether getOwnPropertyDescriptor works if it's given. Otherwise,
//shim partially.
if
(
Object
.
defineProperty
)
{
var
getOwnPropertyDescriptorWorksOnObject
=
doesGetOwnPropertyDescriptorWork
({});
var
getOwnPropertyDescriptorWorksOnDom
=
typeof
document
==
"
undefined
"
||
doesGetOwnPropertyDescriptorWork
(
document
.
createElement
(
"
div
"
));
if
(
!
getOwnPropertyDescriptorWorksOnDom
||
!
getOwnPropertyDescriptorWorksOnObject
)
{
var
getOwnPropertyDescriptorFallback
=
Object
.
getOwnPropertyDescriptor
;
}
}
if
(
!
Object
.
getOwnPropertyDescriptor
||
getOwnPropertyDescriptorFallback
)
{
var
ERR_NON_OBJECT
=
"
Object.getOwnPropertyDescriptor called on a non-object:
"
;
Object
.
getOwnPropertyDescriptor
=
function
getOwnPropertyDescriptor
(
object
,
property
)
{
if
((
typeof
object
!=
"
object
"
&&
typeof
object
!=
"
function
"
)
||
object
===
null
)
{
throw
new
TypeError
(
ERR_NON_OBJECT
+
object
);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if
(
getOwnPropertyDescriptorFallback
)
{
try
{
return
getOwnPropertyDescriptorFallback
.
call
(
Object
,
object
,
property
);
}
catch
(
exception
)
{
// try the shim if the real one doesn't work
}
}
// If object does not owns property return undefined immediately.
if
(
!
owns
(
object
,
property
))
{
return
;
...
...
@@ -81,6 +139,7 @@ if (!Object.getOwnPropertyDescriptor) {
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor
.
value
=
object
[
property
];
descriptor
.
writable
=
true
;
return
descriptor
;
};
}
...
...
@@ -96,15 +155,64 @@ if (!Object.getOwnPropertyNames) {
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if
(
!
Object
.
create
)
{
// Contributed by Brandon Benvie, October, 2012
var
createEmpty
;
var
supportsProto
=
Object
.
prototype
.
__proto__
===
null
;
if
(
supportsProto
||
typeof
document
==
'
undefined
'
)
{
createEmpty
=
function
()
{
return
{
"
__proto__
"
:
null
};
};
}
else
{
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty
=
function
()
{
var
iframe
=
document
.
createElement
(
'
iframe
'
);
var
parent
=
document
.
body
||
document
.
documentElement
;
iframe
.
style
.
display
=
'
none
'
;
parent
.
appendChild
(
iframe
);
iframe
.
src
=
'
javascript:
'
;
var
empty
=
iframe
.
contentWindow
.
Object
.
prototype
;
parent
.
removeChild
(
iframe
);
iframe
=
null
;
delete
empty
.
constructor
;
delete
empty
.
hasOwnProperty
;
delete
empty
.
propertyIsEnumerable
;
delete
empty
.
isPrototypeOf
;
delete
empty
.
toLocaleString
;
delete
empty
.
toString
;
delete
empty
.
valueOf
;
empty
.
__proto__
=
null
;
function
Empty
()
{}
Empty
.
prototype
=
empty
;
// short-circuit future calls
createEmpty
=
function
()
{
return
new
Empty
();
};
return
new
Empty
();
};
}
Object
.
create
=
function
create
(
prototype
,
properties
)
{
var
object
;
function
Type
()
{}
// An empty constructor.
if
(
prototype
===
null
)
{
object
=
{
"
__proto__
"
:
null
}
;
object
=
createEmpty
()
;
}
else
{
if
(
typeof
prototype
!=
"
object
"
)
{
throw
new
TypeError
(
"
typeof prototype[
"
+
(
typeof
prototype
)
+
"
] != 'object'
"
);
if
(
typeof
prototype
!==
"
object
"
&&
typeof
prototype
!==
"
function
"
)
{
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw
new
TypeError
(
"
Object prototype may only be an Object or null
"
);
// same msg as Chrome
}
var
Type
=
function
()
{};
Type
.
prototype
=
prototype
;
object
=
new
Type
();
// IE has no built-in implementation of `Object.getPrototypeOf`
...
...
@@ -113,9 +221,11 @@ if (!Object.create) {
// objects created using `Object.create`
object
.
__proto__
=
prototype
;
}
if
(
properties
!==
void
0
)
{
Object
.
defineProperties
(
object
,
properties
);
}
return
object
;
};
}
...
...
@@ -125,7 +235,7 @@ if (!Object.create) {
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/
kriskowal
/es5-shim/issues#issue/5
// related issue: https://github.com/
es-shims
/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
...
...
@@ -148,7 +258,8 @@ if (Object.defineProperty) {
var
definePropertyWorksOnDom
=
typeof
document
==
"
undefined
"
||
doesDefinePropertyWork
(
document
.
createElement
(
"
div
"
));
if
(
!
definePropertyWorksOnObject
||
!
definePropertyWorksOnDom
)
{
var
definePropertyFallback
=
Object
.
defineProperty
;
var
definePropertyFallback
=
Object
.
defineProperty
,
definePropertiesFallback
=
Object
.
defineProperties
;
}
}
...
...
@@ -228,8 +339,17 @@ if (!Object.defineProperty || definePropertyFallback) {
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
if
(
!
Object
.
defineProperties
)
{
if
(
!
Object
.
defineProperties
||
definePropertiesFallback
)
{
Object
.
defineProperties
=
function
defineProperties
(
object
,
properties
)
{
// make a valiant attempt to use the real defineProperties
if
(
definePropertiesFallback
)
{
try
{
return
definePropertiesFallback
.
call
(
Object
,
object
,
properties
);
}
catch
(
exception
)
{
// try the shim if the real one doesn't work
}
}
for
(
var
property
in
properties
)
{
if
(
owns
(
properties
,
property
)
&&
property
!=
"
__proto__
"
)
{
Object
.
defineProperty
(
object
,
property
,
properties
[
property
]);
...
...
examples/flight/node_modules/es5-shim/es5-shim.js
View file @
038fc12d
// Copyright 2009-2012 by contributors, MIT License
// vim: ts=4 sts=4 sw=4 expandtab
//Add semicolon to prevent IIFE from being passed as argument to concated code.
;
// Module systems magic dance
(
function
(
definition
)
{
// RequireJS
...
...
@@ -24,6 +26,20 @@
* Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
*/
// ES-5 15.1.2.2
if
(
parseInt
(
'
08
'
)
!==
8
)
{
parseInt
=
(
function
(
origParseInt
)
{
var
hexRegex
=
/^0
[
xX
]
/
;
return
function
parseIntES5
(
str
,
radix
)
{
str
=
String
(
str
).
trim
();
if
(
!+
radix
)
{
radix
=
hexRegex
.
test
(
str
)
?
16
:
10
;
}
return
origParseInt
(
str
,
radix
);
};
}(
parseInt
));
}
//
// Function
// ========
...
...
@@ -32,6 +48,8 @@
// ES-5 15.3.4.5
// http://es5.github.com/#x15.3.4.5
function
Empty
()
{}
if
(
!
Function
.
prototype
.
bind
)
{
Function
.
prototype
.
bind
=
function
bind
(
that
)
{
// .length is 1
// 1. Let Target be the this value.
...
...
@@ -43,7 +61,7 @@ if (!Function.prototype.bind) {
// 3. Let A be a new (possibly empty) internal list of all of the
// argument values provided after thisArg (arg1, arg2 etc), in order.
// XXX slicedArgs will stand in for "A" if used
var
args
=
slice
.
call
(
arguments
,
1
);
// for normal call
var
args
=
_Array_slice_
.
call
(
arguments
,
1
);
// for normal call
// 4. Let F be a new native ECMAScript object.
// 11. Set the [[Prototype]] internal property of F to the standard
// built-in Function prototype object as specified in 15.3.3.1.
...
...
@@ -53,7 +71,7 @@ if (!Function.prototype.bind) {
// 15.3.4.5.2.
// 14. Set the [[HasInstance]] internal property of F as described in
// 15.3.4.5.3.
var
b
ound
=
function
()
{
var
b
inder
=
function
()
{
if
(
this
instanceof
bound
)
{
// 15.3.4.5.2 [[Construct]]
...
...
@@ -72,18 +90,14 @@ if (!Function.prototype.bind) {
// 5. Return the result of calling the [[Construct]] internal
// method of target providing args as the arguments.
var
F
=
function
(){};
F
.
prototype
=
target
.
prototype
;
var
self
=
new
F
;
var
result
=
target
.
apply
(
self
,
args
.
concat
(
slice
.
call
(
arguments
))
this
,
args
.
concat
(
_Array_slice_
.
call
(
arguments
))
);
if
(
Object
(
result
)
===
result
)
{
return
result
;
}
return
self
;
return
this
;
}
else
{
// 15.3.4.5.1 [[Call]]
...
...
@@ -107,21 +121,42 @@ if (!Function.prototype.bind) {
// equiv: target.call(this, ...boundArgs, ...args)
return
target
.
apply
(
that
,
args
.
concat
(
slice
.
call
(
arguments
))
args
.
concat
(
_Array_slice_
.
call
(
arguments
))
);
}
};
// XXX bound.length is never writable, so don't even try
//
// 15. If the [[Class]] internal property of Target is "Function", then
// a. Let L be the length property of Target minus the length of A.
// b. Set the length own property of F to either 0 or L, whichever is
// larger.
// 16. Else set the length own property of F to 0.
var
boundLength
=
Math
.
max
(
0
,
target
.
length
-
args
.
length
);
// 17. Set the attributes of the length own property of F to the values
// specified in 15.3.5.1.
var
boundArgs
=
[];
for
(
var
i
=
0
;
i
<
boundLength
;
i
++
)
{
boundArgs
.
push
(
"
$
"
+
i
);
}
// XXX Build a dynamic function with desired amount of arguments is the only
// way to set the length property of a function.
// In environments where Content Security Policies enabled (Chrome extensions,
// for ex.) all use of eval or Function costructor throws an exception.
// However in all of these environments Function.prototype.bind exists
// and so this code will never be executed.
var
bound
=
Function
(
"
binder
"
,
"
return function(
"
+
boundArgs
.
join
(
"
,
"
)
+
"
){return binder.apply(this,arguments)}
"
)(
binder
);
if
(
target
.
prototype
)
{
Empty
.
prototype
=
target
.
prototype
;
bound
.
prototype
=
new
Empty
();
// Clean up dangling references.
Empty
.
prototype
=
null
;
}
// TODO
// 18. Set the [[Extensible]] internal property of F to true.
...
...
@@ -155,7 +190,7 @@ if (!Function.prototype.bind) {
var
call
=
Function
.
prototype
.
call
;
var
prototypeOfArray
=
Array
.
prototype
;
var
prototypeOfObject
=
Object
.
prototype
;
var
slice
=
prototypeOfArray
.
slice
;
var
_Array_slice_
=
prototypeOfArray
.
slice
;
// Having a toString local variable name breaks in Opera so use _toString.
var
_toString
=
call
.
bind
(
prototypeOfObject
.
toString
);
var
owns
=
call
.
bind
(
prototypeOfObject
.
hasOwnProperty
);
...
...
@@ -178,6 +213,116 @@ if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
// =====
//
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.12
// Default value for second param
// [bugfix, ielt9, old browsers]
// IE < 9 bug: [1,2].splice(0).join("") == "" but should be "12"
if
([
1
,
2
].
splice
(
0
).
length
!=
2
)
{
var
array_splice
=
Array
.
prototype
.
splice
;
var
array_push
=
Array
.
prototype
.
push
;
var
array_unshift
=
Array
.
prototype
.
unshift
;
if
(
function
()
{
// test IE < 9 to splice bug - see issue #138
function
makeArray
(
l
)
{
var
a
=
[];
while
(
l
--
)
{
a
.
unshift
(
l
)
}
return
a
}
var
array
=
[]
,
lengthBefore
;
array
.
splice
.
bind
(
array
,
0
,
0
).
apply
(
null
,
makeArray
(
20
));
array
.
splice
.
bind
(
array
,
0
,
0
).
apply
(
null
,
makeArray
(
26
));
lengthBefore
=
array
.
length
;
//20
array
.
splice
(
5
,
0
,
"
XXX
"
);
// add one element
if
(
lengthBefore
+
1
==
array
.
length
)
{
return
true
;
// has right splice implementation without bugs
}
// else {
// IE8 bug
// }
}())
{
//IE 6/7
Array
.
prototype
.
splice
=
function
(
start
,
deleteCount
)
{
if
(
!
arguments
.
length
)
{
return
[];
}
else
{
return
array_splice
.
apply
(
this
,
[
start
===
void
0
?
0
:
start
,
deleteCount
===
void
0
?
(
this
.
length
-
start
)
:
deleteCount
].
concat
(
_Array_slice_
.
call
(
arguments
,
2
)))
}
};
}
else
{
//IE8
Array
.
prototype
.
splice
=
function
(
start
,
deleteCount
)
{
var
result
,
args
=
_Array_slice_
.
call
(
arguments
,
2
)
,
addElementsCount
=
args
.
length
;
if
(
!
arguments
.
length
)
{
return
[];
}
if
(
start
===
void
0
)
{
// default
start
=
0
;
}
if
(
deleteCount
===
void
0
)
{
// default
deleteCount
=
this
.
length
-
start
;
}
if
(
addElementsCount
>
0
)
{
if
(
deleteCount
<=
0
)
{
if
(
start
==
this
.
length
)
{
// tiny optimisation #1
array_push
.
apply
(
this
,
args
);
return
[];
}
if
(
start
==
0
)
{
// tiny optimisation #2
array_unshift
.
apply
(
this
,
args
);
return
[];
}
}
// Array.prototype.splice implementation
result
=
_Array_slice_
.
call
(
this
,
start
,
start
+
deleteCount
);
// delete part
args
.
push
.
apply
(
args
,
_Array_slice_
.
call
(
this
,
start
+
deleteCount
,
this
.
length
));
// right part
args
.
unshift
.
apply
(
args
,
_Array_slice_
.
call
(
this
,
0
,
start
));
// left part
// delete all items from this array and replace it to 'left part' + _Array_slice_.call(arguments, 2) + 'right part'
args
.
unshift
(
0
,
this
.
length
);
array_splice
.
apply
(
this
,
args
);
return
result
;
}
return
array_splice
.
call
(
this
,
start
,
deleteCount
);
}
}
}
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.13
// Return len+argCount.
// [bugfix, ielt8]
// IE < 8 bug: [].unshift(0) == undefined but should be "1"
if
([].
unshift
(
0
)
!=
1
)
{
var
array_unshift
=
Array
.
prototype
.
unshift
;
Array
.
prototype
.
unshift
=
function
()
{
array_unshift
.
apply
(
this
,
arguments
);
return
this
.
length
;
};
}
// ES5 15.4.3.2
// http://es5.github.com/#x15.4.3.2
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
...
...
@@ -202,9 +347,25 @@ if (!Array.isArray) {
// ES5 15.4.4.18
// http://es5.github.com/#x15.4.4.18
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
if
(
!
Array
.
prototype
.
forEach
)
{
// Check failure of by-index access of string characters (IE < 9)
// and failure of `0 in boxedString` (Rhino)
var
boxedString
=
Object
(
"
a
"
),
splitString
=
boxedString
[
0
]
!=
"
a
"
||
!
(
0
in
boxedString
);
// Check node 0.6.21 bug where third parameter is not boxed
var
boxedForEach
=
true
;
if
(
Array
.
prototype
.
forEach
)
{
Array
.
prototype
.
forEach
.
call
(
"
foo
"
,
function
(
item
,
i
,
obj
)
{
if
(
typeof
obj
!==
'
object
'
)
boxedForEach
=
false
;
});
}
if
(
!
Array
.
prototype
.
forEach
||
!
boxedForEach
)
{
Array
.
prototype
.
forEach
=
function
forEach
(
fun
/*, thisp*/
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
thisp
=
arguments
[
1
],
i
=
-
1
,
length
=
self
.
length
>>>
0
;
...
...
@@ -217,8 +378,9 @@ if (!Array.prototype.forEach) {
while
(
++
i
<
length
)
{
if
(
i
in
self
)
{
// Invoke the callback function with call, passing arguments:
// context, property value, property key, thisArg object context
fun
.
call
(
thisp
,
self
[
i
],
i
,
self
);
// context, property value, property key, thisArg object
// context
fun
.
call
(
thisp
,
self
[
i
],
i
,
object
);
}
}
};
...
...
@@ -229,7 +391,10 @@ if (!Array.prototype.forEach) {
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
if
(
!
Array
.
prototype
.
map
)
{
Array
.
prototype
.
map
=
function
map
(
fun
/*, thisp*/
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
length
=
self
.
length
>>>
0
,
result
=
Array
(
length
),
thisp
=
arguments
[
1
];
...
...
@@ -241,7 +406,7 @@ if (!Array.prototype.map) {
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
if
(
i
in
self
)
result
[
i
]
=
fun
.
call
(
thisp
,
self
[
i
],
i
,
self
);
result
[
i
]
=
fun
.
call
(
thisp
,
self
[
i
],
i
,
object
);
}
return
result
;
};
...
...
@@ -252,7 +417,10 @@ if (!Array.prototype.map) {
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
if
(
!
Array
.
prototype
.
filter
)
{
Array
.
prototype
.
filter
=
function
filter
(
fun
/*, thisp */
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
length
=
self
.
length
>>>
0
,
result
=
[],
value
,
...
...
@@ -266,7 +434,7 @@ if (!Array.prototype.filter) {
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
if
(
i
in
self
)
{
value
=
self
[
i
];
if
(
fun
.
call
(
thisp
,
value
,
i
,
self
))
{
if
(
fun
.
call
(
thisp
,
value
,
i
,
object
))
{
result
.
push
(
value
);
}
}
...
...
@@ -280,7 +448,10 @@ if (!Array.prototype.filter) {
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
if
(
!
Array
.
prototype
.
every
)
{
Array
.
prototype
.
every
=
function
every
(
fun
/*, thisp */
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
length
=
self
.
length
>>>
0
,
thisp
=
arguments
[
1
];
...
...
@@ -290,7 +461,7 @@ if (!Array.prototype.every) {
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
if
(
i
in
self
&&
!
fun
.
call
(
thisp
,
self
[
i
],
i
,
self
))
{
if
(
i
in
self
&&
!
fun
.
call
(
thisp
,
self
[
i
],
i
,
object
))
{
return
false
;
}
}
...
...
@@ -303,7 +474,10 @@ if (!Array.prototype.every) {
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
if
(
!
Array
.
prototype
.
some
)
{
Array
.
prototype
.
some
=
function
some
(
fun
/*, thisp */
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
length
=
self
.
length
>>>
0
,
thisp
=
arguments
[
1
];
...
...
@@ -313,7 +487,7 @@ if (!Array.prototype.some) {
}
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
if
(
i
in
self
&&
fun
.
call
(
thisp
,
self
[
i
],
i
,
self
))
{
if
(
i
in
self
&&
fun
.
call
(
thisp
,
self
[
i
],
i
,
object
))
{
return
true
;
}
}
...
...
@@ -326,7 +500,10 @@ if (!Array.prototype.some) {
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
if
(
!
Array
.
prototype
.
reduce
)
{
Array
.
prototype
.
reduce
=
function
reduce
(
fun
/*, initial*/
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
length
=
self
.
length
>>>
0
;
// If no callback function or if callback is not a callable function
...
...
@@ -336,7 +513,7 @@ if (!Array.prototype.reduce) {
// no value to return if no initial value and an empty array
if
(
!
length
&&
arguments
.
length
==
1
)
{
throw
new
TypeError
(
'
reduce of empty array with no initial value
'
);
throw
new
TypeError
(
"
reduce of empty array with no initial value
"
);
}
var
i
=
0
;
...
...
@@ -352,14 +529,14 @@ if (!Array.prototype.reduce) {
// if array contains no values, no initial value to return
if
(
++
i
>=
length
)
{
throw
new
TypeError
(
'
reduce of empty array with no initial value
'
);
throw
new
TypeError
(
"
reduce of empty array with no initial value
"
);
}
}
while
(
true
);
}
for
(;
i
<
length
;
i
++
)
{
if
(
i
in
self
)
{
result
=
fun
.
call
(
void
0
,
result
,
self
[
i
],
i
,
self
);
result
=
fun
.
call
(
void
0
,
result
,
self
[
i
],
i
,
object
);
}
}
...
...
@@ -372,7 +549,10 @@ if (!Array.prototype.reduce) {
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
if
(
!
Array
.
prototype
.
reduceRight
)
{
Array
.
prototype
.
reduceRight
=
function
reduceRight
(
fun
/*, initial*/
)
{
var
self
=
toObject
(
this
),
var
object
=
toObject
(
this
),
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
object
,
length
=
self
.
length
>>>
0
;
// If no callback function or if callback is not a callable function
...
...
@@ -382,7 +562,7 @@ if (!Array.prototype.reduceRight) {
// no value to return if no initial value, empty array
if
(
!
length
&&
arguments
.
length
==
1
)
{
throw
new
TypeError
(
'
reduceRight of empty array with no initial value
'
);
throw
new
TypeError
(
"
reduceRight of empty array with no initial value
"
);
}
var
result
,
i
=
length
-
1
;
...
...
@@ -397,14 +577,18 @@ if (!Array.prototype.reduceRight) {
// if array contains no values, no initial value to return
if
(
--
i
<
0
)
{
throw
new
TypeError
(
'
reduceRight of empty array with no initial value
'
);
throw
new
TypeError
(
"
reduceRight of empty array with no initial value
"
);
}
}
while
(
true
);
}
if
(
i
<
0
)
{
return
result
;
}
do
{
if
(
i
in
this
)
{
result
=
fun
.
call
(
void
0
,
result
,
self
[
i
],
i
,
self
);
result
=
fun
.
call
(
void
0
,
result
,
self
[
i
],
i
,
object
);
}
}
while
(
i
--
);
...
...
@@ -415,9 +599,11 @@ if (!Array.prototype.reduceRight) {
// ES5 15.4.4.14
// http://es5.github.com/#x15.4.4.14
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
if
(
!
Array
.
prototype
.
indexOf
)
{
if
(
!
Array
.
prototype
.
indexOf
||
([
0
,
1
].
indexOf
(
1
,
2
)
!=
-
1
)
)
{
Array
.
prototype
.
indexOf
=
function
indexOf
(
sought
/*, fromIndex */
)
{
var
self
=
toObject
(
this
),
var
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
toObject
(
this
),
length
=
self
.
length
>>>
0
;
if
(
!
length
)
{
...
...
@@ -443,9 +629,11 @@ if (!Array.prototype.indexOf) {
// ES5 15.4.4.15
// http://es5.github.com/#x15.4.4.15
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
if
(
!
Array
.
prototype
.
lastIndexOf
)
{
if
(
!
Array
.
prototype
.
lastIndexOf
||
([
0
,
1
].
lastIndexOf
(
0
,
-
3
)
!=
-
1
)
)
{
Array
.
prototype
.
lastIndexOf
=
function
lastIndexOf
(
sought
/*, fromIndex */
)
{
var
self
=
toObject
(
this
),
var
self
=
splitString
&&
_toString
(
this
)
==
"
[object String]
"
?
this
.
split
(
""
)
:
toObject
(
this
),
length
=
self
.
length
>>>
0
;
if
(
!
length
)
{
...
...
@@ -493,7 +681,10 @@ if (!Object.keys) {
Object
.
keys
=
function
keys
(
object
)
{
if
((
typeof
object
!=
"
object
"
&&
typeof
object
!=
"
function
"
)
||
object
===
null
)
{
if
(
(
typeof
object
!=
"
object
"
&&
typeof
object
!=
"
function
"
)
||
object
===
null
)
{
throw
new
TypeError
(
"
Object.keys called on a non-object
"
);
}
...
...
@@ -529,64 +720,96 @@ if (!Object.keys) {
// string format defined in 15.9.1.15. All fields are present in the String.
// The time zone is always UTC, denoted by the suffix Z. If the time value of
// this object is not a finite Number a RangeError exception is thrown.
if
(
!
Date
.
prototype
.
toISOString
||
(
new
Date
(
-
62198755200000
).
toISOString
().
indexOf
(
'
-000001
'
)
===
-
1
))
{
var
negativeDate
=
-
62198755200000
,
negativeYearString
=
"
-000001
"
;
if
(
!
Date
.
prototype
.
toISOString
||
(
new
Date
(
negativeDate
).
toISOString
().
indexOf
(
negativeYearString
)
===
-
1
)
)
{
Date
.
prototype
.
toISOString
=
function
toISOString
()
{
var
result
,
length
,
value
,
year
;
var
result
,
length
,
value
,
year
,
month
;
if
(
!
isFinite
(
this
))
{
throw
new
RangeError
(
"
Date.prototype.toISOString called on non-finite value.
"
);
}
year
=
this
.
getUTCFullYear
();
month
=
this
.
getUTCMonth
();
// see https://github.com/es-shims/es5-shim/issues/111
year
+=
Math
.
floor
(
month
/
12
);
month
=
(
month
%
12
+
12
)
%
12
;
// the date time string format is specified in 15.9.1.15.
result
=
[
this
.
getUTCMonth
()
+
1
,
this
.
getUTCDate
(),
result
=
[
month
+
1
,
this
.
getUTCDate
(),
this
.
getUTCHours
(),
this
.
getUTCMinutes
(),
this
.
getUTCSeconds
()];
year
=
this
.
getUTCFullYear
();
year
=
(
year
<
0
?
'
-
'
:
(
year
>
9999
?
'
+
'
:
''
))
+
(
'
00000
'
+
Math
.
abs
(
year
)).
slice
(
0
<=
year
&&
year
<=
9999
?
-
4
:
-
6
);
year
=
(
(
year
<
0
?
"
-
"
:
(
year
>
9999
?
"
+
"
:
""
))
+
(
"
00000
"
+
Math
.
abs
(
year
))
.
slice
(
0
<=
year
&&
year
<=
9999
?
-
4
:
-
6
)
);
length
=
result
.
length
;
while
(
length
--
)
{
value
=
result
[
length
];
// pad months, days, hours, minutes, and seconds to have two digits.
// pad months, days, hours, minutes, and seconds to have two
// digits.
if
(
value
<
10
)
{
result
[
length
]
=
"
0
"
+
value
;
}
}
// pad milliseconds to have three digits.
return
year
+
"
-
"
+
result
.
slice
(
0
,
2
).
join
(
"
-
"
)
+
"
T
"
+
result
.
slice
(
2
).
join
(
"
:
"
)
+
"
.
"
+
(
"
000
"
+
this
.
getUTCMilliseconds
()).
slice
(
-
3
)
+
"
Z
"
;
}
}
// ES5 15.9.4.4
// http://es5.github.com/#x15.9.4.4
if
(
!
Date
.
now
)
{
Date
.
now
=
function
now
()
{
return
new
Date
().
getTime
();
return
(
year
+
"
-
"
+
result
.
slice
(
0
,
2
).
join
(
"
-
"
)
+
"
T
"
+
result
.
slice
(
2
).
join
(
"
:
"
)
+
"
.
"
+
(
"
000
"
+
this
.
getUTCMilliseconds
()).
slice
(
-
3
)
+
"
Z
"
);
};
}
// ES5 15.9.5.44
// http://es5.github.com/#x15.9.5.44
// This function provides a String representation of a Date object for use by
// JSON.stringify (15.12.3).
if
(
!
Date
.
prototype
.
toJSON
)
{
var
dateToJSONIsSupported
=
false
;
try
{
dateToJSONIsSupported
=
(
Date
.
prototype
.
toJSON
&&
new
Date
(
NaN
).
toJSON
()
===
null
&&
new
Date
(
negativeDate
).
toJSON
().
indexOf
(
negativeYearString
)
!==
-
1
&&
Date
.
prototype
.
toJSON
.
call
({
// generic
toISOString
:
function
()
{
return
true
;
}
})
);
}
catch
(
e
)
{
}
if
(
!
dateToJSONIsSupported
)
{
Date
.
prototype
.
toJSON
=
function
toJSON
(
key
)
{
// When the toJSON method is called with argument key, the following
// steps are taken:
// 1. Let O be the result of calling ToObject, giving it the this
// value as its argument.
// 2. Let tv be ToPrimitive(O, hint Number).
// 2. Let tv be toPrimitive(O, hint Number).
var
o
=
Object
(
this
),
tv
=
toPrimitive
(
o
),
toISO
;
// 3. If tv is a Number and is not finite, return null.
// XXX
if
(
typeof
tv
===
"
number
"
&&
!
isFinite
(
tv
))
{
return
null
;
}
// 4. Let toISO be the result of calling the [[Get]] internal method of
// O with argument "toISOString".
toISO
=
o
.
toISOString
;
// 5. If IsCallable(toISO) is false, throw a TypeError exception.
if
(
typeof
t
his
.
toISOString
!=
"
function
"
)
{
throw
new
TypeError
(
'
toISOString property is not callable
'
);
if
(
typeof
t
oISO
!=
"
function
"
)
{
throw
new
TypeError
(
"
toISOString property is not callable
"
);
}
// 6. Return the result of calling the [[Call]] internal method of
// toISO with O as the this value and an empty argument list.
return
t
his
.
toISOString
(
);
return
t
oISO
.
call
(
o
);
// NOTE 1 The argument is ignored.
...
...
@@ -603,13 +826,13 @@ if (!Date.prototype.toJSON) {
// http://es5.github.com/#x15.9.4.2
// based on work shared by Daniel Friesen (dantman)
// http://gist.github.com/303249
if
(
!
Date
.
parse
||
Date
.
parse
(
"
+275760-09-13T00:00:00.000Z
"
)
!==
8.64e15
)
{
if
(
!
Date
.
parse
||
"
Date.parse is buggy
"
)
{
// XXX global assignment won't work in embeddings that use
// an alternate object for the context.
Date
=
(
function
(
NativeDate
)
{
// Date.length === 7
var
Date
=
function
Date
(
Y
,
M
,
D
,
h
,
m
,
s
,
ms
)
{
function
Date
(
Y
,
M
,
D
,
h
,
m
,
s
,
ms
)
{
var
length
=
arguments
.
length
;
if
(
this
instanceof
NativeDate
)
{
var
date
=
length
==
1
&&
String
(
Y
)
===
Y
?
// isString(Y)
...
...
@@ -634,7 +857,8 @@ if (!Date.parse || Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
// 15.9.1.15 Date Time String Format.
var
isoDateExpression
=
new
RegExp
(
"
^
"
+
"
(
\\
d{4}|[
\
+
\
-]
\\
d{6})
"
+
// four-digit year capture or sign + 6-digit extended year
"
(
\\
d{4}|[
\
+
\
-]
\\
d{6})
"
+
// four-digit year capture or sign +
// 6-digit extended year
"
(?:-(
\\
d{2})
"
+
// optional month capture
"
(?:-(
\\
d{2})
"
+
// optional day capture
"
(?:
"
+
// capture hours:minutes:seconds.milliseconds
...
...
@@ -642,9 +866,9 @@ if (!Date.parse || Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
"
:(
\\
d{2})
"
+
// minutes capture
"
(?:
"
+
// optional :seconds.milliseconds
"
:(
\\
d{2})
"
+
// seconds capture
"
(?:
\\
.(
\\
d{3
}))?
"
+
// milliseconds capture
"
(?:
(
\\
.
\\
d{1,
}))?
"
+
// milliseconds capture
"
)?
"
+
"
(
?:
"
+
// capture UTC offset component
"
(
"
+
// capture UTC offset component
"
Z|
"
+
// UTC capture
"
(?:
"
+
// offset specifier +/-hours:minutes
"
([-+])
"
+
// sign capture
...
...
@@ -654,6 +878,25 @@ if (!Date.parse || Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
"
)?)?)?)?
"
+
"
$
"
);
var
months
=
[
0
,
31
,
59
,
90
,
120
,
151
,
181
,
212
,
243
,
273
,
304
,
334
,
365
];
function
dayFromMonth
(
year
,
month
)
{
var
t
=
month
>
1
?
1
:
0
;
return
(
months
[
month
]
+
Math
.
floor
((
year
-
1969
+
t
)
/
4
)
-
Math
.
floor
((
year
-
1901
+
t
)
/
100
)
+
Math
.
floor
((
year
-
1601
+
t
)
/
400
)
+
365
*
(
year
-
1970
)
);
}
function
toUTC
(
t
)
{
return
Number
(
new
NativeDate
(
1970
,
0
,
1
,
0
,
0
,
0
,
t
));
}
// Copy any custom methods a 3rd party library may have added
for
(
var
key
in
NativeDate
)
{
Date
[
key
]
=
NativeDate
[
key
];
...
...
@@ -669,60 +912,369 @@ if (!Date.parse || Date.parse("+275760-09-13T00:00:00.000Z") !== 8.64e15) {
Date
.
parse
=
function
parse
(
string
)
{
var
match
=
isoDateExpression
.
exec
(
string
);
if
(
match
)
{
match
.
shift
();
// kill match[0], the full match
// parse months, days, hours, minutes, seconds, and milliseconds
for
(
var
i
=
1
;
i
<
7
;
i
++
)
{
// provide default values if necessary
match
[
i
]
=
+
(
match
[
i
]
||
(
i
<
3
?
1
:
0
));
// match[1] is the month. Months are 0-11 in JavaScript
// `Date` objects, but 1-12 in ISO notation, so we
// decrement.
if
(
i
==
1
)
{
match
[
i
]
--
;
// parse the UTC offset component
var
year
=
Number
(
match
[
1
]),
month
=
Number
(
match
[
2
]
||
1
)
-
1
,
day
=
Number
(
match
[
3
]
||
1
)
-
1
,
hour
=
Number
(
match
[
4
]
||
0
),
minute
=
Number
(
match
[
5
]
||
0
),
second
=
Number
(
match
[
6
]
||
0
),
millisecond
=
Math
.
floor
(
Number
(
match
[
7
]
||
0
)
*
1000
),
// When time zone is missed, local offset should be used
// (ES 5.1 bug)
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
isLocalTime
=
Boolean
(
match
[
4
]
&&
!
match
[
8
]),
signOffset
=
match
[
9
]
===
"
-
"
?
1
:
-
1
,
hourOffset
=
Number
(
match
[
10
]
||
0
),
minuteOffset
=
Number
(
match
[
11
]
||
0
),
result
;
if
(
hour
<
(
minute
>
0
||
second
>
0
||
millisecond
>
0
?
24
:
25
)
&&
minute
<
60
&&
second
<
60
&&
millisecond
<
1000
&&
month
>
-
1
&&
month
<
12
&&
hourOffset
<
24
&&
minuteOffset
<
60
&&
// detect invalid offsets
day
>
-
1
&&
day
<
(
dayFromMonth
(
year
,
month
+
1
)
-
dayFromMonth
(
year
,
month
)
)
)
{
result
=
(
(
dayFromMonth
(
year
,
month
)
+
day
)
*
24
+
hour
+
hourOffset
*
signOffset
)
*
60
;
result
=
(
(
result
+
minute
+
minuteOffset
*
signOffset
)
*
60
+
second
)
*
1000
+
millisecond
;
if
(
isLocalTime
)
{
result
=
toUTC
(
result
);
}
if
(
-
8.64e15
<=
result
&&
result
<=
8.64e15
)
{
return
result
;
}
}
return
NaN
;
}
return
NativeDate
.
parse
.
apply
(
this
,
arguments
);
};
// parse the UTC offset component
var
minuteOffset
=
+
match
.
pop
(),
hourOffset
=
+
match
.
pop
(),
sign
=
match
.
pop
();
return
Date
;
})(
Date
);
}
// compute the explicit time zone offset if specified
var
offset
=
0
;
if
(
sign
)
{
// detect invalid offsets and return early
if
(
hourOffset
>
23
||
minuteOffset
>
59
)
{
return
NaN
;
// ES5 15.9.4.4
// http://es5.github.com/#x15.9.4.4
if
(
!
Date
.
now
)
{
Date
.
now
=
function
now
()
{
return
new
Date
().
getTime
();
};
}
//
// Number
// ======
//
// ES5.1 15.7.4.5
// http://es5.github.com/#x15.7.4.5
if
(
!
Number
.
prototype
.
toFixed
||
(
0.00008
).
toFixed
(
3
)
!==
'
0.000
'
||
(
0.9
).
toFixed
(
0
)
===
'
0
'
||
(
1.255
).
toFixed
(
2
)
!==
'
1.25
'
||
(
1000000000000000128
).
toFixed
(
0
)
!==
"
1000000000000000128
"
)
{
// Hide these variables and functions
(
function
()
{
var
base
,
size
,
data
,
i
;
base
=
1
e7
;
size
=
6
;
data
=
[
0
,
0
,
0
,
0
,
0
,
0
];
function
multiply
(
n
,
c
)
{
var
i
=
-
1
;
while
(
++
i
<
size
)
{
c
+=
n
*
data
[
i
];
data
[
i
]
=
c
%
base
;
c
=
Math
.
floor
(
c
/
base
);
}
}
// express the provided time zone offset in minutes. The offset is
// negative for time zones west of UTC; positive otherwise.
offset
=
(
hourOffset
*
60
+
minuteOffset
)
*
6
e4
*
(
sign
==
"
+
"
?
-
1
:
1
);
function
divide
(
n
)
{
var
i
=
size
,
c
=
0
;
while
(
--
i
>=
0
)
{
c
+=
data
[
i
];
data
[
i
]
=
Math
.
floor
(
c
/
n
);
c
=
(
c
%
n
)
*
base
;
}
}
// Date.UTC for years between 0 and 99 converts year to 1900 + year
// The Gregorian calendar has a 400-year cycle, so
// to Date.UTC(year + 400, .... ) - 12622780800000 == Date.UTC(year, ...),
// where 12622780800000 - number of milliseconds in Gregorian calendar 400 years
var
year
=
+
match
[
0
];
if
(
0
<=
year
&&
year
<=
99
)
{
match
[
0
]
=
year
+
400
;
return
NativeDate
.
UTC
.
apply
(
this
,
match
)
+
offset
-
12622780800000
;
function
toString
()
{
var
i
=
size
;
var
s
=
''
;
while
(
--
i
>=
0
)
{
if
(
s
!==
''
||
i
===
0
||
data
[
i
]
!==
0
)
{
var
t
=
String
(
data
[
i
]);
if
(
s
===
''
)
{
s
=
t
;
}
else
{
s
+=
'
0000000
'
.
slice
(
0
,
7
-
t
.
length
)
+
t
;
}
}
}
return
s
;
}
// compute a new UTC date value, accounting for the optional offset
return
NativeDate
.
UTC
.
apply
(
this
,
match
)
+
offset
;
function
pow
(
x
,
n
,
acc
)
{
return
(
n
===
0
?
acc
:
(
n
%
2
===
1
?
pow
(
x
,
n
-
1
,
acc
*
x
)
:
pow
(
x
*
x
,
n
/
2
,
acc
)))
;
}
return
NativeDate
.
parse
.
apply
(
this
,
arguments
);
};
return
Date
;
})(
Date
);
function
log
(
x
)
{
var
n
=
0
;
while
(
x
>=
4096
)
{
n
+=
12
;
x
/=
4096
;
}
while
(
x
>=
2
)
{
n
+=
1
;
x
/=
2
;
}
return
n
;
}
Number
.
prototype
.
toFixed
=
function
(
fractionDigits
)
{
var
f
,
x
,
s
,
m
,
e
,
z
,
j
,
k
;
// Test for NaN and round fractionDigits down
f
=
Number
(
fractionDigits
);
f
=
f
!==
f
?
0
:
Math
.
floor
(
f
);
if
(
f
<
0
||
f
>
20
)
{
throw
new
RangeError
(
"
Number.toFixed called with invalid number of decimals
"
);
}
x
=
Number
(
this
);
// Test for NaN
if
(
x
!==
x
)
{
return
"
NaN
"
;
}
// If it is too big or small, return the string value of the number
if
(
x
<=
-
1
e21
||
x
>=
1
e21
)
{
return
String
(
x
);
}
s
=
""
;
if
(
x
<
0
)
{
s
=
"
-
"
;
x
=
-
x
;
}
m
=
"
0
"
;
if
(
x
>
1
e
-
21
)
{
// 1e-21 < x < 1e21
// -70 < log2(x) < 70
e
=
log
(
x
*
pow
(
2
,
69
,
1
))
-
69
;
z
=
(
e
<
0
?
x
*
pow
(
2
,
-
e
,
1
)
:
x
/
pow
(
2
,
e
,
1
));
z
*=
0x10000000000000
;
// Math.pow(2, 52);
e
=
52
-
e
;
// -18 < e < 122
// x = z / 2 ^ e
if
(
e
>
0
)
{
multiply
(
0
,
z
);
j
=
f
;
while
(
j
>=
7
)
{
multiply
(
1
e7
,
0
);
j
-=
7
;
}
multiply
(
pow
(
10
,
j
,
1
),
0
);
j
=
e
-
1
;
while
(
j
>=
23
)
{
divide
(
1
<<
23
);
j
-=
23
;
}
divide
(
1
<<
j
);
multiply
(
1
,
1
);
divide
(
2
);
m
=
toString
();
}
else
{
multiply
(
0
,
z
);
multiply
(
1
<<
(
-
e
),
0
);
m
=
toString
()
+
'
0.00000000000000000000
'
.
slice
(
2
,
2
+
f
);
}
}
if
(
f
>
0
)
{
k
=
m
.
length
;
if
(
k
<=
f
)
{
m
=
s
+
'
0.0000000000000000000
'
.
slice
(
0
,
f
-
k
+
2
)
+
m
;
}
else
{
m
=
s
+
m
.
slice
(
0
,
k
-
f
)
+
'
.
'
+
m
.
slice
(
k
-
f
);
}
}
else
{
m
=
s
+
m
;
}
return
m
;
}
}());
}
//
// String
// ======
//
// ES5 15.5.4.14
// http://es5.github.com/#x15.5.4.14
// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
// Many browsers do not split properly with regular expressions or they
// do not perform the split correctly under obscure conditions.
// See http://blog.stevenlevithan.com/archives/cross-browser-split
// I've tested in many browsers and this seems to cover the deviant ones:
// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
// 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
// [undefined, "t", undefined, "e", ...]
// ''.split(/.?/) should be [], not [""]
// '.'.split(/()()/) should be ["."], not ["", "", "."]
var
string_split
=
String
.
prototype
.
split
;
if
(
'
ab
'
.
split
(
/
(?:
ab
)
*/
).
length
!==
2
||
'
.
'
.
split
(
/
(
.
?)(
.
?)
/
).
length
!==
4
||
'
tesst
'
.
split
(
/
(
s
)
*/
)[
1
]
===
"
t
"
||
''
.
split
(
/.
?
/
).
length
||
'
.
'
.
split
(
/
()()
/
).
length
>
1
)
{
(
function
()
{
var
compliantExecNpcg
=
/
()??
/
.
exec
(
""
)[
1
]
===
void
0
;
// NPCG: nonparticipating capturing group
String
.
prototype
.
split
=
function
(
separator
,
limit
)
{
var
string
=
this
;
if
(
separator
===
void
0
&&
limit
===
0
)
return
[];
// If `separator` is not a regex, use native split
if
(
Object
.
prototype
.
toString
.
call
(
separator
)
!==
"
[object RegExp]
"
)
{
return
string_split
.
apply
(
this
,
arguments
);
}
var
output
=
[],
flags
=
(
separator
.
ignoreCase
?
"
i
"
:
""
)
+
(
separator
.
multiline
?
"
m
"
:
""
)
+
(
separator
.
extended
?
"
x
"
:
""
)
+
// Proposed for ES6
(
separator
.
sticky
?
"
y
"
:
""
),
// Firefox 3+
lastLastIndex
=
0
,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator
=
new
RegExp
(
separator
.
source
,
flags
+
"
g
"
),
separator2
,
match
,
lastIndex
,
lastLength
;
string
+=
""
;
// Type-convert
if
(
!
compliantExecNpcg
)
{
// Doesn't need flags gy, but they don't hurt
separator2
=
new
RegExp
(
"
^
"
+
separator
.
source
+
"
$(?!
\\
s)
"
,
flags
);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // Math.pow(2, 32) - 1
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
limit
=
limit
===
void
0
?
-
1
>>>
0
:
// Math.pow(2, 32) - 1
limit
>>>
0
;
// ToUint32(limit)
while
(
match
=
separator
.
exec
(
string
))
{
// `separator.lastIndex` is not reliable cross-browser
lastIndex
=
match
.
index
+
match
[
0
].
length
;
if
(
lastIndex
>
lastLastIndex
)
{
output
.
push
(
string
.
slice
(
lastLastIndex
,
match
.
index
));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if
(
!
compliantExecNpcg
&&
match
.
length
>
1
)
{
match
[
0
].
replace
(
separator2
,
function
()
{
for
(
var
i
=
1
;
i
<
arguments
.
length
-
2
;
i
++
)
{
if
(
arguments
[
i
]
===
void
0
)
{
match
[
i
]
=
void
0
;
}
}
});
}
if
(
match
.
length
>
1
&&
match
.
index
<
string
.
length
)
{
Array
.
prototype
.
push
.
apply
(
output
,
match
.
slice
(
1
));
}
lastLength
=
match
[
0
].
length
;
lastLastIndex
=
lastIndex
;
if
(
output
.
length
>=
limit
)
{
break
;
}
}
if
(
separator
.
lastIndex
===
match
.
index
)
{
separator
.
lastIndex
++
;
// Avoid an infinite loop
}
}
if
(
lastLastIndex
===
string
.
length
)
{
if
(
lastLength
||
!
separator
.
test
(
""
))
{
output
.
push
(
""
);
}
}
else
{
output
.
push
(
string
.
slice
(
lastLastIndex
));
}
return
output
.
length
>
limit
?
output
.
slice
(
0
,
limit
)
:
output
;
};
}());
// [bugfix, chrome]
// If separator is undefined, then the result array contains just one String,
// which is the this value (converted to a String). If limit is not undefined,
// then the output array is truncated so that it contains no more than limit
// elements.
// "0".split(undefined, 0) -> []
}
else
if
(
"
0
"
.
split
(
void
0
,
0
).
length
)
{
String
.
prototype
.
split
=
function
(
separator
,
limit
)
{
if
(
separator
===
void
0
&&
limit
===
0
)
return
[];
return
string_split
.
apply
(
this
,
arguments
);
}
}
// ECMA-262, 3rd B.2.3
// Note an ECMAScript standart, although ECMAScript 3rd Edition has a
// non-normative section suggesting uniform semantics and it should be
// normalized across all browsers
// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
if
(
""
.
substr
&&
"
0b
"
.
substr
(
-
1
)
!==
"
b
"
)
{
var
string_substr
=
String
.
prototype
.
substr
;
/**
* Get the substring of a string
* @param {integer} start where to start the substring
* @param {integer} length how many characters to return
* @return {string}
*/
String
.
prototype
.
substr
=
function
(
start
,
length
)
{
return
string_substr
.
call
(
this
,
start
<
0
?
((
start
=
this
.
length
+
start
)
<
0
?
0
:
start
)
:
start
,
length
);
}
}
// ES5 15.5.4.20
// http://es5.github.com/#x15.5.4.20
var
ws
=
"
\
x09
\
x0A
\
x0B
\
x0C
\
x0D
\
x20
\
xA0
\
u1680
\
u180E
\
u2000
\
u2001
\
u2002
\
u2003
"
+
...
...
@@ -735,10 +1287,12 @@ if (!String.prototype.trim || ws.trim()) {
var
trimBeginRegexp
=
new
RegExp
(
"
^
"
+
ws
+
ws
+
"
*
"
),
trimEndRegexp
=
new
RegExp
(
ws
+
ws
+
"
*$
"
);
String
.
prototype
.
trim
=
function
trim
()
{
if
(
this
===
undefined
||
this
===
null
)
{
if
(
this
===
void
0
||
this
===
null
)
{
throw
new
TypeError
(
"
can't convert
"
+
this
+
"
to object
"
);
}
return
String
(
this
).
replace
(
trimBeginRegexp
,
""
).
replace
(
trimEndRegexp
,
""
);
return
String
(
this
)
.
replace
(
trimBeginRegexp
,
""
)
.
replace
(
trimEndRegexp
,
""
);
};
}
...
...
@@ -750,7 +1304,8 @@ if (!String.prototype.trim || ws.trim()) {
// ES5 9.4
// http://es5.github.com/#x9.4
// http://jsperf.com/to-integer
var
toInteger
=
function
(
n
)
{
function
toInteger
(
n
)
{
n
=
+
n
;
if
(
n
!==
n
)
{
// isNaN
n
=
0
;
...
...
@@ -758,20 +1313,47 @@ var toInteger = function (n) {
n
=
(
n
>
0
||
-
1
)
*
Math
.
floor
(
Math
.
abs
(
n
));
}
return
n
;
}
;
}
var
prepareString
=
"
a
"
[
0
]
!=
"
a
"
;
// ES5 9.9
// http://es5.github.com/#x9.9
function
isPrimitive
(
input
)
{
var
type
=
typeof
input
;
return
(
input
===
null
||
type
===
"
undefined
"
||
type
===
"
boolean
"
||
type
===
"
number
"
||
type
===
"
string
"
);
}
function
toPrimitive
(
input
)
{
var
val
,
valueOf
,
toString
;
if
(
isPrimitive
(
input
))
{
return
input
;
}
valueOf
=
input
.
valueOf
;
if
(
typeof
valueOf
===
"
function
"
)
{
val
=
valueOf
.
call
(
input
);
if
(
isPrimitive
(
val
))
{
return
val
;
}
}
toString
=
input
.
toString
;
if
(
typeof
toString
===
"
function
"
)
{
val
=
toString
.
call
(
input
);
if
(
isPrimitive
(
val
))
{
return
val
;
}
}
throw
new
TypeError
();
}
// ES5 9.9
// http://es5.github.com/#x9.9
var
toObject
=
function
(
o
)
{
if
(
o
==
null
)
{
// this matches both null and undefined
throw
new
TypeError
(
"
can't convert
"
+
o
+
"
to object
"
);
}
// If the implementation doesn't support by-index access of
// string characters (ex. IE < 9), split the string
if
(
prepareString
&&
typeof
o
==
"
string
"
&&
o
)
{
return
o
.
split
(
""
);
}
return
Object
(
o
);
};
...
...
examples/flight/node_modules/jquery/dist/jquery.js
View file @
038fc12d
/*!
* jQuery JavaScript Library v2.1.
0
* jQuery JavaScript Library v2.1.
3
* http://jquery.com/
*
* Includes Sizzle.js
...
...
@@ -9,19 +9,19 @@
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-
01-23T21:10
Z
* Date: 2014-
12-18T15:11
Z
*/
(
function
(
global
,
factory
)
{
if
(
typeof
module
===
"
object
"
&&
typeof
module
.
exports
===
"
object
"
)
{
// For CommonJS and CommonJS-like environments where a proper
window is present,
//
execute the factory and get jQuery
// For environments that do not
inherently posses a window with a document
// (such as Node.js), expose a
jQuery-making factory as module.exports
// This accentuates the need for the creation of a real
window
// For CommonJS and CommonJS-like environments where a proper
`window`
//
is present, execute the factory and get jQuery.
// For environments that do not
have a `window` with a `document`
// (such as Node.js), expose a
factory as module.exports.
// This accentuates the need for the creation of a real
`window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info
// See ticket #14549 for more info
.
module
.
exports
=
global
.
document
?
factory
(
global
,
true
)
:
function
(
w
)
{
...
...
@@ -37,10 +37,10 @@
// Pass this if window is not defined yet
}(
typeof
window
!==
"
undefined
"
?
window
:
this
,
function
(
window
,
noGlobal
)
{
// Can't do this because several apps including ASP.NET trace
// Support: Firefox 18+
// Can't be in strict mode, several libs including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
// Support: Firefox 18+
//
var
arr
=
[];
...
...
@@ -59,8 +59,6 @@ var toString = class2type.toString;
var
hasOwn
=
class2type
.
hasOwnProperty
;
var
trim
=
""
.
trim
;
var
support
=
{};
...
...
@@ -69,7 +67,7 @@ var
// Use the correct document accordingly with window argument (sandbox)
document
=
window
.
document
,
version
=
"
2.1.
0
"
,
version
=
"
2.1.
3
"
,
// Define a local copy of jQuery
jQuery
=
function
(
selector
,
context
)
{
...
...
@@ -78,6 +76,10 @@ var
return
new
jQuery
.
fn
.
init
(
selector
,
context
);
},
// Support: Android<4.1
// Make sure we trim BOM and NBSP
rtrim
=
/^
[\s\u
FEFF
\x
A0
]
+|
[\s\u
FEFF
\x
A0
]
+$/g
,
// Matches dashed string for camelizing
rmsPrefix
=
/^-ms-/
,
rdashAlpha
=
/-
([\d
a-z
])
/gi
,
...
...
@@ -108,10 +110,10 @@ jQuery.fn = jQuery.prototype = {
get
:
function
(
num
)
{
return
num
!=
null
?
// Return
a 'clean' array
// Return
just the one element from the set
(
num
<
0
?
this
[
num
+
this
.
length
]
:
this
[
num
]
)
:
// Return
just the object
// Return
all the elements in a clean array
slice
.
call
(
this
);
},
...
...
@@ -183,7 +185,7 @@ jQuery.extend = jQuery.fn.extend = function() {
if
(
typeof
target
===
"
boolean
"
)
{
deep
=
target
;
//
s
kip the boolean and the target
//
S
kip the boolean and the target
target
=
arguments
[
i
]
||
{};
i
++
;
}
...
...
@@ -193,7 +195,7 @@ jQuery.extend = jQuery.fn.extend = function() {
target
=
{};
}
//
e
xtend jQuery itself if only one argument is passed
//
E
xtend jQuery itself if only one argument is passed
if
(
i
===
length
)
{
target
=
this
;
i
--
;
...
...
@@ -250,9 +252,6 @@ jQuery.extend({
noop
:
function
()
{},
// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction
:
function
(
obj
)
{
return
jQuery
.
type
(
obj
)
===
"
function
"
;
},
...
...
@@ -267,7 +266,8 @@ jQuery.extend({
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
return
obj
-
parseFloat
(
obj
)
>=
0
;
// adding 1 corrects loss of precision from parseFloat (#15100)
return
!
jQuery
.
isArray
(
obj
)
&&
(
obj
-
parseFloat
(
obj
)
+
1
)
>=
0
;
},
isPlainObject
:
function
(
obj
)
{
...
...
@@ -279,18 +279,10 @@ jQuery.extend({
return
false
;
}
// Support: Firefox <20
// The try/catch suppresses exceptions thrown when attempting to access
// the "constructor" property of certain host objects, ie. |window.location|
// https://bugzilla.mozilla.org/show_bug.cgi?id=814622
try
{
if
(
obj
.
constructor
&&
!
hasOwn
.
call
(
obj
.
constructor
.
prototype
,
"
isPrototypeOf
"
)
)
{
return
false
;
}
}
catch
(
e
)
{
return
false
;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
...
...
@@ -309,7 +301,7 @@ jQuery.extend({
if
(
obj
==
null
)
{
return
obj
+
""
;
}
// Support: Android
< 4.0, iOS <
6 (functionish RegExp)
// Support: Android
<4.0, iOS<
6 (functionish RegExp)
return
typeof
obj
===
"
object
"
||
typeof
obj
===
"
function
"
?
class2type
[
toString
.
call
(
obj
)
]
||
"
object
"
:
typeof
obj
;
...
...
@@ -339,6 +331,7 @@ jQuery.extend({
},
// Convert dashed to camelCase; used by the css and data modules
// Support: IE9-11+
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase
:
function
(
string
)
{
return
string
.
replace
(
rmsPrefix
,
"
ms-
"
).
replace
(
rdashAlpha
,
fcamelCase
);
...
...
@@ -398,8 +391,11 @@ jQuery.extend({
return
obj
;
},
// Support: Android<4.1
trim
:
function
(
text
)
{
return
text
==
null
?
""
:
trim
.
call
(
text
);
return
text
==
null
?
""
:
(
text
+
""
).
replace
(
rtrim
,
""
);
},
// results is for internal usage only
...
...
@@ -551,14 +547,14 @@ function isArraylike( obj ) {
}
var
Sizzle
=
/*!
* Sizzle CSS Selector Engine v
1.10.16
* Sizzle CSS Selector Engine v
2.2.0-pre
* http://sizzlejs.com/
*
* Copyright 20
13
jQuery Foundation, Inc. and other contributors
* Copyright 20
08, 2014
jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-
01-13
* Date: 2014-
12-16
*/
(
function
(
window
)
{
...
...
@@ -567,7 +563,9 @@ var i,
Expr
,
getText
,
isXML
,
tokenize
,
compile
,
select
,
outermostContext
,
sortInput
,
hasDuplicate
,
...
...
@@ -583,7 +581,7 @@ var i,
contains
,
// Instance-specific data
expando
=
"
sizzle
"
+
-
(
new
Date
()
),
expando
=
"
sizzle
"
+
1
*
new
Date
(
),
preferredDoc
=
window
.
document
,
dirruns
=
0
,
done
=
0
,
...
...
@@ -598,7 +596,6 @@ var i,
},
// General-purpose constants
strundefined
=
typeof
undefined
,
MAX_NEGATIVE
=
1
<<
31
,
// Instance methods
...
...
@@ -608,12 +605,13 @@ var i,
push_native
=
arr
.
push
,
push
=
arr
.
push
,
slice
=
arr
.
slice
,
// Use a stripped-down indexOf if we can't use a native one
indexOf
=
arr
.
indexOf
||
function
(
elem
)
{
// Use a stripped-down indexOf as it's faster than native
// http://jsperf.com/thor-indexof-vs-for/5
indexOf
=
function
(
list
,
elem
)
{
var
i
=
0
,
len
=
this
.
length
;
len
=
list
.
length
;
for
(
;
i
<
len
;
i
++
)
{
if
(
this
[
i
]
===
elem
)
{
if
(
list
[
i
]
===
elem
)
{
return
i
;
}
}
...
...
@@ -634,19 +632,26 @@ var i,
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
identifier
=
characterEncoding
.
replace
(
"
w
"
,
"
w#
"
),
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
attributes
=
"
\\
[
"
+
whitespace
+
"
*(
"
+
characterEncoding
+
"
)
"
+
whitespace
+
"
*(?:([*^$|!~]?=)
"
+
whitespace
+
"
*(?:(['
\"
])((?:
\\\\
.|[^
\\\\
])*?)
\\
3|(
"
+
identifier
+
"
)|)|)
"
+
whitespace
+
"
*
\\
]
"
,
// Prefer arguments quoted,
// then not containing pseudos/brackets,
// then attribute selectors/non-parenthetical expressions,
// then anything else
// These preferences are here to reduce the number of selectors
// needing tokenize in the PSEUDO preFilter
pseudos
=
"
:(
"
+
characterEncoding
+
"
)(?:
\\
(((['
\"
])((?:
\\\\
.|[^
\\\\
])*?)
\\
3|((?:
\\\\
.|[^
\\\\
()[
\\
]]|
"
+
attributes
.
replace
(
3
,
8
)
+
"
)*)|.*)
\\
)|)
"
,
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
attributes
=
"
\\
[
"
+
whitespace
+
"
*(
"
+
characterEncoding
+
"
)(?:
"
+
whitespace
+
// Operator (capture 2)
"
*([*^$|!~]?=)
"
+
whitespace
+
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
"
*(?:'((?:
\\\\
.|[^
\\\\
'])*)'|
\"
((?:
\\\\
.|[^
\\\\\"
])*)
\"
|(
"
+
identifier
+
"
))|)
"
+
whitespace
+
"
*
\\
]
"
,
pseudos
=
"
:(
"
+
characterEncoding
+
"
)(?:
\\
((
"
+
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
// 1. quoted (capture 3; capture 4 or capture 5)
"
('((?:
\\\\
.|[^
\\\\
'])*)'|
\"
((?:
\\\\
.|[^
\\\\\"
])*)
\"
)|
"
+
// 2. simple (capture 6)
"
((?:
\\\\
.|[^
\\\\
()[
\\
]]|
"
+
attributes
+
"
)*)|
"
+
// 3. anything else (capture 2)
"
.*
"
+
"
)
\\
)|)
"
,
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rwhitespace
=
new
RegExp
(
whitespace
+
"
+
"
,
"
g
"
),
rtrim
=
new
RegExp
(
"
^
"
+
whitespace
+
"
+|((?:^|[^
\\\\
])(?:
\\\\
.)*)
"
+
whitespace
+
"
+$
"
,
"
g
"
),
rcomma
=
new
RegExp
(
"
^
"
+
whitespace
+
"
*,
"
+
whitespace
+
"
*
"
),
...
...
@@ -689,7 +694,7 @@ var i,
funescape
=
function
(
_
,
escaped
,
escapedWhitespace
)
{
var
high
=
"
0x
"
+
escaped
-
0x10000
;
// NaN means non-codepoint
// Support: Firefox
// Support: Firefox
<24
// Workaround erroneous numeric interpretation of +"0x"
return
high
!==
high
||
escapedWhitespace
?
escaped
:
...
...
@@ -698,6 +703,14 @@ var i,
String
.
fromCharCode
(
high
+
0x10000
)
:
// Supplemental Plane codepoint (surrogate pair)
String
.
fromCharCode
(
high
>>
10
|
0xD800
,
high
&
0x3FF
|
0xDC00
);
},
// Used for iframes
// See setDocument()
// Removing the function wrapper causes a "Permission Denied"
// error in IE
unloadHandler
=
function
()
{
setDocument
();
};
// Optimize for push.apply( _, NodeList )
...
...
@@ -740,19 +753,18 @@ function Sizzle( selector, context, results, seed ) {
context
=
context
||
document
;
results
=
results
||
[];
nodeType
=
context
.
nodeType
;
if
(
!
selector
||
typeof
selector
!==
"
string
"
)
{
return
results
;
}
if
(
typeof
selector
!==
"
string
"
||
!
selector
||
nodeType
!==
1
&&
nodeType
!==
9
&&
nodeType
!==
11
)
{
if
(
(
nodeType
=
context
.
nodeType
)
!==
1
&&
nodeType
!==
9
)
{
return
[];
return
results
;
}
if
(
documentIsHTML
&&
!
seed
)
{
if
(
!
seed
&&
documentIsHTML
)
{
//
Shortcuts
if
(
(
match
=
rquickExpr
.
exec
(
selector
))
)
{
//
Try to shortcut find operations when possible (e.g., not under DocumentFragment)
if
(
nodeType
!==
11
&&
(
match
=
rquickExpr
.
exec
(
selector
))
)
{
// Speed-up: Sizzle("#ID")
if
(
(
m
=
match
[
1
])
)
{
if
(
nodeType
===
9
)
{
...
...
@@ -784,7 +796,7 @@ function Sizzle( selector, context, results, seed ) {
return
results
;
// Speed-up: Sizzle(".CLASS")
}
else
if
(
(
m
=
match
[
3
])
&&
support
.
getElementsByClassName
&&
context
.
getElementsByClassName
)
{
}
else
if
(
(
m
=
match
[
3
])
&&
support
.
getElementsByClassName
)
{
push
.
apply
(
results
,
context
.
getElementsByClassName
(
m
)
);
return
results
;
}
...
...
@@ -794,7 +806,7 @@ function Sizzle( selector, context, results, seed ) {
if
(
support
.
qsa
&&
(
!
rbuggyQSA
||
!
rbuggyQSA
.
test
(
selector
))
)
{
nid
=
old
=
expando
;
newContext
=
context
;
newSelector
=
nodeType
===
9
&&
selector
;
newSelector
=
nodeType
!==
1
&&
selector
;
// qSA works strangely on Element-rooted queries
// We can work around this by specifying an extra ID on the root
...
...
@@ -981,7 +993,7 @@ function createPositionalPseudo( fn ) {
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
*/
function
testContext
(
context
)
{
return
context
&&
typeof
context
.
getElementsByTagName
!==
strundefined
&&
context
;
return
context
&&
typeof
context
.
getElementsByTagName
!==
"
undefined
"
&&
context
;
}
// Expose support vars for convenience
...
...
@@ -1005,9 +1017,8 @@ isXML = Sizzle.isXML = function( elem ) {
* @returns {Object} Returns the current document
*/
setDocument
=
Sizzle
.
setDocument
=
function
(
node
)
{
var
hasCompare
,
doc
=
node
?
node
.
ownerDocument
||
node
:
preferredDoc
,
parent
=
doc
.
defaultView
;
var
hasCompare
,
parent
,
doc
=
node
?
node
.
ownerDocument
||
node
:
preferredDoc
;
// If no document and documentElement is available, return
if
(
doc
===
document
||
doc
.
nodeType
!==
9
||
!
doc
.
documentElement
)
{
...
...
@@ -1017,9 +1028,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Set our document
document
=
doc
;
docElem
=
doc
.
documentElement
;
// Support tests
documentIsHTML
=
!
isXML
(
doc
);
parent
=
doc
.
defaultView
;
// Support: IE>8
// If iframe document is assigned to "document" variable and if iframe has been reloaded,
...
...
@@ -1028,21 +1037,22 @@ setDocument = Sizzle.setDocument = function( node ) {
if
(
parent
&&
parent
!==
parent
.
top
)
{
// IE11 does not have attachEvent, so all must suffer
if
(
parent
.
addEventListener
)
{
parent
.
addEventListener
(
"
unload
"
,
function
()
{
setDocument
();
},
false
);
parent
.
addEventListener
(
"
unload
"
,
unloadHandler
,
false
);
}
else
if
(
parent
.
attachEvent
)
{
parent
.
attachEvent
(
"
onunload
"
,
function
()
{
setDocument
();
});
parent
.
attachEvent
(
"
onunload
"
,
unloadHandler
);
}
}
/* Support tests
---------------------------------------------------------------------- */
documentIsHTML
=
!
isXML
(
doc
);
/* Attributes
---------------------------------------------------------------------- */
// Support: IE<8
// Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
// Verify that getAttribute really returns attributes and not properties
// (excepting IE8 booleans)
support
.
attributes
=
assert
(
function
(
div
)
{
div
.
className
=
"
i
"
;
return
!
div
.
getAttribute
(
"
className
"
);
...
...
@@ -1057,17 +1067,8 @@ setDocument = Sizzle.setDocument = function( node ) {
return
!
div
.
getElementsByTagName
(
"
*
"
).
length
;
});
// Check if getElementsByClassName can be trusted
support
.
getElementsByClassName
=
rnative
.
test
(
doc
.
getElementsByClassName
)
&&
assert
(
function
(
div
)
{
div
.
innerHTML
=
"
<div class='a'></div><div class='a i'></div>
"
;
// Support: Safari<4
// Catch class over-caching
div
.
firstChild
.
className
=
"
i
"
;
// Support: Opera<10
// Catch gEBCN failure to find non-leading classes
return
div
.
getElementsByClassName
(
"
i
"
).
length
===
2
;
});
// Support: IE<9
support
.
getElementsByClassName
=
rnative
.
test
(
doc
.
getElementsByClassName
);
// Support: IE<10
// Check if getElementById returns elements by name
...
...
@@ -1081,11 +1082,11 @@ setDocument = Sizzle.setDocument = function( node ) {
// ID find and filter
if
(
support
.
getById
)
{
Expr
.
find
[
"
ID
"
]
=
function
(
id
,
context
)
{
if
(
typeof
context
.
getElementById
!==
strundefined
&&
documentIsHTML
)
{
if
(
typeof
context
.
getElementById
!==
"
undefined
"
&&
documentIsHTML
)
{
var
m
=
context
.
getElementById
(
id
);
// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
return
m
&&
m
.
parentNode
?
[
m
]
:
[];
return
m
&&
m
.
parentNode
?
[
m
]
:
[];
}
};
Expr
.
filter
[
"
ID
"
]
=
function
(
id
)
{
...
...
@@ -1102,7 +1103,7 @@ setDocument = Sizzle.setDocument = function( node ) {
Expr
.
filter
[
"
ID
"
]
=
function
(
id
)
{
var
attrId
=
id
.
replace
(
runescape
,
funescape
);
return
function
(
elem
)
{
var
node
=
typeof
elem
.
getAttributeNode
!==
strundefined
&&
elem
.
getAttributeNode
(
"
id
"
);
var
node
=
typeof
elem
.
getAttributeNode
!==
"
undefined
"
&&
elem
.
getAttributeNode
(
"
id
"
);
return
node
&&
node
.
value
===
attrId
;
};
};
...
...
@@ -1111,14 +1112,20 @@ setDocument = Sizzle.setDocument = function( node ) {
// Tag
Expr
.
find
[
"
TAG
"
]
=
support
.
getElementsByTagName
?
function
(
tag
,
context
)
{
if
(
typeof
context
.
getElementsByTagName
!==
strundefined
)
{
if
(
typeof
context
.
getElementsByTagName
!==
"
undefined
"
)
{
return
context
.
getElementsByTagName
(
tag
);
// DocumentFragment nodes don't have gEBTN
}
else
if
(
support
.
qsa
)
{
return
context
.
querySelectorAll
(
tag
);
}
}
:
function
(
tag
,
context
)
{
var
elem
,
tmp
=
[],
i
=
0
,
// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
results
=
context
.
getElementsByTagName
(
tag
);
// Filter out possible comments
...
...
@@ -1136,7 +1143,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Class
Expr
.
find
[
"
CLASS
"
]
=
support
.
getElementsByClassName
&&
function
(
className
,
context
)
{
if
(
typeof
context
.
getElementsByClassName
!==
strundefined
&&
documentIsHTML
)
{
if
(
documentIsHTML
)
{
return
context
.
getElementsByClassName
(
className
);
}
};
...
...
@@ -1165,11 +1172,15 @@ setDocument = Sizzle.setDocument = function( node ) {
// setting a boolean content attribute,
// since its presence should be enough
// http://bugs.jquery.com/ticket/12359
div
.
innerHTML
=
"
<select t=''><option selected=''></option></select>
"
;
docElem
.
appendChild
(
div
).
innerHTML
=
"
<a id='
"
+
expando
+
"
'></a>
"
+
"
<select id='
"
+
expando
+
"
-
\
f]' msallowcapture=''>
"
+
"
<option selected=''></option></select>
"
;
// Support: IE8, Opera 1
0-12
// Support: IE8, Opera 1
1-12.16
// Nothing should be selected when empty strings follow ^= or $= or *=
if
(
div
.
querySelectorAll
(
"
[t^='']
"
).
length
)
{
// The test attribute must be unknown in Opera but "safe" for WinRT
// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
if
(
div
.
querySelectorAll
(
"
[msallowcapture^='']
"
).
length
)
{
rbuggyQSA
.
push
(
"
[*^$]=
"
+
whitespace
+
"
*(?:''|
\"\"
)
"
);
}
...
...
@@ -1179,12 +1190,24 @@ setDocument = Sizzle.setDocument = function( node ) {
rbuggyQSA
.
push
(
"
\\
[
"
+
whitespace
+
"
*(?:value|
"
+
booleans
+
"
)
"
);
}
// Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
if
(
!
div
.
querySelectorAll
(
"
[id~=
"
+
expando
+
"
-]
"
).
length
)
{
rbuggyQSA
.
push
(
"
~=
"
);
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if
(
!
div
.
querySelectorAll
(
"
:checked
"
).
length
)
{
rbuggyQSA
.
push
(
"
:checked
"
);
}
// Support: Safari 8+, iOS 8+
// https://bugs.webkit.org/show_bug.cgi?id=136851
// In-page `selector#id sibing-combinator selector` fails
if
(
!
div
.
querySelectorAll
(
"
a#
"
+
expando
+
"
+*
"
).
length
)
{
rbuggyQSA
.
push
(
"
.#.+[+~]
"
);
}
});
assert
(
function
(
div
)
{
...
...
@@ -1212,7 +1235,8 @@ setDocument = Sizzle.setDocument = function( node ) {
});
}
if
(
(
support
.
matchesSelector
=
rnative
.
test
(
(
matches
=
docElem
.
webkitMatchesSelector
||
if
(
(
support
.
matchesSelector
=
rnative
.
test
(
(
matches
=
docElem
.
matches
||
docElem
.
webkitMatchesSelector
||
docElem
.
mozMatchesSelector
||
docElem
.
oMatchesSelector
||
docElem
.
msMatchesSelector
)
))
)
{
...
...
@@ -1300,7 +1324,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Maintain original order
return
sortInput
?
(
indexOf
.
call
(
sortInput
,
a
)
-
indexOf
.
call
(
sortInput
,
b
)
)
:
(
indexOf
(
sortInput
,
a
)
-
indexOf
(
sortInput
,
b
)
)
:
0
;
}
...
...
@@ -1327,7 +1351,7 @@ setDocument = Sizzle.setDocument = function( node ) {
aup
?
-
1
:
bup
?
1
:
sortInput
?
(
indexOf
.
call
(
sortInput
,
a
)
-
indexOf
.
call
(
sortInput
,
b
)
)
:
(
indexOf
(
sortInput
,
a
)
-
indexOf
(
sortInput
,
b
)
)
:
0
;
// If the nodes are siblings, we can do a quick check
...
...
@@ -1390,10 +1414,10 @@ Sizzle.matchesSelector = function( elem, expr ) {
elem
.
document
&&
elem
.
document
.
nodeType
!==
11
)
{
return
ret
;
}
}
catch
(
e
)
{}
}
catch
(
e
)
{}
}
return
Sizzle
(
expr
,
document
,
null
,
[
elem
]
).
length
>
0
;
return
Sizzle
(
expr
,
document
,
null
,
[
elem
]
).
length
>
0
;
};
Sizzle
.
contains
=
function
(
context
,
elem
)
{
...
...
@@ -1522,7 +1546,7 @@ Expr = Sizzle.selectors = {
match
[
1
]
=
match
[
1
].
replace
(
runescape
,
funescape
);
// Move the given value to match[3] whether quoted or unquoted
match
[
3
]
=
(
match
[
4
]
||
match
[
5
]
||
""
).
replace
(
runescape
,
funescape
);
match
[
3
]
=
(
match
[
3
]
||
match
[
4
]
||
match
[
5
]
||
""
).
replace
(
runescape
,
funescape
);
if
(
match
[
2
]
===
"
~=
"
)
{
match
[
3
]
=
"
"
+
match
[
3
]
+
"
"
;
...
...
@@ -1565,15 +1589,15 @@ Expr = Sizzle.selectors = {
"
PSEUDO
"
:
function
(
match
)
{
var
excess
,
unquoted
=
!
match
[
5
]
&&
match
[
2
];
unquoted
=
!
match
[
6
]
&&
match
[
2
];
if
(
matchExpr
[
"
CHILD
"
].
test
(
match
[
0
]
)
)
{
return
null
;
}
// Accept quoted arguments as-is
if
(
match
[
3
]
&&
match
[
4
]
!==
undefined
)
{
match
[
2
]
=
match
[
4
];
if
(
match
[
3
]
)
{
match
[
2
]
=
match
[
4
]
||
match
[
5
]
||
""
;
// Strip excess characters from unquoted arguments
}
else
if
(
unquoted
&&
rpseudo
.
test
(
unquoted
)
&&
...
...
@@ -1609,7 +1633,7 @@ Expr = Sizzle.selectors = {
return
pattern
||
(
pattern
=
new
RegExp
(
"
(^|
"
+
whitespace
+
"
)
"
+
className
+
"
(
"
+
whitespace
+
"
|$)
"
))
&&
classCache
(
className
,
function
(
elem
)
{
return
pattern
.
test
(
typeof
elem
.
className
===
"
string
"
&&
elem
.
className
||
typeof
elem
.
getAttribute
!==
strundefined
&&
elem
.
getAttribute
(
"
class
"
)
||
""
);
return
pattern
.
test
(
typeof
elem
.
className
===
"
string
"
&&
elem
.
className
||
typeof
elem
.
getAttribute
!==
"
undefined
"
&&
elem
.
getAttribute
(
"
class
"
)
||
""
);
});
},
...
...
@@ -1631,7 +1655,7 @@ Expr = Sizzle.selectors = {
operator
===
"
^=
"
?
check
&&
result
.
indexOf
(
check
)
===
0
:
operator
===
"
*=
"
?
check
&&
result
.
indexOf
(
check
)
>
-
1
:
operator
===
"
$=
"
?
check
&&
result
.
slice
(
-
check
.
length
)
===
check
:
operator
===
"
~=
"
?
(
"
"
+
result
+
"
"
).
indexOf
(
check
)
>
-
1
:
operator
===
"
~=
"
?
(
"
"
+
result
.
replace
(
rwhitespace
,
"
"
)
+
"
"
).
indexOf
(
check
)
>
-
1
:
operator
===
"
|=
"
?
result
===
check
||
result
.
slice
(
0
,
check
.
length
+
1
)
===
check
+
"
-
"
:
false
;
};
...
...
@@ -1751,7 +1775,7 @@ Expr = Sizzle.selectors = {
matched
=
fn
(
seed
,
argument
),
i
=
matched
.
length
;
while
(
i
--
)
{
idx
=
indexOf
.
call
(
seed
,
matched
[
i
]
);
idx
=
indexOf
(
seed
,
matched
[
i
]
);
seed
[
idx
]
=
!
(
matches
[
idx
]
=
matched
[
i
]
);
}
})
:
...
...
@@ -1790,6 +1814,8 @@ Expr = Sizzle.selectors = {
function
(
elem
,
context
,
xml
)
{
input
[
0
]
=
elem
;
matcher
(
input
,
null
,
xml
,
results
);
// Don't keep the element (issue #299)
input
[
0
]
=
null
;
return
!
results
.
pop
();
};
}),
...
...
@@ -1801,6 +1827,7 @@ Expr = Sizzle.selectors = {
}),
"
contains
"
:
markFunction
(
function
(
text
)
{
text
=
text
.
replace
(
runescape
,
funescape
);
return
function
(
elem
)
{
return
(
elem
.
textContent
||
elem
.
innerText
||
getText
(
elem
)
).
indexOf
(
text
)
>
-
1
;
};
...
...
@@ -1978,7 +2005,7 @@ function setFilters() {}
setFilters
.
prototype
=
Expr
.
filters
=
Expr
.
pseudos
;
Expr
.
setFilters
=
new
setFilters
();
function
tokenize
(
selector
,
parseOnly
)
{
tokenize
=
Sizzle
.
tokenize
=
function
(
selector
,
parseOnly
)
{
var
matched
,
match
,
tokens
,
type
,
soFar
,
groups
,
preFilters
,
cached
=
tokenCache
[
selector
+
"
"
];
...
...
@@ -2043,7 +2070,7 @@ function tokenize( selector, parseOnly ) {
Sizzle
.
error
(
selector
)
:
// Cache the tokens
tokenCache
(
selector
,
groups
).
slice
(
0
);
}
}
;
function
toSelector
(
tokens
)
{
var
i
=
0
,
...
...
@@ -2122,6 +2149,15 @@ function elementMatcher( matchers ) {
matchers
[
0
];
}
function
multipleContexts
(
selector
,
contexts
,
results
)
{
var
i
=
0
,
len
=
contexts
.
length
;
for
(
;
i
<
len
;
i
++
)
{
Sizzle
(
selector
,
contexts
[
i
],
results
);
}
return
results
;
}
function
condense
(
unmatched
,
map
,
filter
,
context
,
xml
)
{
var
elem
,
newUnmatched
=
[],
...
...
@@ -2213,7 +2249,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
i
=
matcherOut
.
length
;
while
(
i
--
)
{
if
(
(
elem
=
matcherOut
[
i
])
&&
(
temp
=
postFinder
?
indexOf
.
call
(
seed
,
elem
)
:
preMap
[
i
])
>
-
1
)
{
(
temp
=
postFinder
?
indexOf
(
seed
,
elem
)
:
preMap
[
i
])
>
-
1
)
{
seed
[
temp
]
=
!
(
results
[
temp
]
=
elem
);
}
...
...
@@ -2248,13 +2284,16 @@ function matcherFromTokens( tokens ) {
return
elem
===
checkContext
;
},
implicitRelative
,
true
),
matchAnyContext
=
addCombinator
(
function
(
elem
)
{
return
indexOf
.
call
(
checkContext
,
elem
)
>
-
1
;
return
indexOf
(
checkContext
,
elem
)
>
-
1
;
},
implicitRelative
,
true
),
matchers
=
[
function
(
elem
,
context
,
xml
)
{
return
(
!
leadingRelative
&&
(
xml
||
context
!==
outermostContext
)
)
||
(
var
ret
=
(
!
leadingRelative
&&
(
xml
||
context
!==
outermostContext
)
)
||
(
(
checkContext
=
context
).
nodeType
?
matchContext
(
elem
,
context
,
xml
)
:
matchAnyContext
(
elem
,
context
,
xml
)
);
// Avoid hanging onto element (issue #299)
checkContext
=
null
;
return
ret
;
}
];
for
(
;
i
<
len
;
i
++
)
{
...
...
@@ -2390,7 +2429,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
superMatcher
;
}
compile
=
Sizzle
.
compile
=
function
(
selector
,
group
/* Internal Use Only */
)
{
compile
=
Sizzle
.
compile
=
function
(
selector
,
match
/* Internal Use Only */
)
{
var
i
,
setMatchers
=
[],
elementMatchers
=
[],
...
...
@@ -2398,12 +2437,12 @@ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
if
(
!
cached
)
{
// Generate a function of recursive functions that can be used to check each element
if
(
!
group
)
{
group
=
tokenize
(
selector
);
if
(
!
match
)
{
match
=
tokenize
(
selector
);
}
i
=
group
.
length
;
i
=
match
.
length
;
while
(
i
--
)
{
cached
=
matcherFromTokens
(
group
[
i
]
);
cached
=
matcherFromTokens
(
match
[
i
]
);
if
(
cached
[
expando
]
)
{
setMatchers
.
push
(
cached
);
}
else
{
...
...
@@ -2413,25 +2452,30 @@ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
// Cache the compiled function
cached
=
compilerCache
(
selector
,
matcherFromGroupMatchers
(
elementMatchers
,
setMatchers
)
);
// Save selector and tokenization
cached
.
selector
=
selector
;
}
return
cached
;
};
function
multipleContexts
(
selector
,
contexts
,
results
)
{
var
i
=
0
,
len
=
contexts
.
length
;
for
(
;
i
<
len
;
i
++
)
{
Sizzle
(
selector
,
contexts
[
i
],
results
);
}
return
results
;
}
function
select
(
selector
,
context
,
results
,
seed
)
{
/**
* A low-level selection function that works with Sizzle's compiled
* selector functions
* @param {String|Function} selector A selector or a pre-compiled
* selector function built with Sizzle.compile
* @param {Element} context
* @param {Array} [results]
* @param {Array} [seed] A set of elements to match against
*/
select
=
Sizzle
.
select
=
function
(
selector
,
context
,
results
,
seed
)
{
var
i
,
tokens
,
token
,
type
,
find
,
match
=
tokenize
(
selector
);
compiled
=
typeof
selector
===
"
function
"
&&
selector
,
match
=
!
seed
&&
tokenize
(
(
selector
=
compiled
.
selector
||
selector
)
);
results
=
results
||
[];
if
(
!
seed
)
{
// Try to minimize operations if there is only one group
// Try to minimize operations if there is no seed and only one group
if
(
match
.
length
===
1
)
{
// Take a shortcut and set the context if the root selector is an ID
...
...
@@ -2443,7 +2487,12 @@ function select( selector, context, results, seed ) {
context
=
(
Expr
.
find
[
"
ID
"
](
token
.
matches
[
0
].
replace
(
runescape
,
funescape
),
context
)
||
[]
)[
0
];
if
(
!
context
)
{
return
results
;
// Precompiled matchers will still verify ancestry, so step up a level
}
else
if
(
compiled
)
{
context
=
context
.
parentNode
;
}
selector
=
selector
.
slice
(
tokens
.
shift
().
value
.
length
);
}
...
...
@@ -2476,11 +2525,10 @@ function select( selector, context, results, seed ) {
}
}
}
}
// Compile and execute a filtering function
// Compile and execute a filtering function
if one is not provided
// Provide `match` to avoid retokenization if we modified the selector above
compile
(
selector
,
match
)(
(
compiled
||
compile
(
selector
,
match
)
)(
seed
,
context
,
!
documentIsHTML
,
...
...
@@ -2488,14 +2536,14 @@ function select( selector, context, results, seed ) {
rsibling
.
test
(
selector
)
&&
testContext
(
context
.
parentNode
)
||
context
);
return
results
;
}
}
;
// One-time assignments
// Sort stability
support
.
sortStable
=
expando
.
split
(
""
).
sort
(
sortOrder
).
join
(
""
)
===
expando
;
// Support: Chrome
<14
// Support: Chrome
14-35+
// Always assume duplicates if they aren't passed to the comparison function
support
.
detectDuplicates
=
!!
hasDuplicate
;
...
...
@@ -2704,7 +2752,7 @@ var rootjQuery,
if
(
match
[
1
]
)
{
context
=
context
instanceof
jQuery
?
context
[
0
]
:
context
;
// scripts is true for back-compat
//
Option to run
scripts is true for back-compat
// Intentionally let the error be thrown if parseHTML is not present
jQuery
.
merge
(
this
,
jQuery
.
parseHTML
(
match
[
1
],
...
...
@@ -2732,8 +2780,8 @@ var rootjQuery,
}
else
{
elem
=
document
.
getElementById
(
match
[
2
]
);
//
Check parentNode to catch when Blackberry 4.6 returns
//
nodes that are no longer in the document #6963
//
Support: Blackberry 4.6
//
gEBID returns nodes no longer in the document (#6963)
if
(
elem
&&
elem
.
parentNode
)
{
// Inject the element directly into the jQuery object
this
.
length
=
1
;
...
...
@@ -2786,7 +2834,7 @@ rootjQuery = jQuery( document );
var
rparentsprev
=
/^
(?:
parents|prev
(?:
Until|All
))
/
,
//
m
ethods guaranteed to produce a unique set when starting from a unique set
//
M
ethods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique
=
{
children
:
true
,
contents
:
true
,
...
...
@@ -2866,8 +2914,7 @@ jQuery.fn.extend({
return
this
.
pushStack
(
matched
.
length
>
1
?
jQuery
.
unique
(
matched
)
:
matched
);
},
// Determine the position of an element within
// the matched set of elements
// Determine the position of an element within the set
index
:
function
(
elem
)
{
// No argument, return index in parent
...
...
@@ -2875,7 +2922,7 @@ jQuery.fn.extend({
return
(
this
[
0
]
&&
this
[
0
].
parentNode
)
?
this
.
first
().
prevAll
().
length
:
-
1
;
}
//
i
ndex in selector
//
I
ndex in selector
if
(
typeof
elem
===
"
string
"
)
{
return
indexOf
.
call
(
jQuery
(
elem
),
this
[
0
]
);
}
...
...
@@ -3291,7 +3338,7 @@ jQuery.extend({
progressValues
,
progressContexts
,
resolveContexts
;
//
a
dd listeners to Deferred subordinates; treat others as resolved
//
A
dd listeners to Deferred subordinates; treat others as resolved
if
(
length
>
1
)
{
progressValues
=
new
Array
(
length
);
progressContexts
=
new
Array
(
length
);
...
...
@@ -3308,7 +3355,7 @@ jQuery.extend({
}
}
//
i
f we're not waiting on anything, resolve the master
//
I
f we're not waiting on anything, resolve the master
if
(
!
remaining
)
{
deferred
.
resolveWith
(
resolveContexts
,
resolveValues
);
}
...
...
@@ -3365,8 +3412,9 @@ jQuery.extend({
readyList
.
resolveWith
(
document
,
[
jQuery
]
);
// Trigger any bound ready events
if
(
jQuery
.
fn
.
trigger
)
{
jQuery
(
document
).
trigger
(
"
ready
"
).
off
(
"
ready
"
);
if
(
jQuery
.
fn
.
triggerHandler
)
{
jQuery
(
document
).
triggerHandler
(
"
ready
"
);
jQuery
(
document
).
off
(
"
ready
"
);
}
}
});
...
...
@@ -3386,7 +3434,7 @@ jQuery.ready.promise = function( obj ) {
readyList
=
jQuery
.
Deferred
();
// Catch cases where $(document).ready() is called after the browser event has already occurred.
//
w
e once tried to use readyState "interactive" here, but it caused issues like the one
//
W
e once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if
(
document
.
readyState
===
"
complete
"
)
{
// Handle it asynchronously to allow scripts the opportunity to delay ready
...
...
@@ -3480,7 +3528,7 @@ jQuery.acceptData = function( owner ) {
function
Data
()
{
// Support: Android
<
4,
// Support: Android
<
4,
// Old WebKit does not have Object.preventExtensions/freeze method,
// return new empty object instead with no [[set]] accessor
Object
.
defineProperty
(
this
.
cache
=
{},
0
,
{
...
...
@@ -3489,7 +3537,7 @@ function Data() {
}
});
this
.
expando
=
jQuery
.
expando
+
Math
.
random
()
;
this
.
expando
=
jQuery
.
expando
+
Data
.
uid
++
;
}
Data
.
uid
=
1
;
...
...
@@ -3517,7 +3565,7 @@ Data.prototype = {
descriptor
[
this
.
expando
]
=
{
value
:
unlock
};
Object
.
defineProperties
(
owner
,
descriptor
);
// Support: Android
<
4
// Support: Android
<
4
// Fallback to a less secure definition
}
catch
(
e
)
{
descriptor
[
this
.
expando
]
=
unlock
;
...
...
@@ -3657,17 +3705,16 @@ var data_user = new Data();
/*
Implementation Summary
1. Enforce API surface and semantic compatibility with 1.9.x branch
2. Improve the module's maintainability by reducing the storage
paths to a single mechanism.
3. Use the same single mechanism to support "private" and "user" data.
4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
5. Avoid exposing implementation details on user objects (eg. expando properties)
6. Provide a clear path for implementation upgrade to WeakMap in 2014
*/
// Implementation Summary
//
// 1. Enforce API surface and semantic compatibility with 1.9.x branch
// 2. Improve the module's maintainability by reducing the storage
// paths to a single mechanism.
// 3. Use the same single mechanism to support "private" and "user" data.
// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
// 5. Avoid exposing implementation details on user objects (eg. expando properties)
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
var
rbrace
=
/^
(?:\{[\w\W]
*
\}
|
\[[\w\W]
*
\])
$/
,
rmultiDash
=
/
([
A-Z
])
/g
;
...
...
@@ -3738,13 +3785,17 @@ jQuery.fn.extend({
if
(
elem
.
nodeType
===
1
&&
!
data_priv
.
get
(
elem
,
"
hasDataAttrs
"
)
)
{
i
=
attrs
.
length
;
while
(
i
--
)
{
name
=
attrs
[
i
].
name
;
// Support: IE11+
// The attrs elements can be null (#14894)
if
(
attrs
[
i
]
)
{
name
=
attrs
[
i
].
name
;
if
(
name
.
indexOf
(
"
data-
"
)
===
0
)
{
name
=
jQuery
.
camelCase
(
name
.
slice
(
5
)
);
dataAttr
(
elem
,
name
,
data
[
name
]
);
}
}
}
data_priv
.
set
(
elem
,
"
hasDataAttrs
"
,
true
);
}
}
...
...
@@ -3868,7 +3919,7 @@ jQuery.extend({
queue
.
unshift
(
"
inprogress
"
);
}
//
c
lear up the last queue stop function
//
C
lear up the last queue stop function
delete
hooks
.
stop
;
fn
.
call
(
elem
,
next
,
hooks
);
}
...
...
@@ -3878,7 +3929,7 @@ jQuery.extend({
}
},
//
not intended for public consumption - generates a queueHooks object, or returns
the current one
//
Not public - generate a queueHooks object, or return
the current one
_queueHooks
:
function
(
elem
,
type
)
{
var
key
=
type
+
"
queueHooks
"
;
return
data_priv
.
get
(
elem
,
key
)
||
data_priv
.
access
(
elem
,
key
,
{
...
...
@@ -3908,7 +3959,7 @@ jQuery.fn.extend({
this
.
each
(
function
()
{
var
queue
=
jQuery
.
queue
(
this
,
type
,
data
);
//
e
nsure a hooks for this queue
//
E
nsure a hooks for this queue
jQuery
.
_queueHooks
(
this
,
type
);
if
(
type
===
"
fx
"
&&
queue
[
0
]
!==
"
inprogress
"
)
{
...
...
@@ -3972,17 +4023,25 @@ var rcheckableType = (/^(?:checkbox|radio)$/i);
(
function
()
{
var
fragment
=
document
.
createDocumentFragment
(),
div
=
fragment
.
appendChild
(
document
.
createElement
(
"
div
"
)
);
div
=
fragment
.
appendChild
(
document
.
createElement
(
"
div
"
)
),
input
=
document
.
createElement
(
"
input
"
);
// #11217 - WebKit loses check when the name is after the checked attribute
div
.
innerHTML
=
"
<input type='radio' checked='checked' name='t'/>
"
;
// Support: Safari<=5.1
// Check state lost if the name is set (#11217)
// Support: Windows Web Apps (WWA)
// `name` and `type` must use .setAttribute for WWA (#14901)
input
.
setAttribute
(
"
type
"
,
"
radio
"
);
input
.
setAttribute
(
"
checked
"
,
"
checked
"
);
input
.
setAttribute
(
"
name
"
,
"
t
"
);
// Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
// old WebKit doesn't clone checked state correctly in fragments
div
.
appendChild
(
input
);
// Support: Safari<=5.1, Android<4.2
// Older WebKit doesn't clone checked state correctly in fragments
support
.
checkClone
=
div
.
cloneNode
(
true
).
cloneNode
(
true
).
lastChild
.
checked
;
// Support: IE<=11+
// Make sure textarea (and checkbox) defaultValue is properly cloned
// Support: IE9-IE11+
div
.
innerHTML
=
"
<textarea>x</textarea>
"
;
support
.
noCloneChecked
=
!!
div
.
cloneNode
(
true
).
lastChild
.
defaultValue
;
})();
...
...
@@ -3995,7 +4054,7 @@ support.focusinBubbles = "onfocusin" in window;
var
rkeyEvent
=
/^key/
,
rmouseEvent
=
/^
(?:
mouse|contextmenu
)
|click/
,
rmouseEvent
=
/^
(?:
mouse|
pointer|
contextmenu
)
|click/
,
rfocusMorph
=
/^
(?:
focusinfocus|focusoutblur
)
$/
,
rtypenamespace
=
/^
([^
.
]
*
)(?:\.(
.+
)
|
)
$/
;
...
...
@@ -4360,8 +4419,8 @@ jQuery.event = {
j
=
0
;
while
(
(
handleObj
=
matched
.
handlers
[
j
++
])
&&
!
event
.
isImmediatePropagationStopped
()
)
{
// Triggered event must either 1) have no namespace, or
//
2) have namespace(s)
a subset or equal to those in the bound event (both can have no namespace).
// Triggered event must either 1) have no namespace, or
2) have namespace(s)
// a subset or equal to those in the bound event (both can have no namespace).
if
(
!
event
.
namespace_re
||
event
.
namespace_re
.
test
(
handleObj
.
namespace
)
)
{
event
.
handleObj
=
handleObj
;
...
...
@@ -4511,7 +4570,7 @@ jQuery.event = {
event
.
target
=
document
;
}
// Support: Safari 6.0+, Chrome
<
28
// Support: Safari 6.0+, Chrome
<
28
// Target should not be a text node (#504, #13143)
if
(
event
.
target
.
nodeType
===
3
)
{
event
.
target
=
event
.
target
.
parentNode
;
...
...
@@ -4564,7 +4623,7 @@ jQuery.event = {
// Support: Firefox 20+
// Firefox doesn't alert if the returnValue field is not set.
if
(
event
.
result
!==
undefined
)
{
if
(
event
.
result
!==
undefined
&&
event
.
originalEvent
)
{
event
.
originalEvent
.
returnValue
=
event
.
result
;
}
}
...
...
@@ -4615,9 +4674,9 @@ jQuery.Event = function( src, props ) {
// Events bubbling up the document may have been marked as prevented
// by a handler lower down the tree; reflect the correct value.
this
.
isDefaultPrevented
=
src
.
defaultPrevented
||
// Support: Android < 4.0
src
.
defaultPrevented
===
undefined
&&
src
.
getPreventDefault
&&
src
.
getPreventDefault
()
?
// Support: Android<4.0
src
.
returnValue
===
false
?
returnTrue
:
returnFalse
;
...
...
@@ -4664,7 +4723,14 @@ jQuery.Event.prototype = {
}
},
stopImmediatePropagation
:
function
()
{
var
e
=
this
.
originalEvent
;
this
.
isImmediatePropagationStopped
=
returnTrue
;
if
(
e
&&
e
.
stopImmediatePropagation
)
{
e
.
stopImmediatePropagation
();
}
this
.
stopPropagation
();
}
};
...
...
@@ -4673,7 +4739,9 @@ jQuery.Event.prototype = {
// Support: Chrome 15+
jQuery
.
each
({
mouseenter
:
"
mouseover
"
,
mouseleave
:
"
mouseout
"
mouseleave
:
"
mouseout
"
,
pointerenter
:
"
pointerover
"
,
pointerleave
:
"
pointerout
"
},
function
(
orig
,
fix
)
{
jQuery
.
event
.
special
[
orig
]
=
{
delegateType
:
fix
,
...
...
@@ -4697,8 +4765,8 @@ jQuery.each({
};
});
// Create "bubbling" focus and blur events
// Support: Firefox, Chrome, Safari
// Create "bubbling" focus and blur events
if
(
!
support
.
focusinBubbles
)
{
jQuery
.
each
({
focus
:
"
focusin
"
,
blur
:
"
focusout
"
},
function
(
orig
,
fix
)
{
...
...
@@ -4851,7 +4919,7 @@ var
// We have to close these tags to support XHTML (#13200)
wrapMap
=
{
// Support: IE
9
// Support: IE9
option
:
[
1
,
"
<select multiple='multiple'>
"
,
"
</select>
"
],
thead
:
[
1
,
"
<table>
"
,
"
</table>
"
],
...
...
@@ -4862,7 +4930,7 @@ var
_default
:
[
0
,
""
,
""
]
};
// Support: IE
9
// Support: IE9
wrapMap
.
optgroup
=
wrapMap
.
option
;
wrapMap
.
tbody
=
wrapMap
.
tfoot
=
wrapMap
.
colgroup
=
wrapMap
.
caption
=
wrapMap
.
thead
;
...
...
@@ -4952,7 +5020,7 @@ function getAll( context, tag ) {
ret
;
}
//
Support: IE >= 9
//
Fix IE bugs, see support tests
function
fixInput
(
src
,
dest
)
{
var
nodeName
=
dest
.
nodeName
.
toLowerCase
();
...
...
@@ -4972,8 +5040,7 @@ jQuery.extend({
clone
=
elem
.
cloneNode
(
true
),
inPage
=
jQuery
.
contains
(
elem
.
ownerDocument
,
elem
);
// Support: IE >= 9
// Fix Cloning issues
// Fix IE cloning issues
if
(
!
support
.
noCloneChecked
&&
(
elem
.
nodeType
===
1
||
elem
.
nodeType
===
11
)
&&
!
jQuery
.
isXMLDoc
(
elem
)
)
{
...
...
@@ -5024,8 +5091,8 @@ jQuery.extend({
// Add nodes directly
if
(
jQuery
.
type
(
elem
)
===
"
object
"
)
{
// Support: QtWebKit
//
jQuery.merge because push.apply(_, arraylike) throws
// Support: QtWebKit
, PhantomJS
//
push.apply(_, arraylike) throws on ancient WebKit
jQuery
.
merge
(
nodes
,
elem
.
nodeType
?
[
elem
]
:
elem
);
// Convert non-html into a text node
...
...
@@ -5047,15 +5114,14 @@ jQuery.extend({
tmp
=
tmp
.
lastChild
;
}
// Support: QtWebKit
//
jQuery.merge because push.apply(_, arraylike) throws
// Support: QtWebKit
, PhantomJS
//
push.apply(_, arraylike) throws on ancient WebKit
jQuery
.
merge
(
nodes
,
tmp
.
childNodes
);
// Remember the top-level container
tmp
=
fragment
.
firstChild
;
// Fixes #12346
// Support: Webkit, IE
// Ensure the created nodes are orphaned (#12392)
tmp
.
textContent
=
""
;
}
}
...
...
@@ -5098,7 +5164,7 @@ jQuery.extend({
},
cleanData
:
function
(
elems
)
{
var
data
,
elem
,
events
,
type
,
key
,
j
,
var
data
,
elem
,
type
,
key
,
special
=
jQuery
.
event
.
special
,
i
=
0
;
...
...
@@ -5107,9 +5173,8 @@ jQuery.extend({
key
=
elem
[
data_priv
.
expando
];
if
(
key
&&
(
data
=
data_priv
.
cache
[
key
])
)
{
events
=
Object
.
keys
(
data
.
events
||
{}
);
if
(
events
.
length
)
{
for
(
j
=
0
;
(
type
=
events
[
j
])
!==
undefined
;
j
++
)
{
if
(
data
.
events
)
{
for
(
type
in
data
.
events
)
{
if
(
special
[
type
]
)
{
jQuery
.
event
.
remove
(
elem
,
type
);
...
...
@@ -5412,14 +5477,15 @@ var iframe,
*/
// Called only from within defaultDisplay
function
actualDisplay
(
name
,
doc
)
{
var
elem
=
jQuery
(
doc
.
createElement
(
name
)
).
appendTo
(
doc
.
body
),
var
style
,
elem
=
jQuery
(
doc
.
createElement
(
name
)
).
appendTo
(
doc
.
body
),
// getDefaultComputedStyle might be reliably used only on attached element
display
=
window
.
getDefaultComputedStyle
?
display
=
window
.
getDefaultComputedStyle
&&
(
style
=
window
.
getDefaultComputedStyle
(
elem
[
0
]
)
)
?
// Use of this method is a temporary fix (more like optmization) until something better comes along,
// Use of this method is a temporary fix (more like opt
i
mization) until something better comes along,
// since it was removed from specification and supported only in FF
window
.
getDefaultComputedStyle
(
elem
[
0
]
)
.
display
:
jQuery
.
css
(
elem
[
0
],
"
display
"
);
style
.
display
:
jQuery
.
css
(
elem
[
0
],
"
display
"
);
// We don't have any data stored on the element,
// so use "detach" method as fast way to get rid of the element
...
...
@@ -5467,7 +5533,14 @@ var rmargin = (/^margin/);
var
rnumnonpx
=
new
RegExp
(
"
^(
"
+
pnum
+
"
)(?!px)[a-z%]+$
"
,
"
i
"
);
var
getStyles
=
function
(
elem
)
{
// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
if
(
elem
.
ownerDocument
.
defaultView
.
opener
)
{
return
elem
.
ownerDocument
.
defaultView
.
getComputedStyle
(
elem
,
null
);
}
return
window
.
getComputedStyle
(
elem
,
null
);
};
...
...
@@ -5479,7 +5552,7 @@ function curCSS( elem, name, computed ) {
computed
=
computed
||
getStyles
(
elem
);
// Support: IE9
// getPropertyValue is only needed for .css('filter')
in IE9, see #12537
// getPropertyValue is only needed for .css('filter')
(#12537)
if
(
computed
)
{
ret
=
computed
.
getPropertyValue
(
name
)
||
computed
[
name
];
}
...
...
@@ -5525,15 +5598,13 @@ function addGetHookIf( conditionFn, hookFn ) {
return
{
get
:
function
()
{
if
(
conditionFn
()
)
{
// Hook not needed (or it's not possible to use it due to missing dependency),
// remove it.
// Since there are no other hooks for marginRight, remove the whole object.
// Hook not needed (or it's not possible to use it due
// to missing dependency), remove it.
delete
this
.
get
;
return
;
}
// Hook needed; redefine it so that the support test is not executed again.
return
(
this
.
get
=
hookFn
).
apply
(
this
,
arguments
);
}
};
...
...
@@ -5542,28 +5613,34 @@ function addGetHookIf( conditionFn, hookFn ) {
(
function
()
{
var
pixelPositionVal
,
boxSizingReliableVal
,
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
divReset
=
"
padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;
"
+
"
-moz-box-sizing:content-box;box-sizing:content-box
"
,
docElem
=
document
.
documentElement
,
container
=
document
.
createElement
(
"
div
"
),
div
=
document
.
createElement
(
"
div
"
);
if
(
!
div
.
style
)
{
return
;
}
// Support: IE9-11+
// Style of cloned element affects source element cloned (#8908)
div
.
style
.
backgroundClip
=
"
content-box
"
;
div
.
cloneNode
(
true
).
style
.
backgroundClip
=
""
;
support
.
clearCloneStyle
=
div
.
style
.
backgroundClip
===
"
content-box
"
;
container
.
style
.
cssText
=
"
border:0;width:0;height:0;
position:absolute;top:0;left:-9999
px;
"
+
"
margin-top:1px
"
;
container
.
style
.
cssText
=
"
border:0;width:0;height:0;
top:0;left:-9999px;margin-top:1
px;
"
+
"
position:absolute
"
;
container
.
appendChild
(
div
);
// Executing both pixelPosition & boxSizingReliable tests require only one layout
// so they're executed at the same time to save the second computation.
function
computePixelPositionAndBoxSizingReliable
()
{
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
div
.
style
.
cssText
=
"
-webkit-box-sizing:border-box;-moz-box-sizing:border-box;
"
+
"
box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;
"
+
"
position:absolute;top:1%
"
;
div
.
style
.
cssText
=
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
"
-webkit-box-sizing:border-box;-moz-box-sizing:border-box;
"
+
"
box-sizing:border-box;display:block;margin-top:1%;top:1%;
"
+
"
border:1px;padding:1px;width:4px;position:absolute
"
;
div
.
innerHTML
=
""
;
docElem
.
appendChild
(
container
);
var
divStyle
=
window
.
getComputedStyle
(
div
,
null
);
...
...
@@ -5573,10 +5650,12 @@ function addGetHookIf( conditionFn, hookFn ) {
docElem
.
removeChild
(
container
);
}
// Use window.getComputedStyle because jsdom on node.js will break without it.
// Support: node.js jsdom
// Don't assume that getComputedStyle is a property of the global object
if
(
window
.
getComputedStyle
)
{
jQuery
.
extend
(
support
,
{
jQuery
.
extend
(
support
,
{
pixelPosition
:
function
()
{
// This test is executed only once but we still do memoizing
// since we can use the boxSizingReliable pre-computing.
// No need to check if the test was already performed, though.
...
...
@@ -5590,6 +5669,7 @@ function addGetHookIf( conditionFn, hookFn ) {
return
boxSizingReliableVal
;
},
reliableMarginRight
:
function
()
{
// Support: Android 2.3
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. (#3333)
...
...
@@ -5597,7 +5677,13 @@ function addGetHookIf( conditionFn, hookFn ) {
// This support function is only executed once so no memoizing is needed.
var
ret
,
marginDiv
=
div
.
appendChild
(
document
.
createElement
(
"
div
"
)
);
marginDiv
.
style
.
cssText
=
div
.
style
.
cssText
=
divReset
;
// Reset CSS: box-sizing; display; margin; border; padding
marginDiv
.
style
.
cssText
=
div
.
style
.
cssText
=
// Support: Firefox<29, Android 2.3
// Vendor-prefix box-sizing
"
-webkit-box-sizing:content-box;-moz-box-sizing:content-box;
"
+
"
box-sizing:content-box;display:block;margin:0;border:0;padding:0
"
;
marginDiv
.
style
.
marginRight
=
marginDiv
.
style
.
width
=
"
0
"
;
div
.
style
.
width
=
"
1px
"
;
docElem
.
appendChild
(
container
);
...
...
@@ -5605,9 +5691,7 @@ function addGetHookIf( conditionFn, hookFn ) {
ret
=
!
parseFloat
(
window
.
getComputedStyle
(
marginDiv
,
null
).
marginRight
);
docElem
.
removeChild
(
container
);
// Clean up the div for other support tests.
div
.
innerHTML
=
""
;
div
.
removeChild
(
marginDiv
);
return
ret
;
}
...
...
@@ -5639,29 +5723,29 @@ jQuery.swap = function( elem, options, callback, args ) {
var
//
s
wappable if display is none or starts with table except "table", "table-cell", or "table-caption"
//
s
ee here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
//
S
wappable if display is none or starts with table except "table", "table-cell", or "table-caption"
//
S
ee here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
rdisplayswap
=
/^
(
none|table
(?!
-c
[
ea
])
.+
)
/
,
rnumsplit
=
new
RegExp
(
"
^(
"
+
pnum
+
"
)(.*)$
"
,
"
i
"
),
rrelNum
=
new
RegExp
(
"
^([+-])=(
"
+
pnum
+
"
)
"
,
"
i
"
),
cssShow
=
{
position
:
"
absolute
"
,
visibility
:
"
hidden
"
,
display
:
"
block
"
},
cssNormalTransform
=
{
letterSpacing
:
0
,
fontWeight
:
400
letterSpacing
:
"
0
"
,
fontWeight
:
"
400
"
},
cssPrefixes
=
[
"
Webkit
"
,
"
O
"
,
"
Moz
"
,
"
ms
"
];
//
r
eturn a css property mapped to a potentially vendor prefixed property
//
R
eturn a css property mapped to a potentially vendor prefixed property
function
vendorPropName
(
style
,
name
)
{
//
s
hortcut for names that are not vendor prefixed
//
S
hortcut for names that are not vendor prefixed
if
(
name
in
style
)
{
return
name
;
}
//
c
heck for vendor prefixed names
//
C
heck for vendor prefixed names
var
capName
=
name
[
0
].
toUpperCase
()
+
name
.
slice
(
1
),
origName
=
name
,
i
=
cssPrefixes
.
length
;
...
...
@@ -5694,7 +5778,7 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
val
=
0
;
for
(
;
i
<
4
;
i
+=
2
)
{
//
b
oth box models exclude margin, so add it if we want it
//
B
oth box models exclude margin, so add it if we want it
if
(
extra
===
"
margin
"
)
{
val
+=
jQuery
.
css
(
elem
,
extra
+
cssExpand
[
i
],
true
,
styles
);
}
...
...
@@ -5705,15 +5789,15 @@ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
val
-=
jQuery
.
css
(
elem
,
"
padding
"
+
cssExpand
[
i
],
true
,
styles
);
}
//
a
t this point, extra isn't border nor margin, so remove border
//
A
t this point, extra isn't border nor margin, so remove border
if
(
extra
!==
"
margin
"
)
{
val
-=
jQuery
.
css
(
elem
,
"
border
"
+
cssExpand
[
i
]
+
"
Width
"
,
true
,
styles
);
}
}
else
{
//
a
t this point, extra isn't content, so add padding
//
A
t this point, extra isn't content, so add padding
val
+=
jQuery
.
css
(
elem
,
"
padding
"
+
cssExpand
[
i
],
true
,
styles
);
//
a
t this point, extra isn't content nor padding, so add border
//
A
t this point, extra isn't content nor padding, so add border
if
(
extra
!==
"
padding
"
)
{
val
+=
jQuery
.
css
(
elem
,
"
border
"
+
cssExpand
[
i
]
+
"
Width
"
,
true
,
styles
);
}
...
...
@@ -5731,7 +5815,7 @@ function getWidthOrHeight( elem, name, extra ) {
styles
=
getStyles
(
elem
),
isBorderBox
=
jQuery
.
css
(
elem
,
"
boxSizing
"
,
false
,
styles
)
===
"
border-box
"
;
//
s
ome non-html elements return undefined for offsetWidth, so check for null/undefined
//
S
ome non-html elements return undefined for offsetWidth, so check for null/undefined
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
if
(
val
<=
0
||
val
==
null
)
{
...
...
@@ -5746,7 +5830,7 @@ function getWidthOrHeight( elem, name, extra ) {
return
val
;
}
//
we need the c
heck for style in case a browser which returns unreliable values
//
C
heck for style in case a browser which returns unreliable values
// for getComputedStyle silently falls back to the reliable elem.style
valueIsBorderBox
=
isBorderBox
&&
(
support
.
boxSizingReliable
()
||
val
===
elem
.
style
[
name
]
);
...
...
@@ -5755,7 +5839,7 @@ function getWidthOrHeight( elem, name, extra ) {
val
=
parseFloat
(
val
)
||
0
;
}
//
u
se the active box-sizing model to add/subtract irrelevant styles
//
U
se the active box-sizing model to add/subtract irrelevant styles
return
(
val
+
augmentWidthOrHeight
(
elem
,
...
...
@@ -5795,13 +5879,10 @@ function showHide( elements, show ) {
values
[
index
]
=
data_priv
.
access
(
elem
,
"
olddisplay
"
,
defaultDisplay
(
elem
.
nodeName
)
);
}
}
else
{
if
(
!
values
[
index
]
)
{
hidden
=
isHidden
(
elem
);
if
(
display
&&
display
!==
"
none
"
||
!
hidden
)
{
data_priv
.
set
(
elem
,
"
olddisplay
"
,
hidden
?
display
:
jQuery
.
css
(
elem
,
"
display
"
)
);
}
if
(
display
!==
"
none
"
||
!
hidden
)
{
data_priv
.
set
(
elem
,
"
olddisplay
"
,
hidden
?
display
:
jQuery
.
css
(
elem
,
"
display
"
)
);
}
}
}
...
...
@@ -5822,12 +5903,14 @@ function showHide( elements, show ) {
}
jQuery
.
extend
({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks
:
{
opacity
:
{
get
:
function
(
elem
,
computed
)
{
if
(
computed
)
{
// We should always get a number back from opacity
var
ret
=
curCSS
(
elem
,
"
opacity
"
);
return
ret
===
""
?
"
1
"
:
ret
;
...
...
@@ -5840,6 +5923,8 @@ jQuery.extend({
cssNumber
:
{
"
columnCount
"
:
true
,
"
fillOpacity
"
:
true
,
"
flexGrow
"
:
true
,
"
flexShrink
"
:
true
,
"
fontWeight
"
:
true
,
"
lineHeight
"
:
true
,
"
opacity
"
:
true
,
...
...
@@ -5853,12 +5938,12 @@ jQuery.extend({
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps
:
{
// normalize float css property
"
float
"
:
"
cssFloat
"
},
// Get and set the style property on a DOM Node
style
:
function
(
elem
,
name
,
value
,
extra
)
{
// Don't set styles on text and comment nodes
if
(
!
elem
||
elem
.
nodeType
===
3
||
elem
.
nodeType
===
8
||
!
elem
.
style
)
{
return
;
...
...
@@ -5871,42 +5956,38 @@ jQuery.extend({
name
=
jQuery
.
cssProps
[
origName
]
||
(
jQuery
.
cssProps
[
origName
]
=
vendorPropName
(
style
,
origName
)
);
// gets hook for the prefixed version
// followed by the unprefixed version
// Gets hook for the prefixed version, then unprefixed version
hooks
=
jQuery
.
cssHooks
[
name
]
||
jQuery
.
cssHooks
[
origName
];
// Check if we're setting a value
if
(
value
!==
undefined
)
{
type
=
typeof
value
;
//
convert relative number strings (+= or -=) to relative numbers. #7345
//
Convert "+=" or "-=" to relative numbers (#7345)
if
(
type
===
"
string
"
&&
(
ret
=
rrelNum
.
exec
(
value
))
)
{
value
=
(
ret
[
1
]
+
1
)
*
ret
[
2
]
+
parseFloat
(
jQuery
.
css
(
elem
,
name
)
);
// Fixes bug #9237
type
=
"
number
"
;
}
// Make sure that null and NaN values aren't set
. See: #7116
// Make sure that null and NaN values aren't set
(#7116)
if
(
value
==
null
||
value
!==
value
)
{
return
;
}
// If a number
was passed in
, add 'px' to the (except for certain CSS properties)
// If a number, add 'px' to the (except for certain CSS properties)
if
(
type
===
"
number
"
&&
!
jQuery
.
cssNumber
[
origName
]
)
{
value
+=
"
px
"
;
}
//
Fixes #8908, it can be done more correctly by specifying setters in cssHooks,
// b
ut it would mean to define eight (for every problematic property) identical function
s
//
Support: IE9-11+
// b
ackground-* props affect original clone's value
s
if
(
!
support
.
clearCloneStyle
&&
value
===
""
&&
name
.
indexOf
(
"
background
"
)
===
0
)
{
style
[
name
]
=
"
inherit
"
;
}
// If a hook was provided, use that value, otherwise just set the specified value
if
(
!
hooks
||
!
(
"
set
"
in
hooks
)
||
(
value
=
hooks
.
set
(
elem
,
value
,
extra
))
!==
undefined
)
{
// Support: Chrome, Safari
// Setting style to blank string required to delete "style: x !important;"
style
[
name
]
=
""
;
style
[
name
]
=
value
;
}
...
...
@@ -5928,8 +6009,7 @@ jQuery.extend({
// Make sure that we're working with the right name
name
=
jQuery
.
cssProps
[
origName
]
||
(
jQuery
.
cssProps
[
origName
]
=
vendorPropName
(
elem
.
style
,
origName
)
);
// gets hook for the prefixed version
// followed by the unprefixed version
// Try prefixed name followed by the unprefixed name
hooks
=
jQuery
.
cssHooks
[
name
]
||
jQuery
.
cssHooks
[
origName
];
// If a hook was provided get the computed value from there
...
...
@@ -5942,12 +6022,12 @@ jQuery.extend({
val
=
curCSS
(
elem
,
name
,
styles
);
}
//
c
onvert "normal" to computed value
//
C
onvert "normal" to computed value
if
(
val
===
"
normal
"
&&
name
in
cssNormalTransform
)
{
val
=
cssNormalTransform
[
name
];
}
//
Return, converting to number
if forced or a qualifier was provided and val looks numeric
//
Make numeric
if forced or a qualifier was provided and val looks numeric
if
(
extra
===
""
||
extra
)
{
num
=
parseFloat
(
val
);
return
extra
===
true
||
jQuery
.
isNumeric
(
num
)
?
num
||
0
:
val
;
...
...
@@ -5960,9 +6040,10 @@ jQuery.each([ "height", "width" ], function( i, name ) {
jQuery
.
cssHooks
[
name
]
=
{
get
:
function
(
elem
,
computed
,
extra
)
{
if
(
computed
)
{
// certain elements can have dimension info if we invisibly show them
// however, it must have a current display style that would benefit from this
return
elem
.
offsetWidth
===
0
&&
rdisplayswap
.
test
(
jQuery
.
css
(
elem
,
"
display
"
)
)
?
// Certain elements can have dimension info if we invisibly show them
// but it must have a current display style that would benefit
return
rdisplayswap
.
test
(
jQuery
.
css
(
elem
,
"
display
"
)
)
&&
elem
.
offsetWidth
===
0
?
jQuery
.
swap
(
elem
,
cssShow
,
function
()
{
return
getWidthOrHeight
(
elem
,
name
,
extra
);
})
:
...
...
@@ -5989,8 +6070,6 @@ jQuery.each([ "height", "width" ], function( i, name ) {
jQuery
.
cssHooks
.
marginRight
=
addGetHookIf
(
support
.
reliableMarginRight
,
function
(
elem
,
computed
)
{
if
(
computed
)
{
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
return
jQuery
.
swap
(
elem
,
{
"
display
"
:
"
inline-block
"
},
curCSS
,
[
elem
,
"
marginRight
"
]
);
}
...
...
@@ -6008,7 +6087,7 @@ jQuery.each({
var
i
=
0
,
expanded
=
{},
//
a
ssumes a single number if not a string
//
A
ssumes a single number if not a string
parts
=
typeof
value
===
"
string
"
?
value
.
split
(
"
"
)
:
[
value
];
for
(
;
i
<
4
;
i
++
)
{
...
...
@@ -6131,17 +6210,18 @@ Tween.propHooks = {
return
tween
.
elem
[
tween
.
prop
];
}
//
p
assing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
//
so, simple values such as "10px" are parsed to Float.
// complex values such as "rotate(1rad)" are returned as
is.
//
P
assing an empty string as a 3rd parameter to .css will automatically
// attempt a parseFloat and fallback to a string if the parse fails
.
//
Simple values such as "10px" are parsed to Float;
// complex values such as "rotate(1rad)" are returned as
-
is.
result
=
jQuery
.
css
(
tween
.
elem
,
tween
.
prop
,
""
);
// Empty strings, null, undefined and "auto" are converted to 0.
return
!
result
||
result
===
"
auto
"
?
0
:
result
;
},
set
:
function
(
tween
)
{
// use step hook for back compat - use cssHook if its there - use .style if its
// available and use plain properties where available
// Use step hook for back compat.
// Use cssHook if its there.
// Use .style if available and use plain properties where available.
if
(
jQuery
.
fx
.
step
[
tween
.
prop
]
)
{
jQuery
.
fx
.
step
[
tween
.
prop
](
tween
);
}
else
if
(
tween
.
elem
.
style
&&
(
tween
.
elem
.
style
[
jQuery
.
cssProps
[
tween
.
prop
]
]
!=
null
||
jQuery
.
cssHooks
[
tween
.
prop
]
)
)
{
...
...
@@ -6155,7 +6235,6 @@ Tween.propHooks = {
// Support: IE9
// Panic based approach to setting things on disconnected nodes
Tween
.
propHooks
.
scrollTop
=
Tween
.
propHooks
.
scrollLeft
=
{
set
:
function
(
tween
)
{
if
(
tween
.
elem
.
nodeType
&&
tween
.
elem
.
parentNode
)
{
...
...
@@ -6211,16 +6290,16 @@ var
start
=
+
target
||
1
;
do
{
// If previous iteration zeroed out, double until we get *something*
// Use
a string for doubling factor
so we don't accidentally see scale as unchanged below
// If previous iteration zeroed out, double until we get *something*
.
// Use
string for doubling
so we don't accidentally see scale as unchanged below
scale
=
scale
||
"
.5
"
;
// Adjust and apply
start
=
start
/
scale
;
jQuery
.
style
(
tween
.
elem
,
prop
,
start
+
unit
);
// Update scale, tolerating zero or NaN from tween.cur()
//
And breaking
the loop if scale is unchanged or perfect, or if we've just had enough
// Update scale, tolerating zero or NaN from tween.cur()
,
//
break
the loop if scale is unchanged or perfect, or if we've just had enough
}
while
(
scale
!==
(
scale
=
tween
.
cur
()
/
target
)
&&
scale
!==
1
&&
--
maxIterations
);
}
...
...
@@ -6252,8 +6331,8 @@ function genFx( type, includeWidth ) {
i
=
0
,
attrs
=
{
height
:
type
};
//
i
f we include width, step value is 1 to do all cssExpand values,
//
if we don't include width,
step value is 2 to skip over Left and Right
//
I
f we include width, step value is 1 to do all cssExpand values,
//
otherwise
step value is 2 to skip over Left and Right
includeWidth
=
includeWidth
?
1
:
0
;
for
(
;
i
<
4
;
i
+=
2
-
includeWidth
)
{
which
=
cssExpand
[
i
];
...
...
@@ -6275,7 +6354,7 @@ function createTween( value, prop, animation ) {
for
(
;
index
<
length
;
index
++
)
{
if
(
(
tween
=
collection
[
index
].
call
(
animation
,
prop
,
value
))
)
{
//
w
e're done with this property
//
W
e're done with this property
return
tween
;
}
}
...
...
@@ -6283,14 +6362,14 @@ function createTween( value, prop, animation ) {
function
defaultPrefilter
(
elem
,
props
,
opts
)
{
/* jshint validthis: true */
var
prop
,
value
,
toggle
,
tween
,
hooks
,
oldfire
,
display
,
var
prop
,
value
,
toggle
,
tween
,
hooks
,
oldfire
,
display
,
checkDisplay
,
anim
=
this
,
orig
=
{},
style
=
elem
.
style
,
hidden
=
elem
.
nodeType
&&
isHidden
(
elem
),
dataShow
=
data_priv
.
get
(
elem
,
"
fxshow
"
);
//
h
andle queue: false promises
//
H
andle queue: false promises
if
(
!
opts
.
queue
)
{
hooks
=
jQuery
.
_queueHooks
(
elem
,
"
fx
"
);
if
(
hooks
.
unqueued
==
null
)
{
...
...
@@ -6305,8 +6384,7 @@ function defaultPrefilter( elem, props, opts ) {
hooks
.
unqueued
++
;
anim
.
always
(
function
()
{
// doing this makes sure that the complete handler will be called
// before this completes
// Ensure the complete handler is called before this completes
anim
.
always
(
function
()
{
hooks
.
unqueued
--
;
if
(
!
jQuery
.
queue
(
elem
,
"
fx
"
).
length
)
{
...
...
@@ -6316,7 +6394,7 @@ function defaultPrefilter( elem, props, opts ) {
});
}
//
h
eight/width overflow pass
//
H
eight/width overflow pass
if
(
elem
.
nodeType
===
1
&&
(
"
height
"
in
props
||
"
width
"
in
props
)
)
{
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE9-10 do not
...
...
@@ -6327,13 +6405,12 @@ function defaultPrefilter( elem, props, opts ) {
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height animated
display
=
jQuery
.
css
(
elem
,
"
display
"
);
// Get default display if display is currently "none"
if
(
display
===
"
none
"
)
{
display
=
defaultDisplay
(
elem
.
nodeName
);
}
if
(
display
===
"
inline
"
&&
jQuery
.
css
(
elem
,
"
float
"
)
===
"
none
"
)
{
// Test default display if display is currently "none"
checkDisplay
=
display
===
"
none
"
?
data_priv
.
get
(
elem
,
"
olddisplay
"
)
||
defaultDisplay
(
elem
.
nodeName
)
:
display
;
if
(
checkDisplay
===
"
inline
"
&&
jQuery
.
css
(
elem
,
"
float
"
)
===
"
none
"
)
{
style
.
display
=
"
inline-block
"
;
}
}
...
...
@@ -6363,6 +6440,10 @@ function defaultPrefilter( elem, props, opts ) {
}
}
orig
[
prop
]
=
dataShow
&&
dataShow
[
prop
]
||
jQuery
.
style
(
elem
,
prop
);
// Any non-fx value stops us from restoring the original display value
}
else
{
display
=
undefined
;
}
}
...
...
@@ -6375,7 +6456,7 @@ function defaultPrefilter( elem, props, opts ) {
dataShow
=
data_priv
.
access
(
elem
,
"
fxshow
"
,
{}
);
}
//
s
tore state if its toggle - enables .stop().toggle() to "reverse"
//
S
tore state if its toggle - enables .stop().toggle() to "reverse"
if
(
toggle
)
{
dataShow
.
hidden
=
!
hidden
;
}
...
...
@@ -6405,6 +6486,10 @@ function defaultPrefilter( elem, props, opts ) {
}
}
}
// If this is a noop like .hide().hide(), restore an overwritten display value
}
else
if
(
(
display
===
"
none
"
?
defaultDisplay
(
elem
.
nodeName
)
:
display
)
===
"
inline
"
)
{
style
.
display
=
display
;
}
}
...
...
@@ -6431,8 +6516,8 @@ function propFilter( props, specialEasing ) {
value
=
hooks
.
expand
(
value
);
delete
props
[
name
];
//
not quite $.extend, this wont overwrite keys already present
.
//
also - reusing 'index' from above
because we have the correct "name"
//
Not quite $.extend, this won't overwrite existing keys
.
//
Reusing 'index'
because we have the correct "name"
for
(
index
in
value
)
{
if
(
!
(
index
in
props
)
)
{
props
[
index
]
=
value
[
index
];
...
...
@@ -6451,7 +6536,7 @@ function Animation( elem, properties, options ) {
index
=
0
,
length
=
animationPrefilters
.
length
,
deferred
=
jQuery
.
Deferred
().
always
(
function
()
{
//
d
on't match elem in the :animated selector
//
D
on't match elem in the :animated selector
delete
tick
.
elem
;
}),
tick
=
function
()
{
...
...
@@ -6460,7 +6545,8 @@ function Animation( elem, properties, options ) {
}
var
currentTime
=
fxNow
||
createFxNow
(),
remaining
=
Math
.
max
(
0
,
animation
.
startTime
+
animation
.
duration
-
currentTime
),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
// Support: Android 2.3
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
temp
=
remaining
/
animation
.
duration
||
0
,
percent
=
1
-
temp
,
index
=
0
,
...
...
@@ -6496,7 +6582,7 @@ function Animation( elem, properties, options ) {
},
stop
:
function
(
gotoEnd
)
{
var
index
=
0
,
//
i
f we are going to the end, we want to run all the tweens
//
I
f we are going to the end, we want to run all the tweens
// otherwise we skip this part
length
=
gotoEnd
?
animation
.
tweens
.
length
:
0
;
if
(
stopped
)
{
...
...
@@ -6507,8 +6593,7 @@ function Animation( elem, properties, options ) {
animation
.
tweens
[
index
].
run
(
1
);
}
// resolve when we played the last frame
// otherwise, reject
// Resolve when we played the last frame; otherwise, reject
if
(
gotoEnd
)
{
deferred
.
resolveWith
(
elem
,
[
animation
,
gotoEnd
]
);
}
else
{
...
...
@@ -6590,7 +6675,7 @@ jQuery.speed = function( speed, easing, fn ) {
opt
.
duration
=
jQuery
.
fx
.
off
?
0
:
typeof
opt
.
duration
===
"
number
"
?
opt
.
duration
:
opt
.
duration
in
jQuery
.
fx
.
speeds
?
jQuery
.
fx
.
speeds
[
opt
.
duration
]
:
jQuery
.
fx
.
speeds
.
_default
;
//
n
ormalize opt.queue - true/undefined/null -> "fx"
//
N
ormalize opt.queue - true/undefined/null -> "fx"
if
(
opt
.
queue
==
null
||
opt
.
queue
===
true
)
{
opt
.
queue
=
"
fx
"
;
}
...
...
@@ -6614,10 +6699,10 @@ jQuery.speed = function( speed, easing, fn ) {
jQuery
.
fn
.
extend
({
fadeTo
:
function
(
speed
,
to
,
easing
,
callback
)
{
//
s
how any hidden elements after setting opacity to 0
//
S
how any hidden elements after setting opacity to 0
return
this
.
filter
(
isHidden
).
css
(
"
opacity
"
,
0
).
show
()
//
a
nimate to the value specified
//
A
nimate to the value specified
.
end
().
animate
({
opacity
:
to
},
speed
,
easing
,
callback
);
},
animate
:
function
(
prop
,
speed
,
easing
,
callback
)
{
...
...
@@ -6680,9 +6765,9 @@ jQuery.fn.extend({
}
}
//
start the next in the queue if the last step wasn't forced
//
timers currently will call their complete callbacks, which will dequeue
//
but only if they were gotoEnd
//
Start the next in the queue if the last step wasn't forced.
//
Timers currently will call their complete callbacks, which
//
will dequeue but only if they were gotoEnd.
if
(
dequeue
||
!
gotoEnd
)
{
jQuery
.
dequeue
(
this
,
type
);
}
...
...
@@ -6700,17 +6785,17 @@ jQuery.fn.extend({
timers
=
jQuery
.
timers
,
length
=
queue
?
queue
.
length
:
0
;
//
e
nable finishing flag on private data
//
E
nable finishing flag on private data
data
.
finish
=
true
;
//
e
mpty the queue first
//
E
mpty the queue first
jQuery
.
queue
(
this
,
type
,
[]
);
if
(
hooks
&&
hooks
.
stop
)
{
hooks
.
stop
.
call
(
this
,
true
);
}
//
l
ook for any active animations, and finish them
//
L
ook for any active animations, and finish them
for
(
index
=
timers
.
length
;
index
--
;
)
{
if
(
timers
[
index
].
elem
===
this
&&
timers
[
index
].
queue
===
type
)
{
timers
[
index
].
anim
.
stop
(
true
);
...
...
@@ -6718,14 +6803,14 @@ jQuery.fn.extend({
}
}
//
l
ook for any animations in the old queue and finish them
//
L
ook for any animations in the old queue and finish them
for
(
index
=
0
;
index
<
length
;
index
++
)
{
if
(
queue
[
index
]
&&
queue
[
index
].
finish
)
{
queue
[
index
].
finish
.
call
(
this
);
}
}
//
t
urn off finishing flag
//
T
urn off finishing flag
delete
data
.
finish
;
});
}
...
...
@@ -6828,21 +6913,21 @@ jQuery.fn.delay = function( time, type ) {
input
.
type
=
"
checkbox
"
;
// Support: iOS
5.1, Android 4.x, Android 2.3
//
Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere)
// Support: iOS
<=5.1, Android<=4.2+
//
Default value for a checkbox should be "on"
support
.
checkOn
=
input
.
value
!==
""
;
//
Must access the parent to make an option select properly
//
Support: IE9, IE10
//
Support: IE<=11+
//
Must access selectedIndex to make default options select
support
.
optSelected
=
opt
.
selected
;
//
Make sure that the options inside disabled selects aren't marked as disabled
//
(WebKit marks them as disabled)
//
Support: Android<=2.3
//
Options inside disabled selects are incorrectly marked as disabled
select
.
disabled
=
true
;
support
.
optDisabled
=
!
opt
.
disabled
;
//
Check if an input maintains its value after becoming a radio
//
Support: IE9, IE10
//
Support: IE<=11+
//
An input loses its value after becoming a radio
input
=
document
.
createElement
(
"
input
"
);
input
.
value
=
"
t
"
;
input
.
type
=
"
radio
"
;
...
...
@@ -6939,8 +7024,6 @@ jQuery.extend({
set
:
function
(
elem
,
value
)
{
if
(
!
support
.
radioValue
&&
value
===
"
radio
"
&&
jQuery
.
nodeName
(
elem
,
"
input
"
)
)
{
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to default in case type is set after value during creation
var
val
=
elem
.
value
;
elem
.
setAttribute
(
"
type
"
,
value
);
if
(
val
)
{
...
...
@@ -7010,7 +7093,7 @@ jQuery.extend({
var
ret
,
hooks
,
notxml
,
nType
=
elem
.
nodeType
;
//
d
on't get/set properties on text, comment and attribute nodes
//
D
on't get/set properties on text, comment and attribute nodes
if
(
!
elem
||
nType
===
3
||
nType
===
8
||
nType
===
2
)
{
return
;
}
...
...
@@ -7046,8 +7129,6 @@ jQuery.extend({
}
});
// Support: IE9+
// Selectedness for an option in an optgroup can be inaccurate
if
(
!
support
.
optSelected
)
{
jQuery
.
propHooks
.
selected
=
{
get
:
function
(
elem
)
{
...
...
@@ -7155,7 +7236,7 @@ jQuery.fn.extend({
}
}
//
o
nly assign if different to avoid unneeded rendering.
//
O
nly assign if different to avoid unneeded rendering.
finalValue
=
value
?
jQuery
.
trim
(
cur
)
:
""
;
if
(
elem
.
className
!==
finalValue
)
{
elem
.
className
=
finalValue
;
...
...
@@ -7182,14 +7263,14 @@ jQuery.fn.extend({
return
this
.
each
(
function
()
{
if
(
type
===
"
string
"
)
{
//
t
oggle individual class names
//
T
oggle individual class names
var
className
,
i
=
0
,
self
=
jQuery
(
this
),
classNames
=
value
.
match
(
rnotwhite
)
||
[];
while
(
(
className
=
classNames
[
i
++
])
)
{
//
c
heck each className given, space separated list
//
C
heck each className given, space separated list
if
(
self
.
hasClass
(
className
)
)
{
self
.
removeClass
(
className
);
}
else
{
...
...
@@ -7204,7 +7285,7 @@ jQuery.fn.extend({
data_priv
.
set
(
this
,
"
__className__
"
,
this
.
className
);
}
// If the element has a class name or if we're passed
"false"
,
// If the element has a class name or if we're passed
`false`
,
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
...
...
@@ -7248,9 +7329,9 @@ jQuery.fn.extend({
ret
=
elem
.
value
;
return
typeof
ret
===
"
string
"
?
//
h
andle most common string cases
//
H
andle most common string cases
ret
.
replace
(
rreturn
,
""
)
:
//
h
andle cases where value is null/undef or number
//
H
andle cases where value is null/undef or number
ret
==
null
?
""
:
ret
;
}
...
...
@@ -7297,6 +7378,16 @@ jQuery.fn.extend({
jQuery
.
extend
({
valHooks
:
{
option
:
{
get
:
function
(
elem
)
{
var
val
=
jQuery
.
find
.
attr
(
elem
,
"
value
"
);
return
val
!=
null
?
val
:
// Support: IE10-11+
// option.text throws exceptions (#14686, #14858)
jQuery
.
trim
(
jQuery
.
text
(
elem
)
);
}
},
select
:
{
get
:
function
(
elem
)
{
var
value
,
option
,
...
...
@@ -7343,12 +7434,12 @@ jQuery.extend({
while
(
i
--
)
{
option
=
options
[
i
];
if
(
(
option
.
selected
=
jQuery
.
inArray
(
jQuery
(
option
).
val
()
,
values
)
>=
0
)
)
{
if
(
(
option
.
selected
=
jQuery
.
inArray
(
option
.
value
,
values
)
>=
0
)
)
{
optionSet
=
true
;
}
}
//
f
orce browsers to behave consistently when non-matching value is set
//
F
orce browsers to behave consistently when non-matching value is set
if
(
!
optionSet
)
{
elem
.
selectedIndex
=
-
1
;
}
...
...
@@ -7369,8 +7460,6 @@ jQuery.each([ "radio", "checkbox" ], function() {
};
if
(
!
support
.
checkOn
)
{
jQuery
.
valHooks
[
this
].
get
=
function
(
elem
)
{
// Support: Webkit
// "" is returned instead of "on" if a value isn't specified
return
elem
.
getAttribute
(
"
value
"
)
===
null
?
"
on
"
:
elem
.
value
;
};
}
...
...
@@ -7452,10 +7541,6 @@ jQuery.parseXML = function( data ) {
var
// Document location
ajaxLocParts
,
ajaxLocation
,
rhash
=
/#.*$/
,
rts
=
/
([
?&
])
_=
[^
&
]
*/
,
rheaders
=
/^
(
.*
?)
:
[
\t]
*
([^\r\n]
*
)
$/mg
,
...
...
@@ -7484,22 +7569,13 @@ var
transports
=
{},
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes
=
"
*/
"
.
concat
(
"
*
"
);
allTypes
=
"
*/
"
.
concat
(
"
*
"
),
// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
try
{
ajaxLocation
=
location
.
href
;
}
catch
(
e
)
{
// Use the href attribute of an A element
// since IE will modify it given document.location
ajaxLocation
=
document
.
createElement
(
"
a
"
);
ajaxLocation
.
href
=
""
;
ajaxLocation
=
ajaxLocation
.
href
;
}
// Document location
ajaxLocation
=
window
.
location
.
href
,
// Segment location into parts
ajaxLocParts
=
rurl
.
exec
(
ajaxLocation
.
toLowerCase
()
)
||
[];
// Segment location into parts
ajaxLocParts
=
rurl
.
exec
(
ajaxLocation
.
toLowerCase
()
)
||
[];
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function
addToPrefiltersOrTransports
(
structure
)
{
...
...
@@ -7978,7 +8054,8 @@ jQuery.extend({
}
// We can fire global events as of now if asked to
fireGlobals
=
s
.
global
;
// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
fireGlobals
=
jQuery
.
event
&&
s
.
global
;
// Watch for a new set of requests
if
(
fireGlobals
&&
jQuery
.
active
++
===
0
)
{
...
...
@@ -8051,7 +8128,7 @@ jQuery.extend({
return
jqXHR
.
abort
();
}
//
a
borting is no longer a cancellation
//
A
borting is no longer a cancellation
strAbort
=
"
abort
"
;
// Install callbacks on deferreds
...
...
@@ -8163,8 +8240,7 @@ jQuery.extend({
isSuccess
=
!
error
;
}
}
else
{
// We extract error from statusText
// then normalize statusText and status for non-aborts
// Extract error from statusText and normalize for non-aborts
error
=
statusText
;
if
(
status
||
!
statusText
)
{
statusText
=
"
error
"
;
...
...
@@ -8220,7 +8296,7 @@ jQuery.extend({
jQuery
.
each
(
[
"
get
"
,
"
post
"
],
function
(
i
,
method
)
{
jQuery
[
method
]
=
function
(
url
,
data
,
callback
,
type
)
{
//
s
hift arguments if data argument was omitted
//
S
hift arguments if data argument was omitted
if
(
jQuery
.
isFunction
(
data
)
)
{
type
=
type
||
callback
;
callback
=
data
;
...
...
@@ -8237,13 +8313,6 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
};
});
// Attach a bunch of functions for handling common AJAX events
jQuery
.
each
(
[
"
ajaxStart
"
,
"
ajaxStop
"
,
"
ajaxComplete
"
,
"
ajaxError
"
,
"
ajaxSuccess
"
,
"
ajaxSend
"
],
function
(
i
,
type
)
{
jQuery
.
fn
[
type
]
=
function
(
fn
)
{
return
this
.
on
(
type
,
fn
);
};
});
jQuery
.
_evalUrl
=
function
(
url
)
{
return
jQuery
.
ajax
({
...
...
@@ -8461,8 +8530,9 @@ var xhrId = 0,
// Support: IE9
// Open requests must be manually aborted on unload (#5280)
if
(
window
.
ActiveXObject
)
{
jQuery
(
window
).
on
(
"
unload
"
,
function
()
{
// See https://support.microsoft.com/kb/2856746 for more info
if
(
window
.
attachEvent
)
{
window
.
attachEvent
(
"
onunload
"
,
function
()
{
for
(
var
key
in
xhrCallbacks
)
{
xhrCallbacks
[
key
]();
}
...
...
@@ -8550,10 +8620,15 @@ jQuery.ajaxTransport(function( options ) {
// Create the abort callback
callback
=
xhrCallbacks
[
id
]
=
callback
(
"
abort
"
);
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
try
{
// Do send the request (this may raise an exception)
xhr
.
send
(
options
.
hasContent
&&
options
.
data
||
null
);
}
catch
(
e
)
{
// #14683: Only rethrow if this hasn't been notified as an error yet
if
(
callback
)
{
throw
e
;
}
}
},
abort
:
function
()
{
...
...
@@ -8760,7 +8835,7 @@ jQuery.fn.load = function( url, params, callback ) {
off
=
url
.
indexOf
(
"
"
);
if
(
off
>=
0
)
{
selector
=
url
.
slice
(
off
);
selector
=
jQuery
.
trim
(
url
.
slice
(
off
)
);
url
=
url
.
slice
(
0
,
off
);
}
...
...
@@ -8810,6 +8885,16 @@ jQuery.fn.load = function( url, params, callback ) {
// Attach a bunch of functions for handling common AJAX events
jQuery
.
each
(
[
"
ajaxStart
"
,
"
ajaxStop
"
,
"
ajaxComplete
"
,
"
ajaxError
"
,
"
ajaxSuccess
"
,
"
ajaxSend
"
],
function
(
i
,
type
)
{
jQuery
.
fn
[
type
]
=
function
(
fn
)
{
return
this
.
on
(
type
,
fn
);
};
});
jQuery
.
expr
.
filters
.
animated
=
function
(
elem
)
{
return
jQuery
.
grep
(
jQuery
.
timers
,
function
(
fn
)
{
return
elem
===
fn
.
elem
;
...
...
@@ -8846,7 +8931,8 @@ jQuery.offset = {
calculatePosition
=
(
position
===
"
absolute
"
||
position
===
"
fixed
"
)
&&
(
curCSSTop
+
curCSSLeft
).
indexOf
(
"
auto
"
)
>
-
1
;
// Need to be able to calculate position if either top or left is auto and position is either absolute or fixed
// Need to be able to calculate position if either
// top or left is auto and position is either absolute or fixed
if
(
calculatePosition
)
{
curPosition
=
curElem
.
position
();
curTop
=
curPosition
.
top
;
...
...
@@ -8903,8 +8989,8 @@ jQuery.fn.extend({
return
box
;
}
// Support: BlackBerry 5, iOS 3 (original iPhone)
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
if
(
typeof
elem
.
getBoundingClientRect
!==
strundefined
)
{
box
=
elem
.
getBoundingClientRect
();
}
...
...
@@ -8926,7 +9012,7 @@ jQuery.fn.extend({
// Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
if
(
jQuery
.
css
(
elem
,
"
position
"
)
===
"
fixed
"
)
{
//
We assume that getBoundingClientRect is availabl
e when computed position is fixed
//
Assume getBoundingClientRect is ther
e when computed position is fixed
offset
=
elem
.
getBoundingClientRect
();
}
else
{
...
...
@@ -8989,16 +9075,18 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
};
});
// Support: Safari<7+, Chrome<37+
// Add the top/left cssHooks using jQuery.fn.position
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
// getComputedStyle returns percent when specified for top/left/bottom/right;
// rather than make the css module depend on the offset module, just check for it here
jQuery
.
each
(
[
"
top
"
,
"
left
"
],
function
(
i
,
prop
)
{
jQuery
.
cssHooks
[
prop
]
=
addGetHookIf
(
support
.
pixelPosition
,
function
(
elem
,
computed
)
{
if
(
computed
)
{
computed
=
curCSS
(
elem
,
prop
);
//
i
f curCSS returns percentage, fallback to offset
//
I
f curCSS returns percentage, fallback to offset
return
rnumnonpx
.
test
(
computed
)
?
jQuery
(
elem
).
position
()[
prop
]
+
"
px
"
:
computed
;
...
...
@@ -9011,7 +9099,7 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery
.
each
(
{
Height
:
"
height
"
,
Width
:
"
width
"
},
function
(
name
,
type
)
{
jQuery
.
each
(
{
padding
:
"
inner
"
+
name
,
content
:
type
,
""
:
"
outer
"
+
name
},
function
(
defaultExtra
,
funcName
)
{
//
m
argin is only for outerHeight, outerWidth
//
M
argin is only for outerHeight, outerWidth
jQuery
.
fn
[
funcName
]
=
function
(
margin
,
value
)
{
var
chainable
=
arguments
.
length
&&
(
defaultExtra
||
typeof
margin
!==
"
boolean
"
),
extra
=
defaultExtra
||
(
margin
===
true
||
value
===
true
?
"
margin
"
:
"
border
"
);
...
...
@@ -9068,6 +9156,12 @@ jQuery.fn.andSelf = jQuery.fn.addBack;
// derived from file names, and jQuery is normally delivered in a lowercase
// file name. Do this after creating the global so that if an AMD module wants
// to call noConflict to hide this version of jQuery, it will work.
// Note that for maximum portability, libraries that are not jQuery should
// declare themselves as anonymous modules, and avoid setting a global if an
// AMD loader is present. jQuery is a special case. For more information, see
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
if
(
typeof
define
===
"
function
"
&&
define
.
amd
)
{
define
(
"
jquery
"
,
[],
function
()
{
return
jQuery
;
...
...
@@ -9096,8 +9190,8 @@ jQuery.noConflict = function( deep ) {
return
jQuery
;
};
// Expose jQuery and $ identifiers, even in
//
AMD
(#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// Expose jQuery and $ identifiers, even in
AMD
// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
// and CommonJS for browser emulators (#13566)
if
(
typeof
noGlobal
===
strundefined
)
{
window
.
jQuery
=
window
.
$
=
jQuery
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment