Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated to 1.6

  • Loading branch information...
commit 131cb2423f6d6c5062e968e1fb5b30de37634e48 1 parent cff12a4
scottjehl authored
Showing with 24 additions and 15 deletions.
  1. +24 −15 js/jquery.js
View
39 js/jquery.js
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.6rc1
+ * jQuery JavaScript Library v1.6
* http://jquery.com/
*
* Copyright 2011, John Resig
@@ -11,7 +11,7 @@
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
- * Date: Tue Apr 26 16:21:45 2011 -0400
+ * Date: Mon May 2 13:50:00 2011 -0400
*/
(function( window, undefined ) {
@@ -117,9 +117,10 @@ jQuery.fn = jQuery.prototype = {
// Handle HTML strings
if ( typeof selector === "string" ) {
// Are we dealing with HTML string or an ID?
- if ( selector.length > 1024 ) {
- // Assume very large strings are HTML and skip the regex check
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
+
} else {
match = quickExpr.exec( selector );
}
@@ -203,7 +204,7 @@ jQuery.fn = jQuery.prototype = {
selector: "",
// The current version of jQuery being used
- jquery: "1.6rc1",
+ jquery: "1.6",
// The default length of a jQuery object is 0
length: 0,
@@ -740,7 +741,7 @@ jQuery.extend({
i = 0,
length = elems.length,
// jquery objects are treated as arrays
- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || jQuery.isArray( elems ) ) ;
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
// Go through the array, translating each of the items to their
if ( isArray ) {
@@ -1275,7 +1276,9 @@ jQuery.support = (function() {
width: 0,
height: 0,
border: 0,
- margin: 0
+ margin: 0,
+ // Set background to avoid IE crashes when removing (#9028)
+ background: "none"
};
for ( i in bodyStyle ) {
body.style[ i ] = bodyStyle[ i ];
@@ -1340,6 +1343,7 @@ jQuery.support = (function() {
}
// Remove the body element we added
+ body.innerHTML = "";
document.documentElement.removeChild( body );
// Technique from Juriy Zaytsev
@@ -1870,12 +1874,13 @@ jQuery.fn.extend({
var rclass = /[\n\t\r]/g,
- rspaces = /\s+/,
+ rspace = /\s+/,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rspecial = /^(?:data-|aria-)/,
+ rinvalidChar = /\:/,
formHook;
jQuery.fn.extend({
@@ -1912,7 +1917,7 @@ jQuery.fn.extend({
}
if ( value && typeof value === "string" ) {
- var classNames = (value || "").split( rspaces );
+ var classNames = (value || "").split( rspace );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
@@ -1948,7 +1953,7 @@ jQuery.fn.extend({
}
if ( (value && typeof value === "string") || value === undefined ) {
- var classNames = (value || "").split( rspaces );
+ var classNames = (value || "").split( rspace );
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
@@ -1989,7 +1994,7 @@ jQuery.fn.extend({
i = 0,
self = jQuery( this ),
state = stateVal,
- classNames = value.split( rspaces );
+ classNames = value.split( rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
@@ -2177,7 +2182,10 @@ jQuery.extend({
// Get the appropriate hook, or the formHook
// if getSetAttribute is not supported and we have form objects in IE6/7
- hooks = jQuery.attrHooks[ name ] || ( jQuery.nodeName( elem, "form" ) && formHook );
+ hooks = jQuery.attrHooks[ name ] ||
+ ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ?
+ formHook :
+ undefined );
if ( value !== undefined ) {
@@ -2320,10 +2328,11 @@ if ( !jQuery.support.getSetAttribute ) {
// 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 ) {
+ var ret;
if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
return elem.getAttribute( name );
}
- var ret = elem.getAttributeNode( name );
+ ret = elem.getAttributeNode( name );
// Return undefined if not specified instead of empty string
return ret && ret.specified ?
ret.nodeValue :
@@ -2427,7 +2436,7 @@ var hasOwn = Object.prototype.hasOwnProperty,
rnamespaces = /\.(.*)$/,
rformElems = /^(?:textarea|input|select)$/i,
rperiod = /\./g,
- rspace = / /g,
+ rspaces = / /g,
rescape = /[^\w\s.|`]/g,
fcleanup = function( nm ) {
return nm.replace(rescape, "\\$&");
@@ -3600,7 +3609,7 @@ function liveHandler( event ) {
}
function liveConvert( type, selector ) {
- return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
+ return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
Please sign in to comment.
Something went wrong with that request. Please try again.