Changeset 12525 for trunk/themes/default/js/jquery.js
- Timestamp:
- Oct 28, 2011, 3:25:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/jquery.js
r12040 r12525 1 1 /*! 2 * jQuery JavaScript Library v1.6. 22 * jQuery JavaScript Library v1.6.4 3 3 * http://jquery.com/ 4 4 * … … 12 12 * Released under the MIT, BSD, and GPL Licenses. 13 13 * 14 * Date: Thu Jun 30 14:16:562011 -040014 * Date: Mon Sep 12 18:54:48 2011 -0400 15 15 */ 16 16 (function( window, undefined ) { … … 38 38 39 39 // A simple way to check for HTML strings or ID strings 40 // (both of which we optimize for)41 quickExpr = /^(?:[^ <]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,40 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 41 quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, 42 42 43 43 // Check if a string has a non-whitespace character in it … … 67 67 68 68 // Matches dashed string for camelizing 69 rdashAlpha = /-([a-z])/ig, 69 rdashAlpha = /-([a-z]|[0-9])/ig, 70 rmsPrefix = /^-ms-/, 70 71 71 72 // Used by jQuery.camelCase as callback to replace() 72 73 fcamelCase = function( all, letter ) { 73 return letter.toUpperCase();74 return ( letter + "" ).toUpperCase(); 74 75 }, 75 76 … … 213 214 214 215 // The current version of jQuery being used 215 jquery: "1.6. 2",216 jquery: "1.6.4", 216 217 217 218 // The default length of a jQuery object is 0 … … 522 523 } 523 524 524 // Not own constructor property must be Object 525 if ( obj.constructor && 526 !hasOwn.call(obj, "constructor") && 527 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { 525 try { 526 // Not own constructor property must be Object 527 if ( obj.constructor && 528 !hasOwn.call(obj, "constructor") && 529 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { 530 return false; 531 } 532 } catch ( e ) { 533 // IE8,9 Will throw exceptions on certain host objects #9897 528 534 return false; 529 535 } … … 575 581 576 582 // Cross-browser xml parsing 577 // (xml & tmp used internally)578 parseXML: function( data , xml , tmp ) {579 580 if ( window.DOMParser ) { // Standard581 tmp = new DOMParser();582 xml = tmp.parseFromString( data , "text/xml" );583 } else { // IE584 xml = new ActiveXObject( "Microsoft.XMLDOM" );585 xml.async = "false";586 xml.loadXML( data );587 }588 589 tmp = xml.documentElement;590 591 if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror") {583 parseXML: function( data ) { 584 var xml, tmp; 585 try { 586 if ( window.DOMParser ) { // Standard 587 tmp = new DOMParser(); 588 xml = tmp.parseFromString( data , "text/xml" ); 589 } else { // IE 590 xml = new ActiveXObject( "Microsoft.XMLDOM" ); 591 xml.async = "false"; 592 xml.loadXML( data ); 593 } 594 } catch( e ) { 595 xml = undefined; 596 } 597 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 592 598 jQuery.error( "Invalid XML: " + data ); 593 599 } 594 595 600 return xml; 596 601 }, … … 612 617 }, 613 618 614 // Convert s a dashed string to camelCased string;615 // Used by both the css and data modules619 // Convert dashed to camelCase; used by the css and data modules 620 // Microsoft forgot to hump their vendor prefix (#9572) 616 621 camelCase: function( string ) { 617 return string.replace( r dashAlpha, fcamelCase );622 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 618 623 }, 619 624 … … 700 705 701 706 inArray: function( elem, array ) { 707 if ( !array ) { 708 return -1; 709 } 702 710 703 711 if ( indexOf ) { … … 1072 1080 returned.promise().then( newDefer.resolve, newDefer.reject ); 1073 1081 } else { 1074 newDefer[ action ]( returned);1082 newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); 1075 1083 } 1076 1084 }); … … 1174 1182 div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; 1175 1183 1184 1176 1185 all = div.getElementsByTagName( "*" ); 1177 1186 a = div.getElementsByTagName( "a" )[ 0 ]; … … 1294 1303 height: 0, 1295 1304 border: 0, 1296 margin: 0 1305 margin: 0, 1306 background: "none" 1297 1307 }; 1298 1308 if ( body ) { 1299 1309 jQuery.extend( testElementStyle, { 1300 1310 position: "absolute", 1301 left: -1000,1302 top: -10001311 left: "-1000px", 1312 top: "-1000px" 1303 1313 }); 1304 1314 } … … 1405 1415 1406 1416 var rbrace = /^(?:\{.*\}|\[.*\])$/, 1407 rmultiDash = /([ a-z])([A-Z])/g;1417 rmultiDash = /([A-Z])/g; 1408 1418 1409 1419 jQuery.extend({ … … 1437 1447 } 1438 1448 1439 var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, 1449 var thisCache, ret, 1450 internalKey = jQuery.expando, 1451 getByName = typeof name === "string", 1440 1452 1441 1453 // We have to handle DOM nodes and JS objects differently because IE6-7 … … 1453 1465 // Avoid doing any more work than we need to when trying to get data on an 1454 1466 // object that has no data at all 1455 if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {1467 if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) { 1456 1468 return; 1457 1469 } … … 1512 1524 } 1513 1525 1514 return getByName ? 1515 // Check for both converted-to-camel and non-converted data property names 1516 thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] : 1517 thisCache; 1526 // Check for both converted-to-camel and non-converted data property names 1527 // If a data property was specified 1528 if ( getByName ) { 1529 1530 // First Try to find as-is property data 1531 ret = thisCache[ name ]; 1532 1533 // Test for null|undefined property data 1534 if ( ret == null ) { 1535 1536 // Try to find the camelCased property 1537 ret = thisCache[ jQuery.camelCase( name ) ]; 1538 } 1539 } else { 1540 ret = thisCache; 1541 } 1542 1543 return ret; 1518 1544 }, 1519 1545 … … 1523 1549 } 1524 1550 1525 var internalKey = jQuery.expando, isNode = elem.nodeType, 1551 var thisCache, 1552 1553 // Reference to internal data cache key 1554 internalKey = jQuery.expando, 1555 1556 isNode = elem.nodeType, 1526 1557 1527 1558 // See jQuery.data for more information … … 1538 1569 1539 1570 if ( name ) { 1540 var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; 1571 1572 thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; 1541 1573 1542 1574 if ( thisCache ) { 1575 1576 // Support interoperable removal of hyphenated or camelcased keys 1577 if ( !thisCache[ name ] ) { 1578 name = jQuery.camelCase( name ); 1579 } 1580 1543 1581 delete thisCache[ name ]; 1544 1582 … … 1567 1605 // the window, but it will allow it on all other JS objects; other browsers 1568 1606 // don't care 1569 if ( jQuery.support.deleteExpando || cache != window ) { 1607 // Ensure that `cache` is not a window object #10080 1608 if ( jQuery.support.deleteExpando || !cache.setInterval ) { 1570 1609 delete cache[ id ]; 1571 1610 } else { … … 1691 1730 // data from the HTML5 data-* attribute 1692 1731 if ( data === undefined && elem.nodeType === 1 ) { 1693 var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); 1732 1733 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 1694 1734 1695 1735 data = elem.getAttribute( name ); … … 1911 1951 rclickable = /^a(?:rea)?$/i, 1912 1952 rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, 1913 rinvalidChar = /\:|^on/, 1914 formHook, boolHook; 1953 nodeHook, boolHook; 1915 1954 1916 1955 jQuery.fn.extend({ … … 2050 2089 var className = " " + selector + " "; 2051 2090 for ( var i = 0, l = this.length; i < l; i++ ) { 2052 if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {2091 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { 2053 2092 return true; 2054 2093 } … … 2230 2269 // Use boolHook for boolean attributes 2231 2270 if ( rboolean.test( name ) ) { 2232 2233 2271 hooks = boolHook; 2234 2272 2235 // Use formHook for forms and if the name contains certain characters 2236 } else if ( formHook && name !== "className" && 2237 (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { 2238 2239 hooks = formHook; 2273 // Use nodeHook if available( IE6/7 ) 2274 } else if ( nodeHook ) { 2275 hooks = nodeHook; 2240 2276 } 2241 2277 } … … 2274 2310 if ( elem.nodeType === 1 ) { 2275 2311 name = jQuery.attrFix[ name ] || name; 2276 2277 if ( jQuery.support.getSetAttribute ) { 2278 // Use removeAttribute in browsers that support it 2279 elem.removeAttribute( name ); 2280 } else { 2281 jQuery.attr( elem, name, "" ); 2282 elem.removeAttributeNode( elem.getAttributeNode( name ) ); 2283 } 2312 2313 jQuery.attr( elem, name, "" ); 2314 elem.removeAttribute( name ); 2284 2315 2285 2316 // Set corresponding property to false for boolean attributes … … 2309 2340 } 2310 2341 }, 2311 tabIndex: {2312 get: function( elem ) {2313 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set2314 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/2315 var attributeNode = elem.getAttributeNode("tabIndex");2316 2317 return attributeNode && attributeNode.specified ?2318 parseInt( attributeNode.value, 10 ) :2319 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?2320 0 :2321 undefined;2322 }2323 },2324 2342 // Use the value property for back compat 2325 // Use the formHook for button elements in IE6/7 (#1954)2343 // Use the nodeHook for button elements in IE6/7 (#1954) 2326 2344 value: { 2327 2345 get: function( elem, name ) { 2328 if ( formHook && jQuery.nodeName( elem, "button" ) ) {2329 return formHook.get( elem, name );2346 if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { 2347 return nodeHook.get( elem, name ); 2330 2348 } 2331 2349 return name in elem ? … … 2334 2352 }, 2335 2353 set: function( elem, value, name ) { 2336 if ( formHook && jQuery.nodeName( elem, "button" ) ) {2337 return formHook.set( elem, value, name );2354 if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { 2355 return nodeHook.set( elem, value, name ); 2338 2356 } 2339 2357 // Does not return so that setAttribute is also used … … 2384 2402 2385 2403 } else { 2386 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined) {2404 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { 2387 2405 return ret; 2388 2406 … … 2393 2411 }, 2394 2412 2395 propHooks: {} 2413 propHooks: { 2414 tabIndex: { 2415 get: function( elem ) { 2416 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set 2417 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 2418 var attributeNode = elem.getAttributeNode("tabindex"); 2419 2420 return attributeNode && attributeNode.specified ? 2421 parseInt( attributeNode.value, 10 ) : 2422 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 2423 0 : 2424 undefined; 2425 } 2426 } 2427 } 2396 2428 }); 2429 2430 // Add the tabindex propHook to attrHooks for back-compat 2431 jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex; 2397 2432 2398 2433 // Hook for boolean attributes … … 2400 2435 get: function( elem, name ) { 2401 2436 // Align boolean attributes with corresponding properties 2402 return jQuery.prop( elem, name ) ? 2437 // Fall back to attribute presence where some booleans are not supported 2438 var attrNode; 2439 return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ? 2403 2440 name.toLowerCase() : 2404 2441 undefined; … … 2426 2463 // IE6/7 do not support getting/setting some attributes with get/setAttribute 2427 2464 if ( !jQuery.support.getSetAttribute ) { 2428 2429 // propFix is more comprehensive and contains all fixes2430 jQuery.attrFix = jQuery.propFix;2431 2465 2432 // Use this for any attribute on a form in IE6/7 2433 formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = { 2466 // Use this for any attribute in IE6/7 2467 // This fixes almost every IE6/7 issue 2468 nodeHook = jQuery.valHooks.button = { 2434 2469 get: function( elem, name ) { 2435 2470 var ret; … … 2441 2476 }, 2442 2477 set: function( elem, value, name ) { 2443 // Check form objects in IE (multiple bugs related) 2444 // Only use nodeValue if the attribute node exists on the form 2478 // Set the existing or create a new attribute node 2445 2479 var ret = elem.getAttributeNode( name ); 2446 if ( ret ) { 2447 ret.nodeValue = value; 2448 return value; 2449 } 2480 if ( !ret ) { 2481 ret = document.createAttribute( name ); 2482 elem.setAttributeNode( ret ); 2483 } 2484 return (ret.nodeValue = value + ""); 2450 2485 } 2451 2486 }; … … 2506 2541 } 2507 2542 } 2543 return null; 2508 2544 } 2509 2545 }); … … 3236 3272 if ( !jQuery.nodeName( this, "form" ) ) { 3237 3273 jQuery.event.add(this, "click.specialSubmit", function( e ) { 3274 // Avoid triggering error on non-existent type attribute in IE VML (#7071) 3238 3275 var elem = e.target, 3239 type = elem.type;3276 type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : ""; 3240 3277 3241 3278 if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { … … 3246 3283 jQuery.event.add(this, "keypress.specialSubmit", function( e ) { 3247 3284 var elem = e.target, 3248 type = elem.type;3285 type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : ""; 3249 3286 3250 3287 if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { … … 3271 3308 3272 3309 getVal = function( elem ) { 3273 var type = elem.type, val = elem.value; 3310 var type = jQuery.nodeName( elem, "input" ) ? elem.type : "", 3311 val = elem.value; 3274 3312 3275 3313 if ( type === "radio" || type === "checkbox" ) { … … 5296 5334 // the matched set of elements 5297 5335 index: function( elem ) { 5298 if ( !elem || typeof elem === "string" ) { 5299 return jQuery.inArray( this[0], 5300 // If it receives a string, the selector is used 5301 // If it receives nothing, the siblings are used 5302 elem ? jQuery( elem ) : this.parent().children() ); 5303 } 5336 5337 // No argument, return index in parent 5338 if ( !elem ) { 5339 return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; 5340 } 5341 5342 // index in selector 5343 if ( typeof elem === "string" ) { 5344 return jQuery.inArray( this[0], jQuery( elem ) ); 5345 } 5346 5304 5347 // Locate the position of the desired element 5305 5348 return jQuery.inArray( … … 6049 6092 // elements on the page has a name or id of "length" 6050 6093 for ( i = 0; srcElements[i]; ++i ) { 6051 cloneFixAttributes( srcElements[i], destElements[i] ); 6094 // Ensure that the destination node is not null; Fixes #9587 6095 if ( destElements[i] ) { 6096 cloneFixAttributes( srcElements[i], destElements[i] ); 6097 } 6052 6098 } 6053 6099 } … … 6249 6295 6250 6296 6297 6251 6298 var ralpha = /alpha\([^)]*\)/i, 6252 6299 ropacity = /opacity=([^)]*)/, … … 6255 6302 rnumpx = /^-?\d+(?:px)?$/i, 6256 6303 rnum = /^-?\d/, 6257 rrelNum = /^[+\-]=/, 6258 rrelNumFilter = /[^+\-\.\de]+/g, 6304 rrelNum = /^([\-+])=([\-+.\de]+)/, 6259 6305 6260 6306 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, … … 6333 6379 type = typeof value; 6334 6380 6335 // Make sure that NaN and null values aren't set. See: #71166336 if ( type === "number" && isNaN( value ) || value == null ) {6337 return;6338 }6339 6340 6381 // convert relative number strings (+= or -=) to relative numbers. #7345 6341 if ( type === "string" && rrelNum.test( value) ) {6342 value = +value.replace( rrelNumFilter, "") + parseFloat( jQuery.css( elem, name ) );6382 if ( type === "string" && (ret = rrelNum.exec( value )) ) { 6383 value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) ); 6343 6384 // Fixes bug #9237 6344 6385 type = "number"; 6386 } 6387 6388 // Make sure that NaN and null values aren't set. See: #7116 6389 if ( value == null || type === "number" && isNaN( value ) ) { 6390 return; 6345 6391 } 6346 6392 … … 6460 6506 set: function( elem, value ) { 6461 6507 var style = elem.style, 6462 currentStyle = elem.currentStyle; 6508 currentStyle = elem.currentStyle, 6509 opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")", 6510 filter = currentStyle && currentStyle.filter || style.filter || ""; 6463 6511 6464 6512 // IE has trouble with opacity if it does not have layout … … 6466 6514 style.zoom = 1; 6467 6515 6468 // Set the alpha filter to set the opacity 6469 var opacity = jQuery.isNaN( value ) ? 6470 "" : 6471 "alpha(opacity=" + value * 100 + ")", 6472 filter = currentStyle && currentStyle.filter || style.filter || ""; 6473 6516 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 6517 if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) { 6518 6519 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 6520 // if "filter:" is present at all, clearType is disabled, we want to avoid this 6521 // style.removeAttribute is IE Only, but so apparently is this code path... 6522 style.removeAttribute( "filter" ); 6523 6524 // if there there is no filter style applied in a css rule, we are done 6525 if ( currentStyle && !currentStyle.filter ) { 6526 return; 6527 } 6528 } 6529 6530 // otherwise, set new filter values 6474 6531 style.filter = ralpha.test( filter ) ? 6475 6532 filter.replace( ralpha, opacity ) : … … 6626 6683 rhash = /#.*$/, 6627 6684 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL 6628 rinput = /^(?:color|date|datetime| email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,6685 rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, 6629 6686 // #7653, #8125, #8152: local protocol detection 6630 rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file| widget):$/,6687 rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, 6631 6688 rnoContent = /^(?:GET|HEAD)$/, 6632 6689 rprotocol = /^\/\//, … … 6663 6720 6664 6721 // Document location segments 6665 ajaxLocParts; 6722 ajaxLocParts, 6723 6724 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 6725 allTypes = ["*/"] + ["*"]; 6666 6726 6667 6727 // #8138, IE may throw an exception when accessing … … 6754 6814 // but it'll be ignored by the caller in that case 6755 6815 return selection; 6816 } 6817 6818 // A special extend for ajax options 6819 // that takes "flat" options (not to be deep extended) 6820 // Fixes #9887 6821 function ajaxExtend( target, src ) { 6822 var key, deep, 6823 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 6824 for( key in src ) { 6825 if ( src[ key ] !== undefined ) { 6826 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 6827 } 6828 } 6829 if ( deep ) { 6830 jQuery.extend( true, target, deep ); 6831 } 6756 6832 } 6757 6833 … … 6899 6975 // with both ajaxSettings and settings fields. 6900 6976 // If target is omitted, writes into ajaxSettings. 6901 ajaxSetup: function ( target, settings ) { 6902 if ( !settings ) { 6903 // Only one parameter, we extend ajaxSettings 6977 ajaxSetup: function( target, settings ) { 6978 if ( settings ) { 6979 // Building a settings object 6980 ajaxExtend( target, jQuery.ajaxSettings ); 6981 } else { 6982 // Extending ajaxSettings 6904 6983 settings = target; 6905 target = jQuery.extend( true, jQuery.ajaxSettings, settings ); 6906 } else { 6907 // target was provided, we extend into it 6908 jQuery.extend( true, target, jQuery.ajaxSettings, settings ); 6909 } 6910 // Flatten fields we don't want deep extended 6911 for( var field in { context: 1, url: 1 } ) { 6912 if ( field in settings ) { 6913 target[ field ] = settings[ field ]; 6914 } else if( field in jQuery.ajaxSettings ) { 6915 target[ field ] = jQuery.ajaxSettings[ field ]; 6916 } 6917 } 6984 target = jQuery.ajaxSettings; 6985 } 6986 ajaxExtend( target, settings ); 6918 6987 return target; 6919 6988 }, … … 6943 7012 text: "text/plain", 6944 7013 json: "application/json, text/javascript", 6945 "*": "*/*"7014 "*": allTypes 6946 7015 }, 6947 7016 … … 6973 7042 // Parse text as xml 6974 7043 "text xml": jQuery.parseXML 7044 }, 7045 7046 // For options that shouldn't be deep extended: 7047 // you can add your own custom options here if 7048 // and when you create one that shouldn't be 7049 // deep extended (see ajaxExtend) 7050 flatOptions: { 7051 context: true, 7052 url: true 6975 7053 } 6976 7054 }, … … 7083 7161 // It is defined here because jslint complains if it is declared 7084 7162 // at the end of the function (which would be more logical and readable) 7085 function done( status, statusText, responses, headers ) {7163 function done( status, nativeStatusText, responses, headers ) { 7086 7164 7087 7165 // Called once … … 7106 7184 7107 7185 // Set readyState 7108 jqXHR.readyState = status ? 4 : 0;7186 jqXHR.readyState = status > 0 ? 4 : 0; 7109 7187 7110 7188 var isSuccess, 7111 7189 success, 7112 7190 error, 7191 statusText = nativeStatusText, 7113 7192 response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined, 7114 7193 lastModified, … … 7162 7241 // Set data for the fake xhr object 7163 7242 jqXHR.status = status; 7164 jqXHR.statusText = statusText;7243 jqXHR.statusText = "" + ( nativeStatusText || statusText ); 7165 7244 7166 7245 // Success/Error … … 7184 7263 7185 7264 if ( fireGlobals ) { 7186 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );7265 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 7187 7266 // Handle the global AJAX counter 7188 7267 if ( !( --jQuery.active ) ) { … … 7265 7344 if ( s.data ) { 7266 7345 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data; 7346 // #9682: remove data so that it's not used in an eventual retry 7347 delete s.data; 7267 7348 } 7268 7349 … … 7302 7383 "Accept", 7303 7384 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? 7304 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :7385 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 7305 7386 s.accepts[ "*" ] 7306 7387 ); … … 7348 7429 } catch (e) { 7349 7430 // Propagate exception as error if not done 7350 if ( stat us< 2 ) {7431 if ( state < 2 ) { 7351 7432 done( -1, e ); 7352 7433 // Simply rethrow otherwise … … 7996 8077 [ "opacity" ] 7997 8078 ], 7998 fxNow, 7999 requestAnimationFrame = window.webkitRequestAnimationFrame || 8000 window.mozRequestAnimationFrame || 8001 window.oRequestAnimationFrame; 8079 fxNow; 8002 8080 8003 8081 jQuery.fn.extend({ … … 8375 8453 custom: function( from, to, unit ) { 8376 8454 var self = this, 8377 fx = jQuery.fx, 8378 raf; 8455 fx = jQuery.fx; 8379 8456 8380 8457 this.startTime = fxNow || createFxNow(); … … 8392 8469 8393 8470 if ( t() && jQuery.timers.push(t) && !timerId ) { 8394 // Use requestAnimationFrame instead of setInterval if available 8395 if ( requestAnimationFrame ) { 8396 timerId = true; 8397 raf = function() { 8398 // When timerId gets set to null at any point, this stops 8399 if ( timerId ) { 8400 requestAnimationFrame( raf ); 8401 fx.tick(); 8402 } 8403 }; 8404 requestAnimationFrame( raf ); 8405 } else { 8406 timerId = setInterval( fx.tick, fx.interval ); 8407 } 8471 timerId = setInterval( fx.tick, fx.interval ); 8408 8472 } 8409 8473 }, … … 8948 9012 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode 8949 9013 // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat 8950 var docElemProp = elem.document.documentElement[ "client" + name ]; 9014 var docElemProp = elem.document.documentElement[ "client" + name ], 9015 body = elem.document.body; 8951 9016 return elem.document.compatMode === "CSS1Compat" && docElemProp || 8952 elem.document.body[ "client" + name ] || docElemProp;9017 body && body[ "client" + name ] || docElemProp; 8953 9018 8954 9019 // Get document width or height
Note: See TracChangeset
for help on using the changeset viewer.