Ignore:
Timestamp:
Apr 9, 2012, 6:17:33 AM (12 years ago)
Author:
rvelices
Message:

upgrade jqueryto 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/js/jquery.js

    r13052 r14027  
    11/*!
    2  * jQuery JavaScript Library v1.7.1
     2 * jQuery JavaScript Library v1.7.2
    33 * http://jquery.com/
    44 *
     
    1212 * Released under the MIT, BSD, and GPL Licenses.
    1313 *
    14  * Date: Mon Nov 21 21:11:03 2011 -0500
     14 * Date: Wed Mar 21 12:46:34 2012 -0700
    1515 */
    1616(function( window, undefined ) {
     
    211211
    212212        // The current version of jQuery being used
    213         jquery: "1.7.1",
     213        jquery: "1.7.2",
    214214
    215215        // The default length of a jQuery object is 0
     
    498498        },
    499499
    500         // A crude way of determining if an object is a window
    501500        isWindow: function( obj ) {
    502                 return obj && typeof obj === "object" && "setInterval" in obj;
     501                return obj != null && obj == obj.window;
    503502        },
    504503
     
    580579        // Cross-browser xml parsing
    581580        parseXML: function( data ) {
     581                if ( typeof data !== "string" || !data ) {
     582                        return null;
     583                }
    582584                var xml, tmp;
    583585                try {
     
    823825        // Mutifunctional method to get and set values to a collection
    824826        // 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 ) {
    838842                        // 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;
    850876        },
    851877
     
    10061032                // Last fire value (for non-forgettable lists)
    10071033                memory,
     1034                // Flag to know if list was already fired
     1035                fired,
    10081036                // Flag to know if list is currently firing
    10091037                firing,
     
    10391067                        args = args || [];
    10401068                        memory = !flags.memory || [ context, args ];
     1069                        fired = true;
    10411070                        firing = true;
    10421071                        firingIndex = firingStart || 0;
     
    11741203                        // To know if the callbacks have already been called at least once
    11751204                        fired: function() {
    1176                                 return !!memory;
     1205                                return !!fired;
    11771206                        }
    11781207                };
     
    13371366                opt,
    13381367                input,
    1339                 marginDiv,
    13401368                fragment,
    13411369                tds,
     
    14201448                inlineBlockNeedsLayout: false,
    14211449                shrinkWrapBlocks: false,
    1422                 reliableMarginRight: true
     1450                reliableMarginRight: true,
     1451                pixelMargin: true
    14231452        };
     1453
     1454        // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
     1455        jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
    14241456
    14251457        // Make sure checked status is properly cloned
     
    14571489
    14581490        input.setAttribute("checked", "checked");
     1491
     1492        // #11217 - WebKit loses check when the name is after the checked attribute
     1493        input.setAttribute( "name", "t" );
     1494
    14591495        div.appendChild( input );
    14601496        fragment = document.createDocumentFragment();
     
    14701506        fragment.removeChild( input );
    14711507        fragment.appendChild( div );
    1472 
    1473         div.innerHTML = "";
    1474 
    1475         // Check if div with explicit width and no margin-right incorrectly
    1476         // gets computed margin-right based on width of container. For more
    1477         // info see bug #3333
    1478         // Fails in WebKit before Feb 2011 nightlies
    1479         // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
    1480         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         }
    14891508
    14901509        // Technique from Juriy Zaytsev
     
    14951514        // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
    14961515        if ( div.attachEvent ) {
    1497                 for( i in {
     1516                for ( i in {
    14981517                        submit: 1,
    14991518                        change: 1,
     
    15131532
    15141533        // Null elements to avoid leaks in IE
    1515         fragment = select = opt = marginDiv = div = input = null;
     1534        fragment = select = opt = div = input = null;
    15161535
    15171536        // Run tests that need a body at doc ready
    15181537        jQuery(function() {
    15191538                var container, outer, inner, table, td, offsetSupport,
    1520                         conMarginTop, ptlm, vb, style, html,
     1539                        marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
     1540                        paddingMarginBorderVisibility, paddingMarginBorder,
    15211541                        body = document.getElementsByTagName("body")[0];
    15221542
     
    15271547
    15281548                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'>" +
    15341555                        "<tr><td></td></tr></table>";
    15351556
    15361557                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";
    15381559                body.insertBefore( container, body.firstChild );
    15391560
     
    15491570                // hidden; don safety goggles and see bug #4512 for more information).
    15501571                // (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>";
    15521573                tds = div.getElementsByTagName( "td" );
    15531574                isSupported = ( tds[ 0 ].offsetHeight === 0 );
     
    15601581                support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
    15611582
    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                }
    15661598
    15671599                if ( typeof div.style.zoom !== "undefined" ) {
     
    15701602                        // them layout
    15711603                        // (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";
    15721608                        div.style.display = "inline";
    15731609                        div.style.zoom = 1;
    1574                         support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
     1610                        support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
    15751611
    15761612                        // Check if elements with layout shrink-wrap their children
    15771613                        // (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;
    15841621                div.innerHTML = html;
    15851622
     
    16061643                offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
    16071644
     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
    16081654                body.removeChild( container );
    1609                 div = container = null;
     1655                marginDiv = div = container = null;
    16101656
    16111657                jQuery.extend( support, offsetSupport );
     
    18641910jQuery.fn.extend({
    18651911        data: function( key, value ) {
    1866                 var parts, attr, name,
     1912                var parts, part, attr, name, l,
     1913                        elem = this[0],
     1914                        i = 0,
    18671915                        data = null;
    18681916
    1869                 if ( typeof key === "undefined" ) {
     1917                // Gets all values
     1918                if ( key === undefined ) {
    18701919                        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++ ) {
    18761925                                                name = attr[i].name;
    18771926
     
    18791928                                                        name = jQuery.camelCase( name.substring(5) );
    18801929
    1881                                                         dataAttr( this[0], name, data[ name ] );
     1930                                                        dataAttr( elem, name, data[ name ] );
    18821931                                                }
    18831932                                        }
    1884                                         jQuery._data( this[0], "parsedAttrs", true );
     1933                                        jQuery._data( elem, "parsedAttrs", true );
    18851934                                }
    18861935                        }
    18871936
    18881937                        return data;
    1889 
    1890                 } else if ( typeof key === "object" ) {
     1938                }
     1939
     1940                // Sets multiple values
     1941                if ( typeof key === "object" ) {
    18911942                        return this.each(function() {
    18921943                                jQuery.data( this, key );
     
    18941945                }
    18951946
    1896                 parts = key.split(".");
     1947                parts = key.split( ".", 2 );
    18971948                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 );
    19181972                                jQuery.data( this, key, value );
    1919                                 self.triggerHandler( "changeData" + parts[1] + "!", args );
     1973                                self.triggerHandler( "changeData" + part, parts );
    19201974                        });
    1921                 }
     1975                }, null, value, arguments.length > 1, null, false );
    19221976        },
    19231977
     
    19431997                                data === "false" ? false :
    19441998                                data === "null" ? null :
    1945                                 jQuery.isNumeric( data ) ? parseFloat( data ) :
     1999                                jQuery.isNumeric( data ) ? +data :
    19462000                                        rbrace.test( data ) ? jQuery.parseJSON( data ) :
    19472001                                        data;
     
    20782132jQuery.fn.extend({
    20792133        queue: function( type, data ) {
     2134                var setter = 2;
     2135
    20802136                if ( typeof type !== "string" ) {
    20812137                        data = type;
    20822138                        type = "fx";
    2083                 }
    2084 
    2085                 if ( data === undefined ) {
     2139                        setter--;
     2140                }
     2141
     2142                if ( arguments.length < setter ) {
    20862143                        return jQuery.queue( this[0], type );
    20872144                }
    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                        });
    20952155        },
    20962156        dequeue: function( type ) {
     
    21462206                }
    21472207                resolve();
    2148                 return defer.promise();
     2208                return defer.promise( object );
    21492209        }
    21502210});
     
    21652225jQuery.fn.extend({
    21662226        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 );
    21682228        },
    21692229
     
    21752235
    21762236        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 );
    21782238        },
    21792239
     
    23152375                if ( !arguments.length ) {
    23162376                        if ( elem ) {
    2317                                 hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
     2377                                hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
    23182378
    23192379                                if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
     
    23592419                        }
    23602420
    2361                         hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
     2421                        hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
    23622422
    23632423                        // If set returns undefined, fall back to normal setting
     
    25052565
    25062566        removeAttr: function( elem, value ) {
    2507                 var propName, attrNames, name, l,
     2567                var propName, attrNames, name, l, isBool,
    25082568                        i = 0;
    25092569
     
    25172577                                if ( name ) {
    25182578                                        propName = jQuery.propFix[ name ] || name;
     2579                                        isBool = rboolean.test( name );
    25192580
    25202581                                        // 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                                        }
    25222586                                        elem.removeAttribute( getSetAttribute ? name : propName );
    25232587
    25242588                                        // Set corresponding property to false for boolean attributes
    2525                                         if ( rboolean.test( name ) && propName in elem ) {
     2589                                        if ( isBool && propName in elem ) {
    25262590                                                elem[ propName ] = false;
    25272591                                        }
     
    26772741        fixSpecified = {
    26782742                name: true,
    2679                 id: true
     2743                id: true,
     2744                coords: true
    26802745        };
    26812746
     
    28072872var rformElems = /^(?:textarea|input|select)$/i,
    28082873        rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
    2809         rhoverHack = /\bhover(\.\S+)?\b/,
     2874        rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
    28102875        rkeyEvent = /^key/,
    28112876        rmouseEvent = /^(?:mouse|contextmenu)|click/,
     
    28552920                        handleObjIn = handler;
    28562921                        handler = handleObjIn.handler;
     2922                        selector = handleObjIn.selector;
    28572923                }
    28582924
     
    29062972                                guid: handler.guid,
    29072973                                selector: selector,
    2908                                 quick: quickParse( selector ),
     2974                                quick: selector && quickParse( selector ),
    29092975                                namespace: namespaces.join(".")
    29102976                        }, handleObjIn );
     
    31953261                        args = [].slice.call( arguments, 0 ),
    31963262                        run_all = !event.exclusive && !event.namespace,
     3263                        special = jQuery.event.special[ event.type ] || {},
    31973264                        handlerQueue = [],
    31983265                        i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
     
    32023269                event.delegateTarget = this;
    32033270
     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
    32043276                // Determine handlers that should run if there are delegated events
    3205                 // Avoid disabled elements in IE (#6911) and non-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") ) {
    32073279
    32083280                        // Pregenerate a single jQuery object for reuse with .is()
     
    32113283
    32123284                        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                                        }
    32313307                                }
    32323308                        }
     
    32653341                                }
    32663342                        }
     3343                }
     3344
     3345                // Call the postDispatch hook for the mapped type
     3346                if ( special.postDispatch ) {
     3347                        special.postDispatch.call( this, event );
    32673348                }
    32683349
     
    35583639                                if ( form && !form._submit_attached ) {
    35593640                                        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;
    35643642                                        });
    35653643                                        form._submit_attached = true;
     
    35673645                        });
    35683646                        // 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                        }
    35693657                },
    35703658
     
    36723760                if ( typeof types === "object" ) {
    36733761                        // ( types-Object, selector, data )
    3674                         if ( typeof selector !== "string" ) {
     3762                        if ( typeof selector !== "string" ) { // && selector != null
    36753763                                // ( types-Object, data )
    3676                                 data = selector;
     3764                                data = data || selector;
    36773765                                selector = undefined;
    36783766                        }
     
    37203808        },
    37213809        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 );
    37233811        },
    37243812        off: function( types, selector, fn ) {
     
    37273815                        var handleObj = types.handleObj;
    37283816                        jQuery( types.delegateTarget ).off(
    3729                                 handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
     3817                                handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
    37303818                                handleObj.selector,
    37313819                                handleObj.handler
     
    38863974                return [];
    38873975        }
    3888        
     3976
    38893977        if ( !selector || typeof selector !== "string" ) {
    38903978                return results;
     
    38963984                parts = [],
    38973985                soFar = selector;
    3898        
     3986
    38993987        // Reset the position of the chunker regexp (start from head)
    39003988        do {
     
    39043992                if ( m ) {
    39053993                        soFar = m[3];
    3906                
     3994
    39073995                        parts.push( m[1] );
    3908                
     3996
    39093997                        if ( m[2] ) {
    39103998                                extra = m[3];
     
    39304018                                        selector += parts.shift();
    39314019                                }
    3932                                
     4020
    39334021                                set = posProcess( selector, set, seed );
    39344022                        }
     
    40584146        for ( i = 0, len = Expr.order.length; i < len; i++ ) {
    40594147                type = Expr.order[i];
    4060                
     4148
    40614149                if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
    40624150                        left = match[1];
     
    41904278
    41914279        if ( nodeType ) {
    4192                 if ( nodeType === 1 || nodeType === 9 ) {
     4280                if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
    41934281                        // Use textContent || innerText for elements
    41944282                        if ( typeof elem.textContent === 'string' ) {
     
    44304518                ATTR: function( match, curLoop, inplace, result, not, isXML ) {
    44314519                        var name = match[1] = match[1].replace( rBackslash, "" );
    4432                        
     4520
    44334521                        if ( !isXML && Expr.attrMap[name] ) {
    44344522                                match[1] = Expr.attrMap[name];
     
    44644552                                return true;
    44654553                        }
    4466                        
     4554
    44674555                        return match;
    44684556                },
     
    44744562                }
    44754563        },
    4476        
     4564
    44774565        filters: {
    44784566                enabled: function( elem ) {
     
    44874575                        return elem.checked === true;
    44884576                },
    4489                
     4577
    44904578                selected: function( elem ) {
    44914579                        // Accessing this property makes selected-by-default
     
    44944582                                elem.parentNode.selectedIndex;
    44954583                        }
    4496                        
     4584
    44974585                        return elem.selected === true;
    44984586                },
     
    45164604                text: function( elem ) {
    45174605                        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)
    45194607                        // use getAttribute instead to test this case
    45204608                        return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
     
    46344722                                case "only":
    46354723                                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;
    46394727                                                }
    46404728                                        }
    46414729
    4642                                         if ( type === "first" ) { 
    4643                                                 return true; 
     4730                                        if ( type === "first" ) {
     4731                                                return true;
    46444732                                        }
    46454733
    46464734                                        node = elem;
    46474735
     4736                                        /* falls through */
    46484737                                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;
    46524741                                                }
    46534742                                        }
     
    46624751                                                return true;
    46634752                                        }
    4664                                        
     4753
    46654754                                        doneName = match[0];
    46664755                                        parent = elem.parentNode;
    4667        
     4756
    46684757                                        if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
    46694758                                                count = 0;
    4670                                                
     4759
    46714760                                                for ( node = parent.firstChild; node; node = node.nextSibling ) {
    46724761                                                        if ( node.nodeType === 1 ) {
    46734762                                                                node.nodeIndex = ++count;
    46744763                                                        }
    4675                                                 } 
     4764                                                }
    46764765
    46774766                                                parent[ expando ] = doneName;
    46784767                                        }
    4679                                        
     4768
    46804769                                        diff = elem.nodeIndex - last;
    46814770
     
    46964785                        return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
    46974786                },
    4698                
     4787
    46994788                CLASS: function( elem, match ) {
    47004789                        return (" " + (elem.className || elem.getAttribute("class")) + " ")
     
    47584847        Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
    47594848}
     4849// Expose origPOS
     4850// "global" as in regardless of relation to brackets/parens
     4851Expr.match.globalPOS = origPOS;
    47604852
    47614853var makeArray = function( array, results ) {
     
    47664858                return results;
    47674859        }
    4768        
     4860
    47694861        return array;
    47704862};
     
    49985090                        return;
    49995091                }
    5000        
     5092
    50015093                Sizzle = function( query, context, extra, seed ) {
    50025094                        context = context || document;
     
    50075099                                // See if we find a selector to speed up
    50085100                                var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
    5009                                
     5101
    50105102                                if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
    50115103                                        // Speed-up: Sizzle("TAG")
    50125104                                        if ( match[1] ) {
    50135105                                                return makeArray( context.getElementsByTagName( query ), extra );
    5014                                        
     5106
    50155107                                        // Speed-up: Sizzle(".CLASS")
    50165108                                        } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
     
    50185110                                        }
    50195111                                }
    5020                                
     5112
    50215113                                if ( context.nodeType === 9 ) {
    50225114                                        // Speed-up: Sizzle("body")
     
    50245116                                        if ( query === "body" && context.body ) {
    50255117                                                return makeArray( [ context.body ], extra );
    5026                                                
     5118
    50275119                                        // Speed-up: Sizzle("#ID")
    50285120                                        } else if ( match && match[3] ) {
     
    50375129                                                                return makeArray( [ elem ], extra );
    50385130                                                        }
    5039                                                        
     5131
    50405132                                                } else {
    50415133                                                        return makeArray( [], extra );
    50425134                                                }
    50435135                                        }
    5044                                        
     5136
    50455137                                        try {
    50465138                                                return makeArray( context.querySelectorAll(query), extra );
     
    50805172                                }
    50815173                        }
    5082                
     5174
    50835175                        return oldSizzle(query, context, extra, seed);
    50845176                };
     
    51075199                        // Gecko does not error, returns false instead
    51085200                        matches.call( document.documentElement, "[test!='']:sizzle" );
    5109        
     5201
    51105202                } catch( pseudoError ) {
    51115203                        pseudoWorks = true;
     
    51175209
    51185210                        if ( !Sizzle.isXML( node ) ) {
    5119                                 try { 
     5211                                try {
    51205212                                        if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
    51215213                                                var ret = matches.call( node, expr );
     
    51545246                return;
    51555247        }
    5156        
     5248
    51575249        Expr.order.splice(1, 0, "CLASS");
    51585250        Expr.find.CLASS = function( match, context, isXML ) {
     
    52055297                if ( elem ) {
    52065298                        var match = false;
    5207                        
     5299
    52085300                        elem = elem[dir];
    52095301
     
    52585350Sizzle.isXML = function( elem ) {
    52595351        // 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)
    52615353        var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
    52625354
     
    53085400        isSimple = /^.[^:#\[\.,]*$/,
    53095401        slice = Array.prototype.slice,
    5310         POS = jQuery.expr.match.POS,
     5402        POS = jQuery.expr.match.globalPOS,
    53115403        // methods guaranteed to produce a unique set when starting from a unique set
    53125404        guaranteedUnique = {
     
    53755467
    53765468        is: function( selector ) {
    5377                 return !!selector && ( 
     5469                return !!selector && (
    53785470                        typeof selector === "string" ?
    53795471                                // If this is a positional selector, check membership in the returned set
    53805472                                // so $("p:first").is("p:last") won't return true for a doc with two "p".
    5381                                 POS.test( selector ) ? 
     5473                                POS.test( selector ) ?
    53825474                                        jQuery( selector, this.context ).index( this[0] ) >= 0 :
    53835475                                        jQuery.filter( selector, this ).length > 0 :
     
    53875479        closest: function( selectors, context ) {
    53885480                var ret = [], i, l, cur = this[0];
    5389                
     5481
    53905482                // Array (deprecated as of jQuery 1.7)
    53915483                if ( jQuery.isArray( selectors ) ) {
     
    55065598        },
    55075599        siblings: function( elem ) {
    5508                 return jQuery.sibling( elem.parentNode.firstChild, elem );
     5600                return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
    55095601        },
    55105602        children: function( elem ) {
     
    56405732}
    56415733
    5642 var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
     5734var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
    56435735                "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
    56445736        rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
     
    56505742        rnoInnerhtml = /<(?:script|style)/i,
    56515743        rnocache = /<(?:script|object|embed|option|style)/i,
    5652         rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
     5744        rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
    56535745        // checked="checked" or checked
    56545746        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
     
    56775769
    56785770jQuery.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 );
    56935777        },
    56945778
     
    58425926
    58435927        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 ) {
    58675963                                this.empty().append( value );
    58685964                        }
    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 );
    58825966        },
    58835967
     
    59826066
    59836067                        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                                });
    59856085                        }
    59866086                }
     
    60146114                for ( type in events ) {
    60156115                        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 ] );
    60176117                        }
    60186118                }
     
    60766176        } else if ( nodeName === "input" || nodeName === "textarea" ) {
    60776177                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;
    60786182        }
    60796183
     
    60816185        // gets copied too
    60826186        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" );
    60836192}
    60846193
     
    62056314                        i,
    62066315                        // 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 + ">" ) ?
    62086317                                elem.cloneNode( true ) :
    62096318                                shimCloneNode( elem );
     
    62556364
    62566365        clean: function( elems, context, fragment, scripts ) {
    6257                 var checkScriptType;
     6366                var checkScriptType, script, j,
     6367                                ret = [];
    62586368
    62596369                context = context || document;
     
    62636373                        context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
    62646374                }
    6265 
    6266                 var ret = [], j;
    62676375
    62686376                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
     
    62876395                                                wrap = wrapMap[ tag ] || wrapMap._default,
    62886396                                                depth = wrap[0],
    6289                                                 div = context.createElement("div");
     6397                                                div = context.createElement("div"),
     6398                                                safeChildNodes = safeFragment.childNodes,
     6399                                                remove;
    62906400
    62916401                                        // Append wrapper element to unknown element safe doc fragment
     
    63326442
    63336443                                        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                                        }
    63346459                                }
    63356460                        }
     
    63606485                        };
    63616486                        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 );
    63646490
    63656491                                } 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 );
    63686494
    63696495                                                ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
    63706496                                        }
    6371                                         fragment.appendChild( ret[i] );
     6497                                        fragment.appendChild( script );
    63726498                                }
    63736499                        }
     
    64236549});
    64246550
    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 
    64416551
    64426552
     
    64466556        // fixed for IE9, see #8346
    64476557        rupper = /([A-Z]|^ms)/g,
    6448         rnumpx = /^-?\d+(?:px)?$/i,
    6449         rnum = /^-?\d/,
     6558        rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
     6559        rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
    64506560        rrelNum = /^([\-+])=([\-+.\de]+)/,
     6561        rmargin = /^margin/,
    64516562
    64526563        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
    64556568        curCSS,
    64566569
     
    64596572
    64606573jQuery.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 ) {
    64676575                return value !== undefined ?
    64686576                        jQuery.style( elem, name, value ) :
    64696577                        jQuery.css( elem, name );
    6470         });
     6578        }, name, value, arguments.length > 1 );
    64716579};
    64726580
     
    64796587                                if ( computed ) {
    64806588                                        // We should always get a number back from opacity
    6481                                         var ret = curCSS( elem, "opacity", "opacity" );
     6589                                        var ret = curCSS( elem, "opacity" );
    64826590                                        return ret === "" ? "1" : ret;
    64836591
     
    65876695        // A method for quickly swapping in/out CSS properties to get correct calculations
    65886696        swap: function( elem, options, callback ) {
    6589                 var old = {};
     6697                var old = {},
     6698                        ret, name;
    65906699
    65916700                // Remember the old values, and insert the new ones
    6592                 for ( var name in options ) {
     6701                for ( name in options ) {
    65936702                        old[ name ] = elem.style[ name ];
    65946703                        elem.style[ name ] = options[ name ];
    65956704                }
    65966705
    6597                 callback.call( elem );
     6706                ret = callback.call( elem );
    65986707
    65996708                // Revert the old values
     
    66016710                        elem.style[ name ] = old[ name ];
    66026711                }
     6712
     6713                return ret;
    66036714        }
    66046715});
    66056716
    6606 // DEPRECATED, Use jQuery.css() instead
     6717// DEPRECATED in 1.3, Use jQuery.css() instead
    66076718jQuery.curCSS = jQuery.css;
    66086719
    6609 jQuery.each(["height", "width"], function( i, name ) {
     6720if ( 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
     6750if ( 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
     6791curCSS = getComputedStyle || currentStyle;
     6792
     6793function 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
     6847jQuery.each([ "height", "width" ], function( i, name ) {
    66106848        jQuery.cssHooks[ name ] = {
    66116849                get: function( elem, computed, extra ) {
    6612                         var val;
    6613 
    66146850                        if ( computed ) {
    66156851                                if ( elem.offsetWidth !== 0 ) {
    6616                                         return getWH( elem, name, extra );
     6852                                        return getWidthOrHeight( elem, name, extra );
    66176853                                } 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 );
    66206856                                        });
    66216857                                }
    6622 
    6623                                 return val;
    66246858                        }
    66256859                },
    66266860
    66276861                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;
    66396865                }
    66406866        };
     
    66906916                                // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
    66916917                                // 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() {
    66946919                                        if ( computed ) {
    6695                                                 ret = curCSS( elem, "margin-right", "marginRight" );
     6920                                                return curCSS( elem, "margin-right" );
    66966921                                        } else {
    6697                                                 ret = elem.style.marginRight;
     6922                                                return elem.style.marginRight;
    66986923                                        }
    66996924                                });
    6700                                 return ret;
    67016925                        }
    67026926                };
    67036927        }
    67046928});
    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 here
    6731                 // so we don't default to auto
    6732                 if ( ret === null && style && (uncomputed = style[ name ]) ) {
    6733                         ret = uncomputed;
    6734                 }
    6735 
    6736                 // From the awesome hack by Dean Edwards
    6737                 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
    6738 
    6739                 // If we're not dealing with a regular pixel number
    6740                 // but a number that has a weird ending, we need to convert it to pixels
    6741                 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
    6742 
    6743                         // Remember the original values
    6744                         left = style.left;
    6745                         rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
    6746 
    6747                         // Put in the new values to get a computed value out
    6748                         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 values
    6755                         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 property
    6770         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 necessary
    6793         val = curCSS( elem, name, name );
    6794         if ( val < 0 || val == null ) {
    6795                 val = elem.style[ name ] || 0;
    6796         }
    6797         // Normalize "", auto, and prepare for extra
    6798         val = parseFloat( val ) || 0;
    6799 
    6800         // Add padding, border, margin
    6801         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 }
    68156929
    68166930if ( jQuery.expr && jQuery.expr.filters ) {
     
    68266940        };
    68276941}
     6942
     6943// These hooks are used by animate to expand properties
     6944jQuery.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});
    68286967
    68296968
     
    71457284                global: true,
    71467285                type: "GET",
    7147                 contentType: "application/x-www-form-urlencoded",
     7286                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
    71487287                processData: true,
    71497288                async: true,
     
    74717610                inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
    74727611
    7473                 // If request was aborted inside a prefiler, stop there
     7612                // If request was aborted inside a prefilter, stop there
    74747613                if ( state === 2 ) {
    74757614                        return false;
     
    76447783                                // deserialization algorithm or to provide an option or flag
    76457784                                // 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 );
    76477786                        }
    76487787                });
    76497788
    7650         } else if ( !traditional && obj != null && typeof obj === "object" ) {
     7789        } else if ( !traditional && jQuery.type( obj ) === "object" ) {
    76517790                // Serialize object item.
    76527791                for ( var name in obj ) {
     
    78447983jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
    78457984
    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 );
    78487986
    78497987        if ( s.dataTypes[ 0 ] === "jsonp" ||
     
    81468284                                                                                responses.xml = xml;
    81478285                                                                        }
    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                                                                        }
    81498293
    81508294                                                                        // Firefox throws an exception when accessing
     
    82548398                                        // in a stylesheet to whatever the default browser style is
    82558399                                        // 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 ) ) {
    82578402                                                jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
    82588403                                        }
     
    83588503                                isElement = this.nodeType === 1,
    83598504                                hidden = isElement && jQuery(this).is(":hidden"),
    8360                                 name, val, p, e,
     8505                                name, val, p, e, hooks, replace,
    83618506                                parts, start, end, unit,
    83628507                                method;
     
    83658510                        opt.animatedProperties = {};
    83668511
     8512                        // first pass over propertys to expand / normalize
    83678513                        for ( p in prop ) {
    8368 
    8369                                 // property name normalization
    83708514                                name = jQuery.camelCase( p );
    83718515                                if ( p !== name ) {
     
    83748518                                }
    83758519
     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 ) {
    83768535                                val = prop[ name ];
    8377 
    83788536                                // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
    83798537                                if ( jQuery.isArray( val ) ) {
     
    86028760
    86038761        easing: {
    8604                 linear: function( p, n, firstNum, diff ) {
    8605                         return firstNum + diff * p;
     8762                linear: function( p ) {
     8763                        return p;
    86068764                },
    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;
    86098767                }
    86108768        },
     
    86648822                t.elem = this.elem;
    86658823                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                                }
    86688830                        }
    86698831                };
     
    88328994});
    88338995
    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
     8997jQuery.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        }
    88409004});
    88419005
     
    88749038                        if ( !iframeDoc || !iframe.createElement ) {
    88759039                                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>" );
    88779041                                iframeDoc.close();
    88789042                        }
     
    88969060
    88979061
    8898 var rtable = /^t(?:able|d|h)$/i,
     9062var getOffset,
     9063        rtable = /^t(?:able|d|h)$/i,
    88999064        rroot = /^(?:body|html)$/i;
    89009065
    89019066if ( "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 ) {
    89199068                try {
    89209069                        box = elem.getBoundingClientRect();
    89219070                } catch(e) {}
    89229071
    8923                 var doc = elem.ownerDocument,
    8924                         docElem = doc.documentElement;
    8925 
    89269072                // Make sure we're not dealing with a disconnected DOM node
    89279073                if ( !box || !jQuery.contains( docElem, elem ) ) {
     
    89309076
    89319077                var body = doc.body,
    8932                         win = getWindow(doc),
     9078                        win = getWindow( doc ),
    89339079                        clientTop  = docElem.clientTop  || body.clientTop  || 0,
    89349080                        clientLeft = docElem.clientLeft || body.clientLeft || 0,
     
    89429088
    89439089} 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 ) {
    89619091                var computedStyle,
    89629092                        offsetParent = elem.offsetParent,
    89639093                        prevOffsetParent = elem,
    8964                         doc = elem.ownerDocument,
    8965                         docElem = doc.documentElement,
    89669094                        body = doc.body,
    89679095                        defaultView = doc.defaultView,
     
    90139141        };
    90149142}
     9143
     9144jQuery.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};
    90159166
    90169167jQuery.offset = {
     
    91199270
    91209271// Create scrollLeft and scrollTop methods
    9121 jQuery.each( ["Left", "Top"], function( i, name ) {
    9122         var method = "scroll" + name;
     9272jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
     9273        var top = /Y/.test( prop );
    91239274
    91249275        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                        }
    91469285
    91479286                        if ( win ) {
    91489287                                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()
    91519290                                );
    91529291
    91539292                        } else {
    9154                                 this[ method ] = val;
    9155                         }
    9156                 });
     9293                                elem[ method ] = val;
     9294                        }
     9295                }, method, val, arguments.length, null );
    91579296        };
    91589297});
     
    91709309
    91719310// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
    9172 jQuery.each([ "Height", "Width" ], function( i, name ) {
    9173 
    9174         var type = name.toLowerCase();
     9311jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
     9312        var clientProp = "client" + name,
     9313                scrollProp = "scroll" + name,
     9314                offsetProp = "offset" + name;
    91759315
    91769316        // innerHeight and innerWidth
     
    91949334        };
    91959335
    9196         jQuery.fn[ type ] = function( size ) {
    9197                 // Get window width or height
    9198                 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 mode
    9212                         // 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 height
    9219                 } 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 element
    9228                 } 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 );
    92309370                                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 );
    92389377        };
    9239 
    92409378});
    92419379
Note: See TracChangeset for help on using the changeset viewer.