diff options
author | Manolo Carrasco <manolo@apache.org> | 2011-01-17 09:06:04 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2011-01-17 09:06:04 +0000 |
commit | e4ba7e79c6d782e92de9e03e09d191c24188dc2a (patch) | |
tree | 9480a3ef604b01fc1b1317dd8173c5dbf932b343 /samples | |
parent | 9620a44bb2c081e09498ae7688620c7de7af7128 (diff) | |
download | gwtquery-e4ba7e79c6d782e92de9e03e09d191c24188dc2a.tar.gz gwtquery-e4ba7e79c6d782e92de9e03e09d191c24188dc2a.zip |
- Added QueryMin module thought to produce small javascript code although it increases number of permutations.
- Removed plugins module since it is a new project.
- Added some missing methods in GQuery: first, last, map.
- Updated gwt version to 2.1.1
- Adding lazy interface to Widgets plugin.
Diffstat (limited to 'samples')
13 files changed, 133 insertions, 32 deletions
diff --git a/samples/pom.xml b/samples/pom.xml index b96192ee..376724dd 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.google.gwt</groupId> + <groupId>com.googlecode.gwtquery</groupId> <artifactId>gwtquery-project</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> @@ -19,14 +19,21 @@ <type>jar</type> <scope>provided</scope> </dependency> - <dependency> - <groupId>${groupId}</groupId> - <artifactId>gwtquery-plugins</artifactId> - <version>${version}</version> - <type>jar</type> + <groupId>com.google.gwt</groupId> + <artifactId>gwt-user</artifactId> + <version>${gwtversion}</version> <scope>provided</scope> </dependency> + + +<!-- <dependency>--> +<!-- <groupId>${groupId}</groupId>--> +<!-- <artifactId>gwtquery-plugins</artifactId>--> +<!-- <version>${version}</version>--> +<!-- <type>jar</type>--> +<!-- <scope>provided</scope>--> +<!-- </dependency>--> </dependencies> <build> <plugins> @@ -37,14 +44,15 @@ <logLevel>${gwt.loglevel}</logLevel> <style>${gwt.outputstyle}</style> <gwtVersion>${gwtversion}</gwtVersion> - <soyc>false</soyc> + <compileReport>true</compileReport> <modules> + <module>gwtquery.samples.GwtQueryDemo</module> <module>gwtquery.samples.GwtQueryEffects</module> + <module>gwtquery.samples.GwtQueryEffectsMin</module> <module>gwtquery.samples.GwtQuerySample</module> <module>gwtquery.samples.GwtQueryBench</module> - <module>gwtquery.samples.GwtQueryDemo</module> <module>gwtquery.samples.GwtQueryWidgets</module> - <module>gwtquery.samples.GwtQueryImageZoom</module> + <module>gwtquery.samples.GwtQueryImageZoom</module> </modules> </configuration> <executions> @@ -63,6 +71,7 @@ <fileset><directory>src/main/webapp/gwtquery.samples.GwtQueryBench</directory></fileset> <fileset><directory>src/main/webapp/gwtquery.samples.GwtQueryDemo</directory></fileset> <fileset><directory>src/main/webapp/gwtquery.samples.GwtQueryEffects</directory></fileset> + <fileset><directory>src/main/webapp/gwtquery.samples.GwtQueryEffectsMin</directory></fileset> <fileset><directory>src/main/webapp/gwtquery.samples.GwtQueryPlugin</directory></fileset> <fileset><directory>src/main/webapp/gwtquery.samples.GwtQuerySample</directory></fileset> <fileset><directory>src/main/webapp/gwtquery.samples.GwtQueryWidgets</directory></fileset> @@ -75,6 +84,27 @@ </filesets> </configuration> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-eclipse-plugin</artifactId> + <configuration> + <downloadSources>true</downloadSources> + <downloadJavadocs>true</downloadJavadocs> + <additionalBuildcommands> + <buildCommand> + <name> + com.google.gwt.eclipse.core.gwtProjectValidator + </name> + </buildCommand> + </additionalBuildcommands> + <additionalProjectnatures> + <projectnature>com.google.gwt.eclipse.core.gwtNature + </projectnature> + </additionalProjectnatures> + </configuration> + </plugin> + </plugins> </build> diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml index 66ea7a44..921732a7 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml @@ -1,6 +1,5 @@ <module> <inherits name='com.google.gwt.query.Query'/> - <inherits name='gwtquery.Plugins'/> <entry-point class='gwtquery.samples.client.GwtQueryBenchModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml index e367b228..d4456538 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml @@ -1,6 +1,5 @@ <module> <inherits name='com.google.gwt.query.Query'/> - <inherits name='gwtquery.Plugins'/> <entry-point class='gwtquery.samples.client.GwtQueryDemoModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryEffects.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryEffects.gwt.xml index 0ce4dcad..39578f05 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryEffects.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryEffects.gwt.xml @@ -1,6 +1,5 @@ <module> <inherits name='com.google.gwt.query.Query'/> - <inherits name='gwtquery.Plugins'/> <entry-point class='gwtquery.samples.client.GwtQueryEffectsModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryEffectsMin.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryEffectsMin.gwt.xml new file mode 100644 index 00000000..ee40909c --- /dev/null +++ b/samples/src/main/java/gwtquery/samples/GwtQueryEffectsMin.gwt.xml @@ -0,0 +1,5 @@ +<module> + <inherits name='com.google.gwt.query.QueryMin'/> + <entry-point class='gwtquery.samples.client.GwtQueryEffectsModule'/> +</module> + diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryImageZoom.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryImageZoom.gwt.xml index 233f3321..7fe8b07d 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryImageZoom.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryImageZoom.gwt.xml @@ -1,6 +1,5 @@ <module> <inherits name='com.google.gwt.query.Query'/> - <inherits name='gwtquery.Plugins'/> <entry-point class='gwtquery.samples.client.GwtQueryImageZoom'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml index 344d7a6b..af51bf7d 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml @@ -1,7 +1,5 @@ <module> <inherits name='com.google.gwt.query.Query'/> - <inherits name='gwtquery.Plugins'/> -<!-- <set-property name="user.agent" value="gecko1_8"/>--> <entry-point class='gwtquery.samples.client.GwtQuerySampleModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml index d9d0673c..ea6ddd04 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml @@ -1,6 +1,5 @@ <module> <inherits name='com.google.gwt.query.Query'/> - <inherits name='gwtquery.Plugins'/> <entry-point class='gwtquery.samples.client.GwtQueryWidgetModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java index 7f00702f..a692e076 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java @@ -13,13 +13,13 @@ import com.google.gwt.query.client.Function; import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.impl.SelectorEngineCssToXPath;
import com.google.gwt.query.client.impl.SelectorEngineImpl;
-import com.google.gwt.query.client.impl.SelectorEngineJS;
import com.google.gwt.query.client.impl.SelectorEngineNative;
import com.google.gwt.query.client.impl.SelectorEngineNativeIE8;
import com.google.gwt.query.client.impl.SelectorEngineSizzle;
-import com.google.gwt.query.client.impl.SelectorEngineSizzleGwt;
import com.google.gwt.query.client.impl.SelectorEngineSizzleIE;
-import com.google.gwt.query.client.impl.SelectorEngineXPath;
+import com.google.gwt.query.client.impl.research.SelectorEngineJS;
+import com.google.gwt.query.client.impl.research.SelectorEngineSizzleGwt;
+import com.google.gwt.query.client.impl.research.SelectorEngineXPath;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.IncrementalCommand;
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java index b0df016c..a3b5f955 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java @@ -1,30 +1,39 @@ package gwtquery.samples.client;
+import static com.google.gwt.query.client.GQuery.$;
+
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.query.client.Function;
-import static com.google.gwt.query.client.GQuery.$;
+import com.google.gwt.query.client.GQuery;
+import com.google.gwt.query.client.plugins.Widgets;
+import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
-
-import static gwtquery.plugins.widgets.Widgets.Widgets;
+import com.google.gwt.user.client.ui.Button;
public class GwtQueryWidgetModule implements EntryPoint {
public void onModuleLoad() {
-
- $(".outer").eq(0).after("<button id='enhance'>Enhance</button>");
- $("#enhance").one(Event.ONCLICK, null, new Function() {
- @Override
+ $("<button>Enhance</button>").appendTo(".outer").one(Event.ONCLICK, null, new Function() {
public boolean f(Event e) {
- $(".btn:nth-child(odd)").as(Widgets).button().label("Foo")
- .addClickHandler(new ClickHandler() {
+ $(".btn:nth-child(odd)").each(new Function(){
+ public void f(Element el) {
+ // Replace odd labels by a button
+ GQuery g = $("<button/>");
+ $(el).hide().after(g);
+
+ // Use the Widgets plugin to convert the button element to a button.
+ Button b = g.as(Widgets.Widgets).widget();
+ b.setText("Foo");
+ b.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
Window.alert("You Clicked the Button");
}
- }).end();
-
+ });
+ }
+ });
return true;
}
});
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQueryEffectsMin.html b/samples/src/main/java/gwtquery/samples/public/GwtQueryEffectsMin.html new file mode 100644 index 00000000..07736bc1 --- /dev/null +++ b/samples/src/main/java/gwtquery/samples/public/GwtQueryEffectsMin.html @@ -0,0 +1,65 @@ +<!--<!doctype html>-->
+
+<html>
+<head>
+ <title>GQuery Demo</title>
+ <script language="javascript"
+ src="gwtquery.samples.GwtQueryEffectsMin.nocache.js"></script>
+ <style type="text/css">
+ .box {
+ border-style: groove;
+ border-color: green;
+ border-width: 5px;
+ }
+ .a {
+ border-style: solid;
+ border-color: black;
+ border-width: 7px;
+ background: pink;
+ width: 50%;
+ padding: 10px;
+ display: none;
+ }
+ </style>
+</head>
+<body>
+<div class="outer">
+ <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>
+ <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>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>Foo <span class="note">bar</span> <span class="xyz">baz</span></div>
+</div>
+<br/>
+<button id="b0">Animate me</button><br/>
+<button id="b1">Toggle Animate effects</button>
+<button id="b2">Toggle Clip effects</button>
+<br/>
+<br/>
+<div class="a">
+<span id="i1" class="box">Span 1</span>
+<span id="i2" class="box">Span 2</span>
+<span id="i3" class="box">Span 3</span>
+</div>
+<br/>
+<div class="b">
+<div class="box">Div 1</div>
+<div class="box">Div 2</div>
+<div class="box">Div 3</div>
+<div class="box">Div 4</div>
+</div>
+
+<script src="jquery-1.3.1.js"></script>
+<script>
+// $("#b1").click(function(){
+// $("#i1").animate(({width: '70%', opacity: '0.4', marginLeft: '0.6in', fontSize: '3em', borderWidth: '10px'}));
+// });
+</script>
+
+
+</body>
+</html>
+
\ No newline at end of file diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html b/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html index d47bca9e..a414cf94 100644 --- a/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html +++ b/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html @@ -3,8 +3,6 @@ <title>GQuery Demo</title>
<script language="javascript"
src="gwtquery.samples.GwtQueryWidgets.nocache.js"></script>
- <link href='gquery-star-ratings.css' type="text/css" rel="stylesheet"/>
-
</head>
<body>
<div class="outer">
diff --git a/samples/src/main/webapp/index.html b/samples/src/main/webapp/index.html index 4c3285cb..03f17029 100644 --- a/samples/src/main/webapp/index.html +++ b/samples/src/main/webapp/index.html @@ -14,6 +14,7 @@ <li><a href="javascript:goTo('gwtquery.samples.GwtQuerySample/GwtQuerySample.html')">gwtquery.samples.GwtQuerySample/GwtQuerySample.html</a></li> <li><a href="javascript:goTo('gwtquery.samples.GwtQueryDemo/GwtQueryDemo.html')">gwtquery.samples.GwtQueryDemo/GwtQueryDemo.html</a></li> <li><a href="javascript:goTo('gwtquery.samples.GwtQueryEffects/GwtQueryEffects.html')">gwtquery.samples.GwtQueryEffects/GwtQueryEffects.html</a></li> +<li><a href="javascript:goTo('gwtquery.samples.GwtQueryEffectsMin/GwtQueryEffectsMin.html')">gwtquery.samples.GwtQueryEffects/GwtQueryEffectsMin.html</a></li> <li><a href="javascript:goTo('gwtquery.samples.GwtQueryWidgets/GwtQueryWidgets.html')">gwtquery.samples.GwtQueryWidgets/GwtQueryWidgets.html</a></li> <li><a href="javascript:goTo('gwtquery.samples.GwtQueryBench/GwtQueryBench.html')">gwtquery.samples.GwtQueryBench/GwtQueryBench.html</a></li> <li><a href="javascript:goTo('gwtquery.samples.GwtQueryImageZoom/GwtQueryImageZoom.html')">gwtquery.samples.GwtQueryImageZomm/GwtQueryImageZoom.html</a></li> |