Skip to content

Commit dc85fad

Browse files
committed
transpiler update for template.html
1 parent a127d65 commit dc85fad

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed
157 Bytes
Binary file not shown.
157 Bytes
Binary file not shown.

sources/net.sf.j2s.core/src/net/sf/j2s/core/compiler/Java2ScriptCompiler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,11 @@ public void process(ICompilationUnit sourceUnit, IContainer binaryFolder) {
9797

9898
if (htmlTemplate == null) {
9999
String htmlTemplateFile = getProperty("template.html");
100-
//System.err.println("htmltemplate " + htmlTemplateFile);
100+
//System.err.println("prop htmltemplate " + htmlTemplateFile);
101101
if (htmlTemplateFile == null)
102102
htmlTemplateFile = "template.html";
103-
//System.err.println("htmltemplate " + htmlTemplateFile);
104103
file = new File(prjFolder, htmlTemplateFile);
105-
//System.err.println("htmltemplate " + htmlTemplateFile);
104+
//System.err.println("using htmltemplate " + htmlTemplateFile);
106105
if (!file.exists()) {
107106
String html = getDefaultHTMLTemplate();
108107
System.err.println("creating new htmltemplate\n" + html);
@@ -328,10 +327,11 @@ private String getDefaultHTMLTemplate() {
328327
+"}\n"
329328
+"</script>\n</head>\n<body>\n<script>\n"
330329
+"SwingJS.getApplet('testApplet', Info)\n"
330+
+"getClassList = function(){J2S._saveFile('_j2sclasslist.txt', Clazz.ClassFilesLoaded.sort().join('\\n'))}\n"
331331
+"</script>\n"
332332
+"<div style=\"position:absolute;left:900px;top:30px;width:600px;height:300px;\">\n"
333333
+"<div id=sysoutdiv style=\"border:1px solid green;width:100%;height:95%;overflow:auto\"></div>\n"
334-
+"This is System.out. <a href=\"javascript:testApplet._clearConsole()\">clear it</a> \n"
334+
+"This is System.out. <a href=\"javascript:testApplet._clearConsole()\">clear it</a> <br>Add ?j2snocore to URL to see full class list; ?j2sdebug to use uncompressed j2s/core files <br><a href=\"javascript:getClassList()\">get _j2sClassList.txt</a>\n"
335335
+"</div>\n"
336336
+"</body>\n"
337337
+"</html>\n";

sources/net.sf.j2s.core/test/template.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
console:'sysoutdiv',
1515
allowjavascript: true
1616
}
17+
getClassList = function(){
18+
J2S._saveFile("_j2sclasslist.txt", Clazz.ClassFilesLoaded.sort().join("\n"))
19+
}
1720
</script>
1821
</head>
1922
<body>
@@ -22,7 +25,7 @@
2225
</script>
2326
<div style="position:absolute;left:900px;top:30px;width:600px;height:300px;">
2427
<div id=sysoutdiv style="border:1px solid green;width:100%;height:95%;overflow:auto"></div>
25-
This is System.out. <a href="javascript:testApplet._clearConsole()">clear it</a>
28+
This is System.out. <a href="javascript:testApplet._clearConsole()">clear it</a> <a href="javascript:getClassList()">get _j2sClassList.txt</a>
2629
</div>
2730
</body>
2831
</html>

0 commit comments

Comments
 (0)