Skip to content

Commit 7aa19fe

Browse files
author
zhourenjian
committed
Fixing Opera loading script fails on "../package.js"
Fixing IE 6.0- bugs
1 parent 32d4d07 commit 7aa19fe

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

sources/net.sf.j2s.java.core/src/java/lang/ClassExt.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,29 @@ Clazz.removeEvent = function (element, type, handler) {
10471047
}
10481048
};
10491049

1050+
/* private */
1051+
Clazz.isVeryOldIE = navigator.userAgent.indexOf("MSIE 6.0") != -1 || navigator.userAgent.indexOf("MSIE 5.5") != -1 || navigator.userAgent.indexOf("MSIE 5.0") != -1;
1052+
10501053
/* protected */
10511054
Clazz.handleEvent = function (event) {
10521055
var returnValue = true;
10531056
// grab the event object (IE uses a global event object)
1054-
event = event || Clazz.fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
1057+
if (!Clazz.isVeryOldIE) {
1058+
event = event || Clazz.fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
1059+
} else { // The above line is buggy in IE 6.0
1060+
if (event == null) {
1061+
var evt = null;
1062+
try {
1063+
var pWindow = (this.ownerDocument || this.document || this).parentWindow;
1064+
if (pWindow != null) {
1065+
evt = pWindow.event;
1066+
}
1067+
} catch (e) {
1068+
evt = window.event;
1069+
}
1070+
event = Clazz.fixEvent(evt);
1071+
}
1072+
}
10551073
// get a reference to the hash table of event handlers
10561074
var handlers = this.events[event.type];
10571075
// execute each event handler

sources/net.sf.j2s.java.core/src/java/lang/ClassLoader.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,10 @@ ClazzLoader.generatingW3CScriptOnCallback = function (path, forError) {
939939
}
940940
this.onload = null;
941941
this.onerror = null;
942+
if (!forError && ClazzLoader.isOpera // Opera only
943+
&& !ClazzLoader.innerLoadedScripts[this.src]) {
944+
ClazzLoader.checkInteractive();
945+
}
942946
if (forError || (!ClazzLoader.innerLoadedScripts[this.src]
943947
&& ClazzLoader.isOpera)) {
944948
// Opera will not take another try.
@@ -976,6 +980,9 @@ ClazzLoader.generatingIEScriptOnCallback = function (path) {
976980
var fss = ClazzLoader.failedScripts;
977981
var state = "" + this.readyState;
978982

983+
984+
985+
979986
var local = state == "loading"
980987
&& (this.src.indexOf ("file:") == 0
981988
|| (window.location.protocol == "file:"

sources/net.sf.j2s.java.core/src/java/lang/ClassLoaderProgressMonitor.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ clpm.DEFAULT_OPACITY = 55;
9191
};
9292
/* private */ clpm.createHandle = function () {
9393
var div = document.createElement ("DIV");
94+
div.id = "clazzloader-status";
9495
div.style.cssText = "position:absolute;bottom:4px;left:4px;padding:2px 8px;"
9596
+ "z-index:3333;background-color:#8e0000;color:yellow;"
9697
+ "font-family:Arial, sans-serif;font-size:10pt;white-space:nowrap;";

0 commit comments

Comments
 (0)