Edit File by line
/home/barbar84/www/wp-inclu.../js/jquery
File: jquery.js
[10000] Fix | Delete
// Override mime type if needed
[10001] Fix | Delete
if ( options.mimeType && xhr.overrideMimeType ) {
[10002] Fix | Delete
xhr.overrideMimeType( options.mimeType );
[10003] Fix | Delete
}
[10004] Fix | Delete
[10005] Fix | Delete
// X-Requested-With header
[10006] Fix | Delete
// For cross-domain requests, seeing as conditions for a preflight are
[10007] Fix | Delete
// akin to a jigsaw puzzle, we simply never set it to be sure.
[10008] Fix | Delete
// (it can always be set on a per-request basis or even using ajaxSetup)
[10009] Fix | Delete
// For same-domain requests, won't change header if already provided.
[10010] Fix | Delete
if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
[10011] Fix | Delete
headers[ "X-Requested-With" ] = "XMLHttpRequest";
[10012] Fix | Delete
}
[10013] Fix | Delete
[10014] Fix | Delete
// Set headers
[10015] Fix | Delete
for ( i in headers ) {
[10016] Fix | Delete
xhr.setRequestHeader( i, headers[ i ] );
[10017] Fix | Delete
}
[10018] Fix | Delete
[10019] Fix | Delete
// Callback
[10020] Fix | Delete
callback = function( type ) {
[10021] Fix | Delete
return function() {
[10022] Fix | Delete
if ( callback ) {
[10023] Fix | Delete
callback = errorCallback = xhr.onload =
[10024] Fix | Delete
xhr.onerror = xhr.onabort = xhr.ontimeout =
[10025] Fix | Delete
xhr.onreadystatechange = null;
[10026] Fix | Delete
[10027] Fix | Delete
if ( type === "abort" ) {
[10028] Fix | Delete
xhr.abort();
[10029] Fix | Delete
} else if ( type === "error" ) {
[10030] Fix | Delete
[10031] Fix | Delete
// Support: IE <=9 only
[10032] Fix | Delete
// On a manual native abort, IE9 throws
[10033] Fix | Delete
// errors on any property access that is not readyState
[10034] Fix | Delete
if ( typeof xhr.status !== "number" ) {
[10035] Fix | Delete
complete( 0, "error" );
[10036] Fix | Delete
} else {
[10037] Fix | Delete
complete(
[10038] Fix | Delete
[10039] Fix | Delete
// File: protocol always yields status 0; see #8605, #14207
[10040] Fix | Delete
xhr.status,
[10041] Fix | Delete
xhr.statusText
[10042] Fix | Delete
);
[10043] Fix | Delete
}
[10044] Fix | Delete
} else {
[10045] Fix | Delete
complete(
[10046] Fix | Delete
xhrSuccessStatus[ xhr.status ] || xhr.status,
[10047] Fix | Delete
xhr.statusText,
[10048] Fix | Delete
[10049] Fix | Delete
// Support: IE <=9 only
[10050] Fix | Delete
// IE9 has no XHR2 but throws on binary (trac-11426)
[10051] Fix | Delete
// For XHR2 non-text, let the caller handle it (gh-2498)
[10052] Fix | Delete
( xhr.responseType || "text" ) !== "text" ||
[10053] Fix | Delete
typeof xhr.responseText !== "string" ?
[10054] Fix | Delete
{ binary: xhr.response } :
[10055] Fix | Delete
{ text: xhr.responseText },
[10056] Fix | Delete
xhr.getAllResponseHeaders()
[10057] Fix | Delete
);
[10058] Fix | Delete
}
[10059] Fix | Delete
}
[10060] Fix | Delete
};
[10061] Fix | Delete
};
[10062] Fix | Delete
[10063] Fix | Delete
// Listen to events
[10064] Fix | Delete
xhr.onload = callback();
[10065] Fix | Delete
errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
[10066] Fix | Delete
[10067] Fix | Delete
// Support: IE 9 only
[10068] Fix | Delete
// Use onreadystatechange to replace onabort
[10069] Fix | Delete
// to handle uncaught aborts
[10070] Fix | Delete
if ( xhr.onabort !== undefined ) {
[10071] Fix | Delete
xhr.onabort = errorCallback;
[10072] Fix | Delete
} else {
[10073] Fix | Delete
xhr.onreadystatechange = function() {
[10074] Fix | Delete
[10075] Fix | Delete
// Check readyState before timeout as it changes
[10076] Fix | Delete
if ( xhr.readyState === 4 ) {
[10077] Fix | Delete
[10078] Fix | Delete
// Allow onerror to be called first,
[10079] Fix | Delete
// but that will not handle a native abort
[10080] Fix | Delete
// Also, save errorCallback to a variable
[10081] Fix | Delete
// as xhr.onerror cannot be accessed
[10082] Fix | Delete
window.setTimeout( function() {
[10083] Fix | Delete
if ( callback ) {
[10084] Fix | Delete
errorCallback();
[10085] Fix | Delete
}
[10086] Fix | Delete
} );
[10087] Fix | Delete
}
[10088] Fix | Delete
};
[10089] Fix | Delete
}
[10090] Fix | Delete
[10091] Fix | Delete
// Create the abort callback
[10092] Fix | Delete
callback = callback( "abort" );
[10093] Fix | Delete
[10094] Fix | Delete
try {
[10095] Fix | Delete
[10096] Fix | Delete
// Do send the request (this may raise an exception)
[10097] Fix | Delete
xhr.send( options.hasContent && options.data || null );
[10098] Fix | Delete
} catch ( e ) {
[10099] Fix | Delete
[10100] Fix | Delete
// #14683: Only rethrow if this hasn't been notified as an error yet
[10101] Fix | Delete
if ( callback ) {
[10102] Fix | Delete
throw e;
[10103] Fix | Delete
}
[10104] Fix | Delete
}
[10105] Fix | Delete
},
[10106] Fix | Delete
[10107] Fix | Delete
abort: function() {
[10108] Fix | Delete
if ( callback ) {
[10109] Fix | Delete
callback();
[10110] Fix | Delete
}
[10111] Fix | Delete
}
[10112] Fix | Delete
};
[10113] Fix | Delete
}
[10114] Fix | Delete
} );
[10115] Fix | Delete
[10116] Fix | Delete
[10117] Fix | Delete
[10118] Fix | Delete
[10119] Fix | Delete
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
[10120] Fix | Delete
jQuery.ajaxPrefilter( function( s ) {
[10121] Fix | Delete
if ( s.crossDomain ) {
[10122] Fix | Delete
s.contents.script = false;
[10123] Fix | Delete
}
[10124] Fix | Delete
} );
[10125] Fix | Delete
[10126] Fix | Delete
// Install script dataType
[10127] Fix | Delete
jQuery.ajaxSetup( {
[10128] Fix | Delete
accepts: {
[10129] Fix | Delete
script: "text/javascript, application/javascript, " +
[10130] Fix | Delete
"application/ecmascript, application/x-ecmascript"
[10131] Fix | Delete
},
[10132] Fix | Delete
contents: {
[10133] Fix | Delete
script: /\b(?:java|ecma)script\b/
[10134] Fix | Delete
},
[10135] Fix | Delete
converters: {
[10136] Fix | Delete
"text script": function( text ) {
[10137] Fix | Delete
jQuery.globalEval( text );
[10138] Fix | Delete
return text;
[10139] Fix | Delete
}
[10140] Fix | Delete
}
[10141] Fix | Delete
} );
[10142] Fix | Delete
[10143] Fix | Delete
// Handle cache's special case and crossDomain
[10144] Fix | Delete
jQuery.ajaxPrefilter( "script", function( s ) {
[10145] Fix | Delete
if ( s.cache === undefined ) {
[10146] Fix | Delete
s.cache = false;
[10147] Fix | Delete
}
[10148] Fix | Delete
if ( s.crossDomain ) {
[10149] Fix | Delete
s.type = "GET";
[10150] Fix | Delete
}
[10151] Fix | Delete
} );
[10152] Fix | Delete
[10153] Fix | Delete
// Bind script tag hack transport
[10154] Fix | Delete
jQuery.ajaxTransport( "script", function( s ) {
[10155] Fix | Delete
[10156] Fix | Delete
// This transport only deals with cross domain or forced-by-attrs requests
[10157] Fix | Delete
if ( s.crossDomain || s.scriptAttrs ) {
[10158] Fix | Delete
var script, callback;
[10159] Fix | Delete
return {
[10160] Fix | Delete
send: function( _, complete ) {
[10161] Fix | Delete
script = jQuery( "<script>" )
[10162] Fix | Delete
.attr( s.scriptAttrs || {} )
[10163] Fix | Delete
.prop( { charset: s.scriptCharset, src: s.url } )
[10164] Fix | Delete
.on( "load error", callback = function( evt ) {
[10165] Fix | Delete
script.remove();
[10166] Fix | Delete
callback = null;
[10167] Fix | Delete
if ( evt ) {
[10168] Fix | Delete
complete( evt.type === "error" ? 404 : 200, evt.type );
[10169] Fix | Delete
}
[10170] Fix | Delete
} );
[10171] Fix | Delete
[10172] Fix | Delete
// Use native DOM manipulation to avoid our domManip AJAX trickery
[10173] Fix | Delete
document.head.appendChild( script[ 0 ] );
[10174] Fix | Delete
},
[10175] Fix | Delete
abort: function() {
[10176] Fix | Delete
if ( callback ) {
[10177] Fix | Delete
callback();
[10178] Fix | Delete
}
[10179] Fix | Delete
}
[10180] Fix | Delete
};
[10181] Fix | Delete
}
[10182] Fix | Delete
} );
[10183] Fix | Delete
[10184] Fix | Delete
[10185] Fix | Delete
[10186] Fix | Delete
[10187] Fix | Delete
var oldCallbacks = [],
[10188] Fix | Delete
rjsonp = /(=)\?(?=&|$)|\?\?/;
[10189] Fix | Delete
[10190] Fix | Delete
// Default jsonp settings
[10191] Fix | Delete
jQuery.ajaxSetup( {
[10192] Fix | Delete
jsonp: "callback",
[10193] Fix | Delete
jsonpCallback: function() {
[10194] Fix | Delete
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
[10195] Fix | Delete
this[ callback ] = true;
[10196] Fix | Delete
return callback;
[10197] Fix | Delete
}
[10198] Fix | Delete
} );
[10199] Fix | Delete
[10200] Fix | Delete
// Detect, normalize options and install callbacks for jsonp requests
[10201] Fix | Delete
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
[10202] Fix | Delete
[10203] Fix | Delete
var callbackName, overwritten, responseContainer,
[10204] Fix | Delete
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
[10205] Fix | Delete
"url" :
[10206] Fix | Delete
typeof s.data === "string" &&
[10207] Fix | Delete
( s.contentType || "" )
[10208] Fix | Delete
.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
[10209] Fix | Delete
rjsonp.test( s.data ) && "data"
[10210] Fix | Delete
);
[10211] Fix | Delete
[10212] Fix | Delete
// Handle iff the expected data type is "jsonp" or we have a parameter to set
[10213] Fix | Delete
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
[10214] Fix | Delete
[10215] Fix | Delete
// Get callback name, remembering preexisting value associated with it
[10216] Fix | Delete
callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
[10217] Fix | Delete
s.jsonpCallback() :
[10218] Fix | Delete
s.jsonpCallback;
[10219] Fix | Delete
[10220] Fix | Delete
// Insert callback into url or form data
[10221] Fix | Delete
if ( jsonProp ) {
[10222] Fix | Delete
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
[10223] Fix | Delete
} else if ( s.jsonp !== false ) {
[10224] Fix | Delete
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
[10225] Fix | Delete
}
[10226] Fix | Delete
[10227] Fix | Delete
// Use data converter to retrieve json after script execution
[10228] Fix | Delete
s.converters[ "script json" ] = function() {
[10229] Fix | Delete
if ( !responseContainer ) {
[10230] Fix | Delete
jQuery.error( callbackName + " was not called" );
[10231] Fix | Delete
}
[10232] Fix | Delete
return responseContainer[ 0 ];
[10233] Fix | Delete
};
[10234] Fix | Delete
[10235] Fix | Delete
// Force json dataType
[10236] Fix | Delete
s.dataTypes[ 0 ] = "json";
[10237] Fix | Delete
[10238] Fix | Delete
// Install callback
[10239] Fix | Delete
overwritten = window[ callbackName ];
[10240] Fix | Delete
window[ callbackName ] = function() {
[10241] Fix | Delete
responseContainer = arguments;
[10242] Fix | Delete
};
[10243] Fix | Delete
[10244] Fix | Delete
// Clean-up function (fires after converters)
[10245] Fix | Delete
jqXHR.always( function() {
[10246] Fix | Delete
[10247] Fix | Delete
// If previous value didn't exist - remove it
[10248] Fix | Delete
if ( overwritten === undefined ) {
[10249] Fix | Delete
jQuery( window ).removeProp( callbackName );
[10250] Fix | Delete
[10251] Fix | Delete
// Otherwise restore preexisting value
[10252] Fix | Delete
} else {
[10253] Fix | Delete
window[ callbackName ] = overwritten;
[10254] Fix | Delete
}
[10255] Fix | Delete
[10256] Fix | Delete
// Save back as free
[10257] Fix | Delete
if ( s[ callbackName ] ) {
[10258] Fix | Delete
[10259] Fix | Delete
// Make sure that re-using the options doesn't screw things around
[10260] Fix | Delete
s.jsonpCallback = originalSettings.jsonpCallback;
[10261] Fix | Delete
[10262] Fix | Delete
// Save the callback name for future use
[10263] Fix | Delete
oldCallbacks.push( callbackName );
[10264] Fix | Delete
}
[10265] Fix | Delete
[10266] Fix | Delete
// Call if it was a function and we have a response
[10267] Fix | Delete
if ( responseContainer && isFunction( overwritten ) ) {
[10268] Fix | Delete
overwritten( responseContainer[ 0 ] );
[10269] Fix | Delete
}
[10270] Fix | Delete
[10271] Fix | Delete
responseContainer = overwritten = undefined;
[10272] Fix | Delete
} );
[10273] Fix | Delete
[10274] Fix | Delete
// Delegate to script
[10275] Fix | Delete
return "script";
[10276] Fix | Delete
}
[10277] Fix | Delete
} );
[10278] Fix | Delete
[10279] Fix | Delete
[10280] Fix | Delete
[10281] Fix | Delete
[10282] Fix | Delete
// Support: Safari 8 only
[10283] Fix | Delete
// In Safari 8 documents created via document.implementation.createHTMLDocument
[10284] Fix | Delete
// collapse sibling forms: the second one becomes a child of the first one.
[10285] Fix | Delete
// Because of that, this security measure has to be disabled in Safari 8.
[10286] Fix | Delete
// https://bugs.webkit.org/show_bug.cgi?id=137337
[10287] Fix | Delete
support.createHTMLDocument = ( function() {
[10288] Fix | Delete
var body = document.implementation.createHTMLDocument( "" ).body;
[10289] Fix | Delete
body.innerHTML = "<form></form><form></form>";
[10290] Fix | Delete
return body.childNodes.length === 2;
[10291] Fix | Delete
} )();
[10292] Fix | Delete
[10293] Fix | Delete
[10294] Fix | Delete
// Argument "data" should be string of html
[10295] Fix | Delete
// context (optional): If specified, the fragment will be created in this context,
[10296] Fix | Delete
// defaults to document
[10297] Fix | Delete
// keepScripts (optional): If true, will include scripts passed in the html string
[10298] Fix | Delete
jQuery.parseHTML = function( data, context, keepScripts ) {
[10299] Fix | Delete
if ( typeof data !== "string" ) {
[10300] Fix | Delete
return [];
[10301] Fix | Delete
}
[10302] Fix | Delete
if ( typeof context === "boolean" ) {
[10303] Fix | Delete
keepScripts = context;
[10304] Fix | Delete
context = false;
[10305] Fix | Delete
}
[10306] Fix | Delete
[10307] Fix | Delete
var base, parsed, scripts;
[10308] Fix | Delete
[10309] Fix | Delete
if ( !context ) {
[10310] Fix | Delete
[10311] Fix | Delete
// Stop scripts or inline event handlers from being executed immediately
[10312] Fix | Delete
// by using document.implementation
[10313] Fix | Delete
if ( support.createHTMLDocument ) {
[10314] Fix | Delete
context = document.implementation.createHTMLDocument( "" );
[10315] Fix | Delete
[10316] Fix | Delete
// Set the base href for the created document
[10317] Fix | Delete
// so any parsed elements with URLs
[10318] Fix | Delete
// are based on the document's URL (gh-2965)
[10319] Fix | Delete
base = context.createElement( "base" );
[10320] Fix | Delete
base.href = document.location.href;
[10321] Fix | Delete
context.head.appendChild( base );
[10322] Fix | Delete
} else {
[10323] Fix | Delete
context = document;
[10324] Fix | Delete
}
[10325] Fix | Delete
}
[10326] Fix | Delete
[10327] Fix | Delete
parsed = rsingleTag.exec( data );
[10328] Fix | Delete
scripts = !keepScripts && [];
[10329] Fix | Delete
[10330] Fix | Delete
// Single tag
[10331] Fix | Delete
if ( parsed ) {
[10332] Fix | Delete
return [ context.createElement( parsed[ 1 ] ) ];
[10333] Fix | Delete
}
[10334] Fix | Delete
[10335] Fix | Delete
parsed = buildFragment( [ data ], context, scripts );
[10336] Fix | Delete
[10337] Fix | Delete
if ( scripts && scripts.length ) {
[10338] Fix | Delete
jQuery( scripts ).remove();
[10339] Fix | Delete
}
[10340] Fix | Delete
[10341] Fix | Delete
return jQuery.merge( [], parsed.childNodes );
[10342] Fix | Delete
};
[10343] Fix | Delete
[10344] Fix | Delete
[10345] Fix | Delete
/**
[10346] Fix | Delete
* Load a url into a page
[10347] Fix | Delete
*/
[10348] Fix | Delete
jQuery.fn.load = function( url, params, callback ) {
[10349] Fix | Delete
var selector, type, response,
[10350] Fix | Delete
self = this,
[10351] Fix | Delete
off = url.indexOf( " " );
[10352] Fix | Delete
[10353] Fix | Delete
if ( off > -1 ) {
[10354] Fix | Delete
selector = stripAndCollapse( url.slice( off ) );
[10355] Fix | Delete
url = url.slice( 0, off );
[10356] Fix | Delete
}
[10357] Fix | Delete
[10358] Fix | Delete
// If it's a function
[10359] Fix | Delete
if ( isFunction( params ) ) {
[10360] Fix | Delete
[10361] Fix | Delete
// We assume that it's the callback
[10362] Fix | Delete
callback = params;
[10363] Fix | Delete
params = undefined;
[10364] Fix | Delete
[10365] Fix | Delete
// Otherwise, build a param string
[10366] Fix | Delete
} else if ( params && typeof params === "object" ) {
[10367] Fix | Delete
type = "POST";
[10368] Fix | Delete
}
[10369] Fix | Delete
[10370] Fix | Delete
// If we have elements to modify, make the request
[10371] Fix | Delete
if ( self.length > 0 ) {
[10372] Fix | Delete
jQuery.ajax( {
[10373] Fix | Delete
url: url,
[10374] Fix | Delete
[10375] Fix | Delete
// If "type" variable is undefined, then "GET" method will be used.
[10376] Fix | Delete
// Make value of this field explicit since
[10377] Fix | Delete
// user can override it through ajaxSetup method
[10378] Fix | Delete
type: type || "GET",
[10379] Fix | Delete
dataType: "html",
[10380] Fix | Delete
data: params
[10381] Fix | Delete
} ).done( function( responseText ) {
[10382] Fix | Delete
[10383] Fix | Delete
// Save response for use in complete callback
[10384] Fix | Delete
response = arguments;
[10385] Fix | Delete
[10386] Fix | Delete
self.html( selector ?
[10387] Fix | Delete
[10388] Fix | Delete
// If a selector was specified, locate the right elements in a dummy div
[10389] Fix | Delete
// Exclude scripts to avoid IE 'Permission Denied' errors
[10390] Fix | Delete
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
[10391] Fix | Delete
[10392] Fix | Delete
// Otherwise use the full result
[10393] Fix | Delete
responseText );
[10394] Fix | Delete
[10395] Fix | Delete
// If the request succeeds, this function gets "data", "status", "jqXHR"
[10396] Fix | Delete
// but they are ignored because response was set above.
[10397] Fix | Delete
// If it fails, this function gets "jqXHR", "status", "error"
[10398] Fix | Delete
} ).always( callback && function( jqXHR, status ) {
[10399] Fix | Delete
self.each( function() {
[10400] Fix | Delete
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
[10401] Fix | Delete
} );
[10402] Fix | Delete
} );
[10403] Fix | Delete
}
[10404] Fix | Delete
[10405] Fix | Delete
return this;
[10406] Fix | Delete
};
[10407] Fix | Delete
[10408] Fix | Delete
[10409] Fix | Delete
[10410] Fix | Delete
[10411] Fix | Delete
jQuery.expr.pseudos.animated = function( elem ) {
[10412] Fix | Delete
return jQuery.grep( jQuery.timers, function( fn ) {
[10413] Fix | Delete
return elem === fn.elem;
[10414] Fix | Delete
} ).length;
[10415] Fix | Delete
};
[10416] Fix | Delete
[10417] Fix | Delete
[10418] Fix | Delete
[10419] Fix | Delete
[10420] Fix | Delete
jQuery.offset = {
[10421] Fix | Delete
setOffset: function( elem, options, i ) {
[10422] Fix | Delete
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
[10423] Fix | Delete
position = jQuery.css( elem, "position" ),
[10424] Fix | Delete
curElem = jQuery( elem ),
[10425] Fix | Delete
props = {};
[10426] Fix | Delete
[10427] Fix | Delete
// Set position first, in-case top/left are set even on static elem
[10428] Fix | Delete
if ( position === "static" ) {
[10429] Fix | Delete
elem.style.position = "relative";
[10430] Fix | Delete
}
[10431] Fix | Delete
[10432] Fix | Delete
curOffset = curElem.offset();
[10433] Fix | Delete
curCSSTop = jQuery.css( elem, "top" );
[10434] Fix | Delete
curCSSLeft = jQuery.css( elem, "left" );
[10435] Fix | Delete
calculatePosition = ( position === "absolute" || position === "fixed" ) &&
[10436] Fix | Delete
( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
[10437] Fix | Delete
[10438] Fix | Delete
// Need to be able to calculate position if either
[10439] Fix | Delete
// top or left is auto and position is either absolute or fixed
[10440] Fix | Delete
if ( calculatePosition ) {
[10441] Fix | Delete
curPosition = curElem.position();
[10442] Fix | Delete
curTop = curPosition.top;
[10443] Fix | Delete
curLeft = curPosition.left;
[10444] Fix | Delete
[10445] Fix | Delete
} else {
[10446] Fix | Delete
curTop = parseFloat( curCSSTop ) || 0;
[10447] Fix | Delete
curLeft = parseFloat( curCSSLeft ) || 0;
[10448] Fix | Delete
}
[10449] Fix | Delete
[10450] Fix | Delete
if ( isFunction( options ) ) {
[10451] Fix | Delete
[10452] Fix | Delete
// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
[10453] Fix | Delete
options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
[10454] Fix | Delete
}
[10455] Fix | Delete
[10456] Fix | Delete
if ( options.top != null ) {
[10457] Fix | Delete
props.top = ( options.top - curOffset.top ) + curTop;
[10458] Fix | Delete
}
[10459] Fix | Delete
if ( options.left != null ) {
[10460] Fix | Delete
props.left = ( options.left - curOffset.left ) + curLeft;
[10461] Fix | Delete
}
[10462] Fix | Delete
[10463] Fix | Delete
if ( "using" in options ) {
[10464] Fix | Delete
options.using.call( elem, props );
[10465] Fix | Delete
[10466] Fix | Delete
} else {
[10467] Fix | Delete
if ( typeof props.top === "number" ) {
[10468] Fix | Delete
props.top += "px";
[10469] Fix | Delete
}
[10470] Fix | Delete
if ( typeof props.left === "number" ) {
[10471] Fix | Delete
props.left += "px";
[10472] Fix | Delete
}
[10473] Fix | Delete
curElem.css( props );
[10474] Fix | Delete
}
[10475] Fix | Delete
}
[10476] Fix | Delete
};
[10477] Fix | Delete
[10478] Fix | Delete
jQuery.fn.extend( {
[10479] Fix | Delete
[10480] Fix | Delete
// offset() relates an element's border box to the document origin
[10481] Fix | Delete
offset: function( options ) {
[10482] Fix | Delete
[10483] Fix | Delete
// Preserve chaining for setter
[10484] Fix | Delete
if ( arguments.length ) {
[10485] Fix | Delete
return options === undefined ?
[10486] Fix | Delete
this :
[10487] Fix | Delete
this.each( function( i ) {
[10488] Fix | Delete
jQuery.offset.setOffset( this, options, i );
[10489] Fix | Delete
} );
[10490] Fix | Delete
}
[10491] Fix | Delete
[10492] Fix | Delete
var rect, win,
[10493] Fix | Delete
elem = this[ 0 ];
[10494] Fix | Delete
[10495] Fix | Delete
if ( !elem ) {
[10496] Fix | Delete
return;
[10497] Fix | Delete
}
[10498] Fix | Delete
[10499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function