X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FXWT.java;h=1d2326d82a92b40cd0ca16f9e142230a1d038978;hb=9d69dec685c5385a130c2850bbe86ee70dd83ccf;hp=33d778826c47c113e3d7a93d5d6b70461191be02;hpb=37fa198f384c4cbdb122a44e9dc33e5287fc1ad2;p=org.ibex.core.git diff --git a/src/org/xwt/XWT.java b/src/org/xwt/XWT.java index 33d7788..1d2326d 100644 --- 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("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); } @@ -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("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); @@ -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 { + if (args.length > 0) + if (Log.on) Log.log(XWT.class, "DEPRECATED: xwt.newBox() with multiple arguments is deprecated; use xwt.newBox().apply() " + + Context.enter().interpreterSourceFile + ":" + Context.enter().interpreterLine); + Function callback = null; for(int i=1; i