Skip to content

Commit 194152c

Browse files
hansonrhansonr
authored andcommitted
_applet._j2sFullPath and JSUtil.getJ2SPath()
1 parent 68647cf commit 194152c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

sources/net.sf.j2s.java.core/src/swingjs/JSUtil.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,8 @@ public Promise importModule(String resource, Function<Object, Object> resolve, F
12191219
Object o = DOMNode.class;
12201220
loadStaticResource("/_ES6/jsutil.js");
12211221
if (resource.startsWith("$J2S$/"))
1222-
resource = getJ2SPath() + resource.substring(6);
1222+
resource = getJ2SPath() + resource.substring(5);
1223+
System.out.println("JSUtil.importModule " + resource);
12231224
return /** @j2sNative J2S._ES6.jsutil.importModule(resource, resolve, reject) ||*/null;
12241225
}
12251226

@@ -1249,9 +1250,12 @@ public void accept(Object o) {
12491250

12501251
}
12511252

1253+
/**
1254+
* this path does not end in /
1255+
*/
12521256
@Override
12531257
public String getJ2SPath() {
1254-
return (String) getAppletAttribute("_codePath");
1258+
return (String) getAppletAttribute("_j2sFullPath");
12551259
}
12561260

12571261

sources/net.sf.j2s.java.core/srcjs/js/j2sApplet.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,6 +2780,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
27802780
base[base.length - 1] = codePath;
27812781
codePath = base.join("/");
27822782
}
2783+
applet._j2sFullPath = codePath.substring(0, codePath.length);
27832784
if (applet.__Info.code)
27842785
codePath += applet.__Info.code.replace(/\./g, "/");
27852786
codePath = codePath.substring(0,

0 commit comments

Comments
 (0)