[fusion-commits] r1924 - trunk/lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Sep 30 17:03:20 EDT 2009


Author: liuar
Date: 2009-09-30 17:03:20 -0400 (Wed, 30 Sep 2009)
New Revision: 1924

Modified:
   trunk/lib/fusion.js
Log:
This is a workaround for Safari and Chrome.
When two browsers receive 401 response, the prompt dialog will not show some times.
So it will block fusion working on these two browsers.

This is a known issue: 
See http://www.google.ru/support/forum/p/Chrome/thread?tid=79d3a183e70ede42&hl=en

I will track this problem and fix it when I find the solution.

Modified: trunk/lib/fusion.js
===================================================================
--- trunk/lib/fusion.js	2009-09-30 06:10:53 UTC (rev 1923)
+++ trunk/lib/fusion.js	2009-09-30 21:03:20 UTC (rev 1924)
@@ -1190,24 +1190,27 @@
         document.writeln('<script src="' + src + '"><\/script>'); 
     } 
 
-    var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); 
-    if(appDefUrl){
-        var xhr = new XMLHttpRequest(); 
-		xhr.overrideMimeType('html/xml');
-        var mapAgentUrl = getAgentUrl(); 
-        xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", false); 
-        xhr.send(null); 
-        var appDefXML = xhr.responseXML.documentElement; 
-        
-        if(appDefXML){
-            var googleElement = appDefXML.getElementsByTagName("GoogleScript")[0]; 
-            var yahooElement = appDefXML.getElementsByTagName("YahooScript")[0]; 
-            var veElement = appDefXML.getElementsByTagName("VirtualEarthScript")[0]; 
+	if(navigator.userAgent.indexOf("MSIE")>0 || navigator.userAgent.indexOf("Firefox")>0){
+		var appDefUrl = Fusion.getQueryParam('ApplicationDefinition'); 
+		if(appDefUrl){
+			
+			var xhr = new XMLHttpRequest(); 
+			var mapAgentUrl = getAgentUrl(); 
+			xhr.open("GET", mapAgentUrl + "?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID=" + appDefUrl + "&FORMAT=text%2Fxml", false); 
+			xhr.send(null); 
+			var appDefXML = xhr.responseXML.documentElement; 
+			
+			if(appDefXML){
+				var googleElement = appDefXML.getElementsByTagName("GoogleScript")[0]; 
+				var yahooElement = appDefXML.getElementsByTagName("YahooScript")[0]; 
+				var veElement = appDefXML.getElementsByTagName("VirtualEarthScript")[0]; 
 
-            addElement(googleElement); 
-            addElement(yahooElement); 
-            addElement(veElement);
-        }
-    }
+				addElement(googleElement); 
+				addElement(yahooElement); 
+				addElement(veElement);
+			}
+		}
+	}
+    
 })();
 



More information about the fusion-commits mailing list