Skip to content

Commit be50a4e

Browse files
committed
adds "zakodium.com" to list of x-domain allowed ajax
1 parent 2469edf commit be50a4e

File tree

10 files changed

+51
-20
lines changed

10 files changed

+51
-20
lines changed
2.44 KB
Binary file not shown.

sources/net.sf.j2s.core/dist/swingjs/differences.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
java2script/SwingJS Notes
22
=========================
33

4+
updated 5/4/2025 -- clarity about not supporting UI subclassing
45
updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
56
updated 12/31/2020 -- full support for 64-bit long
67
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
@@ -359,6 +360,9 @@ Java or JavaScript equivalents.
359360
Swing GUI Peers and UIClasses
360361
-----------------------------
361362

363+
SwingJS does not support custom UI classes that subclass UI classes in javax/swing/plaf
364+
or com/sun/javax/swing/plaf.
365+
362366
One of the biggest adaptations introduced in SwingJS is in the area of the graphical
363367
user interface. Basically, what we have is a Java Swing "LookAndFeel" customized for HTML.
364368

@@ -369,7 +373,7 @@ component "uiClass" (one per component, such as BasicButtonUI or BasicTextFieldU
369373
Peers are native objects of the operating system. These are the virtual buttons and text areas
370374
that the user is interacting with at a very base level. They are chunks of low-level code that
371375
paint the screen to give the illusion that you really are pressing a button or typing text
372-
ot the screen. Their events are being passed on to Java or the browser by the operating system.
376+
to the screen. Their events are being passed on to Java or the browser by the operating system.
373377

374378
UI classes provide a consistent "look and feel" for these native objects, rendering them onto
375379
the native window canvas and handling all user-generated events. They paint the borders,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20250724191407
1+
20250903235007
2.44 KB
Binary file not shown.

sources/net.sf.j2s.core/dist/swingjs/ver/5.0.1/differences.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
java2script/SwingJS Notes
22
=========================
33

4+
updated 5/4/2025 -- clarity about not supporting UI subclassing
45
updated 3/11/2023 -- adds support for Java Regex Matcher.start/end(groupID) and .start/end(groupName)
56
updated 12/31/2020 -- full support for 64-bit long
67
updated 12/6/2020 -- note about restrictions on long, including BitSet and Scanner
@@ -359,6 +360,9 @@ Java or JavaScript equivalents.
359360
Swing GUI Peers and UIClasses
360361
-----------------------------
361362

363+
SwingJS does not support custom UI classes that subclass UI classes in javax/swing/plaf
364+
or com/sun/javax/swing/plaf.
365+
362366
One of the biggest adaptations introduced in SwingJS is in the area of the graphical
363367
user interface. Basically, what we have is a Java Swing "LookAndFeel" customized for HTML.
364368

@@ -369,7 +373,7 @@ component "uiClass" (one per component, such as BasicButtonUI or BasicTextFieldU
369373
Peers are native objects of the operating system. These are the virtual buttons and text areas
370374
that the user is interacting with at a very base level. They are chunks of low-level code that
371375
paint the screen to give the illusion that you really are pressing a button or typing text
372-
ot the screen. Their events are being passed on to Java or the browser by the operating system.
376+
to the screen. Their events are being passed on to Java or the browser by the operating system.
373377

374378
UI classes provide a consistent "look and feel" for these native objects, rendering them onto
375379
the native window canvas and handling all user-generated events. They paint the borders,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20250724191407
1+
20250903235007
284 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// j2sApplet.js BH = Bob Hanson hansonr@stolaf.edu
22

3+
// BH 2025.08.16 allow loading file:/// from current directory
34
// BH 2025.04.20 adds Info.coreAssets:"coreAssets.zip"
45
// BH 2025.04.18 enables Info.readyFunction for headless apps
56
// BH 2025.04.17 adds option for explicit directory for core files different from j2sPath/core
@@ -189,6 +190,7 @@ window.J2S = J2S = (function() {
189190
// null here means no conversion necessary
190191
"INTERNET.TEST" : "https://pubchem.ncbi.nlm.nih.gov",
191192
"chemapps.stolaf.edu" : null,
193+
"zakodium.com":null,
192194
"cactus.nci.nih.gov" : null,
193195
".x3dna.org" : null,
194196
"rruff.geo.arizona.edu" : null,
@@ -922,17 +924,25 @@ if (database == "_" && J2S._serverUrl.indexOf("//your.server.here/") >= 0) {
922924
// swingjs.api.J2SInterface
923925
// use host-server PHP relay if not from this host
924926

925-
if (fileName.indexOf("/") == 0)
927+
if (fileName.indexOf("/") == 0) {
926928
fileName = "." + fileName;
927-
else if (fileName.indexOf("https://./") == 0)
929+
} else if (fileName.indexOf("https://./") == 0) {
928930
fileName = fileName.substring(10);
929-
else if (fileName.indexOf("http://./") == 0)
931+
} else if (fileName.indexOf("http://./") == 0) {
930932
fileName = fileName.substring(9);
931-
else if (fileName.indexOf("file:/") >= 0
932-
&& Clazz.loadClass("swingjs.JSUtil") != null
933-
&& fileName.indexOf(swingjs.JSUtil.getAppletDocumentPath$()) != 0
934-
&& fileName.indexOf(swingjs.JSUtil.getAppletCodePath$()) != 0)
935-
fileName = "./" + fileName.substring(5);
933+
} else if (fileName.indexOf("file:/") >= 0) {
934+
var pt = fileName.lastIndexOf("/");
935+
if (fileName.indexOf("/core_") == pt && fileName.endsWith(".js")
936+
|| document && (pt = document.location.href.lastIndexOf("/") + 1) > 0
937+
&& fileName.indexOf(document.location.href.substring(0, pt) == 0)) {
938+
// allow core_*.js from anywhere, or other files within the local document path
939+
} else if (Clazz.loadClass("swingjs.JSUtil") != null
940+
&& fileName.indexOf(swingjs.JSUtil.getAppletDocumentPath$()) != 0
941+
&& fileName.indexOf(swingjs.JSUtil.getAppletCodePath$()) != 0) {
942+
// applet only, not application
943+
fileName = "./" + fileName.substring(5);
944+
}
945+
}
936946
isBinary = (isBinary || J2S.isBinaryUrl(fileName));
937947
var isPDB = !noProxy && (fileName.indexOf("pdb.gz") >= 0 && fileName
938948
.indexOf("//www.rcsb.org/pdb/files/") >= 0);
@@ -977,6 +987,10 @@ if (database == "_" && J2S._serverUrl.indexOf("//your.server.here/") >= 0) {
977987
info.type = "POST";
978988
info.url = fileName.split("?POST?")[0]
979989
info.data = fileName.split("?POST?")[1]
990+
if (info.data.startsWith('{"')) {
991+
info.contentType = "application/json";
992+
info.data = info.data.replaceAll("\n", "\\\\n");
993+
}
980994
} else {
981995
!info.type && (info.type = "GET");
982996
info.url = fileName;

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10686,6 +10686,7 @@ return jQuery;
1068610686
})(jQuery,document,"click mousemove mouseup touchmove touchend", "outjsmol");
1068710687
// j2sApplet.js BH = Bob Hanson hansonr@stolaf.edu
1068810688

10689+
// BH 2025.08.16 allow loading file:/// from current directory
1068910690
// BH 2025.04.20 adds Info.coreAssets:"coreAssets.zip"
1069010691
// BH 2025.04.18 enables Info.readyFunction for headless apps
1069110692
// BH 2025.04.17 adds option for explicit directory for core files different from j2sPath/core
@@ -11608,17 +11609,25 @@ if (database == "_" && J2S._serverUrl.indexOf("//your.server.here/") >= 0) {
1160811609
// swingjs.api.J2SInterface
1160911610
// use host-server PHP relay if not from this host
1161011611

11611-
if (fileName.indexOf("/") == 0)
11612+
if (fileName.indexOf("/") == 0) {
1161211613
fileName = "." + fileName;
11613-
else if (fileName.indexOf("https://./") == 0)
11614+
} else if (fileName.indexOf("https://./") == 0) {
1161411615
fileName = fileName.substring(10);
11615-
else if (fileName.indexOf("http://./") == 0)
11616+
} else if (fileName.indexOf("http://./") == 0) {
1161611617
fileName = fileName.substring(9);
11617-
else if (fileName.indexOf("file:/") >= 0
11618-
&& Clazz.loadClass("swingjs.JSUtil") != null
11619-
&& fileName.indexOf(swingjs.JSUtil.getAppletDocumentPath$()) != 0
11620-
&& fileName.indexOf(swingjs.JSUtil.getAppletCodePath$()) != 0)
11621-
fileName = "./" + fileName.substring(5);
11618+
} else if (fileName.indexOf("file:/") >= 0) {
11619+
var pt = fileName.lastIndexOf("/");
11620+
if (fileName.indexOf("/core_") == pt && fileName.endsWith(".js")
11621+
|| document && (pt = document.location.href.lastIndexOf("/") + 1) > 0
11622+
&& fileName.indexOf(document.location.href.substring(0, pt) == 0)) {
11623+
// allow core_*.js from anywhere, or other files within the local document path
11624+
} else if (Clazz.loadClass("swingjs.JSUtil") != null
11625+
&& fileName.indexOf(swingjs.JSUtil.getAppletDocumentPath$()) != 0
11626+
&& fileName.indexOf(swingjs.JSUtil.getAppletCodePath$()) != 0) {
11627+
// applet only, not application
11628+
fileName = "./" + fileName.substring(5);
11629+
}
11630+
}
1162211631
isBinary = (isBinary || J2S.isBinaryUrl(fileName));
1162311632
var isPDB = !noProxy && (fileName.indexOf("pdb.gz") >= 0 && fileName
1162411633
.indexOf("//www.rcsb.org/pdb/files/") >= 0);

0 commit comments

Comments
 (0)