git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bring jQuery('#id') and jQuery('body') logic back into core (while leaving it in...
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
fbf6491
..
6d333c5
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-19,12
+19,8
@@
var jQuery = function( selector, context ) {
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
// (both of which we optimize for)
quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/,
-
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
// Check if a string has a non-whitespace character in it
rnotwhite = /\S/,
- rwhite = /\s/,
// Used for trimming whitespace
trimLeft = /^\s+/,
// Used for trimming whitespace
trimLeft = /^\s+/,
@@
-138,7
+134,7
@@
jQuery.fn = jQuery.prototype = {
}
return jQuery.merge( this, selector );
}
return jQuery.merge( this, selector );
-
+
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
// HANDLE: $("#id")
} else {
elem = document.getElementById( match[2] );
@@
-162,13
+158,6
@@
jQuery.fn = jQuery.prototype = {
return this;
}
return this;
}
- // HANDLE: $("TAG")
- } else if ( !context && !rnonword.test( selector ) ) {
- this.selector = selector;
- this.context = document;
- selector = document.getElementsByTagName( selector );
- return jQuery.merge( this, selector );
-
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
@@
-583,7
+572,7
@@
jQuery.extend({
script.type = "text/javascript";
script.type = "text/javascript";
- if ( jQuery.support.scriptEval ) {
+ if ( jQuery.support.scriptEval() ) {
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
script.appendChild( document.createTextNode( data ) );
} else {
script.text = data;
@@
-1039,9
+1028,8
@@
if ( indexOf ) {
};
}
};
}
-// Verify that \s matches non-breaking spaces
-// (IE fails on this test)
-if ( !rwhite.test( "\xA0" ) ) {
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}