@@ -2576,16 +2576,20 @@ ClazzLoader.updateHotspot = function () {
2576
2576
if ( Clazz . assureInnerClass == null ) {
2577
2577
Clazz . assureInnerClass = ClazzLoader . assureInnerClass ;
2578
2578
}
2579
- var length = ( arguments . length - 1 ) / 3 ;
2579
+ var args = arguments [ 0 ] ;
2580
+ //if (arguments.length != 1 || arguments[0] == null) {
2581
+ // args = arguments;
2582
+ //}
2583
+ var length = ( args . length - 1 ) / 3 ;
2580
2584
var lastID = 0 ;
2581
2585
/*-# lastUpdated -> lUd #-*/
2582
2586
var lastUpdated = 0 ;
2583
2587
/*-# toUpdateClasses -> tUs #-*/
2584
2588
var toUpdateClasses = new Array ( ) ;
2585
2589
for ( var i = 0 ; i < length ; i ++ ) {
2586
- var time = arguments [ i * 3 ] ;
2587
- var id = arguments [ i * 3 + 1 ] ;
2588
- var clazz = arguments [ i * 3 + 2 ] ;
2590
+ var time = args [ i * 3 ] ;
2591
+ var id = args [ i * 3 + 1 ] ;
2592
+ var clazz = args [ i * 3 + 2 ] ;
2589
2593
if ( ( time > ClazzLoader . lastHotspotUpdated )
2590
2594
|| ( time == ClazzLoader . lastHotspotUpdated
2591
2595
&& id > ClazzLoader . lastHotspotSessionID ) ) {
@@ -2647,6 +2651,110 @@ ClazzLoader.hotspotJSTimeout = null;
2647
2651
/*-# lastHotspotJSFailed -> ltJF #-*/
2648
2652
ClazzLoader . lastHotspotJSFailed = false ;
2649
2653
2654
+ /* private */
2655
+ ClazzLoader . loadHotspotScript = function ( hotspotURL , iframeID ) {
2656
+ var script = document . createElement ( "SCRIPT" ) ;
2657
+ script . type = "text/javascript" ;
2658
+ script . src = hotspotURL ;
2659
+ if ( typeof ( script . onreadystatechange ) == "undefined" ) { // W3C
2660
+ script . onload = script . onerror = function ( ) {
2661
+ try {
2662
+ //if (iframeID != null) {
2663
+ if ( window . parent == null || window . parent [ "ClassLoader" ] == null ) return ;
2664
+ window . parent . ClassLoader . lastHotspotScriptLoaded = true ;
2665
+ var iframe = window . parent . document . getElementById ( iframeID ) ;
2666
+ if ( iframe != null ) {
2667
+ iframe . parentNode . removeChild ( iframe ) ;
2668
+ if ( window . parent . ClassLoader . hotspotMonitoringTimeout != null ) {
2669
+ window . parent . clearTimeout ( window . parent . ClassLoader . hotspotMonitoringTimeout ) ;
2670
+ window . parent . ClassLoader . hotspotMonitoringTimeout = null ;
2671
+ }
2672
+ }
2673
+ // return;
2674
+ //}
2675
+ //ClazzLoader.lastHotspotScriptLoaded = true;
2676
+ //ClazzLoader.removeHotspotScriptNode (this);
2677
+ } catch ( e ) { } ; // refreshing browser may cause exceptions
2678
+ } ;
2679
+ } else {
2680
+ script . onreadystatechange = function ( ) {
2681
+ var state = "" + this . readyState ;
2682
+ if ( state == "loaded" || state == "complete" ) {
2683
+ try {
2684
+ //if (iframeID != null) {
2685
+ if ( window . parent == null || window . parent [ "ClassLoader" ] == null ) return ;
2686
+ window . parent . ClassLoader . lastHotspotScriptLoaded = true ;
2687
+ var iframe = window . parent . document . getElementById ( iframeID ) ;
2688
+ if ( iframe != null ) {
2689
+ iframe . parentNode . removeChild ( iframe ) ;
2690
+ if ( window . parent . ClassLoader . hotspotMonitoringTimeout != null ) {
2691
+ window . parent . clearTimeout ( window . parent . ClassLoader . hotspotMonitoringTimeout ) ;
2692
+ window . parent . ClassLoader . hotspotMonitoringTimeout = null ;
2693
+ }
2694
+ }
2695
+ // return;
2696
+ //}
2697
+ //ClazzLoader.lastHotspotScriptLoaded = true;
2698
+ //ClazzLoader.removeHotspotScriptNode (this);
2699
+ } catch ( e ) { } ; // refreshing browser may cause exceptions
2700
+ }
2701
+ } ;
2702
+ }
2703
+ var head = document . getElementsByTagName ( "HEAD" ) [ 0 ] ;
2704
+ head . appendChild ( script ) ;
2705
+ } ;
2706
+
2707
+ /* private */
2708
+ ClazzLoader . iframeDocumentWrite = function ( handle , html ) {
2709
+ if ( handle . contentWindow != null ) {
2710
+ handle . contentWindow . location = "about:blank" ;
2711
+ } else { // Opera
2712
+ handle . src = "about:blank" ;
2713
+ }
2714
+ try {
2715
+ handle . contentWindow . document . write ( html ) ;
2716
+ handle . contentWindow . document . close ( ) ;
2717
+ } catch ( e ) {
2718
+ window . setTimeout ( ( function ( ) {
2719
+ return function ( ) {
2720
+ handle . contentWindow . document . write ( html ) ;
2721
+ handle . contentWindow . document . close ( ) ;
2722
+ } ;
2723
+ } ) ( ) , 25 ) ;
2724
+ }
2725
+ } ;
2726
+
2727
+ /* private */
2728
+ ClazzLoader . loadHostspotIFrame = function ( hotspotURL ) {
2729
+ var iframe = document . createElement ( "IFRAME" ) ;
2730
+ iframe . style . display = "none" ;
2731
+ var iframeID = null ;
2732
+ do {
2733
+ iframeID = "hotspot-script-" + Math . round ( 10000000 * Math . random ( ) ) ;
2734
+ } while ( document . getElementById ( iframeID ) != null ) ;
2735
+ iframe . id = iframeID ;
2736
+ document . body . appendChild ( iframe ) ;
2737
+ var html = "<html><head><title></title>" ;
2738
+ html += "<script type=\"text/javascript\">\r\n" ;
2739
+ html += "var Clazz" + "Loader = new Object ();\r\n" ;
2740
+ html += "Clazz" + "Loader.updateHotspot = function () {\r\n" ;
2741
+ html += " var args = new Array ();\r\n" ;
2742
+ html += " for (var i = 0; i < arguments.length; i++) {\r\n" ;
2743
+ html += " args[i] = arguments[i];\r\n" ;
2744
+ html += " }\r\n" ;
2745
+ html += " with (window.parent) {\r\n" ;
2746
+ html += " ClassLoader.updateHotspot (args);\r\n" ;
2747
+ html += " };\r\n" ;
2748
+ html += "};\r\n" ;
2749
+ html += "</scr" + "ipt></head><body><script type=\"text/javascript\">\r\n" ;
2750
+ html += "(" + ClazzLoader . loadHotspotScript + ") (" ;
2751
+ html += "\"" + hotspotURL . replace ( / " / g, "\\\"" ) + "\", \"" + iframeID + "\"" ;
2752
+ html += ");\r\n" ;
2753
+ html += "</scr" + "ipt></body></html>" ;
2754
+ ClazzLoader . iframeDocumentWrite ( iframe , html ) ;
2755
+ return iframeID ;
2756
+ } ;
2757
+
2650
2758
/* protected */
2651
2759
/*-# hotspotMonitoring -> htMr #-*/
2652
2760
ClazzLoader . hotspotMonitoring = function ( ) {
@@ -2667,30 +2775,9 @@ ClazzLoader.hotspotMonitoring = function () {
2667
2775
ClazzLoader . lastHotspotJSFailed = true ;
2668
2776
ClazzLoader . lastHotspotScriptLoaded = false ;
2669
2777
2670
- var script = document . createElement ( "SCRIPT" ) ;
2671
- script . type = "text/javascript" ;
2672
- script . src = hotspotURL ;
2673
- if ( typeof ( script . onreadystatechange ) == "undefined" ) { // W3C
2674
- script . onload = script . onerror = function ( ) {
2675
- try {
2676
- ClazzLoader . lastHotspotScriptLoaded = true ;
2677
- ClazzLoader . removeHotspotScriptNode ( this ) ;
2678
- } catch ( e ) { } ; // refreshing browser may cause exceptions
2679
- } ;
2680
- } else {
2681
- script . onreadystatechange = function ( ) {
2682
- var state = "" + this . readyState ;
2683
- if ( state == "loaded" || state == "complete" ) {
2684
- try {
2685
- ClazzLoader . lastHotspotScriptLoaded = true ;
2686
- ClazzLoader . removeHotspotScriptNode ( this ) ;
2687
- } catch ( e ) { } ; // refreshing browser may cause exceptions
2688
- }
2689
- } ;
2690
- }
2778
+ //ClazzLoader.loadHotspotScript (hotspotURL);
2779
+ ClazzLoader . loadHostspotIFrame ( hotspotURL ) ;
2691
2780
2692
- var head = document . getElementsByTagName ( "HEAD" ) [ 0 ] ;
2693
- head . appendChild ( script ) ;
2694
2781
if ( ClazzLoader . hotspotJSTimeout != null ) {
2695
2782
window . clearTimeout ( ClazzLoader . hotspotJSTimeout ) ;
2696
2783
ClazzLoader . hotspotJSTimeout = null ;
0 commit comments