Browse Source

Update to jquery-1.4.4 in benchmark aplication. Added to SampleModule a check of how jquery computes width and height to comparate with gquery.

tags/release-1.3.2
Manolo Carrasco 13 years ago
parent
commit
fea1ce68af

+ 18
- 2
samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java View File

@@ -24,6 +24,7 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.Selector;
import com.google.gwt.query.client.Selectors;
import com.google.gwt.user.client.Window;
public class GwtQuerySampleModule implements EntryPoint {
@@ -45,8 +46,23 @@ public class GwtQuerySampleModule implements EntryPoint {
);
// Cascade effects
$("<div id='id1'>content</div>").appendTo(document).hide().fadeIn(5000).fadeOut(3000);
$("<div id='id' style='font-size: 150%;'>Cascade Efects</div>").appendTo(document).hide().fadeIn(5000).fadeOut(3000);
int gqw = $(".outer").width();
String jqw = runJsCommand("$wnd.$('.outer').width()");
int gqh = $(".outer").height();
String jqh = runJsCommand("$wnd.$('.outer').height()");
String msg = ".outer size: GQuery: " + gqw + "x" + gqh + " jQuery: " + jqw + "x" + jqh;
Window.alert(msg);
}
private native String runJsCommand(String js) /*-{
try {
return "" + eval(js);
} catch (e) {
return "" + e;
}
}-*/;
}

+ 5
- 11
samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html View File

@@ -1,17 +1,11 @@
<html>
<head>
<title>GQuery Demo</title>
<script type="text/javascript">
function __gwtStatsEvent(evt) {
}
</script>
<script language="javascript"
src="gwtquery.samples.GwtQuerySample.nocache.js"></script>
<link href='gquery-star-ratings.css' type="text/css" rel="stylesheet"/>
<script src="js/jquery-1.4.4.js"></script>
<script language="javascript" src="gwtquery.samples.GwtQuerySample.nocache.js"></script>
</head>
<body>
<div class="outer">
<div class="outer" style='border: 4px solid red; padding: 25px; width: auto; height: 150px' >
<div>Foo <span class="note">bar</span> baz</div>
<div>Foo <span class="note">bar</span> <span class="xyz">baz</span></div>
<div>Foo <span class="note">bar</span> <span class="xyz">baz</span></div>
@@ -21,8 +15,8 @@
<div>Foo <span class="note">bar</span> <span class="xyz">baz</span></div>
<div>Foo <span class="note">bar</span> <span class="xyz">baz</span></div>
</div>
</body>
<script>
</script>
</html>

+ 1
- 1
samples/src/main/java/gwtquery/samples/public/html/iframebench.html View File

@@ -19,7 +19,7 @@
return DOMAssistant.$(sel).length;
}
</script>
<script language="javascript" src="../js/jquery-1.3.1.js"></script>
<script language="javascript" src="../js/jquery-1.4.4.js"></script>
<script type="text/javascript">
jQuery.noConflict()
window.parent.jquerybenchmark = function(sel) {

+ 1
- 1
samples/src/main/java/gwtquery/samples/public/html/jquerybench.html View File

@@ -1,7 +1,7 @@
<html>
<head>
<title>JQuery</title>
<script language="javascript" src="../js/jquery-1.3.1.js"></script>
<script language="javascript" src="../js/jquery-1.4.4.js"></script>
<script type="text/javascript">
window.parent.jquerybenchmark = function(sel) {
return $(sel).length;

+ 7179
- 0
samples/src/main/java/gwtquery/samples/public/js/jquery-1.4.4.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save