diff --git a/README.markdown b/README.markdown index dc557f6..25caad5 100644 --- a/README.markdown +++ b/README.markdown @@ -23,18 +23,18 @@ OK, here's some sample code that illustrates the basics: var updateProfileDiv = function(updatedUserInfo){ var profileDiv = $('#profile'); - + profileDiv.find('.mugshot img').attr('src', user.mugshotUrl); - + profileDiv.find('.mugshot .caption').html(user.mugshotCaption); - + if(updatedUserInfo.isAdmin){ profileDiv.find('.admin_links').show(); } else { profileDiv.find('.admin_links').hide(); } }; - + // later... updateProfileDiv(user); diff --git a/examples/lowbots/lowbots.js b/examples/lowbots/lowbots.js index 891574e..8b4cd2b 100644 --- a/examples/lowbots/lowbots.js +++ b/examples/lowbots/lowbots.js @@ -69,7 +69,7 @@ for (row = 6; row < 10; row++){ }else if (is_horizontal_limit && col === 9){ board[row][col].w_border = true; } - } + } board[row][col].no_target = true; } } @@ -90,7 +90,7 @@ var placeQuadrantTargets = function(verticalSide, horizontalSide){ //iterate over four targets to put four in each quadrant var which for (which = 0; which < 4; which++) { - do { + do { var dest_row = (random_below(8) + verticalOffset); var dest_col = (random_below(8) + horizontalOffset); } while (board[dest_row][dest_col].no_target === true || board[dest_row][dest_col].is_target === true) @@ -118,7 +118,7 @@ var placeQuadrantTargets = function(verticalSide, horizontalSide){ } //putting the target in the array targets.push(board[dest_row][dest_col]); - + //adding walls to the new target if (which === 0) { board[dest_row][dest_col].e_border = true; @@ -158,12 +158,12 @@ placeQuadrantTargets(true, true); var place_quadrant_bucket_walls = function (vertical_index, horizontal_index){ var bucket_dest_row = Math.abs(15 * vertical_index - (random_below(4) + 3)); var bucket_dest_col = Math.abs(15 * horizontal_index - (random_below(4) + 3)); - + board[bucket_dest_row][(15 * horizontal_index)].s_border = true; board[bucket_dest_row+1][(15 * horizontal_index)].n_border = true; board[(15 * vertical_index)][bucket_dest_col].e_border = true; board[(15 * vertical_index)][bucket_dest_col+1].w_border = true; - + } place_quadrant_bucket_walls(false, false); @@ -195,12 +195,12 @@ for (which = 0; which < robot_number; which++) { do { var robot_row = random_below(16); var robot_col = random_below(16); - } while (board[robot_row][robot_col].is_target || - typeof board[robot_row][robot_col].robot === 'number' || + } while (board[robot_row][robot_col].is_target || + typeof board[robot_row][robot_col].robot === 'number' || ( (board[robot_row][robot_col].row === 7 || board[robot_row][robot_col].row === 8) && - (board[robot_row][robot_col].col === 7 || board[robot_row][robot_col].col === 8) - ) + (board[robot_row][robot_col].col === 7 || board[robot_row][robot_col].col === 8) + ) ) board[robot_row][robot_col].robot = which; robot_list.push({ @@ -239,7 +239,7 @@ var move = { south: function () { return move.somewhere('row', 1, 's_border'); }, east: function () { return move.somewhere('col', 1, 'e_border'); }, west: function () { return move.somewhere('col', -1, 'w_border'); }, - + somewhere: function(axis, change, wallProperty){ var location = { row: robot_list[current_robot].row, diff --git a/lib/jquery/jquery-1.4.2.js b/lib/jquery/jquery-1.4.2.js index fff6776..244bda4 100644 --- a/lib/jquery/jquery-1.4.2.js +++ b/lib/jquery/jquery-1.4.2.js @@ -54,10 +54,10 @@ var jQuery = function( selector, context ) { // For matching the engine and version of the browser browserMatch, - + // Has the ready events already been bound? readyBound = false, - + // The functions to execute on DOM ready readyList = [], @@ -86,7 +86,7 @@ jQuery.fn = jQuery.prototype = { this.length = 1; return this; } - + // The body element only exists once, optimize finding it if ( selector === "body" && !context ) { this.context = document; @@ -125,9 +125,9 @@ jQuery.fn = jQuery.prototype = { ret = buildFragment( [ match[1] ], [ doc ] ); selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; } - + return jQuery.merge( this, selector ); - + // HANDLE: $("#id") } else { elem = document.getElementById( match[2] ); @@ -218,7 +218,7 @@ jQuery.fn = jQuery.prototype = { if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); - + } else { jQuery.merge( ret, elems ); } @@ -244,7 +244,7 @@ jQuery.fn = jQuery.prototype = { each: function( callback, args ) { return jQuery.each( this, callback, args ); }, - + ready: function( fn ) { // Attach the listeners jQuery.bindReady(); @@ -262,7 +262,7 @@ jQuery.fn = jQuery.prototype = { return this; }, - + eq: function( i ) { return i === -1 ? this.slice( i ) : @@ -287,7 +287,7 @@ jQuery.fn = jQuery.prototype = { return callback.call( elem, i, elem ); })); }, - + end: function() { return this.prevObject || jQuery(null); }, @@ -368,10 +368,10 @@ jQuery.extend({ return jQuery; }, - + // Is the DOM ready to be used? Set to true once it occurs. isReady: false, - + // Handle when the DOM is ready ready: function() { // Make sure that the DOM is not already loaded @@ -402,7 +402,7 @@ jQuery.extend({ } } }, - + bindReady: function() { if ( readyBound ) { return; @@ -420,7 +420,7 @@ jQuery.extend({ if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - + // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); @@ -429,7 +429,7 @@ jQuery.extend({ // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", DOMContentLoaded); - + // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); @@ -465,20 +465,20 @@ jQuery.extend({ if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { return false; } - + // Not own constructor property must be Object if ( obj.constructor && !hasOwnProperty.call(obj, "constructor") && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } - + // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. - + var key; for ( key in obj ) {} - + return key === undefined || hasOwnProperty.call( obj, key ); }, @@ -488,11 +488,11 @@ jQuery.extend({ } return true; }, - + error: function( msg ) { throw msg; }, - + parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; @@ -500,7 +500,7 @@ jQuery.extend({ // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); - + // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") @@ -627,7 +627,7 @@ jQuery.extend({ for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } - + } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; @@ -794,7 +794,7 @@ function evalScript( i, elem ) { // The value/s can be optionally by executed if its a function function access( elems, key, value, exec, fn, pass ) { var length = elems.length; - + // Setting many attributes if ( typeof key === "object" ) { for ( var k in key ) { @@ -802,19 +802,19 @@ function access( elems, key, value, exec, fn, pass ) { } return elems; } - + // Setting one attribute if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = !pass && exec && jQuery.isFunction(value); - + for ( var i = 0; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } - + return elems; } - + // Getting an attribute return length ? fn( elems[0], key ) : undefined; } @@ -909,7 +909,7 @@ function now() { // Fails in Internet Explorer try { delete script.test; - + } catch(e) { jQuery.support.deleteExpando = false; } @@ -950,20 +950,20 @@ function now() { // Technique from Juriy Zaytsev // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - var eventSupported = function( eventName ) { - var el = document.createElement("div"); - eventName = "on" + eventName; - - var isSupported = (eventName in el); - if ( !isSupported ) { - el.setAttribute(eventName, "return;"); - isSupported = typeof el[eventName] === "function"; - } - el = null; - - return isSupported; + var eventSupported = function( eventName ) { + var el = document.createElement("div"); + eventName = "on" + eventName; + + var isSupported = (eventName in el); + if ( !isSupported ) { + el.setAttribute(eventName, "return;"); + isSupported = typeof el[eventName] === "function"; + } + el = null; + + return isSupported; }; - + jQuery.support.submitBubbles = eventSupported("submit"); jQuery.support.changeBubbles = eventSupported("change"); @@ -987,7 +987,7 @@ var expando = "jQuery" + now(), uuid = 0, windowData = {}; jQuery.extend({ cache: {}, - + expando:expando, // The following elements throw uncatchable exceptions if you @@ -1014,7 +1014,7 @@ jQuery.extend({ } // Compute a unique ID for the element - if ( !id ) { + if ( !id ) { id = ++uuid; } @@ -1384,7 +1384,7 @@ jQuery.fn.extend({ if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { return elem.getAttribute("value") === null ? "on" : elem.value; } - + // Everything else, we just grab the value return (elem.value || "").replace(rreturn, ""); @@ -1445,7 +1445,7 @@ jQuery.extend({ height: true, offset: true }, - + attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { @@ -1474,7 +1474,7 @@ jQuery.extend({ var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; - + // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; @@ -1651,9 +1651,9 @@ jQuery.event = { } } } - - if ( special.add ) { - special.add.call( elem, handleObj ); + + if ( special.add ) { + special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; @@ -1720,7 +1720,7 @@ jQuery.event = { namespaces = type.split("."); type = namespaces.shift(); - namespace = new RegExp("(^|\\.)" + + namespace = new RegExp("(^|\\.)" + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)") } @@ -1873,7 +1873,7 @@ jQuery.event = { isClick = jQuery.nodeName(target, "a") && type === "click", special = jQuery.event.special[ type ] || {}; - if ( (!special._default || special._default.call( elem, event ) === false) && + if ( (!special._default || special._default.call( elem, event ) === false) && !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { try { @@ -1932,7 +1932,7 @@ jQuery.event = { event.handler = handleObj.handler; event.data = handleObj.data; event.handleObj = handleObj; - + var ret = handleObj.handler.apply( this, arguments ); if ( ret !== undefined ) { @@ -2026,13 +2026,13 @@ jQuery.event = { live: { add: function( handleObj ) { - jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); + jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); }, remove: function( handleObj ) { var remove = true, type = handleObj.origType.replace(rnamespaces, ""); - + jQuery.each( jQuery.data(this, "events").live || [], function() { if ( type === this.origType.replace(rnamespaces, "") ) { remove = false; @@ -2068,7 +2068,7 @@ jQuery.event = { var removeEvent = document.removeEventListener ? function( elem, type, handle ) { elem.removeEventListener( type, handle, false ); - } : + } : function( elem, type, handle ) { elem.detachEvent( "on" + type, handle ); }; @@ -2113,7 +2113,7 @@ jQuery.Event.prototype = { if ( !e ) { return; } - + // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); @@ -2205,7 +2205,7 @@ if ( !jQuery.support.submitBubbles ) { return trigger( "submit", this, arguments ); } }); - + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { var elem = e.target, type = elem.type; @@ -2267,7 +2267,7 @@ if ( !jQuery.support.changeBubbles ) { if ( e.type !== "focusout" || elem.type !== "radio" ) { jQuery.data( elem, "_change_data", val ); } - + if ( data === undefined || val === data ) { return; } @@ -2280,7 +2280,7 @@ if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { filters: { - focusout: testChange, + focusout: testChange, click: function( e ) { var elem = e.target, type = elem.type; @@ -2344,13 +2344,13 @@ if ( document.addEventListener ) { jQuery.event.special[ fix ] = { setup: function() { this.addEventListener( orig, handler, true ); - }, - teardown: function() { + }, + teardown: function() { this.removeEventListener( orig, handler, true ); } }; - function handler( e ) { + function handler( e ) { e = jQuery.event.fix( e ); e.type = fix; return jQuery.event.handle.call( this, e ); @@ -2367,7 +2367,7 @@ jQuery.each(["bind", "one"], function( i, name ) { } return this; } - + if ( jQuery.isFunction( data ) ) { fn = data; data = undefined; @@ -2407,20 +2407,20 @@ jQuery.fn.extend({ return this; }, - + delegate: function( selector, types, data, fn ) { return this.live( types, data, fn, selector ); }, - + undelegate: function( selector, types, fn ) { if ( arguments.length === 0 ) { return this.unbind( "live" ); - + } else { return this.die( types, null, fn, selector ); } }, - + trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); @@ -2520,7 +2520,7 @@ jQuery.each(["live", "die"], function( i, name ) { context.unbind( liveConvert( type, selector ), fn ); } } - + return this; } }); @@ -2651,20 +2651,20 @@ var Sizzle = function(selector, context, results, seed) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), soFar = selector; - + // Reset the position of the chunker regexp (start from head) while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -2685,7 +2685,7 @@ var Sizzle = function(selector, context, results, seed) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -2796,7 +2796,7 @@ Sizzle.find = function(expr, context, isXML){ for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice(1,1); @@ -3070,7 +3070,7 @@ var Expr = Sizzle.selectors = { }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -3096,7 +3096,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, POS: function(match){ @@ -3217,18 +3217,18 @@ var Expr = Sizzle.selectors = { case 'only': case 'first': while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case 'last': while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } return true; @@ -3238,20 +3238,20 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; @@ -3327,7 +3327,7 @@ var makeArray = function(array, results) { results.push.apply( results, array ); return results; } - + return array; }; @@ -3519,7 +3519,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function(query, context, extra, seed){ context = context || document; @@ -3530,7 +3530,7 @@ if ( document.querySelectorAll ) { return makeArray( context.querySelectorAll(query), extra ); } catch(e){} } - + return oldSizzle(query, context, extra, seed); }; @@ -3559,7 +3559,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -3647,7 +3647,7 @@ var contains = document.compareDocumentPosition ? function(a, b){ var isXML = function(elem){ // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; @@ -3763,7 +3763,7 @@ jQuery.fn.extend({ filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, - + is: function( selector ) { return !!selector && jQuery.filter( selector, this ).length > 0; }, @@ -3777,7 +3777,7 @@ jQuery.fn.extend({ selector = selectors[i]; if ( !matches[selector] ) { - matches[selector] = jQuery.expr.match.POS.test( selector ) ? + matches[selector] = jQuery.expr.match.POS.test( selector ) ? jQuery( selector, context || this.context ) : selector; } @@ -3799,7 +3799,7 @@ jQuery.fn.extend({ return ret; } - var pos = jQuery.expr.match.POS.test( selectors ) ? + var pos = jQuery.expr.match.POS.test( selectors ) ? jQuery( selectors, context || this.context ) : null; return this.map(function( i, cur ) { @@ -3812,7 +3812,7 @@ jQuery.fn.extend({ return null; }); }, - + // Determine the position of an element within // the matched set of elements index: function( elem ) { @@ -3893,7 +3893,7 @@ jQuery.each({ }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); - + if ( !runtil.test( name ) ) { selector = until; } @@ -3920,7 +3920,7 @@ jQuery.extend({ return jQuery.find.matches(expr, elems); }, - + dir: function( elem, dir, until ) { var matched = [], cur = elem[dir]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { @@ -4108,7 +4108,7 @@ jQuery.fn.extend({ return set; } }, - + // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { @@ -4123,7 +4123,7 @@ jQuery.fn.extend({ } } } - + return this; }, @@ -4139,7 +4139,7 @@ jQuery.fn.extend({ elem.removeChild( elem.firstChild ); } } - + return this; }, @@ -4286,9 +4286,9 @@ jQuery.fn.extend({ } else { results = buildFragment( args, this, scripts ); } - + fragment = results.fragment; - + if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { @@ -4393,18 +4393,18 @@ jQuery.each({ jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; - + if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; - + } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = (i > 0 ? this.clone(true) : this).get(); jQuery.fn[ original ].apply( jQuery(insert[i]), elems ); ret = ret.concat( elems ); } - + return this.pushStack( ret, name, insert.selector ); } }; @@ -4492,7 +4492,7 @@ jQuery.extend({ for ( var i = 0; ret[i]; i++ ) { if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); - + } else { if ( ret[i].nodeType === 1 ) { ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); @@ -4504,18 +4504,18 @@ jQuery.extend({ return ret; }, - + cleanData: function( elems ) { var data, id, cache = jQuery.cache, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; - + for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { id = elem[ jQuery.expando ]; - + if ( id ) { data = cache[ id ]; - + if ( data.events ) { for ( var type in data.events ) { if ( special[ type ] ) { @@ -4526,14 +4526,14 @@ jQuery.extend({ } } } - + if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } - + delete cache[ id ]; } } @@ -4566,7 +4566,7 @@ jQuery.fn.css = function( name, value ) { if ( value === undefined ) { return jQuery.curCSS( elem, name ); } - + if ( typeof value === "number" && !rexclude.test(name) ) { value += "px"; } @@ -4974,7 +4974,7 @@ jQuery.extend({ ajax: function( origSettings ) { var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings); - + var jsonp, status, data, callbackContext = origSettings && origSettings.context || s, type = s.type.toUpperCase(); @@ -5289,7 +5289,7 @@ jQuery.extend({ jQuery.event.trigger( "ajaxStop" ); } } - + function trigger(type, args) { (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args); } @@ -5377,19 +5377,19 @@ jQuery.extend({ // key/values into a query string param: function( a, traditional ) { var s = []; - + // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings.traditional; } - + // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray(a) || a.jquery ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); - + } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. @@ -5419,13 +5419,13 @@ jQuery.extend({ buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v ); } }); - + } else if ( !traditional && obj != null && typeof obj === "object" ) { // Serialize object item. jQuery.each( obj, function( k, v ) { buildParams( prefix + "[" + k + "]", v ); }); - + } else { // Serialize scalar item. add( prefix, obj ); @@ -5876,12 +5876,12 @@ jQuery.extend( jQuery.fx, { jQuery.fx.stop(); } }, - + stop: function() { clearInterval( timerId ); timerId = null; }, - + speeds: { slow: 600, fast: 200, @@ -5925,7 +5925,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0]; - if ( options ) { + if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); @@ -5951,7 +5951,7 @@ if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0]; - if ( options ) { + if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); @@ -6059,7 +6059,7 @@ jQuery.offset = { return { top: top, left: left }; }, - + setOffset: function( elem, options, i ) { // set position first, in-case top/left are set even on static elem if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) { @@ -6078,7 +6078,7 @@ jQuery.offset = { top: (options.top - curOffset.top) + curTop, left: (options.left - curOffset.left) + curLeft }; - + if ( "using" in options ) { options.using.call( elem, props ); } else { @@ -6138,7 +6138,7 @@ jQuery.each( ["Left", "Top"], function( i, name ) { jQuery.fn[ method ] = function(val) { var elem = this[0], win; - + if ( !elem ) { return null; } @@ -6202,7 +6202,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { if ( !elem ) { return size == null ? null : this; } - + if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); diff --git a/lib/jquery/jquery-1.6.js b/lib/jquery/jquery-1.6.js index 9a13ab9..61091a7 100644 --- a/lib/jquery/jquery-1.6.js +++ b/lib/jquery/jquery-1.6.js @@ -1893,11 +1893,11 @@ jQuery.fn.extend({ jQuery.removeAttr( this, name ); }); }, - + prop: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.prop ); }, - + removeProp: function( name ) { return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) @@ -2028,7 +2028,7 @@ jQuery.fn.extend({ val: function( value ) { var hooks, ret, elem = this[0]; - + if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; @@ -2155,16 +2155,16 @@ jQuery.extend({ height: true, offset: true }, - + attrFix: { // Always normalize to ensure hook usage tabindex: "tabIndex", readonly: "readOnly" }, - + attr: function( elem, name, value, pass ) { var nType = elem.nodeType; - + // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; @@ -2173,10 +2173,10 @@ jQuery.extend({ if ( pass && name in jQuery.attrFn ) { return jQuery( elem )[ name ]( value ); } - + var ret, hooks, notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - + // Normalize the name if needed name = notxml && jQuery.attrFix[ name ] || name; @@ -2223,11 +2223,11 @@ jQuery.extend({ } } }, - + removeAttr: function( elem, name ) { if ( elem.nodeType === 1 ) { name = jQuery.attrFix[ name ] || name; - + if ( jQuery.support.getSetAttribute ) { // Use removeAttribute in browsers that support it elem.removeAttribute( name ); @@ -2271,43 +2271,43 @@ jQuery.extend({ } } }, - + propFix: {}, - + prop: function( elem, name, value ) { var nType = elem.nodeType; - + // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return undefined; } - + var ret, hooks, notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - + // Try to normalize/fix the name name = notxml && jQuery.propFix[ name ] || name; - + hooks = jQuery.propHooks[ name ]; - + if ( value !== undefined ) { if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; - + } else { return (elem[ name ] = value); } - + } else { if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) { return ret; - + } else { return elem[ name ]; } } }, - + propHooks: {} }); @@ -2324,7 +2324,7 @@ if ( !jQuery.support.getSetAttribute ) { usemap: "useMap", frameborder: "frameBorder" }); - + // Use this for any attribute on a form in IE6/7 formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = { get: function( elem, name ) { @@ -2698,7 +2698,7 @@ jQuery.event = { } } }, - + // Events that are safe to short-circuit if no handlers are attached. // Native DOM events should not be added, they may have inline handlers. customEvent: { @@ -2744,7 +2744,7 @@ jQuery.event = { event.exclusive = exclusive; event.namespace = namespaces.join("."); event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)"); - + // triggerHandler() and global events don't bubble or run the default action if ( onlyHandlers || !elem ) { event.preventDefault(); @@ -2835,7 +2835,7 @@ jQuery.event = { jQuery.event.triggered = undefined; } } - + return event.result; }, @@ -3669,7 +3669,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3679,7 +3679,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3687,9 +3687,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3713,7 +3713,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3842,7 +3842,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -4174,7 +4174,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace( rBackslash, "" ); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -4208,7 +4208,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -4218,7 +4218,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -4231,14 +4231,14 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } - + return elem.selected === true; }, @@ -4260,7 +4260,7 @@ var Expr = Sizzle.selectors = { text: function( elem ) { var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); }, @@ -4375,21 +4375,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4402,22 +4402,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4436,7 +4436,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4502,7 +4502,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4749,7 +4749,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4758,24 +4758,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4788,12 +4788,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4831,7 +4831,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4858,7 +4858,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -4868,7 +4868,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { var ret = matches.call( node, expr ); @@ -4905,7 +4905,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -4956,7 +4956,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -5009,7 +5009,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5130,7 +5130,7 @@ jQuery.fn.extend({ closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; - + // Array if ( jQuery.isArray( selectors ) ) { var match, selector, @@ -5884,7 +5884,7 @@ jQuery.each({ function getAll( elem ) { if ( "getElementsByTagName" in elem ) { return elem.getElementsByTagName( "*" ); - + } else if ( "querySelectorAll" in elem ) { return elem.querySelectorAll( "*" );