]> source.dussan.org Git - gwtquery.git/commitdiff
fixed examples
authorManolo Carrasco <manolo@apache.org>
Thu, 6 May 2010 14:11:05 +0000 (14:11 +0000)
committerManolo Carrasco <manolo@apache.org>
Thu, 6 May 2010 14:11:05 +0000 (14:11 +0000)
samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml
samples/src/main/java/gwtquery/samples/client/GwtQueryDemoModule.java
samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
samples/src/main/java/gwtquery/samples/public/GwtQueryDemo.html

index 86077f47c8ad49d89040a9707f5847dbcbaabc7c..344d7a6bda4ddd37cdbd88b3d570459c9fdaee2e 100644 (file)
@@ -1,7 +1,7 @@
 <module>
     <inherits name='com.google.gwt.query.Query'/>
     <inherits name='gwtquery.Plugins'/>
-    <set-property name="user.agent" value="gecko1_8"/>
+<!--    <set-property name="user.agent" value="gecko1_8"/>-->
     <entry-point class='gwtquery.samples.client.GwtQuerySampleModule'/>
 </module>
     
index 90934a571a2e5b3dc6570793c0d709620a6857a8..ac2679df2ed4439d9e7fc1d289b24c37ec5af3d5 100644 (file)
@@ -1,5 +1,8 @@
 package gwtquery.samples.client;\r
 \r
+import static com.google.gwt.query.client.Effects.Effects;\r
+import static com.google.gwt.query.client.GQuery.$;\r
+\r
 import com.google.gwt.core.client.EntryPoint;\r
 import com.google.gwt.core.client.GWT;\r
 import com.google.gwt.dom.client.Document;\r
@@ -8,7 +11,6 @@ import com.google.gwt.dom.client.Node;
 import com.google.gwt.dom.client.NodeList;\r
 import com.google.gwt.query.client.Function;\r
 import com.google.gwt.query.client.GQuery;\r
-import static com.google.gwt.query.client.GQuery.$;\r
 import com.google.gwt.query.client.Selector;\r
 import com.google.gwt.query.client.Selectors;\r
 import com.google.gwt.user.client.Event;\r
@@ -48,25 +50,19 @@ public class GwtQueryDemoModule implements EntryPoint {
       // two state variables to note current slide being shown\r
       // and current bullet\r
       int curSlide = 0;\r
-\r
       int curBullets = 0;\r
 \r
       // query and store all slides, and bullets of current slide\r
       GQuery slides = $(s.allSlides());\r
-\r
       GQuery bullets = $(s.slideBulletsCtx(slides.get(curSlide)));\r
-\r
       public boolean f(Event e) {\r
         // onclick, if not all bullets shown, show a bullet and increment\r
         if (curBullets < bullets.size()) {\r
-          bullets.eq(curBullets++).show();\r
+          bullets.eq(curBullets++).fadeIn();\r
         } else {\r
           // all bullets shown, hide them and current slide\r
-//                    bullets.css("opacity","0");\r
           bullets.hide();\r
-          slides.eq(curSlide).hide();\r
-\r
-//                    slides.eq(curSlide).css("display", "none");\r
+          slides.eq(curSlide).as(Effects).hide();\r
           // move to next slide, checking for wrap around\r
           curSlide++;\r
           if (curSlide == slides.size()) {\r
@@ -74,7 +70,6 @@ public class GwtQueryDemoModule implements EntryPoint {
           }\r
           curBullets = 0;\r
           // query for new set of bullets, and show next slide\r
-          // by changing opacity to 1 and display to block\r
           bullets = $(s.slideBulletsCtx(slides.get(curSlide)));\r
           slides.eq(curSlide).show();\r
         }\r
index 3bfaa077ad110908812d1bd2b98a04b5675a6919..ce23722091daedbf014878ee3c72e1cdd2275a9e 100644 (file)
@@ -1,23 +1,27 @@
 package gwtquery.samples.client;\r
 \r
+import static com.google.gwt.query.client.GQuery.lazy;\r
+\r
 import com.google.gwt.core.client.EntryPoint;\r
 import com.google.gwt.core.client.GWT;\r
 import com.google.gwt.query.client.GQuery;\r
 import com.google.gwt.query.client.Selector;\r
 import com.google.gwt.query.client.Selectors;\r
 \r
-\r
 public class GwtQuerySampleModule implements EntryPoint {\r
 \r
   public interface Sample extends Selectors {\r
-\r
     @Selector(".note")\r
     GQuery allNotes();\r
-\r
   }\r
 \r
   public void onModuleLoad() {\r
     Sample s = GWT.create(Sample.class);\r
-    s.allNotes().text("Hello Google I/O");\r
+    s.allNotes().text("Hello Google I/O").\r
+      css("cursor", "pointer").\r
+      toggle(\r
+        lazy().css("color", "red").done(),\r
+        lazy().css("color", "").done()\r
+      );\r
   }\r
 }\r
index 6e049cf42e1a2684147d929405b3101de6176140..3dc9ce08966f8059664f6a8fe64cf6d20d6829fa 100644 (file)
@@ -8,17 +8,12 @@
             border: 1px solid black;\r
             width: 800px;\r
             height: 600px;\r
-            display: none\r
         }\r
-\r
         .slide {\r
-            background: -webkit-gradient(linear, left top, left bottom, from(#000000), to(#808080), color-stop(0.9, #808080));\r
-            -webkit-background-origin: padding-box;\r
-            -webkit-background-clip: content-box;\r
+            background-color: #505050;\r
         }\r
-\r
         .slide, .slide * {\r
-            color: white;\r
+            color: #ffffff;\r
             font-size: 150%;\r
         }\r
     </style>\r