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
|
@ -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++ ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue