aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java41
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/AjaxTransportJs.java1
2 files changed, 28 insertions, 14 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java
index b22516d8..70a9b1a8 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/Ajax.java
@@ -11,7 +11,6 @@ import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQ;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.Promise;
-import com.google.gwt.query.client.Properties;
import com.google.gwt.query.client.builders.JsonBuilder;
import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.query.client.plugins.Plugin;
@@ -85,7 +84,7 @@ public class Ajax extends GQuery {
}
});
- public static Promise ajax(Properties p) {
+ public static Promise ajax(Binder p) {
Settings s = createSettings();
s.load(p);
return ajax(s);
@@ -232,7 +231,7 @@ public class Ajax extends GQuery {
return ajax(s);
}
- public static Promise ajax(String url, Properties p) {
+ public static Promise ajax(String url, Binder p) {
Settings s = createSettings();
s.load(p);
s.setUrl(url);
@@ -260,7 +259,15 @@ public class Ajax extends GQuery {
return s;
}
- public static Promise get(String url, Properties data, Function onSuccess) {
+ public static Promise get(String url) {
+ return get(url, null, null);
+ }
+
+ public static Promise get(String url, Binder data) {
+ return get(url, data, null);
+ }
+
+ public static Promise get(String url, Binder data, Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("txt");
@@ -270,7 +277,11 @@ public class Ajax extends GQuery {
return ajax(s);
}
- public static Promise getJSON(String url, Properties data, Function onSuccess) {
+ public static Promise getJSON(String url, Binder data) {
+ return getJSON(url, data, null);
+ }
+
+ public static Promise getJSON(String url, Binder data, Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("json");
@@ -279,12 +290,16 @@ public class Ajax extends GQuery {
s.setSuccess(onSuccess);
return ajax(s);
}
-
+
public static Promise getJSONP(String url) {
return getJSONP(url, null, null);
}
- public static Promise getJSONP(String url, Properties data, Function onSuccess) {
+ public static Promise getJSONP(String url, Binder data) {
+ return getJSONP(url, data, null);
+ }
+
+ public static Promise getJSONP(String url, Binder data, Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("jsonp");
@@ -336,12 +351,12 @@ public class Ajax extends GQuery {
.setSuccess(success)
);
}
-
- public static Promise post(String url, Properties data) {
+
+ public static Promise post(String url, Binder data) {
return post(url, data, null);
}
-
- public static Promise post(String url, Properties data, final Function onSuccess) {
+
+ public static Promise post(String url, Binder data, final Function onSuccess) {
Settings s = createSettings();
s.setUrl(url);
s.setDataType("txt");
@@ -355,11 +370,11 @@ public class Ajax extends GQuery {
super(gq);
}
- public Ajax load(String url, Properties data) {
+ public Ajax load(String url, Binder data) {
return load(url, data);
}
- public Ajax load(String url, Properties data, final Function onSuccess) {
+ public Ajax load(String url, Binder data, final Function onSuccess) {
Settings s = createSettings();
final String filter = url.contains(" ") ? url.replaceFirst("^[^\\s]+\\s+", "") : "";
s.setUrl(url.replaceAll("\\s+.+$", ""));
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/AjaxTransportJs.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/AjaxTransportJs.java
index fe4e91b8..12ce7cda 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/AjaxTransportJs.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/ajax/AjaxTransportJs.java
@@ -8,7 +8,6 @@ import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.Promise;
import com.google.gwt.query.client.plugins.ajax.Ajax.AjaxTransport;
import com.google.gwt.query.client.plugins.ajax.Ajax.Settings;
-import com.google.gwt.query.client.plugins.deferred.Deferred.DeferredPromiseImpl;
import com.google.gwt.query.client.plugins.deferred.PromiseFunction;
import com.google.gwt.query.client.plugins.deferred.PromiseReqBuilder;
import com.google.gwt.query.client.plugins.deferred.PromiseReqBuilderJSONP;