1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-06-11 11:55:39 -04:00
parent 84945cabc4
commit ab2d2eaf94
111 changed files with 4302 additions and 3100 deletions

View file

@ -5,6 +5,8 @@ define( [
"./data/var/dataUser"
], function( jQuery, access, dataPriv, dataUser ) {
"use strict";
// Implementation Summary
//
// 1. Enforce API surface and semantic compatibility with 1.9.x branch
@ -35,7 +37,7 @@ function dataAttr( elem, key, data ) {
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
rbrace.test( data ) ? JSON.parse( data ) :
data;
} catch ( e ) {}
@ -87,7 +89,7 @@ jQuery.fn.extend( {
i = attrs.length;
while ( i-- ) {
// Support: IE11+
// Support: IE 11 only
// The attrs elements can be null (#14894)
if ( attrs[ i ] ) {
name = attrs[ i ].name;
@ -112,7 +114,7 @@ jQuery.fn.extend( {
}
return access( this, function( value ) {
var data, camelKey;
var data;
// The calling jQuery object (element matches) is not empty
// (and therefore has an element appears at this[ 0 ]) and the
@ -122,29 +124,15 @@ jQuery.fn.extend( {
if ( elem && value === undefined ) {
// Attempt to get data from the cache
// with the key as-is
data = dataUser.get( elem, key ) ||
// Try to find dashed key if it exists (gh-2779)
// This is for 2.2.x only
dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
if ( data !== undefined ) {
return data;
}
camelKey = jQuery.camelCase( key );
// Attempt to get data from the cache
// with the key camelized
data = dataUser.get( elem, camelKey );
// The key will always be camelCased in Data
data = dataUser.get( elem, key );
if ( data !== undefined ) {
return data;
}
// Attempt to "discover" the data in
// HTML5 custom data-* attrs
data = dataAttr( elem, camelKey, undefined );
data = dataAttr( elem, key );
if ( data !== undefined ) {
return data;
}
@ -154,24 +142,10 @@ jQuery.fn.extend( {
}
// Set the data...
camelKey = jQuery.camelCase( key );
this.each( function() {
// First, attempt to store a copy or reference of any
// data that might've been store with a camelCased key.
var data = dataUser.get( this, camelKey );
// For HTML5 data-* attribute interop, we have to
// store property names with dashes in a camelCase form.
// This might not apply to all properties...*
dataUser.set( this, camelKey, value );
// *... In the case of properties that might _actually_
// have dashes, we need to also store a copy of that
// unchanged property.
if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
dataUser.set( this, key, value );
}
// We always store the camelCased key
dataUser.set( this, key, value );
} );
}, null, value, arguments.length > 1, null, true );
},