projects
/
org.ibex.core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b4144c
)
2002/08/07 04:53:45
author
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 06:49:48 +0000
(06:49 +0000)
committer
megacz
<megacz@xwt.org>
Fri, 30 Jan 2004 06:49:48 +0000
(06:49 +0000)
darcs-hash:
20040130064948
-2ba56-
a7abc3c754b2eaca68a7f6f37b59e000a88f3767
.gz
CHANGES
patch
|
blob
|
history
src/org/xwt/XWT.java
patch
|
blob
|
history
diff --git
a/CHANGES
b/CHANGES
index
1fe0a9f
..
89c1280
100644
(file)
--- a/
CHANGES
+++ b/
CHANGES
@@
-345,3
+345,7
@@
06-Jul megacz Box.java: use new HTTP interface, getIds() only returns children
06-Jul megacz Box.java: use new HTTP interface, getIds() only returns children
+06-Jul megacz XWT.java: encodeURI, decodeURI, new HTTP stack, calling
+ newBox in the foreground thread is deprecated.
+
+
diff --git
a/src/org/xwt/XWT.java
b/src/org/xwt/XWT.java
index
33d7788
..
00b7066
100644
(file)
--- a/
src/org/xwt/XWT.java
+++ b/
src/org/xwt/XWT.java
@@
-65,6
+65,10
@@
public final class XWT extends JSObject {
else if (name.equals("math")) return org.xwt.util.JSObject.defaultObjects.get("Math", null);
else if (name.equals("loadArchive")) return loadArchive;
else if (name.equals("prefetchImage")) return prefetchImage;
else if (name.equals("math")) return org.xwt.util.JSObject.defaultObjects.get("Math", null);
else if (name.equals("loadArchive")) return loadArchive;
else if (name.equals("prefetchImage")) return prefetchImage;
+ else if (name.equals("encodeURI")) return JSObject.defaultObjects.get("encodeURI", null);
+ else if (name.equals("encodeURIComponent")) return JSObject.defaultObjects.get("encodeURIComponent", null);
+ else if (name.equals("decodeURI")) return JSObject.defaultObjects.get("decodeURI", null);
+ else if (name.equals("decodeURIComponent")) return JSObject.defaultObjects.get("decodeURIComponent", null);
else return super.get(name, start);
}
else return super.get(name, start);
}
@@
-74,11
+78,9
@@
public final class XWT extends JSObject {
else if (name.equals("clipboard")) Platform.setClipBoard(value.toString());
// FIXME: undocumented, possibly insecure
else if (name.equals("clipboard")) Platform.setClipBoard(value.toString());
// FIXME: undocumented, possibly insecure
- else if (name.equals("proxyAuthorization")) try {
- HTTP.ProxyAuthorization.authorization = "Basic " + new String(Base64.encode(value.toString().getBytes("US-ASCII")));
- HTTP.ProxyAuthorization.waitingForUser.release();
- } catch (UnsupportedEncodingException e) {
- if (Log.on) Log.log(this, e);
+ else if (name.equals("proxyAuthorization")) {
+ Proxy.Authorization.authorization = value.toString();
+ Proxy.Authorization.waitingForUser.release();
}
else super.put(name, start, value);
}
else super.put(name, start, value);
@@
-196,6
+198,10
@@
public final class XWT extends JSObject {
private static final JSObject.JSFunction newBox = new JSObject.JSFunction() {
public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
private static final JSObject.JSFunction newBox = new JSObject.JSFunction() {
public Object call(Context cx, Scriptable thisObj, Scriptable ctorObj, Object[] args) throws JavaScriptException {
+ if (args.length > 0 && args[0] != null && !args[0].equals("box") && !(Thread.currentThread() instanceof ThreadMessage))
+ if (Log.on) Log.log(XWT.class, "DEPRECATED: you should not call xwt.newBox() from the foreground thread at " +
+ Context.enter().interpreterSourceFile + ":" + Context.enter().interpreterLine);
+
Function callback = null;
for(int i=1; i<args.length; i++)
if (args[i] instanceof Function && callback == null)
Function callback = null;
for(int i=1; i<args.length; i++)
if (args[i] instanceof Function && callback == null)
@@
-374,8
+380,9
@@
public final class XWT extends JSObject {
} else {
Main.originAddr = InetAddress.getByName("0.0.0.0");
}
} else {
Main.originAddr = InetAddress.getByName("0.0.0.0");
}
- Resources.loadArchive(http.getInputStream(), (int)http.getContentLength(), callback);
-
+ HTTP.HTTPInputStream in = http.GET();
+ Resources.loadArchive(in, in.getContentLength(), callback);
+
} else if (u.getProtocol().equals("file")) {
if (Main.originAddr != null) {
if (Log.on) Log.log(this, "scripts downloaded from the network may not load xwars from the local filesystem");
} else if (u.getProtocol().equals("file")) {
if (Main.originAddr != null) {
if (Log.on) Log.log(this, "scripts downloaded from the network may not load xwars from the local filesystem");