From da588e2f8245049590daf6f3025e6aa7e2086b9d Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Thu, 28 Apr 2011 16:30:19 +0000 Subject: proposal for home page sample --- .../java/gwtquery/samples/HomePageSample.gwt.xml | 7 +++ .../gwtquery/samples/client/HomePageSample.java | 47 +++++++++++++++++++ .../gwtquery/samples/public/HomePageSample.html | 54 ++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 samples/src/main/java/gwtquery/samples/HomePageSample.gwt.xml create mode 100644 samples/src/main/java/gwtquery/samples/client/HomePageSample.java create mode 100644 samples/src/main/java/gwtquery/samples/public/HomePageSample.html (limited to 'samples/src/main/java') diff --git a/samples/src/main/java/gwtquery/samples/HomePageSample.gwt.xml b/samples/src/main/java/gwtquery/samples/HomePageSample.gwt.xml new file mode 100644 index 00000000..429b0f07 --- /dev/null +++ b/samples/src/main/java/gwtquery/samples/HomePageSample.gwt.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/samples/src/main/java/gwtquery/samples/client/HomePageSample.java b/samples/src/main/java/gwtquery/samples/client/HomePageSample.java new file mode 100644 index 00000000..a66f057b --- /dev/null +++ b/samples/src/main/java/gwtquery/samples/client/HomePageSample.java @@ -0,0 +1,47 @@ +/* + * Copyright 2011, The gwtquery team. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package gwtquery.samples.client; + +import static com.google.gwt.query.client.GQuery.$; +import static com.google.gwt.query.client.plugins.Effects.Effects; + +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.query.client.Function; +import com.google.gwt.query.client.css.CSS; +import com.google.gwt.query.client.css.Length; + +public class HomePageSample implements EntryPoint { + + + public void onModuleLoad() { + //Hide the text and set the width and append an h1 element + $("#text").hide().css(CSS.WIDTH.with(Length.px(400))).prepend("

GwtQuery Rocks !

"); + + //add a click handler on the button + $("button").click(new Function(){ + + public void f() { + $("#text").as(Effects) + .clipDown() + .animate("backgroundColor: 'yellow'", 500) + .delay(1000) + .animate("backgroundColor: '#fff'", 1500); + } + + }); + } + +} diff --git a/samples/src/main/java/gwtquery/samples/public/HomePageSample.html b/samples/src/main/java/gwtquery/samples/public/HomePageSample.html new file mode 100644 index 00000000..a3dcfdec --- /dev/null +++ b/samples/src/main/java/gwtquery/samples/public/HomePageSample.html @@ -0,0 +1,54 @@ + + + +GQuery + + + + +

Java Code :

+
+  public void onModuleLoad() {
+    //Hide the text and set the width and append an h1 element
+    $("#text").hide().css(CSS.WIDTH.with(Length.px(400))).prepend("

GwtQuery Rocks !

"); + + //add a click handler on the button + $("button").click(new Function(){ + + public void f() { + $("#text").as(Effects) + .clipDown() + .animate("backgroundColor: 'yellow'", 500) + .delay(1000) + .animate("backgroundColor: '#fff'", 1500); + } + + }); + } +
+ +
Lorem ipsum dolor sit amet, consectetur adipiscing +elit. Maecenas ac ultricies lorem. Integer erat nibh, semper eget +tincidunt non, egestas ac augue. Aliquam dapibus pharetra rhoncus. +Integer adipiscing mauris ullamcorper mauris dictum eu luctus tortor +consequat. Nam quis tortor diam, laoreet aliquam enim. Vivamus turpis +arcu, varius eu consectetur vitae, luctus ut sapien. Donec vel sem +metus, ac mattis est. Nulla facilisi. Etiam pharetra tortor aliquam eros +sagittis sit amet dignissim diam pellentesque. Vivamus lobortis varius +leo, eu pharetra sapien rhoncus vitae. Aliquam fermentum nulla et elit +vestibulum et sagittis leo faucibus. Etiam gravida felis a sapien luctus +tincidunt. Quisque non purus ut massa ultrices scelerisque. Donec vel +risus est, quis tempus est. Integer commodo feugiat ornare. Pellentesque +pretium eleifend dui sit amet accumsan. Mauris vulputate rhoncus turpis +vitae scelerisque. Nulla lobortis, nulla ut porttitor condimentum, lacus +ligula scelerisque tortor, et eleifend arcu risus non massa.
+ + \ No newline at end of file -- cgit v1.2.3