Made it so that you no longer need to build jQuery in order to run the test suite (but you'll still need a checkout of QUnit and Sizzle, at least).
This commit is contained in:
parent
ba8938d444
commit
8effe3a7de
14 changed files with 141 additions and 115 deletions
87
src/core.js
87
src/core.js
|
@ -1,3 +1,5 @@
|
|||
(function() {
|
||||
|
||||
// Define a local copy of jQuery
|
||||
var jQuery = function( selector, context ) {
|
||||
// The jQuery object is actually just the init constructor 'enhanced'
|
||||
|
@ -11,7 +13,7 @@ var jQuery = function( selector, context ) {
|
|||
_$ = window.$,
|
||||
|
||||
// Use the correct document accordingly with window argument (sandbox)
|
||||
document = window.document,
|
||||
//document = window.document,
|
||||
|
||||
// A central reference to the root jQuery(document)
|
||||
rootjQuery,
|
||||
|
@ -699,6 +701,39 @@ jQuery.extend({
|
|||
return proxy;
|
||||
},
|
||||
|
||||
// Mutifunctional method to get and set values to a collection
|
||||
// The value/s can be optionally by executed if its a function
|
||||
access: function( elems, key, value, exec, fn, pass ) {
|
||||
var length = elems.length;
|
||||
|
||||
// Setting many attributes
|
||||
if ( typeof key === "object" ) {
|
||||
for ( var k in key ) {
|
||||
jQuery.access( elems, k, key[k], exec, fn, value );
|
||||
}
|
||||
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;
|
||||
},
|
||||
|
||||
now: function() {
|
||||
return (new Date()).getTime();
|
||||
},
|
||||
|
||||
// Use of jQuery.browser is frowned upon.
|
||||
// More details: http://docs.jquery.com/Utilities/jQuery.browser
|
||||
uaMatch: function( ua ) {
|
||||
|
@ -779,51 +814,7 @@ function doScrollCheck() {
|
|||
jQuery.ready();
|
||||
}
|
||||
|
||||
function evalScript( i, elem ) {
|
||||
if ( elem.src ) {
|
||||
jQuery.ajax({
|
||||
url: elem.src,
|
||||
async: false,
|
||||
dataType: "script"
|
||||
});
|
||||
} else {
|
||||
jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
|
||||
}
|
||||
// Expose jQuery to the global object
|
||||
window.jQuery = window.$ = jQuery;
|
||||
|
||||
if ( elem.parentNode ) {
|
||||
elem.parentNode.removeChild( elem );
|
||||
}
|
||||
}
|
||||
|
||||
// Mutifunctional method to get and set values to a collection
|
||||
// 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 ) {
|
||||
access( elems, k, key[k], exec, fn, value );
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
function now() {
|
||||
return (new Date()).getTime();
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue