[Commits] r1694 - sandbox/cmoullet/ux/LayerManager/ux/data

commits at geoext.org commits at geoext.org
Sun Jan 10 15:46:33 CET 2010


Author: cmoullet
Date: 2010-01-10 15:46:32 +0100 (Sun, 10 Jan 2010)
New Revision: 1694

Modified:
   sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
Log:
Remove unneeded IE workaround. Test on FF, IE, Chrome and Safari.

Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-10 14:09:22 UTC (rev 1693)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-10 14:46:32 UTC (rev 1694)
@@ -8,19 +8,6 @@
 
 Ext.namespace("GeoExt.ux.data");
 
-GeoExt.ux.data.Export.content = null;
-
-GeoExt.ux.data.Export.format = null;
-
-GeoExt.ux.data.Export.exportWindow = null;
-
-GeoExt.ux.data.Export.SupportedLayerType = [
-    ['OpenLayers.Layer.Vector'],
-    ['OpenLayers.Layer.WFS'],
-    ['OpenLayers.Layer.GML'],
-    ['OpenLayers.Layer.GeoRSS']
-];
-
 // layers: optional {Array(<OpenLayers.Layer>)}
 // features: optional: {Array(<OpenLayers.Feature.Vector>)} 
 GeoExt.ux.data.Export = function(map, format, layers, features) {
@@ -68,9 +55,21 @@
     } else {
         return 'Format ' + format + ' not supported. Patch welcome !';
     }
-
 };
 
+GeoExt.ux.data.Export.content = null;
+
+GeoExt.ux.data.Export.format = null;
+
+GeoExt.ux.data.Export.exportWindow = null;
+
+GeoExt.ux.data.Export.SupportedLayerType = [
+    ['OpenLayers.Layer.Vector'],
+    ['OpenLayers.Layer.WFS'],
+    ['OpenLayers.Layer.GML'],
+    ['OpenLayers.Layer.GeoRSS']
+];
+
 GeoExt.ux.data.Export.isLayerSupported = function(className) {
     for (var i = 0; i < GeoExt.ux.data.Export.SupportedLayerType.length; i++) {
         if (GeoExt.ux.data.Export.SupportedLayerType[i][0] === className) {
@@ -80,18 +79,7 @@
     return false;
 };
 
-GeoExt.ux.data.Export.OpenWindowIE = function() {
-    var exportWindow = window.open("", "exportWindow", "location=1,status=1,scrollbars=1,width=100,height=100");
-
-    exportWindow.document.open("text/xml");
-    exportWindow.document.write(GeoExt.ux.data.Export.content.replace(/&lt;/g, '<').replace(/&gt;/g, '>'));
-    exportWindow.document.execCommand('SaveAs', true, ' ');
-
-    exportWindow.document.close();
-    exportWindow.close();
-};
-
-GeoExt.ux.data.Export.OpenWindowDownloadify = function(exportWindowLocation) {
+GeoExt.ux.data.Export.OpenWindowDownloadify = function() {
     var exportWindow = new GeoExt.ux.LayerManagerExportWindow({
         filename: 'export.' + GeoExt.ux.data.Export.format.toLowerCase(),
         filecontent: GeoExt.ux.data.Export.content.replace(/&lt;/g, '<').replace(/&gt;/g, '>')
@@ -102,27 +90,11 @@
 GeoExt.ux.data.Export.KMLExport = function(map, layers, features) {
     GeoExt.ux.data.Export.format = 'KML';
     GeoExt.ux.data.Export.content = GeoExt.ux.data.Export(map, GeoExt.ux.data.Export.format, layers, features);
-    if (Ext.isIE) {
-        GeoExt.ux.data.Export.OpenWindowIE();
-    } else if (Ext.isGecko) {
-        if (GetFlashVersion() > 10.00) {
-            GeoExt.ux.data.Export.OpenWindowDownloadify();
-        } else {
-            alert('Please install Flash 10');
-        }
-    } else if (Ext.isChrome) {
-        if (GetFlashVersion() > 10.00) {
-            GeoExt.ux.data.Export.OpenWindowDownloadify();
-        } else {
-            alert('Please install Flash 10');
-        }
-    } else if (Ext.isSafari) {
-        if (GetFlashVersion() > 10.00) {
-            GeoExt.ux.data.Export.OpenWindowDownloadify();
-        } else {
-            alert('Please install Flash 10');
-        }
+
+    if (GetFlashVersion() > 10.00) {
+        GeoExt.ux.data.Export.OpenWindowDownloadify();
     } else {
-        alert('Your browser is not supported. Patch welcome !');
+        alert('Please install Flash 10 in order to use the following window.');
+        GeoExt.ux.data.Export.OpenWindowDownloadify();
     }
 };
\ No newline at end of file



More information about the Commits mailing list