diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index d0db139ff..14b02de01 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -4622,6 +4622,34 @@ public class PApplet extends Applet } } + // Finally, something special for the Internet Explorer users. Turns out + // that we can't get files that are part of the same folder using the + // methods above when using IE, so we have to resort to the old skool + // getDocumentBase() from teh applet dayz. 1996, my brotha. + try { + URL base = getDocumentBase(); + if (base != null) { + URL url = new URL(base, filename); + URLConnection conn = url.openConnection(); + return conn.getInputStream(); +// if (conn instanceof HttpURLConnection) { +// HttpURLConnection httpConnection = (HttpURLConnection) conn; +// // test for 401 result (HTTP only) +// int responseCode = httpConnection.getResponseCode(); +// } + } + } catch (Exception e) { } // IO or NPE or... + + // Now try it with a 'data' subfolder. getting kinda desperate for data... + try { + URL base = getDocumentBase(); + if (base != null) { + URL url = new URL(base, "data/" + filename); + URLConnection conn = url.openConnection(); + return conn.getInputStream(); + } + } catch (Exception e) { } + try { // attempt to load from a local file, used when running as // an application, or as a signed applet @@ -4647,6 +4675,7 @@ public class PApplet extends Applet //die(e.getMessage(), e); e.printStackTrace(); } + return null; } diff --git a/core/todo.txt b/core/todo.txt index d95d6929a..af1e04ab2 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,11 +1,31 @@ 0187 core X add requestFocusInWindow() call to replace requestFocus() X http://code.google.com/p/processing/issues/detail?id=279 +X add getDocumentBase() version to createInput() for internet explorer + + +LIBRARIES / XML + +_ add getBoolean() methods? +_ http://code.google.com/p/processing/issues/detail?id=304 +_ handle charset decoding in xml element parser? +_ same with the other methods like loadStrings() +_ could also be a way to handle gzip too? +_ tho charset + gzip would be a problem +_ need to handle how save() works inside xml lib +_ need to handle