[Commits] r1699 - in sandbox/cmoullet/ux: GoogleEarthPanel/ux/widgets LayerManager/ux/utils LayerManager/ux/widgets RoutingPanel/ux/widgets StreetViewPanel/ux/widgets

commits at geoext.org commits at geoext.org
Sun Jan 10 18:05:41 CET 2010


Author: cmoullet
Date: 2010-01-10 18:05:41 +0100 (Sun, 10 Jan 2010)
New Revision: 1699

Modified:
   sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
   sandbox/cmoullet/ux/LayerManager/ux/utils/flash.js
   sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js
   sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
   sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js
Log:
Add documentation

Modified: sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js
===================================================================
--- sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js	2010-01-10 15:09:11 UTC (rev 1698)
+++ sandbox/cmoullet/ux/GoogleEarthPanel/ux/widgets/GoogleEarthPanel.js	2010-01-10 17:05:41 UTC (rev 1699)
@@ -218,7 +218,7 @@
      *  :param altitude: ``Number`` The altitude of the lookAt position
      *  :param altitudeMode: ``Number`` The altitudeMode to use
      *  :param heading: ``Number`` The heading of the lookAt position
-     *  :param tilt: ``Number`` The tilt of the lookAt position
+     *  :param tilt: ``Number`` The tfilt of the lookAt position
      *  :param range: ``Number`` The range of the lookAt position
      */
     setLookAt: function (lat, lon, altitude, altitudeMode, heading, tilt, range) {
@@ -976,4 +976,5 @@
     }
 });
 
+/** api: xtype = gxux_googleearthpanel */
 Ext.reg('gxux_googleearthpanel', GeoExt.ux.GoogleEarthPanel);
\ No newline at end of file

Modified: sandbox/cmoullet/ux/LayerManager/ux/utils/flash.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/utils/flash.js	2010-01-10 15:09:11 UTC (rev 1698)
+++ sandbox/cmoullet/ux/LayerManager/ux/utils/flash.js	2010-01-10 17:05:41 UTC (rev 1699)
@@ -1,14 +1,16 @@
-function GetFlashVersion() {
-    var is_ie = navigator.appVersion.toLowerCase().indexOf("msie") != -1;
-    var is_win = navigator.appVersion.toLowerCase().indexOf("win") != -1;
-    var is_opera = navigator.userAgent.toLowerCase().indexOf("opera") != -1;
-    for (i = 12; i > 0; i--) {
-        var flash_version = (is_ie && is_win && !is_opera) ? GetFlashVersionActivex(i) : GetFlashVersionPlugin();
-        if (flash_version != 0) return flash_version;
-    }
-    return 0.0;
-}
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
 
+/** function[GetFlashVersionActivex]
+ *  Private static function to check if a version is installed for IE
+ *
+ * :param i ``Number`` Version number
+ */
 function GetFlashVersionActivex(i) {
     try {
         var control = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + i);
@@ -22,9 +24,13 @@
     }
 }
 
+/** function[GetFlashVersionPlugin]
+ *  Private static function to get the version of the flash plug-in
+ *
+ */
 function GetFlashVersionPlugin() {
     var flash_version = 0.0;
-    if (navigator.plugins != null && navigator.plugins.length > 0) {
+    if (navigator.plugins !== null && navigator.plugins.length > 0) {
         if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
             var plugin_name = navigator.plugins["Shockwave Flash 2.0"] ? "Shockwave Flash 2.0" : "Shockwave Flash";
             var flash_desc = navigator.plugins[plugin_name].description;
@@ -39,11 +45,34 @@
             flash_version = -1;
         }
     }
-    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flash_version = 4;
-    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flash_version = 3;
-    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flash_version = 2;
+    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) {
+        flash_version = 4;
+    }
+    else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) {
+        flash_version = 3;
+    }
+    else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) {
+        flash_version = 2;
+    }
     else {
         flash_version = -1;
     }
     return flash_version;
+}
+
+/** function[GetFlashVersion]
+ *  Static function to get the installed flash version
+ *
+ */
+function GetFlashVersion() {
+    var is_ie = navigator.appVersion.toLowerCase().indexOf("msie") != -1;
+    var is_win = navigator.appVersion.toLowerCase().indexOf("win") != -1;
+    var is_opera = navigator.userAgent.toLowerCase().indexOf("opera") != -1;
+    for (i = 12; i > 0; i--) {
+        var flash_version = (is_ie && is_win && !is_opera) ? GetFlashVersionActivex(i) : GetFlashVersionPlugin();
+        if (flash_version !== 0) {
+            return flash_version;
+        }
+    }
+    return 0.0;
 }
\ No newline at end of file

Modified: sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js
===================================================================
--- sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js	2010-01-10 15:09:11 UTC (rev 1698)
+++ sandbox/cmoullet/ux/LayerManager/ux/widgets/LayerManagerExportPanel.js	2010-01-10 17:05:41 UTC (rev 1699)
@@ -8,13 +8,58 @@
 
 Ext.namespace('GeoExt.ux');
 
+/** api: (define)
+ *  module = GeoExt.ux
+ *  class = LayerManagerExportPanel
+ *  base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
+ */
+
 GeoExt.ux.LayerManagerExportPanel = Ext.extend(Ext.Panel, {
+    /** api: config[map]
+     *  ``OpenLayers.Map``  A configured map
+     */
+    /** private: property[map]
+     *  ``OpenLayers.Map``  The map object.
+     */
+    map: null,
+
+    /** api: config[border]
+     *  ``Boolean``  Default to false
+     */
+    /** private: property[border]
+     *  ``Boolean``  Default to false
+     */
     border: false,
-    formatCombo: null,
+
+    /** api: config[defaultFormat]
+     *  ``String``  Default export format. Default: KML
+     */
+    /** private: property[defaultFormat]
+     *  ``String``  Default export format. Default: KML
+     */
     defaultFormat: 'KML',
+
+    /** api: config[downloadService]
+     *  ``String``  URL used in order to use a server download service. The attributes "format", "content" are sent (POST) to this service.
+     */
+    /** private: property[defaultFormat]
+     *  ``String``  URL used in order to use a server download service. The attributes "format", "content" are sent (POST) to this service.
+     */
     downloadService: null,
+
+    /** private: property[formatCombo]
+     *  ``Ext.form.ComboBox``  Combo box with format information
+     */
+    formatCombo: null,
+
+    /** private: property[exportLinkBox]
+     *  ``Ext.BoxComponent``  Box used to show a link in Firefox, if Flash is not installed
+     */
     exportLinkBox: null,
 
+    /** private: method[initComponent]
+     *  Private initComponent override.
+     */
     initComponent: function() {
 
         this.formatCombo = new Ext.form.ComboBox({
@@ -107,25 +152,18 @@
                                         form.submit();
 
                                     } else {
-                                        if (Ext.isIE) {
-                                            GeoExt.ux.data.Export.OpenWindowIE();
-                                        } else if (Ext.isGecko) {
+                                        if (Ext.isIE || Ext.isChrome || Ext.isSafari) {
                                             if (GetFlashVersion() > 10.00) {
                                                 GeoExt.ux.data.Export.OpenWindowDownloadify();
                                             } else {
-                                                this.exportLinkBox.getEl().dom.innerHTML = '<a href="data:text/xml,' + GeoExt.ux.data.Export.content.replace(/"/g, '\'') + '" target="new">Right mouse click, Save As...</a>';
-                                            }
-                                        } else if (Ext.isChrome) {
-                                            if (GetFlashVersion() > 10.00) {
+                                                alert('Please install Flash 10 in order to use the following window');
                                                 GeoExt.ux.data.Export.OpenWindowDownloadify();
-                                            } else {
-                                                alert('Please install Flash 10');
                                             }
-                                        } else if (Ext.isSafari) {
+                                        } else if (Ext.isGecko) {
                                             if (GetFlashVersion() > 10.00) {
                                                 GeoExt.ux.data.Export.OpenWindowDownloadify();
                                             } else {
-                                                alert('Please install Flash 10');
+                                                this.exportLinkBox.getEl().dom.innerHTML = '<a href="data:text/xml,' + GeoExt.ux.data.Export.content.replace(/"/g, '\'') + '" target="new">Right mouse click, Save As...</a>';
                                             }
                                         } else {
                                             alert('Your browser is not supported. Patch welcome !');
@@ -164,4 +202,6 @@
         ];
         GeoExt.ux.LayerManagerExportPanel.superclass.initComponent.call(this);
     }
-});
\ No newline at end of file
+});
+
+Ext.reg('gxux_layermanagerexportpanel', GeoExt.ux.LayerManagerExportPanel);
\ No newline at end of file

Modified: sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js	2010-01-10 15:09:11 UTC (rev 1698)
+++ sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js	2010-01-10 17:05:41 UTC (rev 1699)
@@ -647,4 +647,5 @@
     }
 });
 
+/** api: xtype = gxux_routingpanel */
 Ext.reg('gxux_routingpanel', GeoExt.ux.RoutingPanel);
\ No newline at end of file

Modified: sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js
===================================================================
--- sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js	2010-01-10 15:09:11 UTC (rev 1698)
+++ sandbox/cmoullet/ux/StreetViewPanel/ux/widgets/StreetViewPanel.js	2010-01-10 17:05:41 UTC (rev 1699)
@@ -607,4 +607,5 @@
     }
 });
 
+/** api: xtype = gxux_streetviewpanel */
 Ext.reg('gxux_streetviewpanel', GeoExt.ux.StreetViewPanel);
\ No newline at end of file



More information about the Commits mailing list