Index: trunk/phase3/resources/jquery/jquery.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | /*! |
3 | | - * jQuery JavaScript Library v1.6.1 |
| 3 | + * jQuery JavaScript Library v1.6.2 |
4 | 4 | * http://jquery.com/ |
5 | 5 | * |
6 | 6 | * Copyright 2011, John Resig |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * Copyright 2011, The Dojo Foundation |
13 | 13 | * Released under the MIT, BSD, and GPL Licenses. |
14 | 14 | * |
15 | | - * Date: Thu May 12 15:04:36 2011 -0400 |
| 15 | + * Date: Thu Jun 30 14:16:56 2011 -0400 |
16 | 16 | */ |
17 | 17 | (function( window, undefined ) { |
18 | 18 | |
— | — | @@ -65,6 +65,14 @@ |
66 | 66 | rmsie = /(msie) ([\w.]+)/, |
67 | 67 | rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, |
68 | 68 | |
| 69 | + // Matches dashed string for camelizing |
| 70 | + rdashAlpha = /-([a-z])/ig, |
| 71 | + |
| 72 | + // Used by jQuery.camelCase as callback to replace() |
| 73 | + fcamelCase = function( all, letter ) { |
| 74 | + return letter.toUpperCase(); |
| 75 | + }, |
| 76 | + |
69 | 77 | // Keep a UserAgent string for use with jQuery.browser |
70 | 78 | userAgent = navigator.userAgent, |
71 | 79 | |
— | — | @@ -204,7 +212,7 @@ |
205 | 213 | selector: "", |
206 | 214 | |
207 | 215 | // The current version of jQuery being used |
208 | | - jquery: "1.6.1", |
| 216 | + jquery: "1.6.2", |
209 | 217 | |
210 | 218 | // The default length of a jQuery object is 0 |
211 | 219 | length: 0, |
— | — | @@ -603,6 +611,12 @@ |
604 | 612 | } |
605 | 613 | }, |
606 | 614 | |
| 615 | + // Converts a dashed string to camelCased string; |
| 616 | + // Used by both the css and data modules |
| 617 | + camelCase: function( string ) { |
| 618 | + return string.replace( rdashAlpha, fcamelCase ); |
| 619 | + }, |
| 620 | + |
607 | 621 | nodeName: function( elem, name ) { |
608 | 622 | return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); |
609 | 623 | }, |
— | — | @@ -799,7 +813,7 @@ |
800 | 814 | }, |
801 | 815 | |
802 | 816 | // Mutifunctional method to get and set values to a collection |
803 | | - // The value/s can be optionally by executed if its a function |
| 817 | + // The value/s can optionally be executed if it's a function |
804 | 818 | access: function( elems, key, value, exec, fn, pass ) { |
805 | 819 | var length = elems.length; |
806 | 820 | |
— | — | @@ -930,7 +944,6 @@ |
931 | 945 | jQuery.ready(); |
932 | 946 | } |
933 | 947 | |
934 | | -// Expose jQuery to the global object |
935 | 948 | return jQuery; |
936 | 949 | |
937 | 950 | })(); |
— | — | @@ -1147,7 +1160,9 @@ |
1148 | 1161 | support, |
1149 | 1162 | fragment, |
1150 | 1163 | body, |
1151 | | - bodyStyle, |
| 1164 | + testElementParent, |
| 1165 | + testElement, |
| 1166 | + testElementStyle, |
1152 | 1167 | tds, |
1153 | 1168 | events, |
1154 | 1169 | eventName, |
— | — | @@ -1241,11 +1256,10 @@ |
1242 | 1257 | } |
1243 | 1258 | |
1244 | 1259 | if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { |
1245 | | - div.attachEvent( "onclick", function click() { |
| 1260 | + div.attachEvent( "onclick", function() { |
1246 | 1261 | // Cloning a node shouldn't copy over any |
1247 | 1262 | // bound event handlers (IE does this) |
1248 | 1263 | support.noCloneEvent = false; |
1249 | | - div.detachEvent( "onclick", click ); |
1250 | 1264 | }); |
1251 | 1265 | div.cloneNode( true ).fireEvent( "onclick" ); |
1252 | 1266 | } |
— | — | @@ -1270,22 +1284,30 @@ |
1271 | 1285 | // Figure out if the W3C box model works as expected |
1272 | 1286 | div.style.width = div.style.paddingLeft = "1px"; |
1273 | 1287 | |
1274 | | - // We use our own, invisible, body |
1275 | | - body = document.createElement( "body" ); |
1276 | | - bodyStyle = { |
| 1288 | + body = document.getElementsByTagName( "body" )[ 0 ]; |
| 1289 | + // We use our own, invisible, body unless the body is already present |
| 1290 | + // in which case we use a div (#9239) |
| 1291 | + testElement = document.createElement( body ? "div" : "body" ); |
| 1292 | + testElementStyle = { |
1277 | 1293 | visibility: "hidden", |
1278 | 1294 | width: 0, |
1279 | 1295 | height: 0, |
1280 | 1296 | border: 0, |
1281 | | - margin: 0, |
1282 | | - // Set background to avoid IE crashes when removing (#9028) |
1283 | | - background: "none" |
| 1297 | + margin: 0 |
1284 | 1298 | }; |
1285 | | - for ( i in bodyStyle ) { |
1286 | | - body.style[ i ] = bodyStyle[ i ]; |
| 1299 | + if ( body ) { |
| 1300 | + jQuery.extend( testElementStyle, { |
| 1301 | + position: "absolute", |
| 1302 | + left: -1000, |
| 1303 | + top: -1000 |
| 1304 | + }); |
1287 | 1305 | } |
1288 | | - body.appendChild( div ); |
1289 | | - documentElement.insertBefore( body, documentElement.firstChild ); |
| 1306 | + for ( i in testElementStyle ) { |
| 1307 | + testElement.style[ i ] = testElementStyle[ i ]; |
| 1308 | + } |
| 1309 | + testElement.appendChild( div ); |
| 1310 | + testElementParent = body || documentElement; |
| 1311 | + testElementParent.insertBefore( testElement, testElementParent.firstChild ); |
1290 | 1312 | |
1291 | 1313 | // Check if a disconnected checkbox will retain its checked |
1292 | 1314 | // value of true after appended to the DOM (IE6/7) |
— | — | @@ -1344,8 +1366,8 @@ |
1345 | 1367 | } |
1346 | 1368 | |
1347 | 1369 | // Remove the body element we added |
1348 | | - body.innerHTML = ""; |
1349 | | - documentElement.removeChild( body ); |
| 1370 | + testElement.innerHTML = ""; |
| 1371 | + testElementParent.removeChild( testElement ); |
1350 | 1372 | |
1351 | 1373 | // Technique from Juriy Zaytsev |
1352 | 1374 | // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ |
— | — | @@ -1369,6 +1391,9 @@ |
1370 | 1392 | } |
1371 | 1393 | } |
1372 | 1394 | |
| 1395 | + // Null connected elements to avoid leaks in IE |
| 1396 | + testElement = fragment = select = opt = body = marginDiv = div = input = null; |
| 1397 | + |
1373 | 1398 | return support; |
1374 | 1399 | })(); |
1375 | 1400 | |
— | — | @@ -1486,7 +1511,10 @@ |
1487 | 1512 | return thisCache[ internalKey ] && thisCache[ internalKey ].events; |
1488 | 1513 | } |
1489 | 1514 | |
1490 | | - return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache; |
| 1515 | + return getByName ? |
| 1516 | + // Check for both converted-to-camel and non-converted data property names |
| 1517 | + thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] : |
| 1518 | + thisCache; |
1491 | 1519 | }, |
1492 | 1520 | |
1493 | 1521 | removeData: function( elem, name, pvt /* Internal Use Only */ ) { |
— | — | @@ -1882,7 +1910,7 @@ |
1883 | 1911 | rfocusable = /^(?:button|input|object|select|textarea)$/i, |
1884 | 1912 | rclickable = /^a(?:rea)?$/i, |
1885 | 1913 | rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, |
1886 | | - rinvalidChar = /\:/, |
| 1914 | + rinvalidChar = /\:|^on/, |
1887 | 1915 | formHook, boolHook; |
1888 | 1916 | |
1889 | 1917 | jQuery.fn.extend({ |
— | — | @@ -1912,30 +1940,31 @@ |
1913 | 1941 | }, |
1914 | 1942 | |
1915 | 1943 | addClass: function( value ) { |
| 1944 | + var classNames, i, l, elem, |
| 1945 | + setClass, c, cl; |
| 1946 | + |
1916 | 1947 | if ( jQuery.isFunction( value ) ) { |
1917 | | - return this.each(function(i) { |
1918 | | - var self = jQuery(this); |
1919 | | - self.addClass( value.call(this, i, self.attr("class") || "") ); |
| 1948 | + return this.each(function( j ) { |
| 1949 | + jQuery( this ).addClass( value.call(this, j, this.className) ); |
1920 | 1950 | }); |
1921 | 1951 | } |
1922 | 1952 | |
1923 | 1953 | if ( value && typeof value === "string" ) { |
1924 | | - var classNames = (value || "").split( rspace ); |
| 1954 | + classNames = value.split( rspace ); |
1925 | 1955 | |
1926 | | - for ( var i = 0, l = this.length; i < l; i++ ) { |
1927 | | - var elem = this[i]; |
| 1956 | + for ( i = 0, l = this.length; i < l; i++ ) { |
| 1957 | + elem = this[ i ]; |
1928 | 1958 | |
1929 | 1959 | if ( elem.nodeType === 1 ) { |
1930 | | - if ( !elem.className ) { |
| 1960 | + if ( !elem.className && classNames.length === 1 ) { |
1931 | 1961 | elem.className = value; |
1932 | 1962 | |
1933 | 1963 | } else { |
1934 | | - var className = " " + elem.className + " ", |
1935 | | - setClass = elem.className; |
| 1964 | + setClass = " " + elem.className + " "; |
1936 | 1965 | |
1937 | | - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { |
1938 | | - if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { |
1939 | | - setClass += " " + classNames[c]; |
| 1966 | + for ( c = 0, cl = classNames.length; c < cl; c++ ) { |
| 1967 | + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { |
| 1968 | + setClass += classNames[ c ] + " "; |
1940 | 1969 | } |
1941 | 1970 | } |
1942 | 1971 | elem.className = jQuery.trim( setClass ); |
— | — | @@ -1948,24 +1977,25 @@ |
1949 | 1978 | }, |
1950 | 1979 | |
1951 | 1980 | removeClass: function( value ) { |
1952 | | - if ( jQuery.isFunction(value) ) { |
1953 | | - return this.each(function(i) { |
1954 | | - var self = jQuery(this); |
1955 | | - self.removeClass( value.call(this, i, self.attr("class")) ); |
| 1981 | + var classNames, i, l, elem, className, c, cl; |
| 1982 | + |
| 1983 | + if ( jQuery.isFunction( value ) ) { |
| 1984 | + return this.each(function( j ) { |
| 1985 | + jQuery( this ).removeClass( value.call(this, j, this.className) ); |
1956 | 1986 | }); |
1957 | 1987 | } |
1958 | 1988 | |
1959 | 1989 | if ( (value && typeof value === "string") || value === undefined ) { |
1960 | | - var classNames = (value || "").split( rspace ); |
| 1990 | + classNames = (value || "").split( rspace ); |
1961 | 1991 | |
1962 | | - for ( var i = 0, l = this.length; i < l; i++ ) { |
1963 | | - var elem = this[i]; |
| 1992 | + for ( i = 0, l = this.length; i < l; i++ ) { |
| 1993 | + elem = this[ i ]; |
1964 | 1994 | |
1965 | 1995 | if ( elem.nodeType === 1 && elem.className ) { |
1966 | 1996 | if ( value ) { |
1967 | | - var className = (" " + elem.className + " ").replace(rclass, " "); |
1968 | | - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { |
1969 | | - className = className.replace(" " + classNames[c] + " ", " "); |
| 1997 | + className = (" " + elem.className + " ").replace( rclass, " " ); |
| 1998 | + for ( c = 0, cl = classNames.length; c < cl; c++ ) { |
| 1999 | + className = className.replace(" " + classNames[ c ] + " ", " "); |
1970 | 2000 | } |
1971 | 2001 | elem.className = jQuery.trim( className ); |
1972 | 2002 | |
— | — | @@ -1984,9 +2014,8 @@ |
1985 | 2015 | isBool = typeof stateVal === "boolean"; |
1986 | 2016 | |
1987 | 2017 | if ( jQuery.isFunction( value ) ) { |
1988 | | - return this.each(function(i) { |
1989 | | - var self = jQuery(this); |
1990 | | - self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); |
| 2018 | + return this.each(function( i ) { |
| 2019 | + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); |
1991 | 2020 | }); |
1992 | 2021 | } |
1993 | 2022 | |
— | — | @@ -2040,7 +2069,13 @@ |
2041 | 2070 | return ret; |
2042 | 2071 | } |
2043 | 2072 | |
2044 | | - return (elem.value || "").replace(rreturn, ""); |
| 2073 | + ret = elem.value; |
| 2074 | + |
| 2075 | + return typeof ret === "string" ? |
| 2076 | + // handle most common string cases |
| 2077 | + ret.replace(rreturn, "") : |
| 2078 | + // handle cases where value is null/undef or number |
| 2079 | + ret == null ? "" : ret; |
2045 | 2080 | } |
2046 | 2081 | |
2047 | 2082 | return undefined; |
— | — | @@ -2186,20 +2221,23 @@ |
2187 | 2222 | notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
2188 | 2223 | |
2189 | 2224 | // Normalize the name if needed |
2190 | | - name = notxml && jQuery.attrFix[ name ] || name; |
| 2225 | + if ( notxml ) { |
| 2226 | + name = jQuery.attrFix[ name ] || name; |
2191 | 2227 | |
2192 | | - hooks = jQuery.attrHooks[ name ]; |
| 2228 | + hooks = jQuery.attrHooks[ name ]; |
2193 | 2229 | |
2194 | | - if ( !hooks ) { |
2195 | | - // Use boolHook for boolean attributes |
2196 | | - if ( rboolean.test( name ) && |
2197 | | - (typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) { |
| 2230 | + if ( !hooks ) { |
| 2231 | + // Use boolHook for boolean attributes |
| 2232 | + if ( rboolean.test( name ) ) { |
2198 | 2233 | |
2199 | | - hooks = boolHook; |
| 2234 | + hooks = boolHook; |
2200 | 2235 | |
2201 | | - // Use formHook for forms and if the name contains certain characters |
2202 | | - } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { |
2203 | | - hooks = formHook; |
| 2236 | + // Use formHook for forms and if the name contains certain characters |
| 2237 | + } else if ( formHook && name !== "className" && |
| 2238 | + (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { |
| 2239 | + |
| 2240 | + hooks = formHook; |
| 2241 | + } |
2204 | 2242 | } |
2205 | 2243 | } |
2206 | 2244 | |
— | — | @@ -2217,8 +2255,8 @@ |
2218 | 2256 | return value; |
2219 | 2257 | } |
2220 | 2258 | |
2221 | | - } else if ( hooks && "get" in hooks && notxml ) { |
2222 | | - return hooks.get( elem, name ); |
| 2259 | + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { |
| 2260 | + return ret; |
2223 | 2261 | |
2224 | 2262 | } else { |
2225 | 2263 | |
— | — | @@ -2282,6 +2320,25 @@ |
2283 | 2321 | 0 : |
2284 | 2322 | undefined; |
2285 | 2323 | } |
| 2324 | + }, |
| 2325 | + // Use the value property for back compat |
| 2326 | + // Use the formHook for button elements in IE6/7 (#1954) |
| 2327 | + value: { |
| 2328 | + get: function( elem, name ) { |
| 2329 | + if ( formHook && jQuery.nodeName( elem, "button" ) ) { |
| 2330 | + return formHook.get( elem, name ); |
| 2331 | + } |
| 2332 | + return name in elem ? |
| 2333 | + elem.value : |
| 2334 | + null; |
| 2335 | + }, |
| 2336 | + set: function( elem, value, name ) { |
| 2337 | + if ( formHook && jQuery.nodeName( elem, "button" ) ) { |
| 2338 | + return formHook.set( elem, value, name ); |
| 2339 | + } |
| 2340 | + // Does not return so that setAttribute is also used |
| 2341 | + elem.value = value; |
| 2342 | + } |
2286 | 2343 | } |
2287 | 2344 | }, |
2288 | 2345 | |
— | — | @@ -2311,10 +2368,11 @@ |
2312 | 2369 | var ret, hooks, |
2313 | 2370 | notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); |
2314 | 2371 | |
2315 | | - // Try to normalize/fix the name |
2316 | | - name = notxml && jQuery.propFix[ name ] || name; |
2317 | | - |
2318 | | - hooks = jQuery.propHooks[ name ]; |
| 2372 | + if ( notxml ) { |
| 2373 | + // Fix name and attach hooks |
| 2374 | + name = jQuery.propFix[ name ] || name; |
| 2375 | + hooks = jQuery.propHooks[ name ]; |
| 2376 | + } |
2319 | 2377 | |
2320 | 2378 | if ( value !== undefined ) { |
2321 | 2379 | if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { |
— | — | @@ -2341,7 +2399,7 @@ |
2342 | 2400 | boolHook = { |
2343 | 2401 | get: function( elem, name ) { |
2344 | 2402 | // Align boolean attributes with corresponding properties |
2345 | | - return elem[ jQuery.propFix[ name ] || name ] ? |
| 2403 | + return jQuery.prop( elem, name ) ? |
2346 | 2404 | name.toLowerCase() : |
2347 | 2405 | undefined; |
2348 | 2406 | }, |
— | — | @@ -2356,7 +2414,7 @@ |
2357 | 2415 | propName = jQuery.propFix[ name ] || name; |
2358 | 2416 | if ( propName in elem ) { |
2359 | 2417 | // Only set the IDL specifically if it already exists on the element |
2360 | | - elem[ propName ] = value; |
| 2418 | + elem[ propName ] = true; |
2361 | 2419 | } |
2362 | 2420 | |
2363 | 2421 | elem.setAttribute( name, name.toLowerCase() ); |
— | — | @@ -2365,24 +2423,6 @@ |
2366 | 2424 | } |
2367 | 2425 | }; |
2368 | 2426 | |
2369 | | -// Use the value property for back compat |
2370 | | -// Use the formHook for button elements in IE6/7 (#1954) |
2371 | | -jQuery.attrHooks.value = { |
2372 | | - get: function( elem, name ) { |
2373 | | - if ( formHook && jQuery.nodeName( elem, "button" ) ) { |
2374 | | - return formHook.get( elem, name ); |
2375 | | - } |
2376 | | - return elem.value; |
2377 | | - }, |
2378 | | - set: function( elem, value, name ) { |
2379 | | - if ( formHook && jQuery.nodeName( elem, "button" ) ) { |
2380 | | - return formHook.set( elem, value, name ); |
2381 | | - } |
2382 | | - // Does not return so that setAttribute is also used |
2383 | | - elem.value = value; |
2384 | | - } |
2385 | | -}; |
2386 | | - |
2387 | 2427 | // IE6/7 do not support getting/setting some attributes with get/setAttribute |
2388 | 2428 | if ( !jQuery.support.getSetAttribute ) { |
2389 | 2429 | |
— | — | @@ -2390,7 +2430,7 @@ |
2391 | 2431 | jQuery.attrFix = jQuery.propFix; |
2392 | 2432 | |
2393 | 2433 | // Use this for any attribute on a form in IE6/7 |
2394 | | - formHook = jQuery.attrHooks.name = jQuery.valHooks.button = { |
| 2434 | + formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = { |
2395 | 2435 | get: function( elem, name ) { |
2396 | 2436 | var ret; |
2397 | 2437 | ret = elem.getAttributeNode( name ); |
— | — | @@ -2493,8 +2533,7 @@ |
2494 | 2534 | |
2495 | 2535 | |
2496 | 2536 | |
2497 | | -var hasOwn = Object.prototype.hasOwnProperty, |
2498 | | - rnamespaces = /\.(.*)$/, |
| 2537 | +var rnamespaces = /\.(.*)$/, |
2499 | 2538 | rformElems = /^(?:textarea|input|select)$/i, |
2500 | 2539 | rperiod = /\./g, |
2501 | 2540 | rspaces = / /g, |
— | — | @@ -2838,7 +2877,7 @@ |
2839 | 2878 | event.target = elem; |
2840 | 2879 | |
2841 | 2880 | // Clone any incoming data and prepend the event, creating the handler arg list |
2842 | | - data = data ? jQuery.makeArray( data ) : []; |
| 2881 | + data = data != null ? jQuery.makeArray( data ) : []; |
2843 | 2882 | data.unshift( event ); |
2844 | 2883 | |
2845 | 2884 | var cur = elem, |
— | — | @@ -3144,34 +3183,27 @@ |
3145 | 3184 | // Checks if an event happened on an element within another element |
3146 | 3185 | // Used in jQuery.event.special.mouseenter and mouseleave handlers |
3147 | 3186 | var withinElement = function( event ) { |
| 3187 | + |
3148 | 3188 | // Check if mouse(over|out) are still within the same parent element |
3149 | | - var parent = event.relatedTarget; |
| 3189 | + var related = event.relatedTarget, |
| 3190 | + inside = false, |
| 3191 | + eventType = event.type; |
3150 | 3192 | |
3151 | | - // set the correct event type |
3152 | 3193 | event.type = event.data; |
3153 | 3194 | |
3154 | | - // Firefox sometimes assigns relatedTarget a XUL element |
3155 | | - // which we cannot access the parentNode property of |
3156 | | - try { |
| 3195 | + if ( related !== this ) { |
3157 | 3196 | |
3158 | | - // Chrome does something similar, the parentNode property |
3159 | | - // can be accessed but is null. |
3160 | | - if ( parent && parent !== document && !parent.parentNode ) { |
3161 | | - return; |
| 3197 | + if ( related ) { |
| 3198 | + inside = jQuery.contains( this, related ); |
3162 | 3199 | } |
3163 | 3200 | |
3164 | | - // Traverse up the tree |
3165 | | - while ( parent && parent !== this ) { |
3166 | | - parent = parent.parentNode; |
3167 | | - } |
| 3201 | + if ( !inside ) { |
3168 | 3202 | |
3169 | | - if ( parent !== this ) { |
3170 | | - // handle event if we actually just moused on to a non sub-element |
3171 | 3203 | jQuery.event.handle.apply( this, arguments ); |
| 3204 | + |
| 3205 | + event.type = eventType; |
3172 | 3206 | } |
3173 | | - |
3174 | | - // assuming we've left the element since we most likely mousedover a xul element |
3175 | | - } catch(e) { } |
| 3207 | + } |
3176 | 3208 | }, |
3177 | 3209 | |
3178 | 3210 | // In case of event delegation, we only need to rename the event.type, |
— | — | @@ -5890,9 +5922,22 @@ |
5891 | 5923 | } |
5892 | 5924 | |
5893 | 5925 | jQuery.buildFragment = function( args, nodes, scripts ) { |
5894 | | - var fragment, cacheable, cacheresults, |
5895 | | - doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); |
| 5926 | + var fragment, cacheable, cacheresults, doc; |
5896 | 5927 | |
| 5928 | + // nodes may contain either an explicit document object, |
| 5929 | + // a jQuery collection or context object. |
| 5930 | + // If nodes[0] contains a valid object to assign to doc |
| 5931 | + if ( nodes && nodes[0] ) { |
| 5932 | + doc = nodes[0].ownerDocument || nodes[0]; |
| 5933 | + } |
| 5934 | + |
| 5935 | + // Ensure that an attr object doesn't incorrectly stand in as a document object |
| 5936 | + // Chrome and Firefox seem to allow this to occur and will throw exception |
| 5937 | + // Fixes #8950 |
| 5938 | + if ( !doc.createDocumentFragment ) { |
| 5939 | + doc = document; |
| 5940 | + } |
| 5941 | + |
5897 | 5942 | // Only cache "small" (1/2 KB) HTML strings that are associated with the main document |
5898 | 5943 | // Cloning options loses the selected state, so don't cache them |
5899 | 5944 | // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment |
— | — | @@ -5972,7 +6017,7 @@ |
5973 | 6018 | function findInputs( elem ) { |
5974 | 6019 | if ( jQuery.nodeName( elem, "input" ) ) { |
5975 | 6020 | fixDefaultChecked( elem ); |
5976 | | - } else if ( elem.getElementsByTagName ) { |
| 6021 | + } else if ( "getElementsByTagName" in elem ) { |
5977 | 6022 | jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); |
5978 | 6023 | } |
5979 | 6024 | } |
— | — | @@ -6021,6 +6066,8 @@ |
6022 | 6067 | } |
6023 | 6068 | } |
6024 | 6069 | |
| 6070 | + srcElements = destElements = null; |
| 6071 | + |
6025 | 6072 | // Return the cloned set |
6026 | 6073 | return clone; |
6027 | 6074 | }, |
— | — | @@ -6201,10 +6248,8 @@ |
6202 | 6249 | |
6203 | 6250 | |
6204 | 6251 | |
6205 | | - |
6206 | 6252 | var ralpha = /alpha\([^)]*\)/i, |
6207 | 6253 | ropacity = /opacity=([^)]*)/, |
6208 | | - rdashAlpha = /-([a-z])/ig, |
6209 | 6254 | // fixed for IE9, see #8346 |
6210 | 6255 | rupper = /([A-Z]|^ms)/g, |
6211 | 6256 | rnumpx = /^-?\d+(?:px)?$/i, |
— | — | @@ -6218,12 +6263,8 @@ |
6219 | 6264 | curCSS, |
6220 | 6265 | |
6221 | 6266 | getComputedStyle, |
6222 | | - currentStyle, |
| 6267 | + currentStyle; |
6223 | 6268 | |
6224 | | - fcamelCase = function( all, letter ) { |
6225 | | - return letter.toUpperCase(); |
6226 | | - }; |
6227 | | - |
6228 | 6269 | jQuery.fn.css = function( name, value ) { |
6229 | 6270 | // Setting 'undefined' is a no-op |
6230 | 6271 | if ( arguments.length === 2 && value === undefined ) { |
— | — | @@ -6257,13 +6298,14 @@ |
6258 | 6299 | |
6259 | 6300 | // Exclude the following css properties to add px |
6260 | 6301 | cssNumber: { |
6261 | | - "zIndex": true, |
| 6302 | + "fillOpacity": true, |
6262 | 6303 | "fontWeight": true, |
| 6304 | + "lineHeight": true, |
6263 | 6305 | "opacity": true, |
6264 | | - "zoom": true, |
6265 | | - "lineHeight": true, |
| 6306 | + "orphans": true, |
6266 | 6307 | "widows": true, |
6267 | | - "orphans": true |
| 6308 | + "zIndex": true, |
| 6309 | + "zoom": true |
6268 | 6310 | }, |
6269 | 6311 | |
6270 | 6312 | // Add in properties whose names you wish to fix before |
— | — | @@ -6298,6 +6340,8 @@ |
6299 | 6341 | // convert relative number strings (+= or -=) to relative numbers. #7345 |
6300 | 6342 | if ( type === "string" && rrelNum.test( value ) ) { |
6301 | 6343 | value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) ); |
| 6344 | + // Fixes bug #9237 |
| 6345 | + type = "number"; |
6302 | 6346 | } |
6303 | 6347 | |
6304 | 6348 | // If a number was passed in, add 'px' to the (except for certain CSS properties) |
— | — | @@ -6364,10 +6408,6 @@ |
6365 | 6409 | for ( name in options ) { |
6366 | 6410 | elem.style[ name ] = old[ name ]; |
6367 | 6411 | } |
6368 | | - }, |
6369 | | - |
6370 | | - camelCase: function( string ) { |
6371 | | - return string.replace( rdashAlpha, fcamelCase ); |
6372 | 6412 | } |
6373 | 6413 | }); |
6374 | 6414 | |
— | — | @@ -6381,44 +6421,21 @@ |
6382 | 6422 | |
6383 | 6423 | if ( computed ) { |
6384 | 6424 | if ( elem.offsetWidth !== 0 ) { |
6385 | | - val = getWH( elem, name, extra ); |
6386 | | - |
| 6425 | + return getWH( elem, name, extra ); |
6387 | 6426 | } else { |
6388 | 6427 | jQuery.swap( elem, cssShow, function() { |
6389 | 6428 | val = getWH( elem, name, extra ); |
6390 | 6429 | }); |
6391 | 6430 | } |
6392 | 6431 | |
6393 | | - if ( val <= 0 ) { |
6394 | | - val = curCSS( elem, name, name ); |
6395 | | - |
6396 | | - if ( val === "0px" && currentStyle ) { |
6397 | | - val = currentStyle( elem, name, name ); |
6398 | | - } |
6399 | | - |
6400 | | - if ( val != null ) { |
6401 | | - // Should return "auto" instead of 0, use 0 for |
6402 | | - // temporary backwards-compat |
6403 | | - return val === "" || val === "auto" ? "0px" : val; |
6404 | | - } |
6405 | | - } |
6406 | | - |
6407 | | - if ( val < 0 || val == null ) { |
6408 | | - val = elem.style[ name ]; |
6409 | | - |
6410 | | - // Should return "auto" instead of 0, use 0 for |
6411 | | - // temporary backwards-compat |
6412 | | - return val === "" || val === "auto" ? "0px" : val; |
6413 | | - } |
6414 | | - |
6415 | | - return typeof val === "string" ? val : val + "px"; |
| 6432 | + return val; |
6416 | 6433 | } |
6417 | 6434 | }, |
6418 | 6435 | |
6419 | 6436 | set: function( elem, value ) { |
6420 | 6437 | if ( rnumpx.test( value ) ) { |
6421 | 6438 | // ignore negative width and height values #1599 |
6422 | | - value = parseFloat(value); |
| 6439 | + value = parseFloat( value ); |
6423 | 6440 | |
6424 | 6441 | if ( value >= 0 ) { |
6425 | 6442 | return value + "px"; |
— | — | @@ -6541,27 +6558,50 @@ |
6542 | 6559 | curCSS = getComputedStyle || currentStyle; |
6543 | 6560 | |
6544 | 6561 | function getWH( elem, name, extra ) { |
6545 | | - var which = name === "width" ? cssWidth : cssHeight, |
6546 | | - val = name === "width" ? elem.offsetWidth : elem.offsetHeight; |
6547 | 6562 | |
6548 | | - if ( extra === "border" ) { |
6549 | | - return val; |
6550 | | - } |
| 6563 | + // Start with offset property |
| 6564 | + var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, |
| 6565 | + which = name === "width" ? cssWidth : cssHeight; |
6551 | 6566 | |
6552 | | - jQuery.each( which, function() { |
6553 | | - if ( !extra ) { |
6554 | | - val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0; |
| 6567 | + if ( val > 0 ) { |
| 6568 | + if ( extra !== "border" ) { |
| 6569 | + jQuery.each( which, function() { |
| 6570 | + if ( !extra ) { |
| 6571 | + val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0; |
| 6572 | + } |
| 6573 | + if ( extra === "margin" ) { |
| 6574 | + val += parseFloat( jQuery.css( elem, extra + this ) ) || 0; |
| 6575 | + } else { |
| 6576 | + val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0; |
| 6577 | + } |
| 6578 | + }); |
6555 | 6579 | } |
6556 | 6580 | |
6557 | | - if ( extra === "margin" ) { |
6558 | | - val += parseFloat(jQuery.css( elem, "margin" + this )) || 0; |
| 6581 | + return val + "px"; |
| 6582 | + } |
6559 | 6583 | |
6560 | | - } else { |
6561 | | - val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0; |
6562 | | - } |
6563 | | - }); |
| 6584 | + // Fall back to computed then uncomputed css if necessary |
| 6585 | + val = curCSS( elem, name, name ); |
| 6586 | + if ( val < 0 || val == null ) { |
| 6587 | + val = elem.style[ name ] || 0; |
| 6588 | + } |
| 6589 | + // Normalize "", auto, and prepare for extra |
| 6590 | + val = parseFloat( val ) || 0; |
6564 | 6591 | |
6565 | | - return val; |
| 6592 | + // Add padding, border, margin |
| 6593 | + if ( extra ) { |
| 6594 | + jQuery.each( which, function() { |
| 6595 | + val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0; |
| 6596 | + if ( extra !== "padding" ) { |
| 6597 | + val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0; |
| 6598 | + } |
| 6599 | + if ( extra === "margin" ) { |
| 6600 | + val += parseFloat( jQuery.css( elem, extra + this ) ) || 0; |
| 6601 | + } |
| 6602 | + }); |
| 6603 | + } |
| 6604 | + |
| 6605 | + return val + "px"; |
6566 | 6606 | } |
6567 | 6607 | |
6568 | 6608 | if ( jQuery.expr && jQuery.expr.filters ) { |
— | — | @@ -7957,8 +7997,8 @@ |
7958 | 7998 | ], |
7959 | 7999 | fxNow, |
7960 | 8000 | requestAnimationFrame = window.webkitRequestAnimationFrame || |
7961 | | - window.mozRequestAnimationFrame || |
7962 | | - window.oRequestAnimationFrame; |
| 8001 | + window.mozRequestAnimationFrame || |
| 8002 | + window.oRequestAnimationFrame; |
7963 | 8003 | |
7964 | 8004 | jQuery.fn.extend({ |
7965 | 8005 | show: function( speed, easing, callback ) { |
— | — | @@ -8272,15 +8312,15 @@ |
8273 | 8313 | // Queueing |
8274 | 8314 | opt.old = opt.complete; |
8275 | 8315 | opt.complete = function( noUnmark ) { |
| 8316 | + if ( jQuery.isFunction( opt.old ) ) { |
| 8317 | + opt.old.call( this ); |
| 8318 | + } |
| 8319 | + |
8276 | 8320 | if ( opt.queue !== false ) { |
8277 | 8321 | jQuery.dequeue( this ); |
8278 | 8322 | } else if ( noUnmark !== false ) { |
8279 | 8323 | jQuery._unmark( this ); |
8280 | 8324 | } |
8281 | | - |
8282 | | - if ( jQuery.isFunction( opt.old ) ) { |
8283 | | - opt.old.call( this ); |
8284 | | - } |
8285 | 8325 | }; |
8286 | 8326 | |
8287 | 8327 | return opt; |
— | — | @@ -8353,7 +8393,7 @@ |
8354 | 8394 | if ( t() && jQuery.timers.push(t) && !timerId ) { |
8355 | 8395 | // Use requestAnimationFrame instead of setInterval if available |
8356 | 8396 | if ( requestAnimationFrame ) { |
8357 | | - timerId = 1; |
| 8397 | + timerId = true; |
8358 | 8398 | raf = function() { |
8359 | 8399 | // When timerId gets set to null at any point, this stops |
8360 | 8400 | if ( timerId ) { |
— | — | @@ -8516,7 +8556,8 @@ |
8517 | 8557 | |
8518 | 8558 | if ( !elemdisplay[ nodeName ] ) { |
8519 | 8559 | |
8520 | | - var elem = jQuery( "<" + nodeName + ">" ).appendTo( "body" ), |
| 8560 | + var body = document.body, |
| 8561 | + elem = jQuery( "<" + nodeName + ">" ).appendTo( body ), |
8521 | 8562 | display = elem.css( "display" ); |
8522 | 8563 | |
8523 | 8564 | elem.remove(); |
— | — | @@ -8530,14 +8571,15 @@ |
8531 | 8572 | iframe.frameBorder = iframe.width = iframe.height = 0; |
8532 | 8573 | } |
8533 | 8574 | |
8534 | | - document.body.appendChild( iframe ); |
| 8575 | + body.appendChild( iframe ); |
8535 | 8576 | |
8536 | 8577 | // Create a cacheable copy of the iframe document on first call. |
8537 | | - // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake html |
8538 | | - // document to it, Webkit & Firefox won't allow reusing the iframe document |
| 8578 | + // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML |
| 8579 | + // document to it; WebKit & Firefox won't allow reusing the iframe document. |
8539 | 8580 | if ( !iframeDoc || !iframe.createElement ) { |
8540 | 8581 | iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; |
8541 | | - iframeDoc.write( "<!doctype><html><body></body></html>" ); |
| 8582 | + iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" ); |
| 8583 | + iframeDoc.close(); |
8542 | 8584 | } |
8543 | 8585 | |
8544 | 8586 | elem = iframeDoc.createElement( nodeName ); |
— | — | @@ -8546,7 +8588,7 @@ |
8547 | 8589 | |
8548 | 8590 | display = jQuery.css( elem, "display" ); |
8549 | 8591 | |
8550 | | - document.body.removeChild( iframe ); |
| 8592 | + body.removeChild( iframe ); |
8551 | 8593 | } |
8552 | 8594 | |
8553 | 8595 | // Store the correct default display |
— | — | @@ -8867,22 +8909,24 @@ |
8868 | 8910 | |
8869 | 8911 | |
8870 | 8912 | |
8871 | | -// Create innerHeight, innerWidth, outerHeight and outerWidth methods |
| 8913 | +// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods |
8872 | 8914 | jQuery.each([ "Height", "Width" ], function( i, name ) { |
8873 | 8915 | |
8874 | 8916 | var type = name.toLowerCase(); |
8875 | 8917 | |
8876 | 8918 | // innerHeight and innerWidth |
8877 | | - jQuery.fn["inner" + name] = function() { |
8878 | | - return this[0] ? |
8879 | | - parseFloat( jQuery.css( this[0], type, "padding" ) ) : |
| 8919 | + jQuery.fn[ "inner" + name ] = function() { |
| 8920 | + var elem = this[0]; |
| 8921 | + return elem && elem.style ? |
| 8922 | + parseFloat( jQuery.css( elem, type, "padding" ) ) : |
8880 | 8923 | null; |
8881 | 8924 | }; |
8882 | 8925 | |
8883 | 8926 | // outerHeight and outerWidth |
8884 | | - jQuery.fn["outer" + name] = function( margin ) { |
8885 | | - return this[0] ? |
8886 | | - parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) : |
| 8927 | + jQuery.fn[ "outer" + name ] = function( margin ) { |
| 8928 | + var elem = this[0]; |
| 8929 | + return elem && elem.style ? |
| 8930 | + parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : |
8887 | 8931 | null; |
8888 | 8932 | }; |
8889 | 8933 | |
— | — | @@ -8932,5 +8976,6 @@ |
8933 | 8977 | }); |
8934 | 8978 | |
8935 | 8979 | |
| 8980 | +// Expose jQuery to the global object |
8936 | 8981 | window.jQuery = window.$ = jQuery; |
8937 | 8982 | })(window); |
\ No newline at end of file |