[Commits] r1693 - in sandbox/cmoullet/ux/LayerManager: examples ux/data ux/widgets

commits at geoext.org commits at geoext.org
Sun Jan 10 15:09:22 CET 2010


Author: cmoullet
Date: 2010-01-10 15:09:22 +0100 (Sun, 10 Jan 2010)
New Revision: 1693

Removed:
   sandbox/cmoullet/ux/LayerManager/ux/data/ExportWindow.html
Modified:
   sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.js
   sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
   sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js
   sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js
Log:
Remove html export window and replace it by an Ext.Window

Modified: sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.js	2010-01-10 07:26:01 UTC (rev 1692)
+++ sandbox/cmoullet/ux/LayerManager/examples/LayerManagerExample.js	2010-01-10 14:09:22 UTC (rev 1693)
@@ -58,7 +58,7 @@
         text: 'Export KML',
         enableToggle: false,
         handler: function() {
-            GeoExt.ux.data.Export.KMLExport(map, [sundials], null, null);
+            GeoExt.ux.data.Export.KMLExport(map, [sundials], null);
         }
     });
 

Modified: sandbox/cmoullet/ux/LayerManager/ux/data/Export.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-10 07:26:01 UTC (rev 1692)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/Export.js	2010-01-10 14:09:22 UTC (rev 1693)
@@ -8,6 +8,19 @@
 
 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) {
@@ -84,56 +97,32 @@
         filecontent: GeoExt.ux.data.Export.content.replace(/&lt;/g, '<').replace(/&gt;/g, '>')
     });
     exportWindow.show();
-    //if (exportWindowLocation) {
-    //    GeoExt.ux.data.Export.exportWindow = window.open(exportWindowLocation, "_blank", "menubar=1,scrollbars=1,width=800,height=600");
-    //} else {
-    //    GeoExt.ux.data.Export.exportWindow = window.open("../ux/data/ExportWindow.html", "_blank", "menubar=1,scrollbars=1,width=800,height=600");
-    //}
-
 };
 
-GeoExt.ux.data.Export.ChildOnLoad = function() {
-    GeoExt.ux.data.Export.exportWindow.document.getElementById('filename').value = 'export.' + GeoExt.ux.data.Export.format.toLowerCase();
-    GeoExt.ux.data.Export.exportWindow.document.getElementById('data').value = GeoExt.ux.data.Export.content.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
-};
-
-GeoExt.ux.data.Export.content = null;
-
-GeoExt.ux.data.Export.format = null;
-
-GeoExt.ux.data.Export.exportWindow = null;
-
-GeoExt.ux.data.Export.KMLExport = function(map, layers, features, exportWindowLocation) {
+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(exportWindowLocation);
+            GeoExt.ux.data.Export.OpenWindowDownloadify();
         } else {
             alert('Please install Flash 10');
         }
     } else if (Ext.isChrome) {
         if (GetFlashVersion() > 10.00) {
-            GeoExt.ux.data.Export.OpenWindowDownloadify(exportWindowLocation);
+            GeoExt.ux.data.Export.OpenWindowDownloadify();
         } else {
             alert('Please install Flash 10');
         }
     } else if (Ext.isSafari) {
         if (GetFlashVersion() > 10.00) {
-            GeoExt.ux.data.Export.OpenWindowDownloadify(exportWindowLocation);
+            GeoExt.ux.data.Export.OpenWindowDownloadify();
         } else {
             alert('Please install Flash 10');
         }
     } else {
         alert('Your browser is not supported. Patch welcome !');
     }
-};
-
-GeoExt.ux.data.Export.SupportedLayerType = [
-    ['OpenLayers.Layer.Vector'],
-    ['OpenLayers.Layer.WFS'],
-    ['OpenLayers.Layer.GML'],
-    ['OpenLayers.Layer.GeoRSS']
-];
\ No newline at end of file
+};
\ No newline at end of file

Deleted: sandbox/cmoullet/ux/LayerManager/ux/data/ExportWindow.html
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/ExportWindow.html	2010-01-10 07:26:01 UTC (rev 1692)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/ExportWindow.html	2010-01-10 14:09:22 UTC (rev 1693)
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
-    <title>Export</title>
-    <style type="text/css" media="screen">
-        body {
-            background: #fff;
-            width: 780px;
-            margin: 20px auto;
-        }
-
-        label, input, textarea, h1, h2, p {
-            font-family: Arial, sans-serif;
-            font-size: 12pt;
-        }
-
-        input, textarea {
-            border: solid 1px #aaa;
-            padding: 4px;
-            width: 98%;
-        }
-
-        label {
-            font-weight: bold;
-        }
-
-        h1 {
-            font-size: 30pt;
-            font-weight: bold;
-            letter-spacing: -1px;
-        }
-
-        h2 {
-            font-size: 14pt;
-        }
-
-        pre {
-            overflow: auto;
-            padding: 10px;
-            background: #222;
-            color: #ccc;
-        }
-    </style>
-    <script type="text/javascript" src="../downloadify/js/swfobject.js"></script>
-    <script type="text/javascript" src="../downloadify/js/downloadify.min.js"></script>
-</head>
-<body onload="load();">
-<h1>File Exporter</h1>
-
-<form>
-    <p>
-        <label for="filename">Filename</label><br/>
-        <input type="text" name="filename" value="" id="filename"/>
-    </p>
-
-    <p>
-        <label for="data">File Content</label><br/>
-        <textarea cols="60" rows="15" name="data" id="data"></textarea>
-    </p>
-
-    <p id="downloadify" style="text-align:right">
-        You must have Flash 10 installed to download this file.
-    </p>
-</form>
-
-<script type="text/javascript">
-    function load() {
-        window.opener.GeoExt.ux.data.Export.ChildOnLoad();
-        Downloadify.create('downloadify', {
-            filename: function() {
-                return document.getElementById('filename').value;
-            },
-            data: function() {
-                return document.getElementById('data').value;
-            },
-            onComplete: function() {
-                window.close();
-            },
-            onCancel: function() {
-            },
-            onError: function() {
-                alert('Error occured during storage');
-            },
-            transparent: false,
-            swf: '../downloadify/media/downloadify.swf',
-            downloadImage: '../downloadify/images/download.png',
-            width: 100,
-            height: 30,
-            append: false
-        });
-    }
-</script>
-
-</body>
-</html>

Modified: sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js	2010-01-10 07:26:01 UTC (rev 1692)
+++ sandbox/cmoullet/ux/LayerManager/ux/data/FormatStore.js	2010-01-10 14:09:22 UTC (rev 1693)
@@ -9,16 +9,20 @@
 Ext.namespace("GeoExt.ux.data");
 
 GeoExt.ux.data.formats = [
-    ['KML', 'OpenLayers.Format.KML', {extractStyles: true,extractAttributes: true,kmlns: "http://www.opengis.net/kml/2.2"}],
+    ['KML', 'OpenLayers.Format.KML', {
+        extractStyles: true,
+        extractAttributes: true,
+        kmlns: "http://www.opengis.net/kml/2.2"
+    }],
     ['GeoJSON', 'OpenLayers.Format.GeoJSON',{}],
     ['GeoRSS', 'OpenLayers.Format.GeoRSS',{}],
     ['GML', 'OpenLayers.Format.GML',{}]
 ];
 
 GeoExt.ux.data.formats.getFormatConfig = function(format) {
-    for (var i = 0; i< GeoExt.ux.data.formats.length;i++) {
+    for (var i = 0; i < GeoExt.ux.data.formats.length; i++) {
         if (GeoExt.ux.data.formats[i][0] == format) {
-            return GeoExt.ux.data.formats[i][2]; 
+            return GeoExt.ux.data.formats[i][2];
         }
     }
 

Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js	2010-01-10 07:26:01 UTC (rev 1692)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportWindow.js	2010-01-10 14:09:22 UTC (rev 1693)
@@ -95,5 +95,4 @@
                 this);
 
     }
-
 });
\ No newline at end of file



More information about the Commits mailing list