OAuth OK!
This commit is contained in:
parent
494a840f70
commit
567e4a6635
382 changed files with 52478 additions and 7572 deletions
33
testOauthClient/wwwroot/lib/jquery-validation/src/ajax.js
vendored
Normal file
33
testOauthClient/wwwroot/lib/jquery-validation/src/ajax.js
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// ajax mode: abort
|
||||
// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]});
|
||||
// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort()
|
||||
|
||||
var pendingRequests = {},
|
||||
ajax;
|
||||
// Use a prefilter if available (1.5+)
|
||||
if ( $.ajaxPrefilter ) {
|
||||
$.ajaxPrefilter(function( settings, _, xhr ) {
|
||||
var port = settings.port;
|
||||
if ( settings.mode === "abort" ) {
|
||||
if ( pendingRequests[port] ) {
|
||||
pendingRequests[port].abort();
|
||||
}
|
||||
pendingRequests[port] = xhr;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Proxy ajax
|
||||
ajax = $.ajax;
|
||||
$.ajax = function( settings ) {
|
||||
var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode,
|
||||
port = ( "port" in settings ? settings : $.ajaxSettings ).port;
|
||||
if ( mode === "abort" ) {
|
||||
if ( pendingRequests[port] ) {
|
||||
pendingRequests[port].abort();
|
||||
}
|
||||
pendingRequests[port] = ajax.apply(this, arguments);
|
||||
return pendingRequests[port];
|
||||
}
|
||||
return ajax.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue