[Commits] r908 - in apps/opengeo/geoexplorer/trunk/lib: . GeoExplorer GeoExplorer/Embed

commits at geoext.org commits at geoext.org
Fri May 29 21:10:14 CEST 2009


Author: dwins
Date: 2009-05-29 21:10:14 +0200 (Fri, 29 May 2009)
New Revision: 908

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Embed/Embed.js
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/LayerMenuItem.js
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/MapToolSplitToggle.js
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Viewer.js
Log:
Incorporate some code cleanup suggested by JSLint


Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js	2009-05-29 19:05:26 UTC (rev 907)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/CapabilitiesGrid.js	2009-05-29 19:10:14 UTC (rev 908)
@@ -65,9 +65,7 @@
 
         var expander = new Ext.grid.RowExpander({
             tpl : new Ext.Template(
-                '<p><b>Abstract:</b> {abstract}</p>'
-            )
-        });
+                '<p><b>Abstract:</b> {abstract}</p>')});
 
         this.plugins = expander;
 
@@ -100,7 +98,8 @@
             // ??? When this happens, the layer needs to be cloned.
             // I believe that current in GeoExt trunk, a copy is a shallow
             // copy.
-            record = records[i].copy(++Ext.data.Record.AUTO_ID);
+            Ext.data.Record.AUTO_ID++;
+            record = records[i].copy(Ext.data.Record.AUTO_ID);
             /*
              * TODO: deal with srs and maxExtent
              * At this point, we need to think about SRS if we want the layer to

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Embed/Embed.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Embed/Embed.js	2009-05-29 19:05:26 UTC (rev 907)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Embed/Embed.js	2009-05-29 19:10:14 UTC (rev 908)
@@ -138,7 +138,7 @@
                     }));
                 }
             });
-        }
+        };
 
         this.mapPanel.layers.on("update", updateLayerSwitcher, this);
         this.mapPanel.layers.on("remove", updateLayerSwitcher, this);

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/LayerMenuItem.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/LayerMenuItem.js	2009-05-29 19:05:26 UTC (rev 907)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/LayerMenuItem.js	2009-05-29 19:10:14 UTC (rev 908)
@@ -45,8 +45,7 @@
     GeoExplorer.LayerMenuItem.superclass.constructor.call(
         this, 
         this.panel, 
-        config
-    );
+        config);
 };
 
 Ext.extend(GeoExplorer.LayerMenuItem, Ext.menu.Adapter);

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/MapToolSplitToggle.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/MapToolSplitToggle.js	2009-05-29 19:05:26 UTC (rev 907)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/MapToolSplitToggle.js	2009-05-29 19:10:14 UTC (rev 908)
@@ -61,8 +61,7 @@
     if (options.toggleGroup) {
         this.on("render", 
             function() {Ext.ButtonToggleMgr.register(this);},
-            this
-        );
+            this);
     }
 
 };
@@ -84,9 +83,9 @@
         e.preventDefault();
         if (!this.disabled) {
             if (e.getTarget(".x-btn-menu-arrow-wrap")) {
-                if (this.menu 
-                    && !this.menu.isVisible() 
-                    && !this.ignoreNextClick) { 
+                if (this.menu && 
+                !this.menu.isVisible() && 
+                !this.ignoreNextClick) { 
                     this.showMenu();
                 }
                 this.fireEvent("arrowclick", this, e);
@@ -94,9 +93,9 @@
                     this.arrowHandler.call(this.scope || this, this, e);
                 }
             } else {
-                if (this.enableToggle 
-                    && (this.allowDepress !== false 
-                    || !this.pressed)) {
+                if (this.enableToggle && 
+                    (this.allowDepress !== false || 
+                    !this.pressed)) {
                     this.toggle();
                 }
                 this.fireEvent("click", this, e);

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Viewer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Viewer.js	2009-05-29 19:05:26 UTC (rev 907)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer/Viewer.js	2009-05-29 19:10:14 UTC (rev 908)
@@ -31,8 +31,7 @@
              * Event: ready
              * Fires when application is ready for user interaction.
              */
-            "ready"
-        );
+            "ready");
         
         // pass on any proxy config to OpenLayers
         if(this.proxy) {
@@ -86,4 +85,4 @@
         }
     }
     
-});
\ No newline at end of file
+});

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-05-29 19:05:26 UTC (rev 907)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-05-29 19:10:14 UTC (rev 908)
@@ -116,7 +116,7 @@
                             proxy: this.proxy, 
                             url: url,
                             success: function(request){
-                                var data = request.responseXML || request.responseText
+                                var data = request.responseXML || request.responseText;
                                 
                                 // Read the response. It's important to note that the
                                 // WMSCapabilitiesStore reads the data as well, though
@@ -142,17 +142,15 @@
                             },
                             scope: this
                         });
-                    } 
-                })(id)
-            );
+                    }; 
+                })(id));
         }
         
         this.dispatch(
             dispatchQueue,
             
             // activate app when the above are both done
-            this.activate
-        );
+            this.activate);
     },
     
     createWMSCapabilitiesURL: function(url) {
@@ -164,8 +162,7 @@
         if(argIndex > -1) {
             var search = url.substring(url.indexOf("?")+1);
             url = url.replace(search, Ext.urlEncode(Ext.apply(
-                Ext.urlDecode(search), args
-            )));
+                Ext.urlDecode(search), args)));
         } else {
             url = url + "?" + Ext.urlEncode(args);
         }
@@ -319,8 +316,7 @@
                     }),
                     ddGroup: "OverlayLayerDD"
                 }, 
-                layerTreeConfig)
-        );
+                layerTreeConfig));
         
         var baseLayerTree = new Ext.tree.TreePanel(
             Ext.apply(
@@ -330,8 +326,7 @@
                     }), 
                     ddGroup: "BaseLayerDD"
                 }, 
-                layerTreeConfig)
-        );
+                layerTreeConfig));
 
         var layersContainer = new Ext.Panel({
             autoScroll: true,
@@ -434,7 +429,7 @@
                 var id = store.find("name", conf.name);
                 
                 if (id >= 0) {
-                    var record = store.getAt(id).copy();
+                    record = store.getAt(id).copy();
                     var layer = record.get("layer");
                     
                     // set layer max extent from capabilities
@@ -603,8 +598,7 @@
         zoomSelector.on('select', function(combo, record, index) {
                 this.map.zoomTo(record.data.level);
             },
-            this
-        );
+            this);
 
         var zoomSelectorWrapper = new Ext.Panel({
             items: [zoomSelector],
@@ -708,7 +702,7 @@
                     }
                 }
             }
-        })
+        });
 
         var updateInfo = function() {
             var queryableLayers = this.mapPanel.layers.queryBy(function(x){
@@ -746,14 +740,12 @@
 
         // create length measure control
         var measureLength = this.createMeasureTool(
-            OpenLayers.Handler.Path, 'Length'
-        );
+            OpenLayers.Handler.Path, 'Length');
         this.map.addControl(measureLength);
         
         // create area measure control
         var measureArea = this.createMeasureTool(
-            OpenLayers.Handler.Polygon, 'Area'
-        );
+            OpenLayers.Handler.Polygon, 'Area');
         this.map.addControl(measureArea);
 
         var tools = [
@@ -973,7 +965,7 @@
         }
 
         var html = evt.text;
-        if (!(html == '' || html.match(/<body>\s*<\/body>/))) {
+        if (!(html === '' || html.match(/<body>\s*<\/body>/))) {
             popup.add({
                 title: title,
                 html: html,



More information about the Commits mailing list