Skip to content

Commit 363cf49

Browse files
committed
Adds spinner image and ?j2snozcore option (uncompressed core)
Info.spinnerImage default is swingjs/j2s/core/Spinner.gif other possibilities: Info.spinnerImage: 'none', Info.spinnerImage: 'xxx/yyy.gif', (still in core/) page host root: Info.spinnerImage: '/xxx/yyy.gif', arbitrary image: Info.spinnerImage: 'https://....xxx/yyy.gif',
1 parent f86918f commit 363cf49

File tree

9 files changed

+38
-13
lines changed

9 files changed

+38
-13
lines changed
19 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20191031001912
1+
20191031090934
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20191031001912
1+
20191031090934
19 KB
Binary file not shown.
25.4 KB
Loading

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,15 @@ if (typeof(SwingJS) == "undefined") {
9898
jarPath: "java",
9999
jarFile: "[code].jar",
100100
j2sPath: "j2s",
101+
spinnerImage: "core/Spinner.gif",
101102
disableJ2SLoadMonitor: false,
102103
disableInitialConsole: false,
103104
debug: false
104105
};
105106

106107
J2S._addDefaultInfo(Info, DefaultInfo);
108+
109+
107110
Info.jarFile && Info.code && Info.jarFile.replace(/\[code\]/,Info.code);
108111
J2S._debugAlert = Info.debug;
109112
Info.serverURL && (J2S._serverUrl = Info.serverURL);

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

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

3-
// J2S._version set to "3.2.4.07" 2019.01.04; 2019.02.06
3+
// J2S._version set to "3.2.4.09" 2019.10.31
44

5+
// BH 2019.10.31 (Karsten Blankenagel) adds Info.spinnerImage: ["none"|<j2sdir/>path|/path|http[s]://path]
56
// BH 2019.10.20 fixes modal for popup dialog; still needs work for two applets?
67
// BH 2019.09.13 fixes touchend canceling click
78
// BH 2019.08.29 fixes mouseupoutjsmol not firing MouseEvent.MOUSE_UP
@@ -32,10 +33,13 @@ self.J2S
3233

3334
try {
3435
// will alert in system.out.println with a message when events occur
35-
J2S._traceEvents = (document.location.href.indexOf("j2sevents") >= 0)
36-
J2S._traceMouse = (document.location.href.indexOf("j2smouse") >= 0)
37-
J2S._traceMouseMove = (document.location.href.indexOf("j2smousemove") >= 0)
38-
J2S._startProfiling = (document.location.href.indexOf("j2sprofile") >= 0)
36+
J2S._traceEvents = (document.location.href.indexOf("j2sevents") >= 0);
37+
J2S._traceMouse = (document.location.href.indexOf("j2smouse") >= 0);
38+
J2S._traceMouseMove = (document.location.href.indexOf("j2smousemove") >= 0);
39+
J2S._startProfiling = (document.location.href.indexOf("j2sprofile") >= 0);
40+
if (document.location.href.indexOf("j2snozcore") >= 0)
41+
J2S._coreZExt = "";
42+
3943
} catch (e) {}
4044

4145
J2S.onClazzLoaded || (J2S.onClazzLoaded = function(i, msg) {console.log([i,msg])});
@@ -64,7 +68,7 @@ if (!J2S._version)
6468
var z = J2S.z || 9000;
6569
var j = {
6670

67-
_version : "3.2.4.07", // svn.keywords:lastUpdated
71+
_version : "3.2.4.09", // svn.keywords:lastUpdated
6872
_alertNoBinary : true,
6973
_allowedAppletSize : [ 25, 2048, 500 ], // min, max, default
7074
// (pixels)
@@ -86,6 +90,7 @@ if (!J2S._version)
8690
_applets : {},
8791
_asynchronous : true,
8892
_ajaxQueue : [],
93+
_coreZExt : ".z",
8994
_persistentMenu : false,
9095
_getZOrders : getZOrders,
9196
_z : getZOrders(z),
@@ -1179,6 +1184,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
11791184
// when leaving page, Java applet may be dead
11801185
applet._appletPanel = (javaAppletPanel || javaApplet);
11811186
applet._applet = javaApplet;
1187+
J2S.$css(J2S.$(applet, 'appletdiv'), { 'background-image': '' });
11821188
}
11831189
J2S._track(applet.readyCallback(appId, fullId, isReady));
11841190
}
@@ -1236,6 +1242,8 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
12361242
......<div id=\"ID_appletdiv\" style=\"z-index:"
12371243
+ J2S.getZ(applet, "header")
12381244
+ ";width:100%;height:100%;position:absolute;top:0px;left:0px;"
1245+
+ (applet._spinnerImage ?
1246+
"background-image:url(" + applet._spinnerImage + "); background-repeat:no-repeat; background-position:center;" : "")
12391247
+ css + ">";
12401248
var height = applet._height;
12411249
var width = applet._width;
@@ -1289,7 +1297,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
12891297
!J2S._fileCache && obj._cacheFiles && (J2S._fileCache = {});
12901298
if (!obj._console)
12911299
obj._console = obj._id + "_infodiv";
1292-
if (obj._console == "none")
1300+
if (obj._console == "none" || obj._console == "NONE")
12931301
obj._console = null;
12941302

12951303
obj._color = (Info.color ? Info.color.replace(/0x/, "#") : "#FFFFFF");
@@ -2301,7 +2309,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
23012309
__coreSet.push(type);
23022310
__coreSet.sort();
23032311
J2S._coreFiles = [ path + "/core/core" + __coreSet.join("")
2304-
+ ".z.js" ];
2312+
+ J2S._coreZExt + ".js" ];
23052313
}
23062314
if (more && (more = more.split(" ")))
23072315
for (var i = 0; i < more.length; i++)
@@ -2326,6 +2334,9 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
23262334
this._isJSV = Info._isJSV || false;
23272335
this._isAstex = Info._isAstex || false;
23282336
this._platform = Info._platform || "";
2337+
this._spinnerImage = (!Info.spinnerImage || Info.spinnerImage == "NONE" || Info.spinnerImage == "none" ? null
2338+
: Info.spinnerImage.indexOf("//") < 0 && Info.spinnerImage.indexOf("/") != 0 ? Info.j2sPath + "/" + Info.spinnerImage
2339+
: Info.spinnerImage);
23292340
if (checkOnly)
23302341
return this;
23312342
J2S.setWindowVar(id, this);
@@ -2907,6 +2918,7 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
29072918
fDown(xy, 501);
29082919
} else if (target) {
29092920
var o = $(target(501)).position();
2921+
if (!o) return false;
29102922
xy = {
29112923
x : o.left,
29122924
y : o.top

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10669,8 +10669,9 @@ return jQuery;
1066910669
})(jQuery,document,"click mousemove mouseup touchmove touchend", "outjsmol");
1067010670
// j2sApplet.js BH = Bob Hanson hansonr@stolaf.edu
1067110671

10672-
// J2S._version set to "3.2.4.07" 2019.01.04; 2019.02.06
10672+
// J2S._version set to "3.2.4.09" 2019.10.31
1067310673

10674+
// BH 2019.10.31 (Karsten Blankenagel) adds Info.spinnerImage: ["none"|<j2sdir/>path|/path|http[s]://path]
1067410675
// BH 2019.10.20 fixes modal for popup dialog; still needs work for two applets?
1067510676
// BH 2019.09.13 fixes touchend canceling click
1067610677
// BH 2019.08.29 fixes mouseupoutjsmol not firing MouseEvent.MOUSE_UP
@@ -10733,7 +10734,7 @@ if (!J2S._version)
1073310734
var z = J2S.z || 9000;
1073410735
var j = {
1073510736

10736-
_version : "3.2.4.07", // svn.keywords:lastUpdated
10737+
_version : "3.2.4.09", // svn.keywords:lastUpdated
1073710738
_alertNoBinary : true,
1073810739
_allowedAppletSize : [ 25, 2048, 500 ], // min, max, default
1073910740
// (pixels)
@@ -11848,6 +11849,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
1184811849
// when leaving page, Java applet may be dead
1184911850
applet._appletPanel = (javaAppletPanel || javaApplet);
1185011851
applet._applet = javaApplet;
11852+
J2S.$css(J2S.$(applet, 'appletdiv'), { 'background-image': '' });
1185111853
}
1185211854
J2S._track(applet.readyCallback(appId, fullId, isReady));
1185311855
}
@@ -11905,6 +11907,8 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
1190511907
......<div id=\"ID_appletdiv\" style=\"z-index:"
1190611908
+ J2S.getZ(applet, "header")
1190711909
+ ";width:100%;height:100%;position:absolute;top:0px;left:0px;"
11910+
+ (applet._spinnerImage ?
11911+
"background-image:url(" + applet._spinnerImage + "); background-repeat:no-repeat; background-position:center;" : "")
1190811912
+ css + ">";
1190911913
var height = applet._height;
1191011914
var width = applet._width;
@@ -11958,7 +11962,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
1195811962
!J2S._fileCache && obj._cacheFiles && (J2S._fileCache = {});
1195911963
if (!obj._console)
1196011964
obj._console = obj._id + "_infodiv";
11961-
if (obj._console == "none")
11965+
if (obj._console == "none" || obj._console == "NONE")
1196211966
obj._console = null;
1196311967

1196411968
obj._color = (Info.color ? Info.color.replace(/0x/, "#") : "#FFFFFF");
@@ -12995,6 +12999,9 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
1299512999
this._isJSV = Info._isJSV || false;
1299613000
this._isAstex = Info._isAstex || false;
1299713001
this._platform = Info._platform || "";
13002+
this._spinnerImage = (!Info.spinnerImage || Info.spinnerImage == "NONE" || Info.spinnerImage == "none" ? null
13003+
: Info.spinnerImage.indexOf("//") < 0 && Info.spinnerImage.indexOf("/") != 0 ? Info.j2sPath + "/" + Info.spinnerImage
13004+
: Info.spinnerImage);
1299813005
if (checkOnly)
1299913006
return this;
1300013007
J2S.setWindowVar(id, this);
@@ -19585,12 +19592,15 @@ if (typeof(SwingJS) == "undefined") {
1958519592
jarPath: "java",
1958619593
jarFile: "[code].jar",
1958719594
j2sPath: "j2s",
19595+
spinnerImage: "core/Spinner.gif",
1958819596
disableJ2SLoadMonitor: false,
1958919597
disableInitialConsole: false,
1959019598
debug: false
1959119599
};
1959219600

1959319601
J2S._addDefaultInfo(Info, DefaultInfo);
19602+
19603+
1959419604
Info.jarFile && Info.code && Info.jarFile.replace(/\[code\]/,Info.code);
1959519605
J2S._debugAlert = Info.debug;
1959619606
Info.serverURL && (J2S._serverUrl = Info.serverURL);

0 commit comments

Comments
 (0)