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
7537bab562
commit
d84c5a7c1d
226 changed files with 51770 additions and 4157 deletions
|
@ -1,10 +1,11 @@
|
|||
define([
|
||||
define( [
|
||||
"../core",
|
||||
"../core/parseHTML",
|
||||
"../ajax",
|
||||
"../traversing",
|
||||
"../manipulation",
|
||||
"../selector",
|
||||
|
||||
// Optional event/alias dependency
|
||||
"../event/alias"
|
||||
], function( jQuery ) {
|
||||
|
@ -22,9 +23,9 @@ jQuery.fn.load = function( url, params, callback ) {
|
|||
|
||||
var selector, type, response,
|
||||
self = this,
|
||||
off = url.indexOf(" ");
|
||||
off = url.indexOf( " " );
|
||||
|
||||
if ( off >= 0 ) {
|
||||
if ( off > -1 ) {
|
||||
selector = jQuery.trim( url.slice( off ) );
|
||||
url = url.slice( 0, off );
|
||||
}
|
||||
|
@ -43,14 +44,16 @@ jQuery.fn.load = function( url, params, callback ) {
|
|||
|
||||
// If we have elements to modify, make the request
|
||||
if ( self.length > 0 ) {
|
||||
jQuery.ajax({
|
||||
jQuery.ajax( {
|
||||
url: url,
|
||||
|
||||
// if "type" variable is undefined, then "GET" method will be used
|
||||
type: type,
|
||||
// If "type" variable is undefined, then "GET" method will be used.
|
||||
// Make value of this field explicit since
|
||||
// user can override it through ajaxSetup method
|
||||
type: type || "GET",
|
||||
dataType: "html",
|
||||
data: params
|
||||
}).done(function( responseText ) {
|
||||
} ).done( function( responseText ) {
|
||||
|
||||
// Save response for use in complete callback
|
||||
response = arguments;
|
||||
|
@ -59,17 +62,22 @@ jQuery.fn.load = function( url, params, callback ) {
|
|||
|
||||
// If a selector was specified, locate the right elements in a dummy div
|
||||
// Exclude scripts to avoid IE 'Permission Denied' errors
|
||||
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
|
||||
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
|
||||
|
||||
// Otherwise use the full result
|
||||
responseText );
|
||||
|
||||
}).complete( callback && function( jqXHR, status ) {
|
||||
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
|
||||
});
|
||||
// If the request succeeds, this function gets "data", "status", "jqXHR"
|
||||
// but they are ignored because response was set above.
|
||||
// If it fails, this function gets "jqXHR", "status", "error"
|
||||
} ).always( callback && function( jqXHR, status ) {
|
||||
self.each( function() {
|
||||
callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
});
|
||||
} );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue