From 8f505c17946934d1e792e32b22903f0cc9ed7995 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 09:48:12 +0100 Subject: CSS3 animations where failing with "%" units, fixing it in the same way we do with non CSS3 --- .../client/plugins/effects/TransitionsAnimation.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java index 0bb7e1e3..c93e62bf 100755 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java @@ -148,16 +148,14 @@ public class TransitionsAnimation extends PropertiesAnimation { } else { MatchResult parts = REGEX_SYMBOL_NUMBER_UNIT.exec(val); if (parts != null) { - unit = REGEX_NON_PIXEL_ATTRS.test(key) || Transitions.transformRegex.test(key) ? "" : "px"; String part1 = parts.getGroup(1); String part2 = parts.getGroup(2); String part3 = parts.getGroup(3); trsEnd = "" + Double.parseDouble(part2); - if (unit.isEmpty() && part3 != null) { - unit = part3; - } + unit = REGEX_NON_PIXEL_ATTRS.test(key) ? "" : part3 == null || part3.isEmpty() ? "px" : part3; + if (trsStart.isEmpty()) { trsStart = key.matches("scale") ? "1" : "0"; } @@ -168,6 +166,17 @@ public class TransitionsAnimation extends PropertiesAnimation { double en = Double.parseDouble(trsEnd); trsEnd = "" + (st + (n*en)); } + + // Deal with non px units like "%" + if (!unit.isEmpty() && !"px".equals(unit) && trsStart.matches("\\d+")) { + double start = Double.parseDouble(trsStart); + double to = Double.parseDouble(trsEnd); + g.css(key, to + unit); + start = to * start / g.cur(key, true); + trsStart = start + unit; + g.css(key, start + unit); + } + } else { trsStart = ""; trsEnd = val; -- cgit v1.2.3 From 3f395a181c89bbe8d9de12d7c70583da3ea08bb3 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 11:21:43 +0100 Subject: Fix testLiveWithNameSpace --- .../src/main/java/com/google/gwt/query/client/js/JsCache.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java index fa604fe8..c8f00a6c 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsCache.java @@ -79,7 +79,7 @@ public class JsCache extends JavaScriptObject { } return (T)o; } - + public final native T get(Object id) /*-{ return @com.google.gwt.query.client.js.JsCache::gwtBox(*)([ this && this[id] ]); }-*/; @@ -129,11 +129,11 @@ public class JsCache extends JavaScriptObject { for (k in this) return false; return true; }-*/; - + public final native boolean contains(Object o)/*-{ return this.indexOf(o) >= 0; }-*/; - + public final native void remove(Object o) /*-{ var i = this.indexOf(o); if (i >= 0) this.splice(i, 1); @@ -229,8 +229,9 @@ public class JsCache extends JavaScriptObject { private final native JsArrayString keysImpl() /*-{ var key, keys=[]; - // Chrome in DevMode injects a property to JS objects - for(key in this) if (key != '__gwt_ObjectId') keys.push(String(key)); + // Chrome in DevMode sets '__gwt_ObjectId' to JS objects + // GWT sets '$H' when calling getHashCode (see com/google/gwt/core/client/impl/Impl.java) + for(key in this) if (key != '__gwt_ObjectId' && key != '$H') keys.push(String(key)); return keys; }-*/; -- cgit v1.2.3 From d01b00ce50eb63fed97521a71eccafb804bf6c75 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 11:35:23 +0100 Subject: Fixing broken code introduced in commit 0f3d35d4999c215d961197c86ee60319b648e696 --- .../src/main/java/com/google/gwt/query/client/js/JsMap.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsMap.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsMap.java index 6bc43077..d912a7f2 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsMap.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsMap.java @@ -49,9 +49,9 @@ final public class JsMap extends JavaScriptObject { return old; } - public T remove(int hashCode){ - T old = get(hashCode); - c().delete(hashCode()); + public T remove(int key){ + T old = get(key); + c().delete(key); return old; } -- cgit v1.2.3 From 6b0b5e9f83a81f314b0bf6219eae66294eea20d2 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 13:49:39 +0100 Subject: Using transitionend envents instead of gquery delays --- .../query/client/plugins/effects/Transitions.java | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index e1479ad1..c7fe0b9b 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -308,9 +308,9 @@ public class Transitions extends GQuery { return this; } - final Properties p = (stringOrProperties instanceof String) ? $$((String) stringOrProperties) : (Properties) stringOrProperties; - - final String oldTransitions = css(transition); + final Properties p = (stringOrProperties instanceof String) + ? $$((String) stringOrProperties) + : (Properties) stringOrProperties; if (easing == null) { easing = EasingCurve.ease; @@ -326,23 +326,24 @@ public class Transitions extends GQuery { final String transitionValue = value; // Use gQuery queue, so as we can chain transitions, animations etc. - delay(0, new Function(){public void f() { - // This is called once per element - $(this) - // Configure animation using transition property - .css(transition, transitionValue) - // Set all css properties for this transition using the css method in this class - .as(Transitions).css(p); - }}); - - // restore oldTransitions in the element, and use the queue to prevent more effects being run. - // TODO: Use transitionEnd events once GQuery supports non-bit events - delay(duration + delay, new Function(){public void f() { - // This is called once per element - $(this).as(Transitions) - .css(transition, oldTransitions) - .each(funcs); - }}); + queue(new Function(){ + public void f() { + // This is called once per element + final String old = $(this).css(transition); + $(this) + // Configure animation using transition property + .css(transition, transitionValue) + // Set all css properties for this transition using the css method in this class + .as(Transitions).css(p) + // Bind to transitionEnd to unlock the queue and restore old transitions + .bind(transitionEnd, new Function(){ + public void f(){ + $(this).dequeue().unbind(transitionEnd); + $(this).css(transition, old); + } + }); + } + }); return this; } -- cgit v1.2.3 From 782f2b7f683cbf859d483140744c5852065aae0c Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 15:32:00 +0100 Subject: Support for animation delays compatible with GQuery queues --- .../query/client/plugins/effects/Transitions.java | 41 ++++++++++++---------- .../plugins/effects/TransitionsAnimation.java | 4 ++- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index c7fe0b9b..ab9209dc 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -19,6 +19,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map.Entry; +import com.google.gwt.core.client.Duration; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style; import com.google.gwt.query.client.Function; @@ -167,7 +168,7 @@ public class Transitions extends GQuery { protected static final String transition = getVendorPropertyName("transition"); // passing an invalid transition property in chrome, makes disable all transitions in the element - private static final RegExp invalidTransitionNamesRegex = RegExp.compile("^(.*transform.*|duration|easing|clip-.*)$"); + private static final RegExp invalidTransitionNamesRegex = RegExp.compile("^(.*transform.*|duration|easing|delay|clip-.*)$"); private static final String transitionDelay = getVendorPropertyName("transitionDelay"); private static final String transitionEnd = browser.mozilla || browser.msie ? "transitionend" : (prefix + "transitionEnd"); @@ -251,7 +252,7 @@ public class Transitions extends GQuery { t.setFromString(prop, value); getStyleImpl().setStyleProperty(e, transform, t.toString()); } - } else { + } else if (!invalidTransitionNamesRegex.test(prop)){ super.css(prop, value); } return this; @@ -303,7 +304,7 @@ public class Transitions extends GQuery { .transition("{x: +100, width: +40px}", 2000, EasingCurve.easeOut); * */ - public Transitions transition(Object stringOrProperties, int duration, Easing easing, int delay, final Function... funcs) { + public Transitions transition(Object stringOrProperties, final int duration, final Easing easing, final int delay, final Function... funcs) { if (isEmpty()) { return this; } @@ -312,34 +313,36 @@ public class Transitions extends GQuery { ? $$((String) stringOrProperties) : (Properties) stringOrProperties; - if (easing == null) { - easing = EasingCurve.ease; - } - - String attribs = duration + "ms" + " " + easing.toString() + " " + delay + "ms"; - List props = filterTransitionPropertyNames(p); - String value = ""; - for (String s : props) { - value += (value.isEmpty() ? "" : ", ") + s + " " + attribs; - } - - final String transitionValue = value; + final String ease = easing == null ? "ease" : easing.toString(); + final List props = filterTransitionPropertyNames(p); + final double queuedAt = delay > 0 ? Duration.currentTimeMillis() : 0; // Use gQuery queue, so as we can chain transitions, animations etc. queue(new Function(){ public void f() { // This is called once per element - final String old = $(this).css(transition); + final String oldTransitionValue = $(this).css(transition); + // Recompute delay based on the time spent in the queue + double d = Math.max(0, delay - (int)(Duration.currentTimeMillis() - queuedAt)); + // Generate transition value + String attribs = duration + "ms" + " " + ease + " " + d + "ms"; + String newTransitionValue = ""; + for (String s : props) { + newTransitionValue += (newTransitionValue.isEmpty() ? "" : ", ") + s + " " + attribs; + } + $(this) // Configure animation using transition property - .css(transition, transitionValue) + .css(transition, newTransitionValue) // Set all css properties for this transition using the css method in this class .as(Transitions).css(p) // Bind to transitionEnd to unlock the queue and restore old transitions .bind(transitionEnd, new Function(){ public void f(){ - $(this).dequeue().unbind(transitionEnd); - $(this).css(transition, old); + $(this).dequeue() + .unbind(transitionEnd) + .css(transition, oldTransitionValue) + .each(funcs); } }); } diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java index c93e62bf..74353323 100755 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/TransitionsAnimation.java @@ -186,6 +186,7 @@ public class TransitionsAnimation extends PropertiesAnimation { } protected Transitions g; + protected int delay = 0; public TransitionsAnimation(Element elem, Properties p, Function... funcs) { this(null, elem, p, funcs); @@ -193,6 +194,7 @@ public class TransitionsAnimation extends PropertiesAnimation { public TransitionsAnimation(Easing easing, Element elem, Properties p, Function... funcs) { super(easing, elem, p, funcs); + delay = p.getInt("delay"); g = $(e).as(Transitions.Transitions); } @@ -244,7 +246,7 @@ public class TransitionsAnimation extends PropertiesAnimation { // TODO: Reflow, it seems it is not needed in chrome and FF, check other browsers // g.css("offsetHeight"); p = getFxProperties(false); - g.transition(p, duration, easing, 0, new Function(){public void f() { + g.transition(p, duration, easing, delay, new Function(){public void f() { onComplete(); }}); } -- cgit v1.2.3 From 4486175d10fc327fd22a28c3d24bb891216271b2 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 17:18:07 +0100 Subject: Rolling back to transitionEnd since setting transitionEnd made custom events fail (slideEnter) --- .../query/client/plugins/effects/Transitions.java | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index ab9209dc..da314fbb 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -32,6 +32,7 @@ import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.EasingCur import com.google.gwt.regexp.shared.MatchResult; import com.google.gwt.regexp.shared.RegExp; import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Timer; /** * Transitions and transformation plugin for gQuery. @@ -323,7 +324,7 @@ public class Transitions extends GQuery { // This is called once per element final String oldTransitionValue = $(this).css(transition); // Recompute delay based on the time spent in the queue - double d = Math.max(0, delay - (int)(Duration.currentTimeMillis() - queuedAt)); + int d = Math.max(0, delay - (int)(Duration.currentTimeMillis() - queuedAt)); // Generate transition value String attribs = duration + "ms" + " " + ease + " " + d + "ms"; String newTransitionValue = ""; @@ -331,20 +332,20 @@ public class Transitions extends GQuery { newTransitionValue += (newTransitionValue.isEmpty() ? "" : ", ") + s + " " + attribs; } - $(this) - // Configure animation using transition property - .css(transition, newTransitionValue) - // Set all css properties for this transition using the css method in this class - .as(Transitions).css(p) - // Bind to transitionEnd to unlock the queue and restore old transitions - .bind(transitionEnd, new Function(){ - public void f(){ - $(this).dequeue() - .unbind(transitionEnd) - .css(transition, oldTransitionValue) - .each(funcs); - } - }); + final Transitions g = $(this).as(Transitions); + // Configure animation using transition property + g.css(transition, newTransitionValue); + // Set all css properties for this transition using the css method in this class + g.css(p); + + // TODO: Use transitionEnd events once GQuery supports non-bit events + // last time I tried, setting 'transitionEnd' made custom events fail (slideEnter) + new Timer() { + public void run() { + g.css(transition, oldTransitionValue).each(funcs); + dequeue(); + } + }.schedule(d + duration); } }); -- cgit v1.2.3 From 8139302077a2700ede939f2122d1a558565c7e14 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 17:21:35 +0100 Subject: variable names --- .../gwt/query/client/plugins/effects/Transitions.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index da314fbb..62658401 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -310,12 +310,12 @@ public class Transitions extends GQuery { return this; } - final Properties p = (stringOrProperties instanceof String) + final Properties cssProps = (stringOrProperties instanceof String) ? $$((String) stringOrProperties) : (Properties) stringOrProperties; final String ease = easing == null ? "ease" : easing.toString(); - final List props = filterTransitionPropertyNames(p); + final List transProps = filterTransitionPropertyNames(cssProps); final double queuedAt = delay > 0 ? Duration.currentTimeMillis() : 0; // Use gQuery queue, so as we can chain transitions, animations etc. @@ -328,24 +328,23 @@ public class Transitions extends GQuery { // Generate transition value String attribs = duration + "ms" + " " + ease + " " + d + "ms"; String newTransitionValue = ""; - for (String s : props) { + for (String s : transProps) { newTransitionValue += (newTransitionValue.isEmpty() ? "" : ", ") + s + " " + attribs; } - final Transitions g = $(this).as(Transitions); + final Transitions $this = $(this).as(Transitions); // Configure animation using transition property - g.css(transition, newTransitionValue); + $this.css(transition, newTransitionValue); // Set all css properties for this transition using the css method in this class - g.css(p); + $this.css(cssProps); // TODO: Use transitionEnd events once GQuery supports non-bit events // last time I tried, setting 'transitionEnd' made custom events fail (slideEnter) new Timer() { public void run() { - g.css(transition, oldTransitionValue).each(funcs); - dequeue(); + $this.css(transition, oldTransitionValue).each(funcs).dequeue(); } - }.schedule(d + duration); + }.schedule(d); } }); -- cgit v1.2.3 From a7ddf19e54169bc97ce8c142df3da32ae5e2d107 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 17:23:33 +0100 Subject: add duration --- .../java/com/google/gwt/query/client/plugins/effects/Transitions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index 62658401..a0f021f6 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -344,7 +344,7 @@ public class Transitions extends GQuery { public void run() { $this.css(transition, oldTransitionValue).each(funcs).dequeue(); } - }.schedule(d); + }.schedule(d + duration); } }); -- cgit v1.2.3 From 318d0ba4dd790dd1cc8ba233f2b2b6ca02041232 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 18:24:52 +0100 Subject: Update lazy interfaces --- .../com/google/gwt/query/client/LazyGQuery.java | 14 +++- .../gwt/query/client/plugins/LazyEffects.java | 75 ++++++---------------- 2 files changed, 31 insertions(+), 58 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index 2d9ce894..11f09f22 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -12,7 +12,7 @@ * the License. */ package com.google.gwt.query.client; -import static com.google.gwt.query.client.plugins.QueuePlugin.*; +import static com.google.gwt.query.client.plugins.QueuePlugin.Queue; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -23,9 +23,18 @@ import com.google.gwt.core.client.JsArray; import com.google.gwt.core.client.JsArrayMixed; import com.google.gwt.core.client.JsArrayString; import com.google.gwt.core.client.ScriptInjector; -import com.google.gwt.dom.client.*; +import com.google.gwt.dom.client.BodyElement; +import com.google.gwt.dom.client.ButtonElement; +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.InputElement; +import com.google.gwt.dom.client.Node; +import com.google.gwt.dom.client.NodeList; +import com.google.gwt.dom.client.OptionElement; +import com.google.gwt.dom.client.SelectElement; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.HasCssName; +import com.google.gwt.dom.client.TextAreaElement; import com.google.gwt.query.client.css.CSS; import com.google.gwt.query.client.css.HasCssValue; import com.google.gwt.query.client.css.TakesCssValue; @@ -47,7 +56,6 @@ import com.google.gwt.query.client.plugins.ajax.Ajax; import com.google.gwt.query.client.plugins.ajax.Ajax.Settings; import com.google.gwt.query.client.plugins.deferred.Deferred; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing; -import com.google.gwt.query.client.plugins.effects.Transitions; import com.google.gwt.query.client.plugins.events.EventsListener; import com.google.gwt.query.client.plugins.widgets.WidgetsUtils; import com.google.gwt.regexp.shared.RegExp; diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java index a07112df..2a921a4e 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyEffects.java @@ -20,13 +20,10 @@ import com.google.gwt.query.client.Function; import com.google.gwt.query.client.GQuery; import com.google.gwt.query.client.Properties; import com.google.gwt.query.client.plugins.effects.ClipAnimation; -import com.google.gwt.query.client.plugins.effects.ClipAnimation.Action; import com.google.gwt.query.client.plugins.effects.ClipAnimation.Direction; import com.google.gwt.query.client.plugins.effects.Fx; -import com.google.gwt.query.client.plugins.effects.PropertiesAnimation; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.EasingCurve; -import com.google.gwt.query.client.plugins.effects.TransitionsAnimation; import com.google.gwt.query.client.plugins.effects.TransitionsAnimation.TransitionsClipAnimation; import com.google.gwt.query.client.LazyBase; @@ -203,94 +200,62 @@ public interface LazyEffects extends LazyBase{ LazyEffects animate(Object stringOrProperties, int duration, Function... funcs); /** - * Animate the set of matched elements using the clip property. It is possible - * to show or hide a set of elements, specify the direction of the animation - * and the start corner of the effect. Finally it executes the set of - * functions passed as arguments. - */ - LazyEffects clip(ClipAnimation.Action a, ClipAnimation.Corner c, ClipAnimation.Direction d, Function... f); - - /** - * Animate the set of matched elements using the clip property. It is possible - * to show or hide a set of elements, specify the direction of the animation - * and the start corner of the effect. Finally it executes the set of - * functions passed as arguments. - */ - LazyEffects clip(ClipAnimation.Action a, ClipAnimation.Corner c, ClipAnimation.Direction d, int duration, Function... f); - - /** - * Animate the set of matched elements using the clip property. It is possible - * to show or hide a set of elements, specify the direction of the animation - * and the start corner of the effect. Finally it executes the set of - * functions passed as arguments. - */ - LazyEffects clip(ClipAnimation.Action a, ClipAnimation.Corner c, Function... f); - - /** - * Reveal all matched elements by adjusting the clip property firing an - * optional callback after completion. The effect goes from the center to the - * perimeter. + * Reveal all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the center to the perimeter. */ LazyEffects clipAppear(Function... f); /** - * Reveal all matched elements by adjusting the clip property firing an - * optional callback after completion. The effect goes from the center to the - * perimeter. + * Reveal all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the center to the perimeter. */ LazyEffects clipAppear(int millisecs, Function... f); /** - * Hide all matched elements by adjusting the clip property firing an optional - * callback after completion. The effect goes from the perimeter to the - * center. + * Hide all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the perimeter to the center. */ LazyEffects clipDisappear(Function... f); /** - * Hide all matched elements by adjusting the clip property firing an optional - * callback after completion. The effect goes from the perimeter to the - * center. + * Hide all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the perimeter to the center. */ LazyEffects clipDisappear(int millisecs, Function... f); /** - * Reveal all matched elements by adjusting the clip property firing an - * optional callback after completion. The effect goes from the top to the - * bottom. + * Reveal all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the top to the bottom. */ LazyEffects clipDown(Function... f); /** - * Reveal all matched elements by adjusting the clip property firing an - * optional callback after completion. The effect goes from the top to the - * bottom. + * Reveal all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the top to the bottom. */ LazyEffects clipDown(int millisecs, Function... f); /** - * Toggle the visibility of all matched elements by adjusting the clip - * property and firing an optional callback after completion. The effect goes - * from the bottom to the top. + * Toggle the visibility of all matched elements by adjusting the clip or scale property and + * firing an optional callback after completion. The effect goes from the bottom to the top. */ LazyEffects clipToggle(Function... f); /** - * Toggle the visibility of all matched elements by adjusting the clip - * property and firing an optional callback after completion. The effect goes - * from the bottom to the top. + * Toggle the visibility of all matched elements by adjusting the clip or scale or scale property + * and firing an optional callback after completion. The effect goes from the bottom to the top. */ LazyEffects clipToggle(int millisecs, Function... f); /** - * Hide all matched elements by adjusting the clip property firing an optional - * callback after completion. The effect goes from the bottom to the top. + * Hide all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the bottom to the top. */ LazyEffects clipUp(Function... f); /** - * Hide all matched elements by adjusting the clip property firing an optional - * callback after completion. The effect goes from the bottom to the top. + * Hide all matched elements by adjusting the clip or scale property firing an optional callback + * after completion. The effect goes from the bottom to the top. */ LazyEffects clipUp(int millisecs, Function... f); -- cgit v1.2.3 From d94f4dde77ed3d5a1c804be454d11627ebfc404b Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 18:33:12 +0100 Subject: Fix imports in LazyGquery --- .../com/google/gwt/query/client/LazyGQuery.java | 41 ++-------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java index 11f09f22..da25dba4 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/LazyGQuery.java @@ -12,60 +12,23 @@ * the License. */ package com.google.gwt.query.client; -import static com.google.gwt.query.client.plugins.QueuePlugin.Queue; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Map; -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.core.client.JsArray; -import com.google.gwt.core.client.JsArrayMixed; -import com.google.gwt.core.client.JsArrayString; -import com.google.gwt.core.client.ScriptInjector; -import com.google.gwt.dom.client.BodyElement; -import com.google.gwt.dom.client.ButtonElement; -import com.google.gwt.dom.client.Document; + import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.InputElement; import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.NodeList; -import com.google.gwt.dom.client.OptionElement; -import com.google.gwt.dom.client.SelectElement; -import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.HasCssName; -import com.google.gwt.dom.client.TextAreaElement; +import com.google.gwt.query.client.GQuery.Offset; import com.google.gwt.query.client.css.CSS; import com.google.gwt.query.client.css.HasCssValue; import com.google.gwt.query.client.css.TakesCssValue; import com.google.gwt.query.client.css.TakesCssValue.CssSetter; -import com.google.gwt.query.client.impl.AttributeImpl; -import com.google.gwt.query.client.impl.DocumentStyleImpl; -import com.google.gwt.query.client.impl.SelectorEngine; -import com.google.gwt.query.client.js.JsCache; -import com.google.gwt.query.client.js.JsMap; import com.google.gwt.query.client.js.JsNamedArray; import com.google.gwt.query.client.js.JsNodeArray; -import com.google.gwt.query.client.js.JsObjectArray; -import com.google.gwt.query.client.js.JsUtils; import com.google.gwt.query.client.plugins.Effects; -import com.google.gwt.query.client.plugins.Events; -import com.google.gwt.query.client.plugins.Plugin; -import com.google.gwt.query.client.plugins.Widgets; -import com.google.gwt.query.client.plugins.ajax.Ajax; -import com.google.gwt.query.client.plugins.ajax.Ajax.Settings; -import com.google.gwt.query.client.plugins.deferred.Deferred; import com.google.gwt.query.client.plugins.effects.PropertiesAnimation.Easing; -import com.google.gwt.query.client.plugins.events.EventsListener; -import com.google.gwt.query.client.plugins.widgets.WidgetsUtils; -import com.google.gwt.regexp.shared.RegExp; -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.EventListener; -import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.query.client.LazyBase; public interface LazyGQuery extends LazyBase{ -- cgit v1.2.3 From 0d30f11c1f03de893431159ef613aa94c304dfe5 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Moñino Date: Tue, 10 Dec 2013 20:49:05 +0100 Subject: For some reason compiler does not likes $this --- .../com/google/gwt/query/client/plugins/effects/Transitions.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java index a0f021f6..57403501 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java @@ -332,17 +332,17 @@ public class Transitions extends GQuery { newTransitionValue += (newTransitionValue.isEmpty() ? "" : ", ") + s + " " + attribs; } - final Transitions $this = $(this).as(Transitions); + final Transitions thisTrans = $(this).as(Transitions); // Configure animation using transition property - $this.css(transition, newTransitionValue); + thisTrans.css(transition, newTransitionValue); // Set all css properties for this transition using the css method in this class - $this.css(cssProps); + thisTrans.css(cssProps); // TODO: Use transitionEnd events once GQuery supports non-bit events // last time I tried, setting 'transitionEnd' made custom events fail (slideEnter) new Timer() { public void run() { - $this.css(transition, oldTransitionValue).each(funcs).dequeue(); + thisTrans.css(transition, oldTransitionValue).each(funcs).dequeue(); } }.schedule(d + duration); } -- cgit v1.2.3