Skip to content

Commit 73d5449

Browse files
committed
Adds spinner image.
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 73d5449

File tree

9 files changed

+28
-8
lines changed

9 files changed

+28
-8
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: 10 additions & 3 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
@@ -64,7 +65,7 @@ if (!J2S._version)
6465
var z = J2S.z || 9000;
6566
var j = {
6667

67-
_version : "3.2.4.07", // svn.keywords:lastUpdated
68+
_version : "3.2.4.09", // svn.keywords:lastUpdated
6869
_alertNoBinary : true,
6970
_allowedAppletSize : [ 25, 2048, 500 ], // min, max, default
7071
// (pixels)
@@ -1179,6 +1180,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
11791180
// when leaving page, Java applet may be dead
11801181
applet._appletPanel = (javaAppletPanel || javaApplet);
11811182
applet._applet = javaApplet;
1183+
J2S.$css(J2S.$(applet, 'appletdiv'), { 'background-image': '' });
11821184
}
11831185
J2S._track(applet.readyCallback(appId, fullId, isReady));
11841186
}
@@ -1236,6 +1238,8 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
12361238
......<div id=\"ID_appletdiv\" style=\"z-index:"
12371239
+ J2S.getZ(applet, "header")
12381240
+ ";width:100%;height:100%;position:absolute;top:0px;left:0px;"
1241+
+ (applet._spinnerImage ?
1242+
"background-image:url(" + applet._spinnerImage + "); background-repeat:no-repeat; background-position:center;" : "")
12391243
+ css + ">";
12401244
var height = applet._height;
12411245
var width = applet._width;
@@ -1289,7 +1293,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
12891293
!J2S._fileCache && obj._cacheFiles && (J2S._fileCache = {});
12901294
if (!obj._console)
12911295
obj._console = obj._id + "_infodiv";
1292-
if (obj._console == "none")
1296+
if (obj._console == "none" || obj._console == "NONE")
12931297
obj._console = null;
12941298

12951299
obj._color = (Info.color ? Info.color.replace(/0x/, "#") : "#FFFFFF");
@@ -2326,6 +2330,9 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
23262330
this._isJSV = Info._isJSV || false;
23272331
this._isAstex = Info._isAstex || false;
23282332
this._platform = Info._platform || "";
2333+
this._spinnerImage = (!Info.spinnerImage || Info.spinnerImage == "NONE" || Info.spinnerImage == "none" ? null
2334+
: Info.spinnerImage.indexOf("//") < 0 && Info.spinnerImage.indexOf("/") != 0 ? Info.j2sPath + "/" + Info.spinnerImage
2335+
: Info.spinnerImage);
23292336
if (checkOnly)
23302337
return this;
23312338
J2S.setWindowVar(id, this);

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)