mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
0c7088e379
commit
cf2c7ca241
157 changed files with 2861 additions and 2975 deletions
14
dashboard-ui/bower_components/jquery/src/ajax.js
vendored
14
dashboard-ui/bower_components/jquery/src/ajax.js
vendored
|
@ -1,7 +1,7 @@
|
|||
define( [
|
||||
"./core",
|
||||
"./var/document",
|
||||
"./var/rnotwhite",
|
||||
"./var/rnothtmlwhite",
|
||||
"./ajax/var/location",
|
||||
"./ajax/var/nonce",
|
||||
"./ajax/var/rquery",
|
||||
|
@ -11,14 +11,14 @@ define( [
|
|||
"./event/trigger",
|
||||
"./deferred",
|
||||
"./serialize" // jQuery.param
|
||||
], function( jQuery, document, rnotwhite, location, nonce, rquery ) {
|
||||
], function( jQuery, document, rnothtmlwhite, location, nonce, rquery ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var
|
||||
r20 = /%20/g,
|
||||
rhash = /#.*$/,
|
||||
rts = /([?&])_=[^&]*/,
|
||||
rantiCache = /([?&])_=[^&]*/,
|
||||
rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
|
||||
|
||||
// #7653, #8125, #8152: local protocol detection
|
||||
|
@ -64,7 +64,7 @@ function addToPrefiltersOrTransports( structure ) {
|
|||
|
||||
var dataType,
|
||||
i = 0,
|
||||
dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
|
||||
dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
|
||||
|
||||
if ( jQuery.isFunction( func ) ) {
|
||||
|
||||
|
@ -532,7 +532,7 @@ jQuery.extend( {
|
|||
s.type = options.method || options.type || s.method || s.type;
|
||||
|
||||
// Extract dataTypes list
|
||||
s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
|
||||
s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
|
||||
|
||||
// A cross-domain request is in order when the origin doesn't match the current origin.
|
||||
if ( s.crossDomain == null ) {
|
||||
|
@ -604,9 +604,9 @@ jQuery.extend( {
|
|||
delete s.data;
|
||||
}
|
||||
|
||||
// Add anti-cache in uncached url if needed
|
||||
// Add or update anti-cache param if needed
|
||||
if ( s.cache === false ) {
|
||||
cacheURL = cacheURL.replace( rts, "" );
|
||||
cacheURL = cacheURL.replace( rantiCache, "$1" );
|
||||
uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
define( [
|
||||
"../core",
|
||||
"../core/stripAndCollapse",
|
||||
"../core/parseHTML",
|
||||
"../ajax",
|
||||
"../traversing",
|
||||
"../manipulation",
|
||||
"../selector"
|
||||
], function( jQuery ) {
|
||||
], function( jQuery, stripAndCollapse ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -18,7 +19,7 @@ jQuery.fn.load = function( url, params, callback ) {
|
|||
off = url.indexOf( " " );
|
||||
|
||||
if ( off > -1 ) {
|
||||
selector = jQuery.trim( url.slice( off ) );
|
||||
selector = stripAndCollapse( url.slice( off ) );
|
||||
url = url.slice( 0, off );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ define( [
|
|||
"../core",
|
||||
"../core/access",
|
||||
"./support",
|
||||
"../var/rnotwhite",
|
||||
"../var/rnothtmlwhite",
|
||||
"../selector"
|
||||
], function( jQuery, access, support, rnotwhite ) {
|
||||
], function( jQuery, access, support, rnothtmlwhite ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -89,7 +89,10 @@ jQuery.extend( {
|
|||
removeAttr: function( elem, value ) {
|
||||
var name,
|
||||
i = 0,
|
||||
attrNames = value && value.match( rnotwhite );
|
||||
|
||||
// Attribute names can contain non-HTML whitespace characters
|
||||
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
|
||||
attrNames = value && value.match( rnothtmlwhite );
|
||||
|
||||
if ( attrNames && elem.nodeType === 1 ) {
|
||||
while ( ( name = attrNames[ i++ ] ) ) {
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
define( [
|
||||
"../core",
|
||||
"../var/rnotwhite",
|
||||
"../core/stripAndCollapse",
|
||||
"../var/rnothtmlwhite",
|
||||
"../data/var/dataPriv",
|
||||
"../core/init"
|
||||
], function( jQuery, rnotwhite, dataPriv ) {
|
||||
], function( jQuery, stripAndCollapse, rnothtmlwhite, dataPriv ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var rclass = /[\t\r\n\f]/g;
|
||||
|
||||
function getClass( elem ) {
|
||||
return elem.getAttribute && elem.getAttribute( "class" ) || "";
|
||||
}
|
||||
|
@ -25,12 +24,11 @@ jQuery.fn.extend( {
|
|||
}
|
||||
|
||||
if ( typeof value === "string" && value ) {
|
||||
classes = value.match( rnotwhite ) || [];
|
||||
classes = value.match( rnothtmlwhite ) || [];
|
||||
|
||||
while ( ( elem = this[ i++ ] ) ) {
|
||||
curValue = getClass( elem );
|
||||
cur = elem.nodeType === 1 &&
|
||||
( " " + curValue + " " ).replace( rclass, " " );
|
||||
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
||||
|
||||
if ( cur ) {
|
||||
j = 0;
|
||||
|
@ -41,7 +39,7 @@ jQuery.fn.extend( {
|
|||
}
|
||||
|
||||
// Only assign if different to avoid unneeded rendering.
|
||||
finalValue = jQuery.trim( cur );
|
||||
finalValue = stripAndCollapse( cur );
|
||||
if ( curValue !== finalValue ) {
|
||||
elem.setAttribute( "class", finalValue );
|
||||
}
|
||||
|
@ -67,14 +65,13 @@ jQuery.fn.extend( {
|
|||
}
|
||||
|
||||
if ( typeof value === "string" && value ) {
|
||||
classes = value.match( rnotwhite ) || [];
|
||||
classes = value.match( rnothtmlwhite ) || [];
|
||||
|
||||
while ( ( elem = this[ i++ ] ) ) {
|
||||
curValue = getClass( elem );
|
||||
|
||||
// This expression is here for better compressibility (see addClass)
|
||||
cur = elem.nodeType === 1 &&
|
||||
( " " + curValue + " " ).replace( rclass, " " );
|
||||
cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
|
||||
|
||||
if ( cur ) {
|
||||
j = 0;
|
||||
|
@ -87,7 +84,7 @@ jQuery.fn.extend( {
|
|||
}
|
||||
|
||||
// Only assign if different to avoid unneeded rendering.
|
||||
finalValue = jQuery.trim( cur );
|
||||
finalValue = stripAndCollapse( cur );
|
||||
if ( curValue !== finalValue ) {
|
||||
elem.setAttribute( "class", finalValue );
|
||||
}
|
||||
|
@ -122,7 +119,7 @@ jQuery.fn.extend( {
|
|||
// Toggle individual class names
|
||||
i = 0;
|
||||
self = jQuery( this );
|
||||
classNames = value.match( rnotwhite ) || [];
|
||||
classNames = value.match( rnothtmlwhite ) || [];
|
||||
|
||||
while ( ( className = classNames[ i++ ] ) ) {
|
||||
|
||||
|
@ -165,10 +162,8 @@ jQuery.fn.extend( {
|
|||
className = " " + selector + " ";
|
||||
while ( ( elem = this[ i++ ] ) ) {
|
||||
if ( elem.nodeType === 1 &&
|
||||
( " " + getClass( elem ) + " " ).replace( rclass, " " )
|
||||
.indexOf( className ) > -1
|
||||
) {
|
||||
return true;
|
||||
( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,12 +66,19 @@ jQuery.extend( {
|
|||
// Use proper attribute retrieval(#12072)
|
||||
var tabindex = jQuery.find.attr( elem, "tabindex" );
|
||||
|
||||
return tabindex ?
|
||||
parseInt( tabindex, 10 ) :
|
||||
if ( tabindex ) {
|
||||
return parseInt( tabindex, 10 );
|
||||
}
|
||||
|
||||
if (
|
||||
rfocusable.test( elem.nodeName ) ||
|
||||
rclickable.test( elem.nodeName ) && elem.href ?
|
||||
0 :
|
||||
-1;
|
||||
rclickable.test( elem.nodeName ) &&
|
||||
elem.href
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -88,9 +95,14 @@ jQuery.extend( {
|
|||
// on the option
|
||||
// The getter ensures a default option is selected
|
||||
// when in an optgroup
|
||||
// eslint rule "no-unused-expressions" is disabled for this code
|
||||
// since it considers such accessions noop
|
||||
if ( !support.optSelected ) {
|
||||
jQuery.propHooks.selected = {
|
||||
get: function( elem ) {
|
||||
|
||||
/* eslint no-unused-expressions: "off" */
|
||||
|
||||
var parent = elem.parentNode;
|
||||
if ( parent && parent.parentNode ) {
|
||||
parent.parentNode.selectedIndex;
|
||||
|
@ -98,6 +110,9 @@ if ( !support.optSelected ) {
|
|||
return null;
|
||||
},
|
||||
set: function( elem ) {
|
||||
|
||||
/* eslint no-unused-expressions: "off" */
|
||||
|
||||
var parent = elem.parentNode;
|
||||
if ( parent ) {
|
||||
parent.selectedIndex;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
define( [
|
||||
"../core",
|
||||
"../core/stripAndCollapse",
|
||||
"./support",
|
||||
"../core/init"
|
||||
], function( jQuery, support ) {
|
||||
], function( jQuery, stripAndCollapse, support ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var rreturn = /\r/g,
|
||||
rspaces = /[\x20\t\r\n\f]+/g;
|
||||
var rreturn = /\r/g;
|
||||
|
||||
jQuery.fn.extend( {
|
||||
val: function( value ) {
|
||||
|
@ -28,13 +28,13 @@ jQuery.fn.extend( {
|
|||
|
||||
ret = elem.value;
|
||||
|
||||
return typeof ret === "string" ?
|
||||
// Handle most common string cases
|
||||
if ( typeof ret === "string" ) {
|
||||
return ret.replace( rreturn, "" );
|
||||
}
|
||||
|
||||
// Handle most common string cases
|
||||
ret.replace( rreturn, "" ) :
|
||||
|
||||
// Handle cases where value is null/undef or number
|
||||
ret == null ? "" : ret;
|
||||
// Handle cases where value is null/undef or number
|
||||
return ret == null ? "" : ret;
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -91,20 +91,24 @@ jQuery.extend( {
|
|||
// option.text throws exceptions (#14686, #14858)
|
||||
// Strip and collapse whitespace
|
||||
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
|
||||
jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
|
||||
stripAndCollapse( jQuery.text( elem ) );
|
||||
}
|
||||
},
|
||||
select: {
|
||||
get: function( elem ) {
|
||||
var value, option,
|
||||
var value, option, i,
|
||||
options = elem.options,
|
||||
index = elem.selectedIndex,
|
||||
one = elem.type === "select-one",
|
||||
values = one ? null : [],
|
||||
max = one ? index + 1 : options.length,
|
||||
i = index < 0 ?
|
||||
max :
|
||||
one ? index : 0;
|
||||
max = one ? index + 1 : options.length;
|
||||
|
||||
if ( index < 0 ) {
|
||||
i = max;
|
||||
|
||||
} else {
|
||||
i = one ? index : 0;
|
||||
}
|
||||
|
||||
// Loop through all the selected options
|
||||
for ( ; i < max; i++ ) {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
define( [
|
||||
"./core",
|
||||
"./var/rnotwhite"
|
||||
], function( jQuery, rnotwhite ) {
|
||||
"./var/rnothtmlwhite"
|
||||
], function( jQuery, rnothtmlwhite ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// Convert String-formatted options into Object-formatted ones
|
||||
function createOptions( options ) {
|
||||
var object = {};
|
||||
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
|
||||
jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
|
||||
object[ flag ] = true;
|
||||
} );
|
||||
return object;
|
||||
|
|
15
dashboard-ui/bower_components/jquery/src/core.js
vendored
15
dashboard-ui/bower_components/jquery/src/core.js
vendored
|
@ -1,5 +1,5 @@
|
|||
/* global Symbol */
|
||||
// Defining this global in .eslintrc would create a danger of using the global
|
||||
// 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
|
||||
|
||||
define( [
|
||||
|
@ -24,7 +24,7 @@ define( [
|
|||
"use strict";
|
||||
|
||||
var
|
||||
version = "3.1.0",
|
||||
version = "3.1.1",
|
||||
|
||||
// Define a local copy of jQuery
|
||||
jQuery = function( selector, context ) {
|
||||
|
@ -64,13 +64,14 @@ jQuery.fn = jQuery.prototype = {
|
|||
// Get the Nth element in the matched element set OR
|
||||
// Get the whole matched element set as a clean array
|
||||
get: function( num ) {
|
||||
return num != null ?
|
||||
|
||||
// Return just the one element from the set
|
||||
( num < 0 ? this[ num + this.length ] : this[ num ] ) :
|
||||
// Return all the elements in a clean array
|
||||
if ( num == null ) {
|
||||
return slice.call( this );
|
||||
}
|
||||
|
||||
// Return all the elements in a clean array
|
||||
slice.call( this );
|
||||
// Return just the one element from the set
|
||||
return num < 0 ? this[ num + this.length ] : this[ num ];
|
||||
},
|
||||
|
||||
// Take an array of elements and push it onto the stack
|
||||
|
|
|
@ -53,13 +53,16 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
|||
}
|
||||
}
|
||||
|
||||
return chainable ?
|
||||
elems :
|
||||
if ( chainable ) {
|
||||
return elems;
|
||||
}
|
||||
|
||||
// Gets
|
||||
bulk ?
|
||||
fn.call( elems ) :
|
||||
len ? fn( elems[ 0 ], key ) : emptyGet;
|
||||
// Gets
|
||||
if ( bulk ) {
|
||||
return fn.call( elems );
|
||||
}
|
||||
|
||||
return len ? fn( elems[ 0 ], key ) : emptyGet;
|
||||
};
|
||||
|
||||
return access;
|
||||
|
|
|
@ -6,7 +6,6 @@ define( [
|
|||
"use strict";
|
||||
|
||||
var readyCallbacks = [],
|
||||
readyFiring = false,
|
||||
whenReady = function( fn ) {
|
||||
readyCallbacks.push( fn );
|
||||
},
|
||||
|
@ -60,16 +59,11 @@ jQuery.extend( {
|
|||
whenReady = function( fn ) {
|
||||
readyCallbacks.push( fn );
|
||||
|
||||
if ( !readyFiring ) {
|
||||
readyFiring = true;
|
||||
|
||||
while ( readyCallbacks.length ) {
|
||||
fn = readyCallbacks.shift();
|
||||
if ( jQuery.isFunction( fn ) ) {
|
||||
executeReady( fn );
|
||||
}
|
||||
while ( readyCallbacks.length ) {
|
||||
fn = readyCallbacks.shift();
|
||||
if ( jQuery.isFunction( fn ) ) {
|
||||
executeReady( fn );
|
||||
}
|
||||
readyFiring = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
14
dashboard-ui/bower_components/jquery/src/core/stripAndCollapse.js
vendored
Normal file
14
dashboard-ui/bower_components/jquery/src/core/stripAndCollapse.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
define( [
|
||||
"../var/rnothtmlwhite"
|
||||
], function( rnothtmlwhite ) {
|
||||
"use strict";
|
||||
|
||||
// Strip and collapse whitespace according to HTML spec
|
||||
// https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
|
||||
function stripAndCollapse( value ) {
|
||||
var tokens = value.match( rnothtmlwhite ) || [];
|
||||
return tokens.join( " " );
|
||||
}
|
||||
|
||||
return stripAndCollapse;
|
||||
} );
|
18
dashboard-ui/bower_components/jquery/src/css.js
vendored
18
dashboard-ui/bower_components/jquery/src/css.js
vendored
|
@ -70,16 +70,18 @@ function setPositiveNumber( elem, value, subtract ) {
|
|||
}
|
||||
|
||||
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
||||
var i = extra === ( isBorderBox ? "border" : "content" ) ?
|
||||
|
||||
// If we already have the right measurement, avoid augmentation
|
||||
4 :
|
||||
|
||||
// Otherwise initialize for horizontal or vertical properties
|
||||
name === "width" ? 1 : 0,
|
||||
|
||||
var i,
|
||||
val = 0;
|
||||
|
||||
// If we already have the right measurement, avoid augmentation
|
||||
if ( extra === ( isBorderBox ? "border" : "content" ) ) {
|
||||
i = 4;
|
||||
|
||||
// Otherwise initialize for horizontal or vertical properties
|
||||
} else {
|
||||
i = name === "width" ? 1 : 0;
|
||||
}
|
||||
|
||||
for ( ; i < 4; i += 2 ) {
|
||||
|
||||
// Both box models exclude margin, so add it if we want it
|
||||
|
|
|
@ -18,7 +18,7 @@ function getDefaultDisplay( elem ) {
|
|||
return display;
|
||||
}
|
||||
|
||||
temp = doc.body.appendChild( doc.createElement( nodeName ) ),
|
||||
temp = doc.body.appendChild( doc.createElement( nodeName ) );
|
||||
display = jQuery.css( temp, "display" );
|
||||
|
||||
temp.parentNode.removeChild( temp );
|
||||
|
|
34
dashboard-ui/bower_components/jquery/src/data.js
vendored
34
dashboard-ui/bower_components/jquery/src/data.js
vendored
|
@ -20,6 +20,31 @@ define( [
|
|||
var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
|
||||
rmultiDash = /[A-Z]/g;
|
||||
|
||||
function getData( data ) {
|
||||
if ( data === "true" ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( data === "false" ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( data === "null" ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Only convert to a number if it doesn't change the string
|
||||
if ( data === +data + "" ) {
|
||||
return +data;
|
||||
}
|
||||
|
||||
if ( rbrace.test( data ) ) {
|
||||
return JSON.parse( data );
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function dataAttr( elem, key, data ) {
|
||||
var name;
|
||||
|
||||
|
@ -31,14 +56,7 @@ function dataAttr( elem, key, data ) {
|
|||
|
||||
if ( typeof data === "string" ) {
|
||||
try {
|
||||
data = data === "true" ? true :
|
||||
data === "false" ? false :
|
||||
data === "null" ? null :
|
||||
|
||||
// Only convert to a number if it doesn't change the string
|
||||
+data + "" === data ? +data :
|
||||
rbrace.test( data ) ? JSON.parse( data ) :
|
||||
data;
|
||||
data = getData( data );
|
||||
} catch ( e ) {}
|
||||
|
||||
// Make sure we set the data so it isn't changed later
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
define( [
|
||||
"../core",
|
||||
"../var/rnotwhite",
|
||||
"../var/rnothtmlwhite",
|
||||
"./var/acceptData"
|
||||
], function( jQuery, rnotwhite, acceptData ) {
|
||||
], function( jQuery, rnothtmlwhite, acceptData ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -127,7 +127,7 @@ Data.prototype = {
|
|||
// Otherwise, create an array by matching non-whitespace
|
||||
key = key in cache ?
|
||||
[ key ] :
|
||||
( key.match( rnotwhite ) || [] );
|
||||
( key.match( rnothtmlwhite ) || [] );
|
||||
}
|
||||
|
||||
i = key.length;
|
||||
|
|
|
@ -2,7 +2,7 @@ define( [
|
|||
"./core",
|
||||
"./var/document",
|
||||
"./var/rcssNum",
|
||||
"./var/rnotwhite",
|
||||
"./var/rnothtmlwhite",
|
||||
"./css/var/cssExpand",
|
||||
"./css/var/isHiddenWithinTree",
|
||||
"./css/var/swap",
|
||||
|
@ -17,7 +17,7 @@ define( [
|
|||
"./manipulation",
|
||||
"./css",
|
||||
"./effects/Tween"
|
||||
], function( jQuery, document, rcssNum, rnotwhite, cssExpand, isHiddenWithinTree, swap,
|
||||
], function( jQuery, document, rcssNum, rnothtmlwhite, cssExpand, isHiddenWithinTree, swap,
|
||||
adjustCSS, dataPriv, showHide ) {
|
||||
|
||||
"use strict";
|
||||
|
@ -415,7 +415,7 @@ jQuery.Animation = jQuery.extend( Animation, {
|
|||
callback = props;
|
||||
props = [ "*" ];
|
||||
} else {
|
||||
props = props.match( rnotwhite );
|
||||
props = props.match( rnothtmlwhite );
|
||||
}
|
||||
|
||||
var prop,
|
||||
|
@ -453,9 +453,14 @@ jQuery.speed = function( speed, easing, fn ) {
|
|||
opt.duration = 0;
|
||||
|
||||
} else {
|
||||
opt.duration = typeof opt.duration === "number" ?
|
||||
opt.duration : opt.duration in jQuery.fx.speeds ?
|
||||
jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
||||
if ( typeof opt.duration !== "number" ) {
|
||||
if ( opt.duration in jQuery.fx.speeds ) {
|
||||
opt.duration = jQuery.fx.speeds[ opt.duration ];
|
||||
|
||||
} else {
|
||||
opt.duration = jQuery.fx.speeds._default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize opt.queue - true/undefined/null -> "fx"
|
||||
|
|
|
@ -2,13 +2,13 @@ define( [
|
|||
"./core",
|
||||
"./var/document",
|
||||
"./var/documentElement",
|
||||
"./var/rnotwhite",
|
||||
"./var/rnothtmlwhite",
|
||||
"./var/slice",
|
||||
"./data/var/dataPriv",
|
||||
|
||||
"./core/init",
|
||||
"./selector"
|
||||
], function( jQuery, document, documentElement, rnotwhite, slice, dataPriv ) {
|
||||
], function( jQuery, document, documentElement, rnothtmlwhite, slice, dataPriv ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -147,7 +147,7 @@ jQuery.event = {
|
|||
}
|
||||
|
||||
// Handle multiple events separated by a space
|
||||
types = ( types || "" ).match( rnotwhite ) || [ "" ];
|
||||
types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
|
||||
t = types.length;
|
||||
while ( t-- ) {
|
||||
tmp = rtypenamespace.exec( types[ t ] ) || [];
|
||||
|
@ -229,7 +229,7 @@ jQuery.event = {
|
|||
}
|
||||
|
||||
// Once for each type.namespace in types; type may be omitted
|
||||
types = ( types || "" ).match( rnotwhite ) || [ "" ];
|
||||
types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
|
||||
t = types.length;
|
||||
while ( t-- ) {
|
||||
tmp = rtypenamespace.exec( types[ t ] ) || [];
|
||||
|
@ -355,51 +355,58 @@ jQuery.event = {
|
|||
},
|
||||
|
||||
handlers: function( event, handlers ) {
|
||||
var i, matches, sel, handleObj,
|
||||
var i, handleObj, sel, matchedHandlers, matchedSelectors,
|
||||
handlerQueue = [],
|
||||
delegateCount = handlers.delegateCount,
|
||||
cur = event.target;
|
||||
|
||||
// Support: IE <=9
|
||||
// Find delegate handlers
|
||||
// Black-hole SVG <use> instance trees (#13180)
|
||||
//
|
||||
// Support: Firefox <=42
|
||||
// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
|
||||
if ( delegateCount && cur.nodeType &&
|
||||
( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
|
||||
if ( delegateCount &&
|
||||
|
||||
// Support: IE <=9
|
||||
// Black-hole SVG <use> instance trees (trac-13180)
|
||||
cur.nodeType &&
|
||||
|
||||
// Support: Firefox <=42
|
||||
// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
|
||||
// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
|
||||
// Support: IE 11 only
|
||||
// ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
|
||||
!( event.type === "click" && event.button >= 1 ) ) {
|
||||
|
||||
for ( ; cur !== this; cur = cur.parentNode || this ) {
|
||||
|
||||
// Don't check non-elements (#13208)
|
||||
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
||||
if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
|
||||
matches = [];
|
||||
if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
|
||||
matchedHandlers = [];
|
||||
matchedSelectors = {};
|
||||
for ( i = 0; i < delegateCount; i++ ) {
|
||||
handleObj = handlers[ i ];
|
||||
|
||||
// Don't conflict with Object.prototype properties (#13203)
|
||||
sel = handleObj.selector + " ";
|
||||
|
||||
if ( matches[ sel ] === undefined ) {
|
||||
matches[ sel ] = handleObj.needsContext ?
|
||||
if ( matchedSelectors[ sel ] === undefined ) {
|
||||
matchedSelectors[ sel ] = handleObj.needsContext ?
|
||||
jQuery( sel, this ).index( cur ) > -1 :
|
||||
jQuery.find( sel, this, null, [ cur ] ).length;
|
||||
}
|
||||
if ( matches[ sel ] ) {
|
||||
matches.push( handleObj );
|
||||
if ( matchedSelectors[ sel ] ) {
|
||||
matchedHandlers.push( handleObj );
|
||||
}
|
||||
}
|
||||
if ( matches.length ) {
|
||||
handlerQueue.push( { elem: cur, handlers: matches } );
|
||||
if ( matchedHandlers.length ) {
|
||||
handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the remaining (directly-bound) handlers
|
||||
cur = this;
|
||||
if ( delegateCount < handlers.length ) {
|
||||
handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
|
||||
handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
|
||||
}
|
||||
|
||||
return handlerQueue;
|
||||
|
@ -633,7 +640,19 @@ jQuery.each( {
|
|||
|
||||
// Add which for click: 1 === left; 2 === middle; 3 === right
|
||||
if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
|
||||
return ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
|
||||
if ( button & 1 ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( button & 2 ) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
if ( button & 4 ) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return event.which;
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
/* ExcludeStart */
|
||||
define( [
|
||||
"../core"
|
||||
], function( jQuery, noGlobal ) {
|
||||
|
||||
// This file is included in a different way from all the others
|
||||
// so the "use strict" pragma is not needed.
|
||||
/* eslint strict: "off" */
|
||||
|
||||
/* ExcludeEnd */
|
||||
"use strict";
|
||||
|
||||
var
|
||||
|
||||
|
@ -32,3 +30,5 @@ jQuery.noConflict = function( deep ) {
|
|||
if ( !noGlobal ) {
|
||||
window.jQuery = window.$ = jQuery;
|
||||
}
|
||||
|
||||
} );
|
||||
|
|
|
@ -30,11 +30,12 @@ define( [
|
|||
"./offset",
|
||||
"./dimensions",
|
||||
"./deprecated",
|
||||
"./exports/amd"
|
||||
"./exports/amd",
|
||||
"./exports/global"
|
||||
], function( jQuery ) {
|
||||
|
||||
"use strict";
|
||||
|
||||
return ( window.jQuery = window.$ = jQuery );
|
||||
return jQuery;
|
||||
|
||||
} );
|
||||
|
|
|
@ -8,15 +8,23 @@ function getAll( context, tag ) {
|
|||
|
||||
// Support: IE <=9 - 11 only
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
|
||||
var ret = typeof context.getElementsByTagName !== "undefined" ?
|
||||
context.getElementsByTagName( tag || "*" ) :
|
||||
typeof context.querySelectorAll !== "undefined" ?
|
||||
context.querySelectorAll( tag || "*" ) :
|
||||
[];
|
||||
var ret;
|
||||
|
||||
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
|
||||
jQuery.merge( [ context ], ret ) :
|
||||
ret;
|
||||
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
||||
ret = context.getElementsByTagName( tag || "*" );
|
||||
|
||||
} else if ( typeof context.querySelectorAll !== "undefined" ) {
|
||||
ret = context.querySelectorAll( tag || "*" );
|
||||
|
||||
} else {
|
||||
ret = [];
|
||||
}
|
||||
|
||||
if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
|
||||
return jQuery.merge( [ context ], ret );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
return getAll;
|
||||
|
|
|
@ -111,13 +111,17 @@ jQuery.fn.extend( {
|
|||
.map( function( i, elem ) {
|
||||
var val = jQuery( this ).val();
|
||||
|
||||
return val == null ?
|
||||
null :
|
||||
jQuery.isArray( val ) ?
|
||||
jQuery.map( val, function( val ) {
|
||||
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
||||
} ) :
|
||||
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
||||
if ( val == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( jQuery.isArray( val ) ) {
|
||||
return jQuery.map( val, function( val ) {
|
||||
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
||||
} );
|
||||
}
|
||||
|
||||
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
||||
} ).get();
|
||||
}
|
||||
} );
|
||||
|
|
|
@ -15,24 +15,29 @@ function winnow( elements, qualifier, not ) {
|
|||
return jQuery.grep( elements, function( elem, i ) {
|
||||
return !!qualifier.call( elem, i, elem ) !== not;
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
// Single element
|
||||
if ( qualifier.nodeType ) {
|
||||
return jQuery.grep( elements, function( elem ) {
|
||||
return ( elem === qualifier ) !== not;
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
if ( typeof qualifier === "string" ) {
|
||||
if ( risSimple.test( qualifier ) ) {
|
||||
return jQuery.filter( qualifier, elements, not );
|
||||
}
|
||||
|
||||
qualifier = jQuery.filter( qualifier, elements );
|
||||
// Arraylike of elements (jQuery, arguments, Array)
|
||||
if ( typeof qualifier !== "string" ) {
|
||||
return jQuery.grep( elements, function( elem ) {
|
||||
return ( indexOf.call( qualifier, elem ) > -1 ) !== 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;
|
||||
} );
|
||||
|
@ -45,11 +50,13 @@ jQuery.filter = function( expr, elems, not ) {
|
|||
expr = ":not(" + expr + ")";
|
||||
}
|
||||
|
||||
return elems.length === 1 && elem.nodeType === 1 ?
|
||||
jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
|
||||
jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
|
||||
return elem.nodeType === 1;
|
||||
} ) );
|
||||
if ( elems.length === 1 && elem.nodeType === 1 ) {
|
||||
return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
|
||||
}
|
||||
|
||||
return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
|
||||
return elem.nodeType === 1;
|
||||
} ) );
|
||||
};
|
||||
|
||||
jQuery.fn.extend( {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue