Changeset 14027 for trunk/themes/default/js/jquery.js
- Timestamp:
- Apr 9, 2012, 6:17:33 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/jquery.js
r13052 r14027 1 1 /*! 2 * jQuery JavaScript Library v1.7. 12 * jQuery JavaScript Library v1.7.2 3 3 * http://jquery.com/ 4 4 * … … 12 12 * Released under the MIT, BSD, and GPL Licenses. 13 13 * 14 * Date: Mon Nov 21 21:11:03 2011 -050014 * Date: Wed Mar 21 12:46:34 2012 -0700 15 15 */ 16 16 (function( window, undefined ) { … … 211 211 212 212 // The current version of jQuery being used 213 jquery: "1.7. 1",213 jquery: "1.7.2", 214 214 215 215 // The default length of a jQuery object is 0 … … 498 498 }, 499 499 500 // A crude way of determining if an object is a window501 500 isWindow: function( obj ) { 502 return obj && typeof obj === "object" && "setInterval" in obj;501 return obj != null && obj == obj.window; 503 502 }, 504 503 … … 580 579 // Cross-browser xml parsing 581 580 parseXML: function( data ) { 581 if ( typeof data !== "string" || !data ) { 582 return null; 583 } 582 584 var xml, tmp; 583 585 try { … … 823 825 // Mutifunctional method to get and set values to a collection 824 826 // The value/s can optionally be executed if it's a function 825 access: function( elems, key, value, exec, fn, pass ) { 826 var length = elems.length; 827 828 // Setting many attributes 829 if ( typeof key === "object" ) { 830 for ( var k in key ) { 831 jQuery.access( elems, k, key[k], exec, fn, value ); 832 } 833 return elems; 834 } 835 836 // Setting one attribute 837 if ( value !== undefined ) { 827 access: function( elems, fn, key, value, chainable, emptyGet, pass ) { 828 var exec, 829 bulk = key == null, 830 i = 0, 831 length = elems.length; 832 833 // Sets many values 834 if ( key && typeof key === "object" ) { 835 for ( i in key ) { 836 jQuery.access( elems, fn, i, key[i], 1, emptyGet, value ); 837 } 838 chainable = 1; 839 840 // Sets one value 841 } else if ( value !== undefined ) { 838 842 // Optionally, function values get executed if exec is true 839 exec = !pass && exec && jQuery.isFunction(value); 840 841 for ( var i = 0; i < length; i++ ) { 842 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); 843 } 844 845 return elems; 846 } 847 848 // Getting an attribute 849 return length ? fn( elems[0], key ) : undefined; 843 exec = pass === undefined && jQuery.isFunction( value ); 844 845 if ( bulk ) { 846 // Bulk operations only iterate when executing function values 847 if ( exec ) { 848 exec = fn; 849 fn = function( elem, key, value ) { 850 return exec.call( jQuery( elem ), value ); 851 }; 852 853 // Otherwise they run against the entire set 854 } else { 855 fn.call( elems, value ); 856 fn = null; 857 } 858 } 859 860 if ( fn ) { 861 for (; i < length; i++ ) { 862 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); 863 } 864 } 865 866 chainable = 1; 867 } 868 869 return chainable ? 870 elems : 871 872 // Gets 873 bulk ? 874 fn.call( elems ) : 875 length ? fn( elems[0], key ) : emptyGet; 850 876 }, 851 877 … … 1006 1032 // Last fire value (for non-forgettable lists) 1007 1033 memory, 1034 // Flag to know if list was already fired 1035 fired, 1008 1036 // Flag to know if list is currently firing 1009 1037 firing, … … 1039 1067 args = args || []; 1040 1068 memory = !flags.memory || [ context, args ]; 1069 fired = true; 1041 1070 firing = true; 1042 1071 firingIndex = firingStart || 0; … … 1174 1203 // To know if the callbacks have already been called at least once 1175 1204 fired: function() { 1176 return !! memory;1205 return !!fired; 1177 1206 } 1178 1207 }; … … 1337 1366 opt, 1338 1367 input, 1339 marginDiv,1340 1368 fragment, 1341 1369 tds, … … 1420 1448 inlineBlockNeedsLayout: false, 1421 1449 shrinkWrapBlocks: false, 1422 reliableMarginRight: true 1450 reliableMarginRight: true, 1451 pixelMargin: true 1423 1452 }; 1453 1454 // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead 1455 jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat"); 1424 1456 1425 1457 // Make sure checked status is properly cloned … … 1457 1489 1458 1490 input.setAttribute("checked", "checked"); 1491 1492 // #11217 - WebKit loses check when the name is after the checked attribute 1493 input.setAttribute( "name", "t" ); 1494 1459 1495 div.appendChild( input ); 1460 1496 fragment = document.createDocumentFragment(); … … 1470 1506 fragment.removeChild( input ); 1471 1507 fragment.appendChild( div ); 1472 1473 div.innerHTML = "";1474 1475 // Check if div with explicit width and no margin-right incorrectly1476 // gets computed margin-right based on width of container. For more1477 // info see bug #33331478 // Fails in WebKit before Feb 2011 nightlies1479 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right1480 if ( window.getComputedStyle ) {1481 marginDiv = document.createElement( "div" );1482 marginDiv.style.width = "0";1483 marginDiv.style.marginRight = "0";1484 div.style.width = "2px";1485 div.appendChild( marginDiv );1486 support.reliableMarginRight =1487 ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;1488 }1489 1508 1490 1509 // Technique from Juriy Zaytsev … … 1495 1514 // to go haywire. See: https://developer.mozilla.org/en/Security/CSP 1496 1515 if ( div.attachEvent ) { 1497 for ( i in {1516 for ( i in { 1498 1517 submit: 1, 1499 1518 change: 1, … … 1513 1532 1514 1533 // Null elements to avoid leaks in IE 1515 fragment = select = opt = marginDiv =div = input = null;1534 fragment = select = opt = div = input = null; 1516 1535 1517 1536 // Run tests that need a body at doc ready 1518 1537 jQuery(function() { 1519 1538 var container, outer, inner, table, td, offsetSupport, 1520 conMarginTop, ptlm, vb, style, html, 1539 marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight, 1540 paddingMarginBorderVisibility, paddingMarginBorder, 1521 1541 body = document.getElementsByTagName("body")[0]; 1522 1542 … … 1527 1547 1528 1548 conMarginTop = 1; 1529 ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"; 1530 vb = "visibility:hidden;border:0;"; 1531 style = "style='" + ptlm + "border:5px solid #000;padding:0;'"; 1532 html = "<div " + style + "><div></div></div>" + 1533 "<table " + style + " cellpadding='0' cellspacing='0'>" + 1549 paddingMarginBorder = "padding:0;margin:0;border:"; 1550 positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;"; 1551 paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;"; 1552 style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;"; 1553 html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" + 1554 "<table " + style + "' cellpadding='0' cellspacing='0'>" + 1534 1555 "<tr><td></td></tr></table>"; 1535 1556 1536 1557 container = document.createElement("div"); 1537 container.style.cssText = vb+ "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";1558 container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; 1538 1559 body.insertBefore( container, body.firstChild ); 1539 1560 … … 1549 1570 // hidden; don safety goggles and see bug #4512 for more information). 1550 1571 // (only IE 8 fails this test) 1551 div.innerHTML = "<table><tr><td style=' padding:0;border:0;display:none'></td><td>t</td></tr></table>";1572 div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>"; 1552 1573 tds = div.getElementsByTagName( "td" ); 1553 1574 isSupported = ( tds[ 0 ].offsetHeight === 0 ); … … 1560 1581 support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); 1561 1582 1562 // Figure out if the W3C box model works as expected 1563 div.innerHTML = ""; 1564 div.style.width = div.style.paddingLeft = "1px"; 1565 jQuery.boxModel = support.boxModel = div.offsetWidth === 2; 1583 // Check if div with explicit width and no margin-right incorrectly 1584 // gets computed margin-right based on width of container. For more 1585 // info see bug #3333 1586 // Fails in WebKit before Feb 2011 nightlies 1587 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 1588 if ( window.getComputedStyle ) { 1589 div.innerHTML = ""; 1590 marginDiv = document.createElement( "div" ); 1591 marginDiv.style.width = "0"; 1592 marginDiv.style.marginRight = "0"; 1593 div.style.width = "2px"; 1594 div.appendChild( marginDiv ); 1595 support.reliableMarginRight = 1596 ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; 1597 } 1566 1598 1567 1599 if ( typeof div.style.zoom !== "undefined" ) { … … 1570 1602 // them layout 1571 1603 // (IE < 8 does this) 1604 div.innerHTML = ""; 1605 div.style.width = div.style.padding = "1px"; 1606 div.style.border = 0; 1607 div.style.overflow = "hidden"; 1572 1608 div.style.display = "inline"; 1573 1609 div.style.zoom = 1; 1574 support.inlineBlockNeedsLayout = ( div.offsetWidth === 2);1610 support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); 1575 1611 1576 1612 // Check if elements with layout shrink-wrap their children 1577 1613 // (IE 6 does this) 1578 div.style.display = ""; 1579 div.innerHTML = "<div style='width:4px;'></div>"; 1580 support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); 1581 } 1582 1583 div.style.cssText = ptlm + vb; 1614 div.style.display = "block"; 1615 div.style.overflow = "visible"; 1616 div.innerHTML = "<div style='width:5px;'></div>"; 1617 support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); 1618 } 1619 1620 div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility; 1584 1621 div.innerHTML = html; 1585 1622 … … 1606 1643 offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); 1607 1644 1645 if ( window.getComputedStyle ) { 1646 div.style.marginTop = "1%"; 1647 support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%"; 1648 } 1649 1650 if ( typeof container.style.zoom !== "undefined" ) { 1651 container.style.zoom = 1; 1652 } 1653 1608 1654 body.removeChild( container ); 1609 div= container = null;1655 marginDiv = div = container = null; 1610 1656 1611 1657 jQuery.extend( support, offsetSupport ); … … 1864 1910 jQuery.fn.extend({ 1865 1911 data: function( key, value ) { 1866 var parts, attr, name, 1912 var parts, part, attr, name, l, 1913 elem = this[0], 1914 i = 0, 1867 1915 data = null; 1868 1916 1869 if ( typeof key === "undefined" ) { 1917 // Gets all values 1918 if ( key === undefined ) { 1870 1919 if ( this.length ) { 1871 data = jQuery.data( this[0]);1872 1873 if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {1874 attr = this[0].attributes;1875 for ( var i = 0,l = attr.length; i < l; i++ ) {1920 data = jQuery.data( elem ); 1921 1922 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { 1923 attr = elem.attributes; 1924 for ( l = attr.length; i < l; i++ ) { 1876 1925 name = attr[i].name; 1877 1926 … … 1879 1928 name = jQuery.camelCase( name.substring(5) ); 1880 1929 1881 dataAttr( this[0], name, data[ name ] );1930 dataAttr( elem, name, data[ name ] ); 1882 1931 } 1883 1932 } 1884 jQuery._data( this[0], "parsedAttrs", true );1933 jQuery._data( elem, "parsedAttrs", true ); 1885 1934 } 1886 1935 } 1887 1936 1888 1937 return data; 1889 1890 } else if ( typeof key === "object" ) { 1938 } 1939 1940 // Sets multiple values 1941 if ( typeof key === "object" ) { 1891 1942 return this.each(function() { 1892 1943 jQuery.data( this, key ); … … 1894 1945 } 1895 1946 1896 parts = key.split( ".");1947 parts = key.split( ".", 2 ); 1897 1948 parts[1] = parts[1] ? "." + parts[1] : ""; 1898 1899 if ( value === undefined ) { 1900 data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); 1901 1902 // Try to fetch any internally stored data first 1903 if ( data === undefined && this.length ) { 1904 data = jQuery.data( this[0], key ); 1905 data = dataAttr( this[0], key, data ); 1906 } 1907 1908 return data === undefined && parts[1] ? 1909 this.data( parts[0] ) : 1910 data; 1911 1912 } else { 1913 return this.each(function() { 1914 var self = jQuery( this ), 1915 args = [ parts[0], value ]; 1916 1917 self.triggerHandler( "setData" + parts[1] + "!", args ); 1949 part = parts[1] + "!"; 1950 1951 return jQuery.access( this, function( value ) { 1952 1953 if ( value === undefined ) { 1954 data = this.triggerHandler( "getData" + part, [ parts[0] ] ); 1955 1956 // Try to fetch any internally stored data first 1957 if ( data === undefined && elem ) { 1958 data = jQuery.data( elem, key ); 1959 data = dataAttr( elem, key, data ); 1960 } 1961 1962 return data === undefined && parts[1] ? 1963 this.data( parts[0] ) : 1964 data; 1965 } 1966 1967 parts[1] = value; 1968 this.each(function() { 1969 var self = jQuery( this ); 1970 1971 self.triggerHandler( "setData" + part, parts ); 1918 1972 jQuery.data( this, key, value ); 1919 self.triggerHandler( "changeData" + part s[1] + "!", args );1973 self.triggerHandler( "changeData" + part, parts ); 1920 1974 }); 1921 } 1975 }, null, value, arguments.length > 1, null, false ); 1922 1976 }, 1923 1977 … … 1943 1997 data === "false" ? false : 1944 1998 data === "null" ? null : 1945 jQuery.isNumeric( data ) ? parseFloat( data ):1999 jQuery.isNumeric( data ) ? +data : 1946 2000 rbrace.test( data ) ? jQuery.parseJSON( data ) : 1947 2001 data; … … 2078 2132 jQuery.fn.extend({ 2079 2133 queue: function( type, data ) { 2134 var setter = 2; 2135 2080 2136 if ( typeof type !== "string" ) { 2081 2137 data = type; 2082 2138 type = "fx"; 2083 } 2084 2085 if ( data === undefined ) { 2139 setter--; 2140 } 2141 2142 if ( arguments.length < setter ) { 2086 2143 return jQuery.queue( this[0], type ); 2087 2144 } 2088 return this.each(function() { 2089 var queue = jQuery.queue( this, type, data ); 2090 2091 if ( type === "fx" && queue[0] !== "inprogress" ) { 2092 jQuery.dequeue( this, type ); 2093 } 2094 }); 2145 2146 return data === undefined ? 2147 this : 2148 this.each(function() { 2149 var queue = jQuery.queue( this, type, data ); 2150 2151 if ( type === "fx" && queue[0] !== "inprogress" ) { 2152 jQuery.dequeue( this, type ); 2153 } 2154 }); 2095 2155 }, 2096 2156 dequeue: function( type ) { … … 2146 2206 } 2147 2207 resolve(); 2148 return defer.promise( );2208 return defer.promise( object ); 2149 2209 } 2150 2210 }); … … 2165 2225 jQuery.fn.extend({ 2166 2226 attr: function( name, value ) { 2167 return jQuery.access( this, name, value, true, jQuery.attr);2227 return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); 2168 2228 }, 2169 2229 … … 2175 2235 2176 2236 prop: function( name, value ) { 2177 return jQuery.access( this, name, value, true, jQuery.prop);2237 return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); 2178 2238 }, 2179 2239 … … 2315 2375 if ( !arguments.length ) { 2316 2376 if ( elem ) { 2317 hooks = jQuery.valHooks[ elem. nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type];2377 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 2318 2378 2319 2379 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { … … 2359 2419 } 2360 2420 2361 hooks = jQuery.valHooks[ this. nodeName.toLowerCase() ] || jQuery.valHooks[ this.type];2421 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 2362 2422 2363 2423 // If set returns undefined, fall back to normal setting … … 2505 2565 2506 2566 removeAttr: function( elem, value ) { 2507 var propName, attrNames, name, l, 2567 var propName, attrNames, name, l, isBool, 2508 2568 i = 0; 2509 2569 … … 2517 2577 if ( name ) { 2518 2578 propName = jQuery.propFix[ name ] || name; 2579 isBool = rboolean.test( name ); 2519 2580 2520 2581 // See #9699 for explanation of this approach (setting first, then removal) 2521 jQuery.attr( elem, name, "" ); 2582 // Do not do this for boolean attributes (see #10870) 2583 if ( !isBool ) { 2584 jQuery.attr( elem, name, "" ); 2585 } 2522 2586 elem.removeAttribute( getSetAttribute ? name : propName ); 2523 2587 2524 2588 // Set corresponding property to false for boolean attributes 2525 if ( rboolean.test( name )&& propName in elem ) {2589 if ( isBool && propName in elem ) { 2526 2590 elem[ propName ] = false; 2527 2591 } … … 2677 2741 fixSpecified = { 2678 2742 name: true, 2679 id: true 2743 id: true, 2744 coords: true 2680 2745 }; 2681 2746 … … 2807 2872 var rformElems = /^(?:textarea|input|select)$/i, 2808 2873 rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, 2809 rhoverHack = / \bhover(\.\S+)?\b/,2874 rhoverHack = /(?:^|\s)hover(\.\S+)?\b/, 2810 2875 rkeyEvent = /^key/, 2811 2876 rmouseEvent = /^(?:mouse|contextmenu)|click/, … … 2855 2920 handleObjIn = handler; 2856 2921 handler = handleObjIn.handler; 2922 selector = handleObjIn.selector; 2857 2923 } 2858 2924 … … 2906 2972 guid: handler.guid, 2907 2973 selector: selector, 2908 quick: quickParse( selector ),2974 quick: selector && quickParse( selector ), 2909 2975 namespace: namespaces.join(".") 2910 2976 }, handleObjIn ); … … 3195 3261 args = [].slice.call( arguments, 0 ), 3196 3262 run_all = !event.exclusive && !event.namespace, 3263 special = jQuery.event.special[ event.type ] || {}, 3197 3264 handlerQueue = [], 3198 3265 i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; … … 3202 3269 event.delegateTarget = this; 3203 3270 3271 // Call the preDispatch hook for the mapped type, and let it bail if desired 3272 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 3273 return; 3274 } 3275 3204 3276 // Determine handlers that should run if there are delegated events 3205 // Avoid disabled elements in IE (#6911) andnon-left-click bubbling in Firefox (#3861)3206 if ( delegateCount && ! event.target.disabled && !(event.button && event.type === "click") ) {3277 // Avoid non-left-click bubbling in Firefox (#3861) 3278 if ( delegateCount && !(event.button && event.type === "click") ) { 3207 3279 3208 3280 // Pregenerate a single jQuery object for reuse with .is() … … 3211 3283 3212 3284 for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { 3213 selMatch = {}; 3214 matches = []; 3215 jqcur[0] = cur; 3216 for ( i = 0; i < delegateCount; i++ ) { 3217 handleObj = handlers[ i ]; 3218 sel = handleObj.selector; 3219 3220 if ( selMatch[ sel ] === undefined ) { 3221 selMatch[ sel ] = ( 3222 handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) 3223 ); 3224 } 3225 if ( selMatch[ sel ] ) { 3226 matches.push( handleObj ); 3227 } 3228 } 3229 if ( matches.length ) { 3230 handlerQueue.push({ elem: cur, matches: matches }); 3285 3286 // Don't process events on disabled elements (#6911, #8165) 3287 if ( cur.disabled !== true ) { 3288 selMatch = {}; 3289 matches = []; 3290 jqcur[0] = cur; 3291 for ( i = 0; i < delegateCount; i++ ) { 3292 handleObj = handlers[ i ]; 3293 sel = handleObj.selector; 3294 3295 if ( selMatch[ sel ] === undefined ) { 3296 selMatch[ sel ] = ( 3297 handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) 3298 ); 3299 } 3300 if ( selMatch[ sel ] ) { 3301 matches.push( handleObj ); 3302 } 3303 } 3304 if ( matches.length ) { 3305 handlerQueue.push({ elem: cur, matches: matches }); 3306 } 3231 3307 } 3232 3308 } … … 3265 3341 } 3266 3342 } 3343 } 3344 3345 // Call the postDispatch hook for the mapped type 3346 if ( special.postDispatch ) { 3347 special.postDispatch.call( this, event ); 3267 3348 } 3268 3349 … … 3558 3639 if ( form && !form._submit_attached ) { 3559 3640 jQuery.event.add( form, "submit._submit", function( event ) { 3560 // If form was submitted by the user, bubble the event up the tree 3561 if ( this.parentNode && !event.isTrigger ) { 3562 jQuery.event.simulate( "submit", this.parentNode, event, true ); 3563 } 3641 event._submit_bubble = true; 3564 3642 }); 3565 3643 form._submit_attached = true; … … 3567 3645 }); 3568 3646 // return undefined since we don't need an event listener 3647 }, 3648 3649 postDispatch: function( event ) { 3650 // If form was submitted by the user, bubble the event up the tree 3651 if ( event._submit_bubble ) { 3652 delete event._submit_bubble; 3653 if ( this.parentNode && !event.isTrigger ) { 3654 jQuery.event.simulate( "submit", this.parentNode, event, true ); 3655 } 3656 } 3569 3657 }, 3570 3658 … … 3672 3760 if ( typeof types === "object" ) { 3673 3761 // ( types-Object, selector, data ) 3674 if ( typeof selector !== "string" ) { 3762 if ( typeof selector !== "string" ) { // && selector != null 3675 3763 // ( types-Object, data ) 3676 data = selector;3764 data = data || selector; 3677 3765 selector = undefined; 3678 3766 } … … 3720 3808 }, 3721 3809 one: function( types, selector, data, fn ) { 3722 return this.on .call( this,types, selector, data, fn, 1 );3810 return this.on( types, selector, data, fn, 1 ); 3723 3811 }, 3724 3812 off: function( types, selector, fn ) { … … 3727 3815 var handleObj = types.handleObj; 3728 3816 jQuery( types.delegateTarget ).off( 3729 handleObj.namespace ? handleObj.type + "." + handleObj.namespace : handleObj.type,3817 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, 3730 3818 handleObj.selector, 3731 3819 handleObj.handler … … 3886 3974 return []; 3887 3975 } 3888 3976 3889 3977 if ( !selector || typeof selector !== "string" ) { 3890 3978 return results; … … 3896 3984 parts = [], 3897 3985 soFar = selector; 3898 3986 3899 3987 // Reset the position of the chunker regexp (start from head) 3900 3988 do { … … 3904 3992 if ( m ) { 3905 3993 soFar = m[3]; 3906 3994 3907 3995 parts.push( m[1] ); 3908 3996 3909 3997 if ( m[2] ) { 3910 3998 extra = m[3]; … … 3930 4018 selector += parts.shift(); 3931 4019 } 3932 4020 3933 4021 set = posProcess( selector, set, seed ); 3934 4022 } … … 4058 4146 for ( i = 0, len = Expr.order.length; i < len; i++ ) { 4059 4147 type = Expr.order[i]; 4060 4148 4061 4149 if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { 4062 4150 left = match[1]; … … 4190 4278 4191 4279 if ( nodeType ) { 4192 if ( nodeType === 1 || nodeType === 9 ) {4280 if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 4193 4281 // Use textContent || innerText for elements 4194 4282 if ( typeof elem.textContent === 'string' ) { … … 4430 4518 ATTR: function( match, curLoop, inplace, result, not, isXML ) { 4431 4519 var name = match[1] = match[1].replace( rBackslash, "" ); 4432 4520 4433 4521 if ( !isXML && Expr.attrMap[name] ) { 4434 4522 match[1] = Expr.attrMap[name]; … … 4464 4552 return true; 4465 4553 } 4466 4554 4467 4555 return match; 4468 4556 }, … … 4474 4562 } 4475 4563 }, 4476 4564 4477 4565 filters: { 4478 4566 enabled: function( elem ) { … … 4487 4575 return elem.checked === true; 4488 4576 }, 4489 4577 4490 4578 selected: function( elem ) { 4491 4579 // Accessing this property makes selected-by-default … … 4494 4582 elem.parentNode.selectedIndex; 4495 4583 } 4496 4584 4497 4585 return elem.selected === true; 4498 4586 }, … … 4516 4604 text: function( elem ) { 4517 4605 var attr = elem.getAttribute( "type" ), type = elem.type; 4518 // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) 4606 // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) 4519 4607 // use getAttribute instead to test this case 4520 4608 return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); … … 4634 4722 case "only": 4635 4723 case "first": 4636 while ( (node = node.previousSibling) ) 4637 if ( node.nodeType === 1 ) { 4638 return false; 4724 while ( (node = node.previousSibling) ) { 4725 if ( node.nodeType === 1 ) { 4726 return false; 4639 4727 } 4640 4728 } 4641 4729 4642 if ( type === "first" ) { 4643 return true; 4730 if ( type === "first" ) { 4731 return true; 4644 4732 } 4645 4733 4646 4734 node = elem; 4647 4735 4736 /* falls through */ 4648 4737 case "last": 4649 while ( (node = node.nextSibling) ) 4650 if ( node.nodeType === 1 ) { 4651 return false; 4738 while ( (node = node.nextSibling) ) { 4739 if ( node.nodeType === 1 ) { 4740 return false; 4652 4741 } 4653 4742 } … … 4662 4751 return true; 4663 4752 } 4664 4753 4665 4754 doneName = match[0]; 4666 4755 parent = elem.parentNode; 4667 4756 4668 4757 if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { 4669 4758 count = 0; 4670 4759 4671 4760 for ( node = parent.firstChild; node; node = node.nextSibling ) { 4672 4761 if ( node.nodeType === 1 ) { 4673 4762 node.nodeIndex = ++count; 4674 4763 } 4675 } 4764 } 4676 4765 4677 4766 parent[ expando ] = doneName; 4678 4767 } 4679 4768 4680 4769 diff = elem.nodeIndex - last; 4681 4770 … … 4696 4785 return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; 4697 4786 }, 4698 4787 4699 4788 CLASS: function( elem, match ) { 4700 4789 return (" " + (elem.className || elem.getAttribute("class")) + " ") … … 4758 4847 Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); 4759 4848 } 4849 // Expose origPOS 4850 // "global" as in regardless of relation to brackets/parens 4851 Expr.match.globalPOS = origPOS; 4760 4852 4761 4853 var makeArray = function( array, results ) { … … 4766 4858 return results; 4767 4859 } 4768 4860 4769 4861 return array; 4770 4862 }; … … 4998 5090 return; 4999 5091 } 5000 5092 5001 5093 Sizzle = function( query, context, extra, seed ) { 5002 5094 context = context || document; … … 5007 5099 // See if we find a selector to speed up 5008 5100 var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); 5009 5101 5010 5102 if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { 5011 5103 // Speed-up: Sizzle("TAG") 5012 5104 if ( match[1] ) { 5013 5105 return makeArray( context.getElementsByTagName( query ), extra ); 5014 5106 5015 5107 // Speed-up: Sizzle(".CLASS") 5016 5108 } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { … … 5018 5110 } 5019 5111 } 5020 5112 5021 5113 if ( context.nodeType === 9 ) { 5022 5114 // Speed-up: Sizzle("body") … … 5024 5116 if ( query === "body" && context.body ) { 5025 5117 return makeArray( [ context.body ], extra ); 5026 5118 5027 5119 // Speed-up: Sizzle("#ID") 5028 5120 } else if ( match && match[3] ) { … … 5037 5129 return makeArray( [ elem ], extra ); 5038 5130 } 5039 5131 5040 5132 } else { 5041 5133 return makeArray( [], extra ); 5042 5134 } 5043 5135 } 5044 5136 5045 5137 try { 5046 5138 return makeArray( context.querySelectorAll(query), extra ); … … 5080 5172 } 5081 5173 } 5082 5174 5083 5175 return oldSizzle(query, context, extra, seed); 5084 5176 }; … … 5107 5199 // Gecko does not error, returns false instead 5108 5200 matches.call( document.documentElement, "[test!='']:sizzle" ); 5109 5201 5110 5202 } catch( pseudoError ) { 5111 5203 pseudoWorks = true; … … 5117 5209 5118 5210 if ( !Sizzle.isXML( node ) ) { 5119 try { 5211 try { 5120 5212 if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { 5121 5213 var ret = matches.call( node, expr ); … … 5154 5246 return; 5155 5247 } 5156 5248 5157 5249 Expr.order.splice(1, 0, "CLASS"); 5158 5250 Expr.find.CLASS = function( match, context, isXML ) { … … 5205 5297 if ( elem ) { 5206 5298 var match = false; 5207 5299 5208 5300 elem = elem[dir]; 5209 5301 … … 5258 5350 Sizzle.isXML = function( elem ) { 5259 5351 // documentElement is verified for cases where it doesn't yet exist 5260 // (such as loading iframes in IE - #4833) 5352 // (such as loading iframes in IE - #4833) 5261 5353 var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; 5262 5354 … … 5308 5400 isSimple = /^.[^:#\[\.,]*$/, 5309 5401 slice = Array.prototype.slice, 5310 POS = jQuery.expr.match. POS,5402 POS = jQuery.expr.match.globalPOS, 5311 5403 // methods guaranteed to produce a unique set when starting from a unique set 5312 5404 guaranteedUnique = { … … 5375 5467 5376 5468 is: function( selector ) { 5377 return !!selector && ( 5469 return !!selector && ( 5378 5470 typeof selector === "string" ? 5379 5471 // If this is a positional selector, check membership in the returned set 5380 5472 // so $("p:first").is("p:last") won't return true for a doc with two "p". 5381 POS.test( selector ) ? 5473 POS.test( selector ) ? 5382 5474 jQuery( selector, this.context ).index( this[0] ) >= 0 : 5383 5475 jQuery.filter( selector, this ).length > 0 : … … 5387 5479 closest: function( selectors, context ) { 5388 5480 var ret = [], i, l, cur = this[0]; 5389 5481 5390 5482 // Array (deprecated as of jQuery 1.7) 5391 5483 if ( jQuery.isArray( selectors ) ) { … … 5506 5598 }, 5507 5599 siblings: function( elem ) { 5508 return jQuery.sibling( elem.parentNode.firstChild, elem );5600 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); 5509 5601 }, 5510 5602 children: function( elem ) { … … 5640 5732 } 5641 5733 5642 var nodeNames = "abbr|article|aside|audio| canvas|datalist|details|figcaption|figure|footer|" +5734 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + 5643 5735 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", 5644 5736 rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, … … 5650 5742 rnoInnerhtml = /<(?:script|style)/i, 5651 5743 rnocache = /<(?:script|object|embed|option|style)/i, 5652 rnoshimcache = new RegExp("<(?:" + nodeNames + ") ", "i"),5744 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), 5653 5745 // checked="checked" or checked 5654 5746 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, … … 5677 5769 5678 5770 jQuery.fn.extend({ 5679 text: function( text ) { 5680 if ( jQuery.isFunction(text) ) { 5681 return this.each(function(i) { 5682 var self = jQuery( this ); 5683 5684 self.text( text.call(this, i, self.text()) ); 5685 }); 5686 } 5687 5688 if ( typeof text !== "object" && text !== undefined ) { 5689 return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); 5690 } 5691 5692 return jQuery.text( this ); 5771 text: function( value ) { 5772 return jQuery.access( this, function( value ) { 5773 return value === undefined ? 5774 jQuery.text( this ) : 5775 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); 5776 }, null, value, arguments.length ); 5693 5777 }, 5694 5778 … … 5842 5926 5843 5927 html: function( value ) { 5844 if ( value === undefined ) { 5845 return this[0] && this[0].nodeType === 1 ? 5846 this[0].innerHTML.replace(rinlinejQuery, "") : 5847 null; 5848 5849 // See if we can take a shortcut and just use innerHTML 5850 } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 5851 (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && 5852 !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { 5853 5854 value = value.replace(rxhtmlTag, "<$1></$2>"); 5855 5856 try { 5857 for ( var i = 0, l = this.length; i < l; i++ ) { 5858 // Remove element nodes and prevent memory leaks 5859 if ( this[i].nodeType === 1 ) { 5860 jQuery.cleanData( this[i].getElementsByTagName("*") ); 5861 this[i].innerHTML = value; 5862 } 5863 } 5864 5865 // If using innerHTML throws an exception, use the fallback method 5866 } catch(e) { 5928 return jQuery.access( this, function( value ) { 5929 var elem = this[0] || {}, 5930 i = 0, 5931 l = this.length; 5932 5933 if ( value === undefined ) { 5934 return elem.nodeType === 1 ? 5935 elem.innerHTML.replace( rinlinejQuery, "" ) : 5936 null; 5937 } 5938 5939 5940 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 5941 ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && 5942 !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { 5943 5944 value = value.replace( rxhtmlTag, "<$1></$2>" ); 5945 5946 try { 5947 for (; i < l; i++ ) { 5948 // Remove element nodes and prevent memory leaks 5949 elem = this[i] || {}; 5950 if ( elem.nodeType === 1 ) { 5951 jQuery.cleanData( elem.getElementsByTagName( "*" ) ); 5952 elem.innerHTML = value; 5953 } 5954 } 5955 5956 elem = 0; 5957 5958 // If using innerHTML throws an exception, use the fallback method 5959 } catch(e) {} 5960 } 5961 5962 if ( elem ) { 5867 5963 this.empty().append( value ); 5868 5964 } 5869 5870 } else if ( jQuery.isFunction( value ) ) { 5871 this.each(function(i){ 5872 var self = jQuery( this ); 5873 5874 self.html( value.call(this, i, self.html()) ); 5875 }); 5876 5877 } else { 5878 this.empty().append( value ); 5879 } 5880 5881 return this; 5965 }, null, value, arguments.length ); 5882 5966 }, 5883 5967 … … 5982 6066 5983 6067 if ( scripts.length ) { 5984 jQuery.each( scripts, evalScript ); 6068 jQuery.each( scripts, function( i, elem ) { 6069 if ( elem.src ) { 6070 jQuery.ajax({ 6071 type: "GET", 6072 global: false, 6073 url: elem.src, 6074 async: false, 6075 dataType: "script" 6076 }); 6077 } else { 6078 jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); 6079 } 6080 6081 if ( elem.parentNode ) { 6082 elem.parentNode.removeChild( elem ); 6083 } 6084 }); 5985 6085 } 5986 6086 } … … 6014 6114 for ( type in events ) { 6015 6115 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 6016 jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data);6116 jQuery.event.add( dest, type, events[ type ][ i ] ); 6017 6117 } 6018 6118 } … … 6076 6176 } else if ( nodeName === "input" || nodeName === "textarea" ) { 6077 6177 dest.defaultValue = src.defaultValue; 6178 6179 // IE blanks contents when cloning scripts 6180 } else if ( nodeName === "script" && dest.text !== src.text ) { 6181 dest.text = src.text; 6078 6182 } 6079 6183 … … 6081 6185 // gets copied too 6082 6186 dest.removeAttribute( jQuery.expando ); 6187 6188 // Clear flags for bubbling special change/submit events, they must 6189 // be reattached when the newly cloned events are first activated 6190 dest.removeAttribute( "_submit_attached" ); 6191 dest.removeAttribute( "_change_attached" ); 6083 6192 } 6084 6193 … … 6205 6314 i, 6206 6315 // IE<=8 does not properly clone detached, unknown element nodes 6207 clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName) ?6316 clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ? 6208 6317 elem.cloneNode( true ) : 6209 6318 shimCloneNode( elem ); … … 6255 6364 6256 6365 clean: function( elems, context, fragment, scripts ) { 6257 var checkScriptType; 6366 var checkScriptType, script, j, 6367 ret = []; 6258 6368 6259 6369 context = context || document; … … 6263 6373 context = context.ownerDocument || context[0] && context[0].ownerDocument || document; 6264 6374 } 6265 6266 var ret = [], j;6267 6375 6268 6376 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { … … 6287 6395 wrap = wrapMap[ tag ] || wrapMap._default, 6288 6396 depth = wrap[0], 6289 div = context.createElement("div"); 6397 div = context.createElement("div"), 6398 safeChildNodes = safeFragment.childNodes, 6399 remove; 6290 6400 6291 6401 // Append wrapper element to unknown element safe doc fragment … … 6332 6442 6333 6443 elem = div.childNodes; 6444 6445 // Clear elements from DocumentFragment (safeFragment or otherwise) 6446 // to avoid hoarding elements. Fixes #11356 6447 if ( div ) { 6448 div.parentNode.removeChild( div ); 6449 6450 // Guard against -1 index exceptions in FF3.6 6451 if ( safeChildNodes.length > 0 ) { 6452 remove = safeChildNodes[ safeChildNodes.length - 1 ]; 6453 6454 if ( remove && remove.parentNode ) { 6455 remove.parentNode.removeChild( remove ); 6456 } 6457 } 6458 } 6334 6459 } 6335 6460 } … … 6360 6485 }; 6361 6486 for ( i = 0; ret[i]; i++ ) { 6362 if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { 6363 scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); 6487 script = ret[i]; 6488 if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) { 6489 scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script ); 6364 6490 6365 6491 } else { 6366 if ( ret[i].nodeType === 1 ) {6367 var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );6492 if ( script.nodeType === 1 ) { 6493 var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType ); 6368 6494 6369 6495 ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); 6370 6496 } 6371 fragment.appendChild( ret[i]);6497 fragment.appendChild( script ); 6372 6498 } 6373 6499 } … … 6423 6549 }); 6424 6550 6425 function evalScript( i, elem ) {6426 if ( elem.src ) {6427 jQuery.ajax({6428 url: elem.src,6429 async: false,6430 dataType: "script"6431 });6432 } else {6433 jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );6434 }6435 6436 if ( elem.parentNode ) {6437 elem.parentNode.removeChild( elem );6438 }6439 }6440 6441 6551 6442 6552 … … 6446 6556 // fixed for IE9, see #8346 6447 6557 rupper = /([A-Z]|^ms)/g, 6448 rnum px = /^-?\d+(?:px)?$/i,6449 rnum = /^-?\d/,6558 rnum = /^[\-+]?(?:\d*\.)?\d+$/i, 6559 rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i, 6450 6560 rrelNum = /^([\-+])=([\-+.\de]+)/, 6561 rmargin = /^margin/, 6451 6562 6452 6563 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 6453 cssWidth = [ "Left", "Right" ], 6454 cssHeight = [ "Top", "Bottom" ], 6564 6565 // order is important! 6566 cssExpand = [ "Top", "Right", "Bottom", "Left" ], 6567 6455 6568 curCSS, 6456 6569 … … 6459 6572 6460 6573 jQuery.fn.css = function( name, value ) { 6461 // Setting 'undefined' is a no-op 6462 if ( arguments.length === 2 && value === undefined ) { 6463 return this; 6464 } 6465 6466 return jQuery.access( this, name, value, true, function( elem, name, value ) { 6574 return jQuery.access( this, function( elem, name, value ) { 6467 6575 return value !== undefined ? 6468 6576 jQuery.style( elem, name, value ) : 6469 6577 jQuery.css( elem, name ); 6470 } );6578 }, name, value, arguments.length > 1 ); 6471 6579 }; 6472 6580 … … 6479 6587 if ( computed ) { 6480 6588 // We should always get a number back from opacity 6481 var ret = curCSS( elem, "opacity" , "opacity");6589 var ret = curCSS( elem, "opacity" ); 6482 6590 return ret === "" ? "1" : ret; 6483 6591 … … 6587 6695 // A method for quickly swapping in/out CSS properties to get correct calculations 6588 6696 swap: function( elem, options, callback ) { 6589 var old = {}; 6697 var old = {}, 6698 ret, name; 6590 6699 6591 6700 // Remember the old values, and insert the new ones 6592 for ( varname in options ) {6701 for ( name in options ) { 6593 6702 old[ name ] = elem.style[ name ]; 6594 6703 elem.style[ name ] = options[ name ]; 6595 6704 } 6596 6705 6597 callback.call( elem );6706 ret = callback.call( elem ); 6598 6707 6599 6708 // Revert the old values … … 6601 6710 elem.style[ name ] = old[ name ]; 6602 6711 } 6712 6713 return ret; 6603 6714 } 6604 6715 }); 6605 6716 6606 // DEPRECATED , Use jQuery.css() instead6717 // DEPRECATED in 1.3, Use jQuery.css() instead 6607 6718 jQuery.curCSS = jQuery.css; 6608 6719 6609 jQuery.each(["height", "width"], function( i, name ) { 6720 if ( document.defaultView && document.defaultView.getComputedStyle ) { 6721 getComputedStyle = function( elem, name ) { 6722 var ret, defaultView, computedStyle, width, 6723 style = elem.style; 6724 6725 name = name.replace( rupper, "-$1" ).toLowerCase(); 6726 6727 if ( (defaultView = elem.ownerDocument.defaultView) && 6728 (computedStyle = defaultView.getComputedStyle( elem, null )) ) { 6729 6730 ret = computedStyle.getPropertyValue( name ); 6731 if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { 6732 ret = jQuery.style( elem, name ); 6733 } 6734 } 6735 6736 // A tribute to the "awesome hack by Dean Edwards" 6737 // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins 6738 // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values 6739 if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) { 6740 width = style.width; 6741 style.width = ret; 6742 ret = computedStyle.width; 6743 style.width = width; 6744 } 6745 6746 return ret; 6747 }; 6748 } 6749 6750 if ( document.documentElement.currentStyle ) { 6751 currentStyle = function( elem, name ) { 6752 var left, rsLeft, uncomputed, 6753 ret = elem.currentStyle && elem.currentStyle[ name ], 6754 style = elem.style; 6755 6756 // Avoid setting ret to empty string here 6757 // so we don't default to auto 6758 if ( ret == null && style && (uncomputed = style[ name ]) ) { 6759 ret = uncomputed; 6760 } 6761 6762 // From the awesome hack by Dean Edwards 6763 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 6764 6765 // If we're not dealing with a regular pixel number 6766 // but a number that has a weird ending, we need to convert it to pixels 6767 if ( rnumnonpx.test( ret ) ) { 6768 6769 // Remember the original values 6770 left = style.left; 6771 rsLeft = elem.runtimeStyle && elem.runtimeStyle.left; 6772 6773 // Put in the new values to get a computed value out 6774 if ( rsLeft ) { 6775 elem.runtimeStyle.left = elem.currentStyle.left; 6776 } 6777 style.left = name === "fontSize" ? "1em" : ret; 6778 ret = style.pixelLeft + "px"; 6779 6780 // Revert the changed values 6781 style.left = left; 6782 if ( rsLeft ) { 6783 elem.runtimeStyle.left = rsLeft; 6784 } 6785 } 6786 6787 return ret === "" ? "auto" : ret; 6788 }; 6789 } 6790 6791 curCSS = getComputedStyle || currentStyle; 6792 6793 function getWidthOrHeight( elem, name, extra ) { 6794 6795 // Start with offset property 6796 var val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 6797 i = name === "width" ? 1 : 0, 6798 len = 4; 6799 6800 if ( val > 0 ) { 6801 if ( extra !== "border" ) { 6802 for ( ; i < len; i += 2 ) { 6803 if ( !extra ) { 6804 val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; 6805 } 6806 if ( extra === "margin" ) { 6807 val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0; 6808 } else { 6809 val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; 6810 } 6811 } 6812 } 6813 6814 return val + "px"; 6815 } 6816 6817 // Fall back to computed then uncomputed css if necessary 6818 val = curCSS( elem, name ); 6819 if ( val < 0 || val == null ) { 6820 val = elem.style[ name ]; 6821 } 6822 6823 // Computed unit is not pixels. Stop here and return. 6824 if ( rnumnonpx.test(val) ) { 6825 return val; 6826 } 6827 6828 // Normalize "", auto, and prepare for extra 6829 val = parseFloat( val ) || 0; 6830 6831 // Add padding, border, margin 6832 if ( extra ) { 6833 for ( ; i < len; i += 2 ) { 6834 val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0; 6835 if ( extra !== "padding" ) { 6836 val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0; 6837 } 6838 if ( extra === "margin" ) { 6839 val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0; 6840 } 6841 } 6842 } 6843 6844 return val + "px"; 6845 } 6846 6847 jQuery.each([ "height", "width" ], function( i, name ) { 6610 6848 jQuery.cssHooks[ name ] = { 6611 6849 get: function( elem, computed, extra ) { 6612 var val;6613 6614 6850 if ( computed ) { 6615 6851 if ( elem.offsetWidth !== 0 ) { 6616 return getW H( elem, name, extra );6852 return getWidthOrHeight( elem, name, extra ); 6617 6853 } else { 6618 jQuery.swap( elem, cssShow, function() {6619 val = getWH( elem, name, extra );6854 return jQuery.swap( elem, cssShow, function() { 6855 return getWidthOrHeight( elem, name, extra ); 6620 6856 }); 6621 6857 } 6622 6623 return val;6624 6858 } 6625 6859 }, 6626 6860 6627 6861 set: function( elem, value ) { 6628 if ( rnumpx.test( value ) ) { 6629 // ignore negative width and height values #1599 6630 value = parseFloat( value ); 6631 6632 if ( value >= 0 ) { 6633 return value + "px"; 6634 } 6635 6636 } else { 6637 return value; 6638 } 6862 return rnum.test( value ) ? 6863 value + "px" : 6864 value; 6639 6865 } 6640 6866 }; … … 6690 6916 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 6691 6917 // Work around by temporarily setting element display to inline-block 6692 var ret; 6693 jQuery.swap( elem, { "display": "inline-block" }, function() { 6918 return jQuery.swap( elem, { "display": "inline-block" }, function() { 6694 6919 if ( computed ) { 6695 ret = curCSS( elem, "margin-right", "marginRight" );6920 return curCSS( elem, "margin-right" ); 6696 6921 } else { 6697 ret =elem.style.marginRight;6922 return elem.style.marginRight; 6698 6923 } 6699 6924 }); 6700 return ret;6701 6925 } 6702 6926 }; 6703 6927 } 6704 6928 }); 6705 6706 if ( document.defaultView && document.defaultView.getComputedStyle ) {6707 getComputedStyle = function( elem, name ) {6708 var ret, defaultView, computedStyle;6709 6710 name = name.replace( rupper, "-$1" ).toLowerCase();6711 6712 if ( (defaultView = elem.ownerDocument.defaultView) &&6713 (computedStyle = defaultView.getComputedStyle( elem, null )) ) {6714 ret = computedStyle.getPropertyValue( name );6715 if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {6716 ret = jQuery.style( elem, name );6717 }6718 }6719 6720 return ret;6721 };6722 }6723 6724 if ( document.documentElement.currentStyle ) {6725 currentStyle = function( elem, name ) {6726 var left, rsLeft, uncomputed,6727 ret = elem.currentStyle && elem.currentStyle[ name ],6728 style = elem.style;6729 6730 // Avoid setting ret to empty string here6731 // so we don't default to auto6732 if ( ret === null && style && (uncomputed = style[ name ]) ) {6733 ret = uncomputed;6734 }6735 6736 // From the awesome hack by Dean Edwards6737 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-1022916738 6739 // If we're not dealing with a regular pixel number6740 // but a number that has a weird ending, we need to convert it to pixels6741 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {6742 6743 // Remember the original values6744 left = style.left;6745 rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;6746 6747 // Put in the new values to get a computed value out6748 if ( rsLeft ) {6749 elem.runtimeStyle.left = elem.currentStyle.left;6750 }6751 style.left = name === "fontSize" ? "1em" : ( ret || 0 );6752 ret = style.pixelLeft + "px";6753 6754 // Revert the changed values6755 style.left = left;6756 if ( rsLeft ) {6757 elem.runtimeStyle.left = rsLeft;6758 }6759 }6760 6761 return ret === "" ? "auto" : ret;6762 };6763 }6764 6765 curCSS = getComputedStyle || currentStyle;6766 6767 function getWH( elem, name, extra ) {6768 6769 // Start with offset property6770 var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,6771 which = name === "width" ? cssWidth : cssHeight,6772 i = 0,6773 len = which.length;6774 6775 if ( val > 0 ) {6776 if ( extra !== "border" ) {6777 for ( ; i < len; i++ ) {6778 if ( !extra ) {6779 val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;6780 }6781 if ( extra === "margin" ) {6782 val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;6783 } else {6784 val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;6785 }6786 }6787 }6788 6789 return val + "px";6790 }6791 6792 // Fall back to computed then uncomputed css if necessary6793 val = curCSS( elem, name, name );6794 if ( val < 0 || val == null ) {6795 val = elem.style[ name ] || 0;6796 }6797 // Normalize "", auto, and prepare for extra6798 val = parseFloat( val ) || 0;6799 6800 // Add padding, border, margin6801 if ( extra ) {6802 for ( ; i < len; i++ ) {6803 val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;6804 if ( extra !== "padding" ) {6805 val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;6806 }6807 if ( extra === "margin" ) {6808 val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;6809 }6810 }6811 }6812 6813 return val + "px";6814 }6815 6929 6816 6930 if ( jQuery.expr && jQuery.expr.filters ) { … … 6826 6940 }; 6827 6941 } 6942 6943 // These hooks are used by animate to expand properties 6944 jQuery.each({ 6945 margin: "", 6946 padding: "", 6947 border: "Width" 6948 }, function( prefix, suffix ) { 6949 6950 jQuery.cssHooks[ prefix + suffix ] = { 6951 expand: function( value ) { 6952 var i, 6953 6954 // assumes a single number if not a string 6955 parts = typeof value === "string" ? value.split(" ") : [ value ], 6956 expanded = {}; 6957 6958 for ( i = 0; i < 4; i++ ) { 6959 expanded[ prefix + cssExpand[ i ] + suffix ] = 6960 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 6961 } 6962 6963 return expanded; 6964 } 6965 }; 6966 }); 6828 6967 6829 6968 … … 7145 7284 global: true, 7146 7285 type: "GET", 7147 contentType: "application/x-www-form-urlencoded ",7286 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 7148 7287 processData: true, 7149 7288 async: true, … … 7471 7610 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 7472 7611 7473 // If request was aborted inside a prefil er, stop there7612 // If request was aborted inside a prefilter, stop there 7474 7613 if ( state === 2 ) { 7475 7614 return false; … … 7644 7783 // deserialization algorithm or to provide an option or flag 7645 7784 // to force array serialization to be shallow. 7646 buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v)? i : "" ) + "]", v, traditional, add );7785 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); 7647 7786 } 7648 7787 }); 7649 7788 7650 } else if ( !traditional && obj != null && typeof obj=== "object" ) {7789 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 7651 7790 // Serialize object item. 7652 7791 for ( var name in obj ) { … … 7844 7983 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 7845 7984 7846 var inspectData = s.contentType === "application/x-www-form-urlencoded" && 7847 ( typeof s.data === "string" ); 7985 var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType ); 7848 7986 7849 7987 if ( s.dataTypes[ 0 ] === "jsonp" || … … 8146 8284 responses.xml = xml; 8147 8285 } 8148 responses.text = xhr.responseText; 8286 8287 // When requesting binary data, IE6-9 will throw an exception 8288 // on any attempt to access responseText (#11426) 8289 try { 8290 responses.text = xhr.responseText; 8291 } catch( _ ) { 8292 } 8149 8293 8150 8294 // Firefox throws an exception when accessing … … 8254 8398 // in a stylesheet to whatever the default browser style is 8255 8399 // for such an element 8256 if ( display === "" && jQuery.css(elem, "display") === "none" ) { 8400 if ( (display === "" && jQuery.css(elem, "display") === "none") || 8401 !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { 8257 8402 jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); 8258 8403 } … … 8358 8503 isElement = this.nodeType === 1, 8359 8504 hidden = isElement && jQuery(this).is(":hidden"), 8360 name, val, p, e, 8505 name, val, p, e, hooks, replace, 8361 8506 parts, start, end, unit, 8362 8507 method; … … 8365 8510 opt.animatedProperties = {}; 8366 8511 8512 // first pass over propertys to expand / normalize 8367 8513 for ( p in prop ) { 8368 8369 // property name normalization8370 8514 name = jQuery.camelCase( p ); 8371 8515 if ( p !== name ) { … … 8374 8518 } 8375 8519 8520 if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) { 8521 replace = hooks.expand( prop[ name ] ); 8522 delete prop[ name ]; 8523 8524 // not quite $.extend, this wont overwrite keys already present. 8525 // also - reusing 'p' from above because we have the correct "name" 8526 for ( p in replace ) { 8527 if ( ! ( p in prop ) ) { 8528 prop[ p ] = replace[ p ]; 8529 } 8530 } 8531 } 8532 } 8533 8534 for ( name in prop ) { 8376 8535 val = prop[ name ]; 8377 8378 8536 // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) 8379 8537 if ( jQuery.isArray( val ) ) { … … 8602 8760 8603 8761 easing: { 8604 linear: function( p , n, firstNum, diff) {8605 return firstNum + diff *p;8762 linear: function( p ) { 8763 return p; 8606 8764 }, 8607 swing: function( p , n, firstNum, diff) {8608 return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;8765 swing: function( p ) { 8766 return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5; 8609 8767 } 8610 8768 }, … … 8664 8822 t.elem = this.elem; 8665 8823 t.saveState = function() { 8666 if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { 8667 jQuery._data( self.elem, "fxshow" + self.prop, self.start ); 8824 if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) { 8825 if ( self.options.hide ) { 8826 jQuery._data( self.elem, "fxshow" + self.prop, self.start ); 8827 } else if ( self.options.show ) { 8828 jQuery._data( self.elem, "fxshow" + self.prop, self.end ); 8829 } 8668 8830 } 8669 8831 }; … … 8832 8994 }); 8833 8995 8834 // Adds width/height step functions 8835 // Do not set anything below 0 8836 jQuery.each([ "width", "height" ], function( i, prop ) { 8837 jQuery.fx.step[ prop ] = function( fx ) { 8838 jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); 8839 }; 8996 // Ensure props that can't be negative don't go there on undershoot easing 8997 jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) { 8998 // exclude marginTop, marginLeft, marginBottom and marginRight from this list 8999 if ( prop.indexOf( "margin" ) ) { 9000 jQuery.fx.step[ prop ] = function( fx ) { 9001 jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); 9002 }; 9003 } 8840 9004 }); 8841 9005 … … 8874 9038 if ( !iframeDoc || !iframe.createElement ) { 8875 9039 iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document; 8876 iframeDoc.write( ( document.compatMode === "CSS1Compat"? "<!doctype html>" : "" ) + "<html><body>" );9040 iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" ); 8877 9041 iframeDoc.close(); 8878 9042 } … … 8896 9060 8897 9061 8898 var rtable = /^t(?:able|d|h)$/i, 9062 var getOffset, 9063 rtable = /^t(?:able|d|h)$/i, 8899 9064 rroot = /^(?:body|html)$/i; 8900 9065 8901 9066 if ( "getBoundingClientRect" in document.documentElement ) { 8902 jQuery.fn.offset = function( options ) { 8903 var elem = this[0], box; 8904 8905 if ( options ) { 8906 return this.each(function( i ) { 8907 jQuery.offset.setOffset( this, options, i ); 8908 }); 8909 } 8910 8911 if ( !elem || !elem.ownerDocument ) { 8912 return null; 8913 } 8914 8915 if ( elem === elem.ownerDocument.body ) { 8916 return jQuery.offset.bodyOffset( elem ); 8917 } 8918 9067 getOffset = function( elem, doc, docElem, box ) { 8919 9068 try { 8920 9069 box = elem.getBoundingClientRect(); 8921 9070 } catch(e) {} 8922 9071 8923 var doc = elem.ownerDocument,8924 docElem = doc.documentElement;8925 8926 9072 // Make sure we're not dealing with a disconnected DOM node 8927 9073 if ( !box || !jQuery.contains( docElem, elem ) ) { … … 8930 9076 8931 9077 var body = doc.body, 8932 win = getWindow( doc),9078 win = getWindow( doc ), 8933 9079 clientTop = docElem.clientTop || body.clientTop || 0, 8934 9080 clientLeft = docElem.clientLeft || body.clientLeft || 0, … … 8942 9088 8943 9089 } else { 8944 jQuery.fn.offset = function( options ) { 8945 var elem = this[0]; 8946 8947 if ( options ) { 8948 return this.each(function( i ) { 8949 jQuery.offset.setOffset( this, options, i ); 8950 }); 8951 } 8952 8953 if ( !elem || !elem.ownerDocument ) { 8954 return null; 8955 } 8956 8957 if ( elem === elem.ownerDocument.body ) { 8958 return jQuery.offset.bodyOffset( elem ); 8959 } 8960 9090 getOffset = function( elem, doc, docElem ) { 8961 9091 var computedStyle, 8962 9092 offsetParent = elem.offsetParent, 8963 9093 prevOffsetParent = elem, 8964 doc = elem.ownerDocument,8965 docElem = doc.documentElement,8966 9094 body = doc.body, 8967 9095 defaultView = doc.defaultView, … … 9013 9141 }; 9014 9142 } 9143 9144 jQuery.fn.offset = function( options ) { 9145 if ( arguments.length ) { 9146 return options === undefined ? 9147 this : 9148 this.each(function( i ) { 9149 jQuery.offset.setOffset( this, options, i ); 9150 }); 9151 } 9152 9153 var elem = this[0], 9154 doc = elem && elem.ownerDocument; 9155 9156 if ( !doc ) { 9157 return null; 9158 } 9159 9160 if ( elem === doc.body ) { 9161 return jQuery.offset.bodyOffset( elem ); 9162 } 9163 9164 return getOffset( elem, doc, doc.documentElement ); 9165 }; 9015 9166 9016 9167 jQuery.offset = { … … 9119 9270 9120 9271 // Create scrollLeft and scrollTop methods 9121 jQuery.each( ["Left", "Top"], function( i, name) {9122 var method = "scroll" + name;9272 jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { 9273 var top = /Y/.test( prop ); 9123 9274 9124 9275 jQuery.fn[ method ] = function( val ) { 9125 var elem, win; 9126 9127 if ( val === undefined ) { 9128 elem = this[ 0 ]; 9129 9130 if ( !elem ) { 9131 return null; 9132 } 9133 9134 win = getWindow( elem ); 9135 9136 // Return the scroll offset 9137 return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : 9138 jQuery.support.boxModel && win.document.documentElement[ method ] || 9139 win.document.body[ method ] : 9140 elem[ method ]; 9141 } 9142 9143 // Set the scroll offset 9144 return this.each(function() { 9145 win = getWindow( this ); 9276 return jQuery.access( this, function( elem, method, val ) { 9277 var win = getWindow( elem ); 9278 9279 if ( val === undefined ) { 9280 return win ? (prop in win) ? win[ prop ] : 9281 jQuery.support.boxModel && win.document.documentElement[ method ] || 9282 win.document.body[ method ] : 9283 elem[ method ]; 9284 } 9146 9285 9147 9286 if ( win ) { 9148 9287 win.scrollTo( 9149 ! i? val : jQuery( win ).scrollLeft(),9150 i? val : jQuery( win ).scrollTop()9288 !top ? val : jQuery( win ).scrollLeft(), 9289 top ? val : jQuery( win ).scrollTop() 9151 9290 ); 9152 9291 9153 9292 } else { 9154 this[ method ] = val;9155 } 9156 } );9293 elem[ method ] = val; 9294 } 9295 }, method, val, arguments.length, null ); 9157 9296 }; 9158 9297 }); … … 9170 9309 9171 9310 // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods 9172 jQuery.each([ "Height", "Width" ], function( i, name ) { 9173 9174 var type = name.toLowerCase(); 9311 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 9312 var clientProp = "client" + name, 9313 scrollProp = "scroll" + name, 9314 offsetProp = "offset" + name; 9175 9315 9176 9316 // innerHeight and innerWidth … … 9194 9334 }; 9195 9335 9196 jQuery.fn[ type ] = function( size ) {9197 // Get window width or height9198 var elem = this[0];9199 if ( !elem ) { 9200 return size == null ? null : this;9201 }9202 9203 if ( jQuery.isFunction( size ) ) {9204 return this.each(function( i ) {9205 var self = jQuery( this );9206 self[ type ]( size.call( this, i, self[ type ]() ) );9207 }); 9208 }9209 9210 if ( jQuery.isWindow( elem ) ) {9211 // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode9212 // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat 9213 var docElemProp = elem.document.documentElement[ "client" + name ],9214 body = elem.document.body;9215 return elem.document.compatMode === "CSS1Compat" && docElemProp ||9216 body && body[ "client" + name ] || docElemProp;9217 9218 // Get document width or height9219 } else if ( elem.nodeType === 9 ) {9220 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater 9221 return Math.max(9222 elem.documentElement["client" + name],9223 elem.body["scroll" + name], elem.documentElement["scroll" + name],9224 elem.body["offset" + name], elem.documentElement["offset" + name]9225 );9226 9227 // Get or set width or height on the element9228 } else if ( size === undefined ) {9229 var orig = jQuery.css( elem, type ),9336 jQuery.fn[ type ] = function( value ) { 9337 return jQuery.access( this, function( elem, type, value ) { 9338 var doc, docElemProp, orig, ret; 9339 9340 if ( jQuery.isWindow( elem ) ) { 9341 // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat 9342 doc = elem.document; 9343 docElemProp = doc.documentElement[ clientProp ]; 9344 return jQuery.support.boxModel && docElemProp || 9345 doc.body && doc.body[ clientProp ] || docElemProp; 9346 } 9347 9348 // Get document width or height 9349 if ( elem.nodeType === 9 ) { 9350 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater 9351 doc = elem.documentElement; 9352 9353 // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height] 9354 // so we can't use max, as it'll choose the incorrect offset[Width/Height] 9355 // instead we use the correct client[Width/Height] 9356 // support:IE6 9357 if ( doc[ clientProp ] >= doc[ scrollProp ] ) { 9358 return doc[ clientProp ]; 9359 } 9360 9361 return Math.max( 9362 elem.body[ scrollProp ], doc[ scrollProp ], 9363 elem.body[ offsetProp ], doc[ offsetProp ] 9364 ); 9365 } 9366 9367 // Get width or height on the element 9368 if ( value === undefined ) { 9369 orig = jQuery.css( elem, type ); 9230 9370 ret = parseFloat( orig ); 9231 9232 return jQuery.isNumeric( ret ) ? ret : orig; 9233 9234 // Set the width or height on the element (default to pixels if value is unitless) 9235 } else { 9236 return this.css( type, typeof size === "string" ? size : size + "px" ); 9237 } 9371 return jQuery.isNumeric( ret ) ? ret : orig; 9372 } 9373 9374 // Set the width or height on the element 9375 jQuery( elem ).css( type, value ); 9376 }, type, value, arguments.length, null ); 9238 9377 }; 9239 9240 9378 }); 9241 9379
Note: See TracChangeset
for help on using the changeset viewer.