Skip to content

Commit cd39896

Browse files
committed
SwingJS-site.zip update
1 parent 596fd9d commit cd39896

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed
2.13 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200426170415
1+
20200429091705
2.13 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200426170415
1+
20200429091705
2.13 KB
Binary file not shown.

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11573,8 +11573,14 @@ if (database == "_" && J2S._serverUrl.indexOf("//your.server.here/") >= 0) {
1157311573
var isNotDirectCall = !mustCallHome && !isFile && !isMyHost && !(url = J2S._isDirectCall(fileName));
1157411574
fileName = url || fileName;
1157511575
var data = null;
11576+
var error = null;
11577+
var success = null;
11578+
if (fWhenDone) {
11579+
success = function(data) { fWhenDone(isTyped ? data : J2S._strToBytes(data)) };
11580+
error = function() { fWhenDone(null) };
11581+
}
1157611582
if (mustCallHome || isNotDirectCall) {
11577-
data = J2S._getRawDataFromServer("_", fileName, fWhenDone, fWhenDone,
11583+
data = J2S._getRawDataFromServer("_", fileName, success, error,
1157811584
asBase64, true, info);
1157911585
} else {
1158011586
fileName = fileName.replace(/file:\/\/\/\//, "file://"); // opera
@@ -11589,8 +11595,14 @@ if (database == "_" && J2S._serverUrl.indexOf("//your.server.here/") >= 0) {
1158911595
info.url = fileName;
1159011596
}
1159111597
if (fWhenDone) {
11592-
info.success = function(data) { fWhenDone(J2S._xhrReturn(info.xhr)) };
11593-
info.error = function() { fWhenDone(info.xhr.statusText) };
11598+
if (isBinary) {
11599+
info.success = success;
11600+
info.error = error;
11601+
} else {
11602+
// BH don't know why this is so complicated
11603+
info.success = function(data) { fWhenDone(J2S._xhrReturn(info.xhr)) };
11604+
info.error = function() { fWhenDone(info.xhr.statusText) };
11605+
}
1159411606
}
1159511607
info.xhr = J2S.$ajax(info);
1159611608
if (!fWhenDone) {
@@ -11871,7 +11883,7 @@ if (database == "_" && J2S._serverUrl.indexOf("//your.server.here/") >= 0) {
1187111883
}
1187211884
if (postOut)
1187311885
url += "?POST?" + postOut;
11874-
return J2S.getFileData(url, null, true, info);
11886+
return J2S.getFileData(url, info.fWhenDone, true, info);
1187511887
}
1187611888

1187711889
// J2S._localFileSaveFunction -- // do something local here; Maybe try the

0 commit comments

Comments
 (0)