Changeset 765e62 in indico
- Timestamp:
- 05/25/11 16:10:36 (2 years ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, b8c30da8ebdbdcbd675a873997cc3e95f567de49, 4287315ec967a3da168d83963c14001db8487d53
- Children:
- daf70c
- Parents:
- 431770
- File:
-
- 1 edited
-
indico/htdocs/js/jquery/jquery.js (modified) (45 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/htdocs/js/jquery/jquery.js
rfb6f28 r765e62 1 1 /*! 2 * jQuery JavaScript Library v1.6 2 * jQuery JavaScript Library v1.6.1 3 3 * http://jquery.com/ 4 4 * … … 12 12 * Released under the MIT, BSD, and GPL Licenses. 13 13 * 14 * Date: Mon May 2 13:50:002011 -040014 * Date: Thu May 12 15:04:36 2011 -0400 15 15 */ 16 16 (function( window, undefined ) { … … 205 205 206 206 // The current version of jQuery being used 207 jquery: "1.6 ",207 jquery: "1.6.1", 208 208 209 209 // The default length of a jQuery object is 0 … … 1056 1056 deferred[ handler ](function() { 1057 1057 returned = fn.apply( this, arguments ); 1058 if ( jQuery.isFunction( returned.promise ) ) {1058 if ( returned && jQuery.isFunction( returned.promise ) ) { 1059 1059 returned.promise().then( newDefer.resolve, newDefer.reject ); 1060 1060 } else { … … 1138 1138 1139 1139 var div = document.createElement( "div" ), 1140 documentElement = document.documentElement, 1140 1141 all, 1141 1142 a, … … 1285 1286 } 1286 1287 body.appendChild( div ); 1287 document .documentElement.appendChild( body);1288 documentElement.insertBefore( body, documentElement.firstChild ); 1288 1289 1289 1290 // Check if a disconnected checkbox will retain its checked … … 1340 1341 div.appendChild( marginDiv ); 1341 1342 support.reliableMarginRight = 1342 ( parseInt( document.defaultView.getComputedStyle( marginDiv, null).marginRight, 10 ) || 0 ) === 0;1343 ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; 1343 1344 } 1344 1345 1345 1346 // Remove the body element we added 1346 1347 body.innerHTML = ""; 1347 document .documentElement.removeChild( body );1348 documentElement.removeChild( body ); 1348 1349 1349 1350 // Technique from Juriy Zaytsev … … 1476 1477 1477 1478 if ( data !== undefined ) { 1478 thisCache[ name] = data;1479 thisCache[ jQuery.camelCase( name ) ] = data; 1479 1480 } 1480 1481 … … 1486 1487 } 1487 1488 1488 return getByName ? thisCache[ name] : thisCache;1489 return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache; 1489 1490 }, 1490 1491 … … 1662 1663 // data from the HTML5 data-* attribute 1663 1664 if ( data === undefined && elem.nodeType === 1 ) { 1664 name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();1665 var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase(); 1665 1666 1666 1667 data = elem.getAttribute( name ); … … 1851 1852 deferDataKey = type + "defer", 1852 1853 queueDataKey = type + "queue", 1853 markDataKey = type + "mark"; 1854 markDataKey = type + "mark", 1855 tmp; 1854 1856 function resolve() { 1855 1857 if ( !( --count ) ) { … … 1880 1882 rfocusable = /^(?:button|input|object|select|textarea)$/i, 1881 1883 rclickable = /^a(?:rea)?$/i, 1882 r special = /^(?:data-|aria-)/,1884 rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, 1883 1885 rinvalidChar = /\:/, 1884 formHook ;1886 formHook, boolHook; 1885 1887 1886 1888 jQuery.fn.extend({ … … 1900 1902 1901 1903 removeProp: function( name ) { 1904 name = jQuery.propFix[ name ] || name; 1902 1905 return this.each(function() { 1903 1906 // try/catch handles cases where IE balks (such as removing a property on window) … … 2073 2076 2074 2077 // If set returns undefined, fall back to normal setting 2075 if ( !hooks || ("set" in hooks && hooks.set( this, val, "value" ) === undefined)) {2078 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { 2076 2079 this.value = val; 2077 2080 } … … 2092 2095 select: { 2093 2096 get: function( elem ) { 2094 var index = elem.selectedIndex, 2097 var value, 2098 index = elem.selectedIndex, 2095 2099 values = [], 2096 2100 options = elem.options, … … 2159 2163 attrFix: { 2160 2164 // Always normalize to ensure hook usage 2161 tabindex: "tabIndex", 2162 readonly: "readOnly" 2165 tabindex: "tabIndex" 2163 2166 }, 2164 2167 … … 2174 2177 return jQuery( elem )[ name ]( value ); 2175 2178 } 2176 2179 2180 // Fallback to prop when attributes are not supported 2181 if ( !("getAttribute" in elem) ) { 2182 return jQuery.prop( elem, name, value ); 2183 } 2184 2177 2185 var ret, hooks, 2178 2186 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 2179 2187 2180 2188 // Normalize the name if needed 2181 2189 name = notxml && jQuery.attrFix[ name ] || name; 2182 2190 2183 // Get the appropriate hook, or the formHook 2184 // if getSetAttribute is not supported and we have form objects in IE6/7 2185 hooks = jQuery.attrHooks[ name ] || 2186 ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ? 2187 formHook : 2188 undefined ); 2191 hooks = jQuery.attrHooks[ name ]; 2192 2193 if ( !hooks ) { 2194 // Use boolHook for boolean attributes 2195 if ( rboolean.test( name ) && 2196 (typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) { 2197 2198 hooks = boolHook; 2199 2200 // Use formHook for forms and if the name contains certain characters 2201 } else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) { 2202 hooks = formHook; 2203 } 2204 } 2189 2205 2190 2206 if ( value !== undefined ) { 2191 2207 2192 if ( value === null || (value === false && !rspecial.test( name ))) {2208 if ( value === null ) { 2193 2209 jQuery.removeAttr( elem, name ); 2194 2210 return undefined; … … 2198 2214 2199 2215 } else { 2200 2201 // Set boolean attributes to the same name2202 if ( value === true && !rspecial.test( name ) ) {2203 value = name;2204 }2205 2206 2216 elem.setAttribute( name, "" + value ); 2207 2217 return value; 2208 2218 } 2209 2219 2220 } else if ( hooks && "get" in hooks && notxml ) { 2221 return hooks.get( elem, name ); 2222 2210 2223 } else { 2211 2224 2212 if ( hooks && "get" in hooks && notxml ) { 2213 return hooks.get( elem, name ); 2214 2215 } else { 2216 2217 ret = elem.getAttribute( name ); 2218 2219 // Non-existent attributes return null, we normalize to undefined 2220 return ret === null ? 2221 undefined : 2222 ret; 2223 } 2224 } 2225 }, 2226 2225 ret = elem.getAttribute( name ); 2226 2227 // Non-existent attributes return null, we normalize to undefined 2228 return ret === null ? 2229 undefined : 2230 ret; 2231 } 2232 }, 2233 2227 2234 removeAttr: function( elem, name ) { 2235 var propName; 2228 2236 if ( elem.nodeType === 1 ) { 2229 2237 name = jQuery.attrFix[ name ] || name; … … 2235 2243 jQuery.attr( elem, name, "" ); 2236 2244 elem.removeAttributeNode( elem.getAttributeNode( name ) ); 2245 } 2246 2247 // Set corresponding property to false for boolean attributes 2248 if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) { 2249 elem[ propName ] = false; 2237 2250 } 2238 2251 } … … 2249 2262 // Reset value to it's default in case type is set after value 2250 2263 // This is for element creation 2251 var val = elem. getAttribute("value");2264 var val = elem.value; 2252 2265 elem.setAttribute( "type", value ); 2253 2266 if ( val ) { … … 2272 2285 } 2273 2286 }, 2274 2275 propFix: {}, 2276 2277 prop: function( elem, name, value ) { 2278 var nType = elem.nodeType; 2279 2280 // don't get/set properties on text, comment and attribute nodes 2281 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 2282 return undefined; 2283 } 2284 2285 var ret, hooks, 2286 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 2287 2288 // Try to normalize/fix the name 2289 name = notxml && jQuery.propFix[ name ] || name; 2290 2291 hooks = jQuery.propHooks[ name ]; 2292 2293 if ( value !== undefined ) { 2294 if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 2295 return ret; 2296 2297 } else { 2298 return (elem[ name ] = value); 2299 } 2300 2301 } else { 2302 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { 2303 return ret; 2304 2305 } else { 2306 return elem[ name ]; 2307 } 2308 } 2309 }, 2310 2311 propHooks: {} 2312 }); 2313 2314 // IE6/7 do not support getting/setting some attributes with get/setAttribute 2315 if ( !jQuery.support.getSetAttribute ) { 2316 jQuery.attrFix = jQuery.extend( jQuery.attrFix, { 2287 2288 propFix: { 2289 tabindex: "tabIndex", 2290 readonly: "readOnly", 2317 2291 "for": "htmlFor", 2318 2292 "class": "className", … … 2323 2297 colspan: "colSpan", 2324 2298 usemap: "useMap", 2325 frameborder: "frameBorder" 2326 }); 2299 frameborder: "frameBorder", 2300 contenteditable: "contentEditable" 2301 }, 2302 2303 prop: function( elem, name, value ) { 2304 var nType = elem.nodeType; 2305 2306 // don't get/set properties on text, comment and attribute nodes 2307 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { 2308 return undefined; 2309 } 2310 2311 var ret, hooks, 2312 notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); 2313 2314 // Try to normalize/fix the name 2315 name = notxml && jQuery.propFix[ name ] || name; 2316 2317 hooks = jQuery.propHooks[ name ]; 2318 2319 if ( value !== undefined ) { 2320 if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { 2321 return ret; 2322 2323 } else { 2324 return (elem[ name ] = value); 2325 } 2326 2327 } else { 2328 if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { 2329 return ret; 2330 2331 } else { 2332 return elem[ name ]; 2333 } 2334 } 2335 }, 2336 2337 propHooks: {} 2338 }); 2339 2340 // Hook for boolean attributes 2341 boolHook = { 2342 get: function( elem, name ) { 2343 // Align boolean attributes with corresponding properties 2344 return elem[ jQuery.propFix[ name ] || name ] ? 2345 name.toLowerCase() : 2346 undefined; 2347 }, 2348 set: function( elem, value, name ) { 2349 var propName; 2350 if ( value === false ) { 2351 // Remove boolean attributes when set to false 2352 jQuery.removeAttr( elem, name ); 2353 } else { 2354 // value is true since we know at this point it's type boolean and not false 2355 // Set boolean attributes to the same name and set the DOM property 2356 propName = jQuery.propFix[ name ] || name; 2357 if ( propName in elem ) { 2358 // Only set the IDL specifically if it already exists on the element 2359 elem[ propName ] = value; 2360 } 2361 2362 elem.setAttribute( name, name.toLowerCase() ); 2363 } 2364 return name; 2365 } 2366 }; 2367 2368 // Use the value property for back compat 2369 // Use the formHook for button elements in IE6/7 (#1954) 2370 jQuery.attrHooks.value = { 2371 get: function( elem, name ) { 2372 if ( formHook && jQuery.nodeName( elem, "button" ) ) { 2373 return formHook.get( elem, name ); 2374 } 2375 return elem.value; 2376 }, 2377 set: function( elem, value, name ) { 2378 if ( formHook && jQuery.nodeName( elem, "button" ) ) { 2379 return formHook.set( elem, value, name ); 2380 } 2381 // Does not return so that setAttribute is also used 2382 elem.value = value; 2383 } 2384 }; 2385 2386 // IE6/7 do not support getting/setting some attributes with get/setAttribute 2387 if ( !jQuery.support.getSetAttribute ) { 2388 2389 // propFix is more comprehensive and contains all fixes 2390 jQuery.attrFix = jQuery.propFix; 2327 2391 2328 2392 // Use this for any attribute on a form in IE6/7 2329 formHook = jQuery.attrHooks.name = jQuery. attrHooks.value = jQuery.valHooks.button = {2393 formHook = jQuery.attrHooks.name = jQuery.valHooks.button = { 2330 2394 get: function( elem, name ) { 2331 2395 var ret; 2332 if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {2333 return elem.getAttribute( name );2334 }2335 2396 ret = elem.getAttributeNode( name ); 2336 // Return undefined if no t specified instead ofempty string2337 return ret && ret. specified?2397 // Return undefined if nodeValue is empty string 2398 return ret && ret.nodeValue !== "" ? 2338 2399 ret.nodeValue : 2339 2400 undefined; … … 3087 3148 var parent = event.relatedTarget; 3088 3149 3150 // set the correct event type 3151 event.type = event.data; 3152 3089 3153 // Firefox sometimes assigns relatedTarget a XUL element 3090 3154 // which we cannot access the parentNode property of … … 3096 3160 return; 3097 3161 } 3162 3098 3163 // Traverse up the tree 3099 3164 while ( parent && parent !== this ) { … … 3102 3167 3103 3168 if ( parent !== this ) { 3104 // set the correct event type3105 event.type = event.data;3106 3107 3169 // handle event if we actually just moused on to a non sub-element 3108 3170 jQuery.event.handle.apply( this, arguments ); … … 4292 4354 4293 4355 reset: function( elem ) { 4294 return elem.nodeName.toLowerCase() === "input" && "reset" === elem.type; 4356 var name = elem.nodeName.toLowerCase(); 4357 return (name === "input" || name === "button") && "reset" === elem.type; 4295 4358 }, 4296 4359 … … 4558 4621 } else { 4559 4622 sortOrder = function( a, b ) { 4623 // The nodes are identical, we can exit early 4624 if ( a === b ) { 4625 hasDuplicate = true; 4626 return 0; 4627 4628 // Fallback to using sourceIndex (in IE) if it's available on both nodes 4629 } else if ( a.sourceIndex && b.sourceIndex ) { 4630 return a.sourceIndex - b.sourceIndex; 4631 } 4632 4560 4633 var al, bl, 4561 4634 ap = [], … … 4565 4638 cur = aup; 4566 4639 4567 // The nodes are identical, we can exit early4568 if ( a === b ) {4569 hasDuplicate = true;4570 return 0;4571 4572 4640 // If the nodes are siblings (or identical) we can do a quick check 4573 } elseif ( aup === bup ) {4641 if ( aup === bup ) { 4574 4642 return siblingCheck( a, b ); 4575 4643 … … 5395 5463 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5396 5464 rscriptType = /\/(java|ecma)script/i, 5465 rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, 5397 5466 wrapMap = { 5398 5467 option: [ 1, "<select multiple='multiple'>", "</select>" ], … … 5885 5954 if ( "getElementsByTagName" in elem ) { 5886 5955 return elem.getElementsByTagName( "*" ); 5887 5956 5888 5957 } else if ( "querySelectorAll" in elem ) { 5889 5958 return elem.querySelectorAll( "*" ); … … 5967 6036 } 5968 6037 5969 var ret = [] ;6038 var ret = [], j; 5970 6039 5971 6040 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { … … 6013 6082 []; 6014 6083 6015 for ( varj = tbody.length - 1; j >= 0 ; --j ) {6084 for ( j = tbody.length - 1; j >= 0 ; --j ) { 6016 6085 if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { 6017 6086 tbody[ j ].parentNode.removeChild( tbody[ j ] ); … … 6034 6103 if ( !jQuery.support.appendChecked ) { 6035 6104 if ( elem[0] && typeof (len = elem.length) === "number" ) { 6036 for ( i = 0; i < len; i++ ) {6037 findInputs( elem[ i] );6105 for ( j = 0; j < len; j++ ) { 6106 findInputs( elem[j] ); 6038 6107 } 6039 6108 } else { … … 6123 6192 }); 6124 6193 } else { 6125 jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "");6194 jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); 6126 6195 } 6127 6196 … … 8000 8069 } 8001 8070 8071 // Do not change referenced properties as per-property easing will be lost 8072 prop = jQuery.extend( {}, prop ); 8073 8002 8074 return this[ optall.queue === false ? "each" : "queue" ](function() { 8003 8075 // XXX 'this' does not always have a nodeName when running the … … 8008 8080 } 8009 8081 8010 var opt = jQuery.extend( {}, optall),8082 var opt = jQuery.extend( {}, optall ), 8011 8083 isElement = this.nodeType === 1, 8012 8084 hidden = isElement && jQuery(this).is(":hidden"), … … 8027 8099 } 8028 8100 8029 val = prop[name]; 8101 val = prop[ name ]; 8102 8103 // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default) 8104 if ( jQuery.isArray( val ) ) { 8105 opt.animatedProperties[ name ] = val[ 1 ]; 8106 val = prop[ name ] = val[ 0 ]; 8107 } else { 8108 opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing'; 8109 } 8030 8110 8031 8111 if ( val === "hide" && hidden || val === "show" && !hidden ) { 8032 return opt.complete.call( this);8112 return opt.complete.call( this ); 8033 8113 } 8034 8114 … … 8049 8129 8050 8130 } else { 8051 display = defaultDisplay( this.nodeName);8131 display = defaultDisplay( this.nodeName ); 8052 8132 8053 8133 // inline-level elements accept inline-block; … … 8063 8143 } 8064 8144 } 8065 8066 // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)8067 opt.animatedProperties[name] = jQuery.isArray( val ) ?8068 val[1]:8069 opt.specialEasing && opt.specialEasing[name] || opt.easing || 'swing';8070 8145 } 8071 8146 … … 8076 8151 for ( p in prop ) { 8077 8152 e = new jQuery.fx( this, opt, p ); 8078 8079 val = prop[p]; 8153 val = prop[ p ]; 8080 8154 8081 8155 if ( rfxtypes.test(val) ) { … … 8083 8157 8084 8158 } else { 8085 parts = rfxnum.exec( val);8159 parts = rfxnum.exec( val ); 8086 8160 start = e.cur(); 8087 8161 8088 8162 if ( parts ) { 8089 8163 end = parseFloat( parts[2] ); 8090 unit = parts[3] || ( jQuery.cssNumber[ name] ? "" : "px" );8164 unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" ); 8091 8165 8092 8166 // We need to compute starting value … … 8099 8173 // If a +=/-= token was provided, we're doing a relative animation 8100 8174 if ( parts[1] ) { 8101 end = ( (parts[1] === "-=" ? -1 : 1) * end) + start;8175 end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start; 8102 8176 } 8103 8177 … … 8127 8201 jQuery._unmark( true, this ); 8128 8202 } 8129 // go in reverse order so anything added to the queue during the loop is ignored8130 8203 while ( i-- ) { 8131 8204 if ( timers[i].elem === this ) { … … 8375 8448 } else { 8376 8449 n = t - this.startTime; 8377 8378 8450 this.state = n / options.duration; 8451 8379 8452 // Perform the easing function, defaults to swing 8380 this.pos = jQuery.easing[ options.animatedProperties[this.prop]](this.state, n, 0, 1, options.duration);8453 this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration ); 8381 8454 this.now = this.start + ((this.end - this.start) * this.pos); 8382 8455 } … … 8391 8464 jQuery.extend( jQuery.fx, { 8392 8465 tick: function() { 8393 var timers = jQuery.timers, 8394 i = timers.length; 8395 while ( i-- ) { 8466 for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) { 8396 8467 if ( !timers[i]() ) { 8397 timers.splice(i , 1);8468 timers.splice(i--, 1); 8398 8469 } 8399 8470 }
Note: See TracChangeset
for help on using the changeset viewer.
