-var jsc = now(),
+var jsc = jQuery.now(),
rscript = /<script(.|\s)*?\/script>/gi,
rselectTextarea = /select|textarea/i,
rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
}
if ( s.cache === false && type === "GET" ) {
- var ts = now();
+ var ts = jQuery.now();
// try replacing _= if it is there
var ret = s.url.replace(rts, "$1_=" + ts + "$2");
jQuery.fn.extend({
attr: function( name, value ) {
- return access( this, name, value, true, jQuery.attr );
+ return jQuery.access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name, fn ) {
+(function() {
+
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
_$ = 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,
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 ) {
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 || "" );
- }
-
- 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;
-}
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
-function now() {
- return (new Date()).getTime();
-}
+})();
};
jQuery.fn.css = function( name, value ) {
- return access( this, name, value, true, function( elem, name, value ) {
+ return jQuery.access( this, name, value, true, function( elem, name, value ) {
if ( value === undefined ) {
return jQuery.curCSS( elem, name );
}
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
+var expando = "jQuery" + jQuery.now(), uuid = 0, windowData = {};
jQuery.extend({
cache: {},
// Start an animation from one number to another
custom: function( from, to, unit ) {
- this.startTime = now();
+ this.startTime = jQuery.now();
this.start = from;
this.end = to;
this.unit = unit || this.unit || "px";
// Each step of an animation
step: function( gotoEnd ) {
- var t = now(), done = true;
+ var t = jQuery.now(), done = true;
if ( gotoEnd || t >= this.options.duration + this.startTime ) {
this.now = this.end;
// timeStamp is buggy for some events on Firefox(#3843)
// So we won't rely on the native value
- this.timeStamp = now();
+ this.timeStamp = jQuery.now();
// Mark it as fixed
this[ expando ] = true;
}
}
});
+
+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 || "" );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+}
\ No newline at end of file
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
})(window);
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = getText;
-jQuery.isXMLDoc = isXML;
-jQuery.contains = contains;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
var root = document.documentElement,
script = document.createElement("script"),
div = document.createElement("div"),
- id = "script" + now();
+ id = "script" + jQuery.now();
div.style.display = "none";
div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/;
-
-// Implement the identical functionality for filter and not
-var winnow = function( elements, qualifier, keep ) {
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- var retVal = !!qualifier.call( elem, i, elem );
- return retVal === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return (elem === qualifier) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, filtered );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
- });
-};
+ rmultiselector = /,/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ slice = Array.prototype.slice;
jQuery.fn.extend({
find: function( selector ) {
return r;
}
});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return (elem === qualifier) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
+ });
+};
\ No newline at end of file
p.instructions { position: absolute; bottom: 0; }
#positionTest { position: absolute; }
</style>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
</body>
-</html>
\ No newline at end of file
+</html>
body { margin: 1px; padding: 5px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
- <script type="text/javascript" src="../../../dist/jquery.js"></script>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$('body').click(function() {
#forceScroll { width: 5000px; height: 5000px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
- <script type="text/javascript" src="../../../dist/jquery.js"></script>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
window.scrollTo(1000,1000);
#relative-2 { top: 20px; left: 20px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
- <script type="text/javascript" src="../../../dist/jquery.js"></script>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$('.relative').click(function() {
#forceScroll { width: 5000px; height: 5000px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
- <script type="text/javascript" src="../../../dist/jquery.js"></script>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
window.scrollTo(1000,1000);
#static-2 { top: 20px; left: 20px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
- <script type="text/javascript" src="../../../dist/jquery.js"></script>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$('.static').click(function() {
th, td { border: 1px solid #000; width: 100px; height: 100px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
- <script type="text/javascript" src="../../../dist/jquery.js"></script>
+ <script src="../../../src/core.js"></script>
+ <script src="../../../src/support.js"></script>
+ <script src="../../../src/sizzle/sizzle.js"></script>
+ <script src="../../../src/sizzle-jquery.js"></script>
+ <script src="../../../src/traversing.js"></script>
+ <script src="../../../src/data.js"></script>
+ <script src="../../../src/event.js"></script>
+ <script src="../../../src/css.js"></script>
+ <script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
$('table, th, td').click(function() {
jQuery.noConflict(); // Allow the test to run with other libs or jQuery's.
+
+// load testswarm agent
+(function() {
+ var url = window.location.search;
+ url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) );
+ if ( !url || url.indexOf("http") !== 0 ) {
+ return;
+ }
+ document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
+})();
<link rel="Stylesheet" media="screen" href="qunit/qunit/qunit.css" />
<link rel="Stylesheet" media="screen" href="data/testsuite.css" />
<!-- Includes -->
- <script type="text/javascript" src="data/testinit.js"></script>
- <script type="text/javascript" src="../dist/jquery.js"></script>
- <script type="text/javascript" src="qunit/qunit/qunit.js"></script>
- <script type="text/javascript" src="data/testrunner.js"></script>
- <script type="text/javascript" src="unit/core.js"></script>
- <script type="text/javascript" src="unit/data.js"></script>
- <script type="text/javascript" src="unit/queue.js"></script>
- <script type="text/javascript" src="unit/attributes.js"></script>
- <script type="text/javascript" src="unit/css.js"></script>
- <script type="text/javascript" src="unit/traversing.js"></script>
- <script type="text/javascript" src="unit/manipulation.js"></script>
- <script type="text/javascript" src="unit/dimensions.js"></script>
- <script type="text/javascript" src="unit/selector.js"></script>
- <script type="text/javascript" src="unit/event.js"></script>
- <script type="text/javascript" src="unit/ajax.js"></script>
- <script type="text/javascript" src="unit/effects.js"></script>
- <script type="text/javascript" src="unit/offset.js"></script>
+ <script src="data/testinit.js"></script>
+
+ <script src="../src/core.js"></script>
+ <script src="../src/support.js"></script>
+ <script src="../src/data.js"></script>
+ <script src="../src/queue.js"></script>
+ <script src="../src/attributes.js"></script>
+ <script src="../src/event.js"></script>
+ <script src="../src/sizzle/sizzle.js"></script>
+ <script src="../src/sizzle-jquery.js"></script>
+ <script src="../src/traversing.js"></script>
+ <script src="../src/manipulation.js"></script>
+ <script src="../src/css.js"></script>
+ <script src="../src/ajax.js"></script>
+ <script src="../src/effects.js"></script>
+ <script src="../src/offset.js"></script>
+ <script src="../src/dimensions.js"></script>
+
+ <script src="qunit/qunit/qunit.js"></script>
+ <script src="data/testrunner.js"></script>
+
+ <script src="unit/core.js"></script>
+ <script src="unit/data.js"></script>
+ <script src="unit/queue.js"></script>
+ <script src="unit/attributes.js"></script>
+ <script src="unit/event.js"></script>
+ <script src="unit/selector.js"></script>
+ <script src="unit/traversing.js"></script>
+ <script src="unit/manipulation.js"></script>
+ <script src="unit/css.js"></script>
+ <script src="unit/ajax.js"></script>
+ <script src="unit/effects.js"></script>
+ <script src="unit/offset.js"></script>
+ <script src="unit/dimensions.js"></script>
</head>
<body id="body">
var count = 0;
function plus(){ if ( ++count == 4 ) start(); }
- var base = window.location.href.replace(/\?.*$/, "");
+ var base = window.location.href.replace(/[^\/]*$/, "");
stop();
test("jQuery.ajax() - script, Remote", function() {
expect(2);
- var base = window.location.href.replace(/\?.*$/, "");
+ var base = window.location.href.replace(/[^\/]*$/, "");
stop();
test("jQuery.ajax() - script, Remote with POST", function() {
expect(3);
- var base = window.location.href.replace(/\?.*$/, "");
+ var base = window.location.href.replace(/[^\/]*$/, "");
stop();
test("jQuery.ajax() - script, Remote with scheme-less URL", function() {
expect(2);
- var base = window.location.href.replace(/\?.*$/, "");
+ var base = window.location.href.replace(/[^\/]*$/, "");
base = base.replace(/^.*?\/\//, "//");
stop();
test("jQuery.getJSON(String, Function) - JSON object with absolute url to local content", function() {
expect(2);
- var base = window.location.href.replace(/\?.*$/, "");
+ var base = window.location.href.replace(/[^\/]*$/, "");
stop();
jQuery.getJSON(url(base + "data/json.php"), function(json) {
});
div.addClass(function(i, val) {
- equals( val, old[i], "Make sure the incoming value is correct." );
- return "test";
+ if ( this.id !== "_firebugConsole" ) {
+ equals( val, old[i], "Make sure the incoming value is correct." );
+ return "test";
+ }
});
var pass = true;
});
$divs.removeClass(function(i, val) {
- equals( val, old[i], "Make sure the incoming value is correct." );
- return "test";
+ if ( this.id !== "_firebugConsole" ) {
+ equals( val, old[i], "Make sure the incoming value is correct." );
+ return "test";
+ }
});
ok( !$divs.is('.test'), "Remove Class" );
$div.css({ display: "", border: "", padding: "" });
- jQuery("#nothiddendivchild").css({ padding: "3px", border: "2px solid #fff" });
+ jQuery("#nothiddendivchild").css({ width: 20, padding: "3px", border: "2px solid #fff" });
equals(jQuery("#nothiddendivchild").width(), 20, "Test child width with border and padding");
jQuery("#nothiddendiv, #nothiddendivchild").css({ border: "", padding: "", width: "" });