aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>2013-12-24 09:56:24 +0100
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>2013-12-24 09:56:24 +0100
commit90316bdd6aa5b44e216ec90581633265f9595aa4 (patch)
tree0f92e3dfb3ffc6bd29295baa4a5305bdade3494d
parent1ddff6749a60c10f25b89feccc01a70c6d92db72 (diff)
downloadgwtquery-90316bdd6aa5b44e216ec90581633265f9595aa4.tar.gz
gwtquery-90316bdd6aa5b44e216ec90581633265f9595aa4.zip
FallBack to dummy implementation in IE8 IE9, and fix merge issues
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java43
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseReqBuilder.java6
2 files changed, 45 insertions, 4 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java
index ec63c852..985e3a03 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java
@@ -31,7 +31,11 @@ public class ConsoleBrowser implements Console {
private static class ConsoleIe8 extends ConsoleIe9 {
@Override
protected native void init()/*-{
- Function.prototype.call.call($wnd.console.log, $wnd.console, Array.prototype.slice.call(arguments));
+ try {
+ Function.prototype.call.call($wnd.console.log, $wnd.console, Array.prototype.slice.call(arguments));
+ this.@com.google.gwt.query.client.impl.ConsoleBrowser.ConsoleIe9::initialized = true;
+ } catch(e) {
+ }
}-*/;
}
@@ -39,17 +43,52 @@ public class ConsoleBrowser implements Console {
* See: http://whattheheadsaid.com/2011/04/internet-explorer-9s-problematic-console-object
*/
private static class ConsoleIe9 extends ConsoleImpl {
+
+ private boolean initialized = false;
+
public ConsoleIe9(){
init();
}
protected native void init()/*-{
+ try {
[ "log", "info", "warn", "error", "dir", "clear", "profile", "profileEnd" ]
.forEach(function(method) {
$wnd.console[method] = this.call($wnd.console[method], $wnd.console);
}, Function.prototype.bind);
+ this.@com.google.gwt.query.client.impl.ConsoleBrowser.ConsoleIe9::initialized = true;
+ } catch(e) {
+ }
}-*/;
-
+
+ @Override
+ public void clear() {
+ if (initialized) super.clear();
+ }
+ @Override
+ public void dir(Object arg) {
+ if (initialized) super.dir(arg);
+ }
+ @Override
+ public void error(Object arg) {
+ if (initialized) super.error(arg);
+ }
+ @Override
+ public void info(Object arg) {
+ if (initialized) super.info(arg);
+ }
+ @Override
+ public void profile(String title) {
+ if (initialized) super.profile(title);
+ }
+ @Override
+ public void profileEnd(String title) {
+ if (initialized) super.profileEnd(title);
+ }
+ @Override
+ public void warn(Object arg) {
+ if (initialized) super.warn(arg);
+ }
@Override
public void group(Object arg) {}
@Override
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseReqBuilder.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseReqBuilder.java
index c19cf704..8ec7cc7a 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseReqBuilder.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/deferred/PromiseReqBuilder.java
@@ -124,7 +124,9 @@ public class PromiseReqBuilder extends DeferredPromiseImpl implements RequestCal
xmlHttpRequest.setRequestHeader("Content-Type", ctype);
}
- xmlHttpRequest.setWithCredentials(true);
+ // Using gQuery to set credentials since this method was added in 2.5.1
+ // xmlHttpRequest.setWithCredentials(true);
+ JsUtils.prop(xmlHttpRequest, "withCredentials", true);
final Request request = createRequestVltr(xmlHttpRequest, settings.getTimeout(), this);
@@ -169,6 +171,6 @@ public class PromiseReqBuilder extends DeferredPromiseImpl implements RequestCal
* Using violator pattern to use protected constructor
*/
private native Request createRequestVltr(XMLHttpRequest rq, int ms, RequestCallback cb) /*-{
- return @com.google.gwt.http.client.Request::new(Lcom/google/gwt/xhr/client/XMLHttpRequest;ILcom/google/gwt/http/client/RequestCallback;)(rq,
+ return @com.google.gwt.http.client.Request::new(Lcom/google/gwt/xhr/client/XMLHttpRequest;ILcom/google/gwt/http/client/RequestCallback;)(rq,cb);
}-*/;
}