diff --git a/AWESOME_REID.html b/AWESOME_REID.html
index dca962f..eaaf424 100644
--- a/AWESOME_REID.html
+++ b/AWESOME_REID.html
@@ -185,65 +185,65 @@
Conferences
CVPR 2019
-Joint Discriminative and Generative Learning for Person Re-identification. [paper ][code ]
-Invariance Matters: Exemplar Memory for Domain Adaptive Person Re-identification. [paper ][code ]
-Dissecting Person Re-identification from the Viewpoint of Viewpoint. [paper ][code ]
-Unsupervised Person Re-identification by Soft Multilabel Learning. [paper ][code ]
-Patch-based Discriminative Feature Learning for Unsupervised Person Re-identification. [paper ][code ]
+Joint Discriminative and Generative Learning for Person Re-identification. [paper ][code ]
+Invariance Matters: Exemplar Memory for Domain Adaptive Person Re-identification. [paper ][code ]
+Dissecting Person Re-identification from the Viewpoint of Viewpoint. [paper ][code ]
+Unsupervised Person Re-identification by Soft Multilabel Learning. [paper ][code ]
+Patch-based Discriminative Feature Learning for Unsupervised Person Re-identification. [paper ][code ]
AAAI 2019
-Spatial and Temporal Mutual Promotion for Video-based Person Re-identification. [paper ][code ]
-Spatial-Temporal Person Re-identification. [paper ][code ]
-Horizontal Pyramid Matching for Person Re-identification. [paper ][code ]
-Backbone Can Not be Trained at Once: Rolling Back to Pre-trained Network for Person Re-identification. [paper ][code ]
-A Bottom-Up Clustering Approach to Unsupervised Person Re-identification. [paper ][code ]
+Spatial and Temporal Mutual Promotion for Video-based Person Re-identification. [paper ][code ]
+Spatial-Temporal Person Re-identification. [paper ][code ]
+Horizontal Pyramid Matching for Person Re-identification. [paper ][code ]
+Backbone Can Not be Trained at Once: Rolling Back to Pre-trained Network for Person Re-identification. [paper ][code ]
+A Bottom-Up Clustering Approach to Unsupervised Person Re-identification. [paper ][code ]
CVPR 2018
-Camera Style Adaptation for Person Re-Identification. [paper ][code ]
-Deep Group-Shuffling Random Walk for Person Re-Identification. [paper ][code ]
-End-to-End Deep Kronecker-Product Matching for Person Re-identification. [paper ][code ]
-Features for Multi-Target Multi-Camera Tracking and Re-Identification. [paper ][code ]
-Group Consistent Similarity Learning via Deep CRF for Person Re-Identification. [paper ][code ]
-Harmonious Attention Network for Person Re-Identification. [paper ][code ]
-Human Semantic Parsing for Person Re-Identification. [paper ][code ]
-Multi-Level Factorisation Net for Person Re-Identification. [paper ][code ]
-Resource Aware Person Re-identification across Multiple Resolutions. [paper ][code ]
-Exploit the Unknown Gradually: One-Shot Video-Based Person Re-Identification by Stepwise Learning. [paper ][code ]
+Camera Style Adaptation for Person Re-Identification. [paper ][code ]
+Deep Group-Shuffling Random Walk for Person Re-Identification. [paper ][code ]
+End-to-End Deep Kronecker-Product Matching for Person Re-identification. [paper ][code ]
+Features for Multi-Target Multi-Camera Tracking and Re-Identification. [paper ][code ]
+Group Consistent Similarity Learning via Deep CRF for Person Re-Identification. [paper ][code ]
+Harmonious Attention Network for Person Re-Identification. [paper ][code ]
+Human Semantic Parsing for Person Re-Identification. [paper ][code ]
+Multi-Level Factorisation Net for Person Re-Identification. [paper ][code ]
+Resource Aware Person Re-identification across Multiple Resolutions. [paper ][code ]
+Exploit the Unknown Gradually: One-Shot Video-Based Person Re-Identification by Stepwise Learning. [paper ][code ]
diff --git a/MODEL_ZOO.html b/MODEL_ZOO.html
index 88a5049..e34e2e0 100644
--- a/MODEL_ZOO.html
+++ b/MODEL_ZOO.html
@@ -182,12 +182,12 @@
Model Zoo
In general,
-results are presented in the format of <Rank-1 (mAP)> , unless specified otherwise.
-when computing model size and FLOPs, only layers that are used at test time are considered (see torchreid.utils.compute_model_complexity
).
-asterisk (*) means the model is trained from scratch.
-combineall=True
means all images in the dataset are used for model training.
-for the cuhk03 dataset, we use the 767/700 split by Zhong et al. CVPR’17 .
-label smoothing regularizer is used in the softmax loss.
+results are presented in the format of <Rank-1 (mAP)> , unless specified otherwise.
+when computing model size and FLOPs, only layers that are used at test time are considered (see torchreid.utils.compute_model_complexity
).
+asterisk (*) means the model is trained from scratch.
+combineall=True
means all images in the dataset are used for model training.
+for the cuhk03 dataset, we use the 767/700 split by Zhong et al. CVPR’17 .
+label smoothing regularizer is used in the softmax loss.
ImageNet pretrained models
diff --git a/_modules/torchreid/utils/reidtools.html b/_modules/torchreid/utils/reidtools.html
index 26dca36..1459658 100644
--- a/_modules/torchreid/utils/reidtools.html
+++ b/_modules/torchreid/utils/reidtools.html
@@ -227,7 +227,7 @@
prefix: string
matched: bool
"""
- if isinstance ( src , tuple ) or isinstance ( src , list ):
+ if isinstance ( src , ( tuple , list )):
if prefix == 'gallery' :
suffix = 'TRUE' if matched else 'FALSE'
dst = osp . join ( dst , prefix + '_top' + str ( rank ) . zfill ( 3 )) + '_' + suffix
diff --git a/_sources/user_guide.rst.txt b/_sources/user_guide.rst.txt
index c7a09a9..1cab5de 100644
--- a/_sources/user_guide.rst.txt
+++ b/_sources/user_guide.rst.txt
@@ -65,7 +65,7 @@ We provide a tool in ``torchreid.utils.model_complexity.py`` to automatically co
# count flops for all layers including ReLU and BatchNorm
utils.compute_model_complexity(model, (1, 3, 256, 128), verbose=True, only_conv_linear=False)
-It is worth noting that (1) this function only provides an estimate of the theoretical time complexity rather than the actual running time which depends on implementations and hardware, and (2) the FLOPs is only counted for layers that are used at test time. This means that redundant layers such as person ID classification layer will be ignored as it is discarded when doing feature extraction. Note that the inference graph depends on how you construct the computations in ``forward()``.
+Note that (1) this function only provides an estimate of the theoretical time complexity rather than the actual running time which depends on implementations and hardware; (2) the FLOPs is only counted for layers that are used at test time. This means that redundant layers such as person ID classification layer will be ignored. The inference graph depends on how you define the computations in ``forward()``.
Combine multiple datasets
@@ -117,7 +117,7 @@ This can be easily done by setting ``combineall=True`` when instantiating a data
combineall=True # it's me, here
)
-More specifically, with ``combineall=False``, you would get
+More specifically, with ``combineall=False``, you will get
.. code-block:: none
@@ -130,7 +130,7 @@ More specifically, with ``combineall=False``, you would get
gallery | 751 | 15913 | 6
---------------------------------------
-with ``combineall=True``, you would get
+with ``combineall=True``, you will get
.. code-block:: none
@@ -168,9 +168,9 @@ Please refer to :ref:`torchreid_optim` for more details.
Do two-stepped transfer learning
-------------------------------------
-To prevent the pretrained layers to be damaged by harmful gradients back-propagated from randomly initialized layers, one can adopt the *two-stepped transfer learning strategy* presented in `Deep Transfer Learning for Person Re-identification `_. The basic idea is to pretrain the randomly initialized layers for few epochs while keeping the base layers frozen before training all layers end-to-end.
+To prevent the pretrained layers from being damaged by harmful gradients back-propagated from randomly initialized layers, one can adopt the *two-stepped transfer learning strategy* presented in `Deep Transfer Learning for Person Re-identification `_. The basic idea is to pretrain the randomly initialized layers for few epochs while keeping the base layers frozen before training all layers end-to-end.
-This has been implemented in ``Engine.train()`` (see :ref:`torchreid_engine`). The arguments to enable this feature are ``fixbase_epoch`` and ``open_layers``. Intuitively, ``fixbase_epoch`` denotes the number of epochs to keep the base layers frozen; ``open_layers`` means which layers are open for training.
+This has been implemented in ``Engine.train()`` (see :ref:`torchreid_engine`). The arguments related to this feature are ``fixbase_epoch`` and ``open_layers``. Intuitively, ``fixbase_epoch`` denotes the number of epochs to keep the base layers frozen; ``open_layers`` means which layer is open for training.
For example, say you want to pretrain the classification layer named "classifier" in ResNet50 for 5 epochs before training all layers, you can do
@@ -198,18 +198,18 @@ You can load a trained model using :code:`torchreid.utils.load_pretrained_weight
Visualize learning curves with tensorboard
--------------------------------------------
-The ``SummaryWriter()`` for tensorboard will be automatically initialized in ``engine.run()`` when you are training your model. Therefore, you do not need to do extra jobs. After the training is done, the ``*tf.events*`` file will be saved in ``save_dir``. Then, you just call ``tensorboard --logdir=your_save_dir`` in your terminal and visit ``http://localhost:6006/`` in your web browser. See `pytorch tensorboard `_ for further information.
+The ``SummaryWriter()`` for tensorboard will be automatically initialized in ``engine.run()`` when you are training your model. Therefore, you do not need to do extra jobs. After the training is done, the ``*tf.events*`` file will be saved in ``save_dir``. Then, you just call ``tensorboard --logdir=your_save_dir`` in your terminal and visit ``http://localhost:6006/`` in a web browser. See `pytorch tensorboard `_ for further information.
Visualize ranked results
-------------------------
-Ranked images can be visualized by setting ``visrank`` to True in ``engine.run()``. ``visrank_topk`` determines the top-k images to be visualized (Default is ``visrank_topk=10``). Note that ``visrank`` can only be used in test mode, i.e. ``test_only=True`` in ``engine.run()``. The images will be saved under ``save_dir/visrank_DATASETNAME`` where each image sketches the ranked list given a query. An example is shown below. Red and green denote incorrect and correct matches respectively.
+Ranked images can be visualized by setting ``visrank`` to true in ``engine.run()``. ``visrank_topk`` determines the top-k images to be visualized (Default is ``visrank_topk=10``). Note that ``visrank`` can only be used in test mode, i.e. ``test_only=True`` in ``engine.run()``. The images will be saved under ``save_dir/visrank_DATASETNAME`` where each image contains the top-k ranked list given a query. An example is shown below. Red and green denote incorrect and correct matches respectively.
.. image:: figures/ranked_results.jpg
:width: 800px
:align: center
-An example command line using ``scripts/main.py`` is
+Example command for ``scripts/main.py`` is
.. code-block:: shell
@@ -235,7 +235,7 @@ To understand where the CNN focuses on to extract features for ReID, you can vis
:align: center
-An example command line using ``scripts/main.py`` is
+Example command for ``scripts/main.py`` is
.. code-block:: shell
@@ -331,4 +331,4 @@ Use your own dataset
Design your own Engine
------------------------
-A new Engine should be designed if you have your own loss function. The base Engine class ``torchreid.engine.Engine`` has implemented some generic methods which you want to inherit to avoid re-writing. Please refer to the source code for more details. You are suggested to see how ``ImageSoftmaxEngine`` and ``ImageTripletEngine`` are constructed (also ``VideoSoftmaxEngine`` and ``VideoTripletEngine``). All you need to implement might be just a ``train()`` function.
\ No newline at end of file
+A new Engine should be designed if you have your own loss function. The base Engine class ``torchreid.engine.Engine`` has implemented some generic methods which you can inherit to avoid re-writing. Please refer to the source code for more details. You are suggested to see how ``ImageSoftmaxEngine`` and ``ImageTripletEngine`` are constructed (also ``VideoSoftmaxEngine`` and ``VideoTripletEngine``). All you need to implement might be just a ``train()`` function.
diff --git a/_static/ajax-loader.gif b/_static/ajax-loader.gif
new file mode 100644
index 0000000..61faf8c
Binary files /dev/null and b/_static/ajax-loader.gif differ
diff --git a/_static/basic.css b/_static/basic.css
index ea6972d..0807176 100644
--- a/_static/basic.css
+++ b/_static/basic.css
@@ -231,16 +231,6 @@ a.headerlink {
visibility: hidden;
}
-a.brackets:before,
-span.brackets > a:before{
- content: "[";
-}
-
-a.brackets:after,
-span.brackets > a:after {
- content: "]";
-}
-
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
@@ -289,12 +279,6 @@ img.align-center, .figure.align-center, object.align-center {
margin-right: auto;
}
-img.align-default, .figure.align-default {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
.align-left {
text-align: left;
}
@@ -303,10 +287,6 @@ img.align-default, .figure.align-default {
text-align: center;
}
-.align-default {
- text-align: center;
-}
-
.align-right {
text-align: right;
}
@@ -378,11 +358,6 @@ table.align-center {
margin-right: auto;
}
-table.align-default {
- margin-left: auto;
- margin-right: auto;
-}
-
table caption span.caption-number {
font-style: italic;
}
@@ -416,16 +391,6 @@ table.citation td {
border-bottom: none;
}
-th > p:first-child,
-td > p:first-child {
- margin-top: 0px;
-}
-
-th > p:last-child,
-td > p:last-child {
- margin-bottom: 0px;
-}
-
/* -- figures --------------------------------------------------------------- */
div.figure {
@@ -495,58 +460,11 @@ ol.upperroman {
list-style: upper-roman;
}
-li > p:first-child {
- margin-top: 0px;
-}
-
-li > p:last-child {
- margin-bottom: 0px;
-}
-
-dl.footnote > dt,
-dl.citation > dt {
- float: left;
-}
-
-dl.footnote > dd,
-dl.citation > dd {
- margin-bottom: 0em;
-}
-
-dl.footnote > dd:after,
-dl.citation > dd:after {
- content: "";
- clear: both;
-}
-
-dl.field-list {
- display: grid;
- grid-template-columns: fit-content(30%) auto;
-}
-
-dl.field-list > dt {
- font-weight: bold;
- word-break: break-word;
- padding-left: 0.5em;
- padding-right: 5px;
-}
-
-dl.field-list > dt:after {
- content: ":";
-}
-
-dl.field-list > dd {
- padding-left: 0.5em;
- margin-top: 0em;
- margin-left: 0em;
- margin-bottom: 0em;
-}
-
dl {
margin-bottom: 15px;
}
-dd > p:first-child {
+dd p {
margin-top: 0px;
}
@@ -619,12 +537,6 @@ dl.glossary dt {
font-style: oblique;
}
-.classifier:before {
- font-style: normal;
- margin: 0.5em;
- content: ":";
-}
-
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
diff --git a/_static/comment-bright.png b/_static/comment-bright.png
new file mode 100644
index 0000000..15e27ed
Binary files /dev/null and b/_static/comment-bright.png differ
diff --git a/_static/comment-close.png b/_static/comment-close.png
new file mode 100644
index 0000000..4d91bcf
Binary files /dev/null and b/_static/comment-close.png differ
diff --git a/_static/comment.png b/_static/comment.png
new file mode 100644
index 0000000..dfbc0cb
Binary files /dev/null and b/_static/comment.png differ
diff --git a/_static/doctools.js b/_static/doctools.js
index b33f87f..344db17 100644
--- a/_static/doctools.js
+++ b/_static/doctools.js
@@ -87,13 +87,14 @@ jQuery.fn.highlightText = function(text, className) {
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
+ var bbox = span.getBBox();
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
- var bbox = node.parentElement.getBBox();
- rect.x.baseVal.value = bbox.x;
+ rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute('class', className);
+ var parentOfText = node.parentNode.parentNode;
addItems.push({
"parent": node.parentNode,
"target": rect});
diff --git a/_static/documentation_options.js b/_static/documentation_options.js
index ffea968..5f175ad 100644
--- a/_static/documentation_options.js
+++ b/_static/documentation_options.js
@@ -6,5 +6,5 @@ var DOCUMENTATION_OPTIONS = {
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
- NAVIGATION_WITH_KEYS: false
+ NAVIGATION_WITH_KEYS: false,
};
\ No newline at end of file
diff --git a/_static/down-pressed.png b/_static/down-pressed.png
new file mode 100644
index 0000000..5756c8c
Binary files /dev/null and b/_static/down-pressed.png differ
diff --git a/_static/down.png b/_static/down.png
new file mode 100644
index 0000000..1b3bdad
Binary files /dev/null and b/_static/down.png differ
diff --git a/_static/jquery-3.4.1.js b/_static/jquery-3.2.1.js
similarity index 89%
rename from _static/jquery-3.4.1.js
rename to _static/jquery-3.2.1.js
index 773ad95..d2d8ca4 100644
--- a/_static/jquery-3.4.1.js
+++ b/_static/jquery-3.2.1.js
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v3.4.1
+ * jQuery JavaScript Library v3.2.1
* https://jquery.com/
*
* Includes Sizzle.js
@@ -9,7 +9,7 @@
* Released under the MIT license
* https://jquery.org/license
*
- * Date: 2019-05-01T21:04Z
+ * Date: 2017-03-20T18:59Z
*/
( function( global, factory ) {
@@ -71,70 +71,16 @@ var ObjectFunctionString = fnToString.call( Object );
var support = {};
-var isFunction = function isFunction( obj ) {
-
- // Support: Chrome <=57, Firefox <=52
- // In some browsers, typeof returns "function" for HTML elements
- // (i.e., `typeof document.createElement( "object" ) === "function"`).
- // We don't want to classify *any* DOM node as a function.
- return typeof obj === "function" && typeof obj.nodeType !== "number";
- };
-var isWindow = function isWindow( obj ) {
- return obj != null && obj === obj.window;
- };
-
-
-
-
- var preservedScriptAttributes = {
- type: true,
- src: true,
- nonce: true,
- noModule: true
- };
-
- function DOMEval( code, node, doc ) {
+ function DOMEval( code, doc ) {
doc = doc || document;
- var i, val,
- script = doc.createElement( "script" );
+ var script = doc.createElement( "script" );
script.text = code;
- if ( node ) {
- for ( i in preservedScriptAttributes ) {
-
- // Support: Firefox 64+, Edge 18+
- // Some browsers don't support the "nonce" property on scripts.
- // On the other hand, just using `getAttribute` is not enough as
- // the `nonce` attribute is reset to an empty string whenever it
- // becomes browsing-context connected.
- // See https://github.com/whatwg/html/issues/2369
- // See https://html.spec.whatwg.org/#nonce-attributes
- // The `node.getAttribute` check was added for the sake of
- // `jQuery.globalEval` so that it can fake a nonce-containing node
- // via an object.
- val = node[ i ] || node.getAttribute && node.getAttribute( i );
- if ( val ) {
- script.setAttribute( i, val );
- }
- }
- }
doc.head.appendChild( script ).parentNode.removeChild( script );
}
-
-
-function toType( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android <=2.3 only (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
-}
/* global Symbol */
// Defining this global in .eslintrc.json would create a danger of using the global
// unguarded in another place, it seems safer to define global only for this module
@@ -142,7 +88,7 @@ function toType( obj ) {
var
- version = "3.4.1",
+ version = "3.2.1",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
@@ -154,7 +100,16 @@ var
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([a-z])/g,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
jQuery.fn = jQuery.prototype = {
@@ -254,7 +209,7 @@ jQuery.extend = jQuery.fn.extend = function() {
}
// Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !isFunction( target ) ) {
+ if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
target = {};
}
@@ -271,28 +226,25 @@ jQuery.extend = jQuery.fn.extend = function() {
// Extend the base object
for ( name in options ) {
+ src = target[ name ];
copy = options[ name ];
- // Prevent Object.prototype pollution
// Prevent never-ending loop
- if ( name === "__proto__" || target === copy ) {
+ if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
( copyIsArray = Array.isArray( copy ) ) ) ) {
- src = target[ name ];
- // Ensure proper type for the source value
- if ( copyIsArray && !Array.isArray( src ) ) {
- clone = [];
- } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
- clone = {};
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && Array.isArray( src ) ? src : [];
+
} else {
- clone = src;
+ clone = src && jQuery.isPlainObject( src ) ? src : {};
}
- copyIsArray = false;
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
@@ -323,6 +275,28 @@ jQuery.extend( {
noop: function() {},
+ isFunction: function( obj ) {
+ return jQuery.type( obj ) === "function";
+ },
+
+ isWindow: function( obj ) {
+ return obj != null && obj === obj.window;
+ },
+
+ isNumeric: function( obj ) {
+
+ // As of jQuery 3.0, isNumeric is limited to
+ // strings and numbers (primitives or objects)
+ // that can be coerced to finite numbers (gh-2662)
+ var type = jQuery.type( obj );
+ return ( type === "number" || type === "string" ) &&
+
+ // parseFloat NaNs numeric-cast false positives ("")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ !isNaN( obj - parseFloat( obj ) );
+ },
+
isPlainObject: function( obj ) {
var proto, Ctor;
@@ -345,6 +319,9 @@ jQuery.extend( {
},
isEmptyObject: function( obj ) {
+
+ /* eslint-disable no-unused-vars */
+ // See https://github.com/eslint/eslint/issues/6125
var name;
for ( name in obj ) {
@@ -353,9 +330,27 @@ jQuery.extend( {
return true;
},
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+
+ // Support: Android <=2.3 only (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call( obj ) ] || "object" :
+ typeof obj;
+ },
+
// Evaluates a script in a global context
- globalEval: function( code, options ) {
- DOMEval( code, { nonce: options && options.nonce } );
+ globalEval: function( code ) {
+ DOMEval( code );
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Support: IE <=9 - 11, Edge 12 - 13
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
each: function( obj, callback ) {
@@ -478,6 +473,37 @@ jQuery.extend( {
// A global GUID counter for objects
guid: 1,
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: Date.now,
+
// jQuery.support is not used in Core but other projects attach their
// properties to it so it needs to exist.
support: support
@@ -500,9 +526,9 @@ function isArrayLike( obj ) {
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
- type = toType( obj );
+ type = jQuery.type( obj );
- if ( isFunction( obj ) || isWindow( obj ) ) {
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
return false;
}
@@ -511,14 +537,14 @@ function isArrayLike( obj ) {
}
var Sizzle =
/*!
- * Sizzle CSS Selector Engine v2.3.4
+ * Sizzle CSS Selector Engine v2.3.3
* https://sizzlejs.com/
*
- * Copyright JS Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
* Released under the MIT license
- * https://js.foundation/
+ * http://jquery.org/license
*
- * Date: 2019-04-08
+ * Date: 2016-08-08
*/
(function( window ) {
@@ -552,7 +578,6 @@ var i,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
- nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
@@ -614,7 +639,8 @@ var i,
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
- rdescend = new RegExp( whitespace + "|>" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
@@ -635,7 +661,6 @@ var i,
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
- rhtml = /HTML$/i,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
@@ -690,9 +715,9 @@ var i,
setDocument();
},
- inDisabledFieldset = addCombinator(
+ disabledAncestor = addCombinator(
function( elem ) {
- return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
+ return elem.disabled === true && ("form" in elem || "label" in elem);
},
{ dir: "parentNode", next: "legend" }
);
@@ -805,22 +830,18 @@ function Sizzle( selector, context, results, seed ) {
// Take advantage of querySelectorAll
if ( support.qsa &&
- !nonnativeSelectorCache[ selector + " " ] &&
- (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
+ !compilerCache[ selector + " " ] &&
+ (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- // Support: IE 8 only
+ if ( nodeType !== 1 ) {
+ newContext = context;
+ newSelector = selector;
+
+ // qSA looks outside Element context, which is not what we want
+ // Thanks to Andrew Dupont for this workaround technique
+ // Support: IE <=8
// Exclude object elements
- (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
-
- newSelector = selector;
- newContext = context;
-
- // qSA considers elements outside a scoping root when evaluating child or
- // descendant combinators, which is not what we want.
- // In such cases, we work around the behavior by prefixing every selector in the
- // list with an ID selector referencing the scope context.
- // Thanks to Andrew Dupont for this technique.
- if ( nodeType === 1 && rdescend.test( selector ) ) {
+ } else if ( context.nodeName.toLowerCase() !== "object" ) {
// Capture the context ID, setting it first if necessary
if ( (nid = context.getAttribute( "id" )) ) {
@@ -842,16 +863,17 @@ function Sizzle( selector, context, results, seed ) {
context;
}
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch ( qsaError ) {
- nonnativeSelectorCache( selector, true );
- } finally {
- if ( nid === expando ) {
- context.removeAttribute( "id" );
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch ( qsaError ) {
+ } finally {
+ if ( nid === expando ) {
+ context.removeAttribute( "id" );
+ }
}
}
}
@@ -1015,7 +1037,7 @@ function createDisabledPseudo( disabled ) {
// Where there is no isDisabled, check manually
/* jshint -W018 */
elem.isDisabled !== !disabled &&
- inDisabledFieldset( elem ) === disabled;
+ disabledAncestor( elem ) === disabled;
}
return elem.disabled === disabled;
@@ -1072,13 +1094,10 @@ support = Sizzle.support = {};
* @returns {Boolean} True iff elem is a non-HTML XML node
*/
isXML = Sizzle.isXML = function( elem ) {
- var namespace = elem.namespaceURI,
- docElem = (elem.ownerDocument || elem).documentElement;
-
- // Support: IE <=8
- // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
- // https://bugs.jquery.com/ticket/4833
- return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
};
/**
@@ -1500,8 +1519,11 @@ Sizzle.matchesSelector = function( elem, expr ) {
setDocument( elem );
}
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
if ( support.matchesSelector && documentIsHTML &&
- !nonnativeSelectorCache[ expr + " " ] &&
+ !compilerCache[ expr + " " ] &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
@@ -1515,9 +1537,7 @@ Sizzle.matchesSelector = function( elem, expr ) {
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
- } catch (e) {
- nonnativeSelectorCache( expr, true );
- }
+ } catch (e) {}
}
return Sizzle( expr, document, null, [ elem ] ).length > 0;
@@ -1976,7 +1996,7 @@ Expr = Sizzle.selectors = {
"contains": markFunction(function( text ) {
text = text.replace( runescape, funescape );
return function( elem ) {
- return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
};
}),
@@ -2115,11 +2135,7 @@ Expr = Sizzle.selectors = {
}),
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ?
- argument + length :
- argument > length ?
- length :
- argument;
+ var i = argument < 0 ? argument + length : argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
@@ -2832,9 +2848,11 @@ var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|
+var risSimple = /^.[^:#\[\.,]*$/;
+
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, not ) {
- if ( isFunction( qualifier ) ) {
+ if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep( elements, function( elem, i ) {
return !!qualifier.call( elem, i, elem ) !== not;
} );
@@ -2854,8 +2872,16 @@ function winnow( elements, qualifier, not ) {
} );
}
- // Filtered directly for both simple and complex selectors
- return jQuery.filter( qualifier, elements, not );
+ // Simple selector that can be filtered directly, removing non-Elements
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ // Complex selector, compare the two sets, removing non-Elements
+ qualifier = jQuery.filter( qualifier, elements );
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
+ } );
}
jQuery.filter = function( expr, elems, not ) {
@@ -2976,7 +3002,7 @@ var rootjQuery,
for ( match in context ) {
// Properties of context are called as methods if possible
- if ( isFunction( this[ match ] ) ) {
+ if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
// ...and otherwise set as attributes
@@ -3019,7 +3045,7 @@ var rootjQuery,
// HANDLE: $(function)
// Shortcut for document ready
- } else if ( isFunction( selector ) ) {
+ } else if ( jQuery.isFunction( selector ) ) {
return root.ready !== undefined ?
root.ready( selector ) :
@@ -3169,18 +3195,18 @@ jQuery.each( {
return siblings( elem.firstChild );
},
contents: function( elem ) {
- if ( typeof elem.contentDocument !== "undefined" ) {
- return elem.contentDocument;
- }
+ if ( nodeName( elem, "iframe" ) ) {
+ return elem.contentDocument;
+ }
- // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
- // Treat the template element as a regular one in browsers that
- // don't support it.
- if ( nodeName( elem, "template" ) ) {
- elem = elem.content || elem;
- }
+ // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
+ // Treat the template element as a regular one in browsers that
+ // don't support it.
+ if ( nodeName( elem, "template" ) ) {
+ elem = elem.content || elem;
+ }
- return jQuery.merge( [], elem.childNodes );
+ return jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
@@ -3334,11 +3360,11 @@ jQuery.Callbacks = function( options ) {
( function add( args ) {
jQuery.each( args, function( _, arg ) {
- if ( isFunction( arg ) ) {
+ if ( jQuery.isFunction( arg ) ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
- } else if ( arg && arg.length && toType( arg ) !== "string" ) {
+ } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
// Inspect recursively
add( arg );
@@ -3453,11 +3479,11 @@ function adoptValue( value, resolve, reject, noValue ) {
try {
// Check for promise aspect first to privilege synchronous behavior
- if ( value && isFunction( ( method = value.promise ) ) ) {
+ if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
method.call( value ).done( resolve ).fail( reject );
// Other thenables
- } else if ( value && isFunction( ( method = value.then ) ) ) {
+ } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
method.call( value, resolve, reject );
// Other non-thenables
@@ -3515,14 +3541,14 @@ jQuery.extend( {
jQuery.each( tuples, function( i, tuple ) {
// Map tuples (progress, done, fail) to arguments (done, fail, progress)
- var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
+ var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
// deferred.progress(function() { bind to newDefer or newDefer.notify })
// deferred.done(function() { bind to newDefer or newDefer.resolve })
// deferred.fail(function() { bind to newDefer or newDefer.reject })
deferred[ tuple[ 1 ] ]( function() {
var returned = fn && fn.apply( this, arguments );
- if ( returned && isFunction( returned.promise ) ) {
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise()
.progress( newDefer.notify )
.done( newDefer.resolve )
@@ -3576,7 +3602,7 @@ jQuery.extend( {
returned.then;
// Handle a returned thenable
- if ( isFunction( then ) ) {
+ if ( jQuery.isFunction( then ) ) {
// Special processors (notify) just wait for resolution
if ( special ) {
@@ -3672,7 +3698,7 @@ jQuery.extend( {
resolve(
0,
newDefer,
- isFunction( onProgress ) ?
+ jQuery.isFunction( onProgress ) ?
onProgress :
Identity,
newDefer.notifyWith
@@ -3684,7 +3710,7 @@ jQuery.extend( {
resolve(
0,
newDefer,
- isFunction( onFulfilled ) ?
+ jQuery.isFunction( onFulfilled ) ?
onFulfilled :
Identity
)
@@ -3695,7 +3721,7 @@ jQuery.extend( {
resolve(
0,
newDefer,
- isFunction( onRejected ) ?
+ jQuery.isFunction( onRejected ) ?
onRejected :
Thrower
)
@@ -3735,15 +3761,8 @@ jQuery.extend( {
// fulfilled_callbacks.disable
tuples[ 3 - i ][ 2 ].disable,
- // rejected_handlers.disable
- // fulfilled_handlers.disable
- tuples[ 3 - i ][ 3 ].disable,
-
// progress_callbacks.lock
- tuples[ 0 ][ 2 ].lock,
-
- // progress_handlers.lock
- tuples[ 0 ][ 3 ].lock
+ tuples[ 0 ][ 2 ].lock
);
}
@@ -3813,7 +3832,7 @@ jQuery.extend( {
// Use .then() to unwrap secondary thenables (cf. gh-3000)
if ( master.state() === "pending" ||
- isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
+ jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
return master.then();
}
@@ -3941,7 +3960,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
bulk = key == null;
// Sets many values
- if ( toType( key ) === "object" ) {
+ if ( jQuery.type( key ) === "object" ) {
chainable = true;
for ( i in key ) {
access( elems, fn, i, key[ i ], true, emptyGet, raw );
@@ -3951,7 +3970,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
} else if ( value !== undefined ) {
chainable = true;
- if ( !isFunction( value ) ) {
+ if ( !jQuery.isFunction( value ) ) {
raw = true;
}
@@ -3993,23 +4012,6 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
return len ? fn( elems[ 0 ], key ) : emptyGet;
};
-
-
-// Matches dashed string for camelizing
-var rmsPrefix = /^-ms-/,
- rdashAlpha = /-([a-z])/g;
-
-// Used by camelCase as callback to replace()
-function fcamelCase( all, letter ) {
- return letter.toUpperCase();
-}
-
-// Convert dashed to camelCase; used by the css and data modules
-// Support: IE <=9 - 11, Edge 12 - 15
-// Microsoft forgot to hump their vendor prefix (#9572)
-function camelCase( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-}
var acceptData = function( owner ) {
// Accepts only:
@@ -4072,14 +4074,14 @@ Data.prototype = {
// Handle: [ owner, key, value ] args
// Always use camelCase key (gh-2257)
if ( typeof data === "string" ) {
- cache[ camelCase( data ) ] = value;
+ cache[ jQuery.camelCase( data ) ] = value;
// Handle: [ owner, { properties } ] args
} else {
// Copy the properties one-by-one to the cache object
for ( prop in data ) {
- cache[ camelCase( prop ) ] = data[ prop ];
+ cache[ jQuery.camelCase( prop ) ] = data[ prop ];
}
}
return cache;
@@ -4089,7 +4091,7 @@ Data.prototype = {
this.cache( owner ) :
// Always use camelCase key (gh-2257)
- owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
+ owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
},
access: function( owner, key, value ) {
@@ -4137,9 +4139,9 @@ Data.prototype = {
// If key is an array of keys...
// We always set camelCase keys, so remove that.
- key = key.map( camelCase );
+ key = key.map( jQuery.camelCase );
} else {
- key = camelCase( key );
+ key = jQuery.camelCase( key );
// If a key with the spaces exists, use it.
// Otherwise, create an array by matching non-whitespace
@@ -4285,7 +4287,7 @@ jQuery.fn.extend( {
if ( attrs[ i ] ) {
name = attrs[ i ].name;
if ( name.indexOf( "data-" ) === 0 ) {
- name = camelCase( name.slice( 5 ) );
+ name = jQuery.camelCase( name.slice( 5 ) );
dataAttr( elem, name, data[ name ] );
}
}
@@ -4489,26 +4491,6 @@ var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-var documentElement = document.documentElement;
-
-
-
- var isAttached = function( elem ) {
- return jQuery.contains( elem.ownerDocument, elem );
- },
- composed = { composed: true };
-
- // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
- // Check attachment across shadow DOM boundaries when possible (gh-3504)
- // Support: iOS 10.0-10.2 only
- // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
- // leading to errors. We need to check for `getRootNode`.
- if ( documentElement.getRootNode ) {
- isAttached = function( elem ) {
- return jQuery.contains( elem.ownerDocument, elem ) ||
- elem.getRootNode( composed ) === elem.ownerDocument;
- };
- }
var isHiddenWithinTree = function( elem, el ) {
// isHiddenWithinTree might be called from jQuery#filter function;
@@ -4523,7 +4505,7 @@ var isHiddenWithinTree = function( elem, el ) {
// Support: Firefox <=43 - 45
// Disconnected elements can have computed display: none, so first confirm that elem is
// in the document.
- isAttached( elem ) &&
+ jQuery.contains( elem.ownerDocument, elem ) &&
jQuery.css( elem, "display" ) === "none";
};
@@ -4552,7 +4534,8 @@ var swap = function( elem, options, callback, args ) {
function adjustCSS( elem, prop, valueParts, tween ) {
- var adjusted, scale,
+ var adjusted,
+ scale = 1,
maxIterations = 20,
currentValue = tween ?
function() {
@@ -4565,39 +4548,35 @@ function adjustCSS( elem, prop, valueParts, tween ) {
unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
// Starting value computation is required for potential unit mismatches
- initialInUnit = elem.nodeType &&
- ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
rcssNum.exec( jQuery.css( elem, prop ) );
if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
- // Support: Firefox <=54
- // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
- initial = initial / 2;
-
// Trust units reported by jQuery.css
unit = unit || initialInUnit[ 3 ];
+ // Make sure we update the tween properties later on
+ valueParts = valueParts || [];
+
// Iteratively approximate from a nonzero starting point
initialInUnit = +initial || 1;
- while ( maxIterations-- ) {
+ do {
- // Evaluate and update our best guess (doubling guesses that zero out).
- // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
- jQuery.style( elem, prop, initialInUnit + unit );
- if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
- maxIterations = 0;
- }
+ // 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
initialInUnit = initialInUnit / scale;
+ jQuery.style( elem, prop, initialInUnit + unit );
- }
-
- initialInUnit = initialInUnit * 2;
- jQuery.style( elem, prop, initialInUnit + unit );
-
- // Make sure we update the tween properties later on
- valueParts = valueParts || [];
+ // 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 = currentValue() / initial ) && scale !== 1 && --maxIterations
+ );
}
if ( valueParts ) {
@@ -4713,9 +4692,9 @@ jQuery.fn.extend( {
} );
var rcheckableType = ( /^(?:checkbox|radio)$/i );
-var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
+var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
-var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
+var rscriptType = ( /^$|\/(?:java|ecma)script/i );
@@ -4785,7 +4764,7 @@ function setGlobalEval( elems, refElements ) {
var rhtml = /<|?\w+;/;
function buildFragment( elems, context, scripts, selection, ignored ) {
- var elem, tmp, tag, wrap, attached, j,
+ var elem, tmp, tag, wrap, contains, j,
fragment = context.createDocumentFragment(),
nodes = [],
i = 0,
@@ -4797,7 +4776,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
if ( elem || elem === 0 ) {
// Add nodes directly
- if ( toType( elem ) === "object" ) {
+ if ( jQuery.type( elem ) === "object" ) {
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
@@ -4849,13 +4828,13 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
continue;
}
- attached = isAttached( elem );
+ contains = jQuery.contains( elem.ownerDocument, elem );
// Append to fragment
tmp = getAll( fragment.appendChild( elem ), "script" );
// Preserve script evaluation history
- if ( attached ) {
+ if ( contains ) {
setGlobalEval( tmp );
}
@@ -4898,6 +4877,8 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
div.innerHTML = "";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
} )();
+var documentElement = document.documentElement;
+
var
@@ -4913,19 +4894,8 @@ function returnFalse() {
return false;
}
-// Support: IE <=9 - 11+
-// focus() and blur() are asynchronous, except when they are no-op.
-// So expect focus to be synchronous when the element is already active,
-// and blur to be synchronous when the element is not already active.
-// (focus and blur are always synchronous in other supported browsers,
-// this just defines when we can count on it).
-function expectSync( elem, type ) {
- return ( elem === safeActiveElement() ) === ( type === "focus" );
-}
-
// Support: IE <=9 only
-// Accessing document.activeElement can throw unexpectedly
-// https://bugs.jquery.com/ticket/13393
+// See #13393 for more info
function safeActiveElement() {
try {
return document.activeElement;
@@ -5225,10 +5195,9 @@ jQuery.event = {
while ( ( handleObj = matched.handlers[ j++ ] ) &&
!event.isImmediatePropagationStopped() ) {
- // If the event is namespaced, then each handler is only invoked if it is
- // specially universal or its namespaces are a superset of the event's.
- if ( !event.rnamespace || handleObj.namespace === false ||
- event.rnamespace.test( handleObj.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.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
event.handleObj = handleObj;
event.data = handleObj.data;
@@ -5317,7 +5286,7 @@ jQuery.event = {
enumerable: true,
configurable: true,
- get: isFunction( hook ) ?
+ get: jQuery.isFunction( hook ) ?
function() {
if ( this.originalEvent ) {
return hook( this.originalEvent );
@@ -5352,51 +5321,39 @@ jQuery.event = {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
},
+ focus: {
+
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ this.focus();
+ return false;
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
click: {
- // Utilize native event to ensure correct state for checkable inputs
- setup: function( data ) {
-
- // For mutual compressibility with _default, replace `this` access with a local var.
- // `|| data` is dead code meant only to preserve the variable through minification.
- var el = this || data;
-
- // Claim the first handler
- if ( rcheckableType.test( el.type ) &&
- el.click && nodeName( el, "input" ) ) {
-
- // dataPriv.set( el, "click", ... )
- leverageNative( el, "click", returnTrue );
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {
+ this.click();
+ return false;
}
-
- // Return false to allow normal processing in the caller
- return false;
- },
- trigger: function( data ) {
-
- // For mutual compressibility with _default, replace `this` access with a local var.
- // `|| data` is dead code meant only to preserve the variable through minification.
- var el = this || data;
-
- // Force setup before triggering a click
- if ( rcheckableType.test( el.type ) &&
- el.click && nodeName( el, "input" ) ) {
-
- leverageNative( el, "click" );
- }
-
- // Return non-false to allow normal event-path propagation
- return true;
},
- // For cross-browser consistency, suppress native .click() on links
- // Also prevent it if we're currently inside a leveraged native-event stack
+ // For cross-browser consistency, don't fire native .click() on links
_default: function( event ) {
- var target = event.target;
- return rcheckableType.test( target.type ) &&
- target.click && nodeName( target, "input" ) &&
- dataPriv.get( target, "click" ) ||
- nodeName( target, "a" );
+ return nodeName( event.target, "a" );
}
},
@@ -5413,93 +5370,6 @@ jQuery.event = {
}
};
-// Ensure the presence of an event listener that handles manually-triggered
-// synthetic events by interrupting progress until reinvoked in response to
-// *native* events that it fires directly, ensuring that state changes have
-// already occurred before other listeners are invoked.
-function leverageNative( el, type, expectSync ) {
-
- // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
- if ( !expectSync ) {
- if ( dataPriv.get( el, type ) === undefined ) {
- jQuery.event.add( el, type, returnTrue );
- }
- return;
- }
-
- // Register the controller as a special universal handler for all event namespaces
- dataPriv.set( el, type, false );
- jQuery.event.add( el, type, {
- namespace: false,
- handler: function( event ) {
- var notAsync, result,
- saved = dataPriv.get( this, type );
-
- if ( ( event.isTrigger & 1 ) && this[ type ] ) {
-
- // Interrupt processing of the outer synthetic .trigger()ed event
- // Saved data should be false in such cases, but might be a leftover capture object
- // from an async native handler (gh-4350)
- if ( !saved.length ) {
-
- // Store arguments for use when handling the inner native event
- // There will always be at least one argument (an event object), so this array
- // will not be confused with a leftover capture object.
- saved = slice.call( arguments );
- dataPriv.set( this, type, saved );
-
- // Trigger the native event and capture its result
- // Support: IE <=9 - 11+
- // focus() and blur() are asynchronous
- notAsync = expectSync( this, type );
- this[ type ]();
- result = dataPriv.get( this, type );
- if ( saved !== result || notAsync ) {
- dataPriv.set( this, type, false );
- } else {
- result = {};
- }
- if ( saved !== result ) {
-
- // Cancel the outer synthetic event
- event.stopImmediatePropagation();
- event.preventDefault();
- return result.value;
- }
-
- // If this is an inner synthetic event for an event with a bubbling surrogate
- // (focus or blur), assume that the surrogate already propagated from triggering the
- // native event and prevent that from happening again here.
- // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
- // bubbling surrogate propagates *after* the non-bubbling base), but that seems
- // less bad than duplication.
- } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
- event.stopPropagation();
- }
-
- // If this is a native event triggered above, everything is now in order
- // Fire an inner synthetic event with the original arguments
- } else if ( saved.length ) {
-
- // ...and capture the result
- dataPriv.set( this, type, {
- value: jQuery.event.trigger(
-
- // Support: IE <=9 - 11+
- // Extend with the prototype to reset the above stopImmediatePropagation()
- jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
- saved.slice( 1 ),
- this
- )
- } );
-
- // Abort handling of the native event
- event.stopImmediatePropagation();
- }
- }
- } );
-}
-
jQuery.removeEvent = function( elem, type, handle ) {
// This "if" is needed for plain objects
@@ -5551,7 +5421,7 @@ jQuery.Event = function( src, props ) {
}
// Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || Date.now();
+ this.timeStamp = src && src.timeStamp || jQuery.now();
// Mark it as fixed
this[ jQuery.expando ] = true;
@@ -5612,7 +5482,6 @@ jQuery.each( {
shiftKey: true,
view: true,
"char": true,
- code: true,
charCode: true,
key: true,
keyCode: true,
@@ -5659,33 +5528,6 @@ jQuery.each( {
}
}, jQuery.event.addProp );
-jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
- jQuery.event.special[ type ] = {
-
- // Utilize native event if possible so blur/focus sequence is correct
- setup: function() {
-
- // Claim the first handler
- // dataPriv.set( this, "focus", ... )
- // dataPriv.set( this, "blur", ... )
- leverageNative( this, type, expectSync );
-
- // Return false to allow normal processing in the caller
- return false;
- },
- trigger: function() {
-
- // Force setup before trigger
- leverageNative( this, type );
-
- // Return non-false to allow normal event-path propagation
- return true;
- },
-
- delegateType: delegateType
- };
-} );
-
// Create mouseenter/leave events using mouseover/out and event-time checks
// so that event delegation works in jQuery.
// Do the same for pointerenter/pointerleave and pointerover/pointerout
@@ -5778,13 +5620,14 @@ var
/* eslint-enable */
- // Support: IE <=10 - 11, Edge 12 - 13 only
+ // Support: IE <=10 - 11, Edge 12 - 13
// In IE/Edge using regex groups here causes severe slowdowns.
// See https://connect.microsoft.com/IE/feedback/details/1736512/
rnoInnerhtml = /