X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fjs%2FSwingJS.js;h=a9bac7c292fb86a84680e578036288b16e4b4388;hp=42e819d3e1e54e664ba65a80888465affd1fe11d;hb=7301a2415adab88038b291fc54caeeb3a5a47a44;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/site/js/SwingJS.js b/site/js/SwingJS.js index 42e819d..a9bac7c 100644 --- a/site/js/SwingJS.js +++ b/site/js/SwingJS.js @@ -1,5 +1,6 @@ // SwingJS.js +// BH 7/24/2015 9:09:39 AM allows setting Info.resourcePath // BH 4/28/2015 10:15:32 PM adds getAppletHtml // BH 4/2/2015 5:17:44 PM adds SwingJS.getJavaResource(path) @@ -17,17 +18,15 @@ if (typeof(SwingJS) == "undefined") { return SwingJS._Applet._get(id, Info, checkOnly); } - SwingJS.getJavaResource = function(path) { + SwingJS.getJavaResource = function(path, isJavaPath) { if (path.indexOf("http") != 0) { var applet = Jmol._applets[java.lang.Thread.currentThread().getName()]; - path = (applet.__Info.resourcePath || applet.__Info.j2sPath) + "/" + path + path = (!isJavaPath && applet.__Info.resourcePath || applet.__Info.j2sPath) + "/" + path } - System.out.println("Swingjs.js getJavaResource " + path); + System.out.println("Swingjs.js getJavaResource " + path) var s = Jmol._getFileData(path); - System.out.println(s); if (s.indexOf("[Exception") == 0) return null; - System.out.println("Swingjs.js getJavaResource len=" + s.length); if (path.lastIndexOf(".css") == path.length - 4) { path = path.substring(0, path.lastIndexOf("/") + 1) + "images/"; s = s.replace(/images\//g, path)