Fixed the build/speed testing application to work with current versions of jQuery. The main changes were implementing :has() where necessary to replace functionality that no longer existed and to use noConflict() so the libraries wouldn't have to be modified for the speed testing.

So now the file jquery-basis.js will be tested against the jquery.js in the /dist directory. Version 1.2.1 is currently in jquery-basis.js.
This commit is contained in:
David Serduke 2007-12-05 17:33:49 +00:00
parent 2da897db84
commit b0b5fa74b6
5 changed files with 5998 additions and 2255 deletions

View file

@ -20,8 +20,8 @@
jQuery(this).parent().children("*:gt(1)").remove(); jQuery(this).parent().children("*:gt(1)").remove();
} catch(e) { } } catch(e) { }
}) })
var times = 5; // set # times to run the test in index.html
jQuery("#times").html(times); var times = parseInt(jQuery("#times").val());
jQuery.benchmarker.startingList = this.get(); jQuery.benchmarker.startingList = this.get();
benchmark(this.get(), times, jQuery.benchmarker.libraries); benchmark(this.get(), times, jQuery.benchmarker.libraries);
} }
@ -33,10 +33,10 @@
jQuery("tbody tr:first-child").remove(); jQuery("tbody tr:first-child").remove();
jQuery("td.test").before("<td><input type='checkbox' checked='checked' /></td>"); jQuery("td.test").before("<td><input type='checkbox' checked='checked' /></td>");
jQuery("button.runTests").bind("click", function() { jQuery("button.runTests").bind("click", function() {
jQuery('td[input:checked] + td.test').benchmark(); jQuery('td:has(input:checked) + td.test').benchmark();
}); });
jQuery("button.retryTies").bind("click", function() { jQuery("tr[td.tie] td.test").benchmark() }) jQuery("button.retryTies").bind("click", function() { jQuery("tr:has(td.tie) td.test").benchmark() })
jQuery("button.selectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = true }) }) jQuery("button.selectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = true }) })
jQuery("button.deselectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = false }) }) jQuery("button.deselectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = false }) })
@ -52,8 +52,9 @@
}) })
}) })
var headers = jQuery.map(jQuery.benchmarker.libraries, function(i) { var headers = jQuery.map(jQuery.benchmarker.libraries, function(i,n) {
return "<th>" + i + "</th>" var extra = n == 0 ? "basis - " : "";
return "<th>" + extra + i + "</th>"
}).join(""); }).join("");
jQuery("thead tr").append(headers); jQuery("thead tr").append(headers);

View file

@ -5,8 +5,11 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Speed Test</title> <title>Speed Test</title>
<script src="../dist/jquery.js" type="text/javascript"></script> <script src="jquery-basis.js" type="text/javascript"></script>
<script src="jquery-1.1.2.js" type="text/javascript"></script> <script src="../../dist/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
<link rel="stylesheet" href="benchmarker.css" type="text/css" media="screen" /> <link rel="stylesheet" href="benchmarker.css" type="text/css" media="screen" />
</head> </head>
@ -15,7 +18,7 @@
<h1>Speed Test</h1> <h1>Speed Test</h1>
<div id="badid"></div> <div id="badid"></div>
<div id="time-test"> <div id="time-test">
<p>Using the following selector expressions (<span id="times">5</span> times each):</p> <p>Using the following selector expressions (<input type="text" id="times" maxlength="5" size="5" value="20"/> times each):</p>
<p>NOTE: Number shown is an average.</p> <p>NOTE: Number shown is an average.</p>
<div class="buttons"> <div class="buttons">
<button class="selectAll">Select All</button> <button class="selectAll">Select All</button>
@ -502,7 +505,7 @@
</div> </div>
</div> </div>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
jQuery.benchmarker = {libraries: ["jQOld", "jQuery"]}; jQuery.benchmarker = {libraries: ["$", "jQuery"]};
</script> </script>
<script src="benchmarker.js"></script> <script src="benchmarker.js"></script>

File diff suppressed because it is too large Load diff

2992
build/speed/jquery-1.2.1.js vendored Normal file

File diff suppressed because it is too large Load diff

2992
build/speed/jquery-basis.js vendored Normal file

File diff suppressed because it is too large Load diff