[Commits] r1159 - in core/branches/geoext/0.5: build lib/GeoExt/data lib/GeoExt/widgets tests/lib/GeoExt/data tests/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Mon Jun 29 11:38:26 CEST 2009


Author: ahocevar
Date: 2009-06-29 11:38:26 +0200 (Mon, 29 Jun 2009)
New Revision: 1159

Modified:
   core/branches/geoext/0.5/build/Makefile
   core/branches/geoext/0.5/build/readme.txt
   core/branches/geoext/0.5/lib/GeoExt/data/LayerStore.js
   core/branches/geoext/0.5/lib/GeoExt/widgets/LegendImage.js
   core/branches/geoext/0.5/lib/GeoExt/widgets/LegendPanel.js
   core/branches/geoext/0.5/lib/GeoExt/widgets/Popup.js
   core/branches/geoext/0.5/tests/lib/GeoExt/data/LayerStore.html
   core/branches/geoext/0.5/tests/lib/GeoExt/widgets/Popup.html
Log:
Ticket pullups since 0.5 RC1 (closes #103, #106, #107)


Modified: core/branches/geoext/0.5/build/Makefile
===================================================================
--- core/branches/geoext/0.5/build/Makefile	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/build/Makefile	2009-06-29 09:38:26 UTC (rev 1159)
@@ -1,7 +1,8 @@
-# Makefile for GeoExplorer apps
+# Makefile for GeoExt
 
+VERSION = r$(shell echo '$$Revision$$' | tr -d "[:alpha:]$$ :")
 LIB_NAME = GeoExt
-ZIP_NAME = $(LIB_NAME).zip
+ZIP_NAME = $(LIB_NAME)-$(VERSION).zip
 
 CSS_DIR = $(LIB_NAME)/resources/css
 CSS_IMPORTS = $(shell cat ../resources/css/geoext-all-debug.css | grep '@import' | sed 's/^@import "\(.*\)";/\1/')
@@ -23,6 +24,7 @@
 	@echo "  make lib LIB_NAME=MyLib"
 	@echo "  make zip"
 	@echo "  make zip ZIP_NAME=MyZip.zip"
+	@echo "  make dist VERSION=0.5-rc1"
 
 clean:
 	-rm -rf $(LIB_NAME)
@@ -35,7 +37,7 @@
 
 examples:
 	mkdir -p $(LIB_NAME)/examples 
-	svn export --force ../examples $(LIB_NAME)/examples
+	rsync -au --exclude=.svn `pwd`/../examples `pwd`/$(LIB_NAME)
 	for file in `find $(LIB_NAME)/examples/ -name "*.html"`; do \
 	    sed -i "s/\.\.\/lib\/GeoExt\.js/\.\.\/script\/GeoExt\.js/g" $${file} ; \
 	    sed -i "s/geoext-all-debug\.css/geoext-all\.css/g" $${file} ; \
@@ -46,8 +48,9 @@
 	mkdir -p $(LIB_NAME)/script $(LIB_NAME)/resources/css
 	
 	jsbuild full.cfg -v -o $(LIB_NAME)/script/ -s GeoExt.js
+	echo "GeoExt.VERSION_NUMBER='$(VERSION)';" >> $(LIB_NAME)/script/GeoExt.js 
 	
-	svn export --force ../resources $(LIB_NAME)/resources
+	rsync -au --exclude=.svn `pwd`/../resources `pwd`/$(LIB_NAME)
 	
 	for file in `find $(CSS_DIR) -name "*.css"`; do \
 	    csstidy $${file} --template=highest $${file} ; \
@@ -65,4 +68,4 @@
 	-rm -f $(ZIP_NAME)
 	zip $(ZIP_NAME) -r $(LIB_NAME)
 
-dist: examples zip
\ No newline at end of file
+dist: examples zip

Modified: core/branches/geoext/0.5/build/readme.txt
===================================================================
--- core/branches/geoext/0.5/build/readme.txt	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/build/readme.txt	2009-06-29 09:38:26 UTC (rev 1159)
@@ -9,7 +9,7 @@
 ------------------
 
 This build dir contains a Makefile, which can be used to build GeoExt. The
-build process requires a bash-like shell, make, sed, find and svn. All this
+build process requires a bash-like shell, make, sed, find and rsync. All this
 should be available on well equipped development *nix and OS X boxes. In
 addition, JSTools and csstidy are required. The latter is available as csstidy
 package on debian-style linux systems.
@@ -52,4 +52,4 @@
     
 The Makefile has even more targets. Invoke make help to see them all.
 
-    $ make help
\ No newline at end of file
+    $ make help

Modified: core/branches/geoext/0.5/lib/GeoExt/data/LayerStore.js
===================================================================
--- core/branches/geoext/0.5/lib/GeoExt/data/LayerStore.js	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/lib/GeoExt/data/LayerStore.js	2009-06-29 09:38:26 UTC (rev 1159)
@@ -135,10 +135,9 @@
         var layers = map.layers.slice(0);
 
         if(initDir & GeoExt.data.LayerStore.STORE_TO_MAP) {
-            var records = this.getRange();
-            for(var i=records.length - 1; i>=0; i--) {
-                this.map.addLayer(records[i].get("layer"));
-            }
+            this.each(function(record) {
+                this.map.addLayer(record.get("layer"));
+            }, this);
         }
         if(initDir & GeoExt.data.LayerStore.MAP_TO_STORE) {
             this.loadData(layers, true);

Modified: core/branches/geoext/0.5/lib/GeoExt/widgets/LegendImage.js
===================================================================
--- core/branches/geoext/0.5/lib/GeoExt/widgets/LegendImage.js	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/lib/GeoExt/widgets/LegendImage.js	2009-06-29 09:38:26 UTC (rev 1159)
@@ -99,5 +99,5 @@
 
 });
 
-
+/** api: xtype = gx_legendimage */
 Ext.reg('gx_legendimage', GeoExt.LegendImage);

Modified: core/branches/geoext/0.5/lib/GeoExt/widgets/LegendPanel.js
===================================================================
--- core/branches/geoext/0.5/lib/GeoExt/widgets/LegendPanel.js	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/lib/GeoExt/widgets/LegendPanel.js	2009-06-29 09:38:26 UTC (rev 1159)
@@ -286,4 +286,5 @@
     
 });
 
+/** api: xtype = gx_legendpanel */
 Ext.reg('gx_legendpanel', GeoExt.LegendPanel);

Modified: core/branches/geoext/0.5/lib/GeoExt/widgets/Popup.js
===================================================================
--- core/branches/geoext/0.5/lib/GeoExt/widgets/Popup.js	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/lib/GeoExt/widgets/Popup.js	2009-06-29 09:38:26 UTC (rev 1159)
@@ -170,7 +170,7 @@
         GeoExt.Popup.superclass.show.apply(this, arguments);
         if(this.anchored) {
             this.position();
-            if(this.panIn && !this._mapmove) {
+            if(this.panIn && !this._mapMove) {
                 this.panIntoView();
             }
         }

Modified: core/branches/geoext/0.5/tests/lib/GeoExt/data/LayerStore.html
===================================================================
--- core/branches/geoext/0.5/tests/lib/GeoExt/data/LayerStore.html	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/tests/lib/GeoExt/data/LayerStore.html	2009-06-29 09:38:26 UTC (rev 1159)
@@ -84,6 +84,35 @@
             t.eq(mapPanel.layers.getCount(),1,"Adding layers to MapPanel's LayerStore does not create duplicate layers"); 
         }
 
+        function test_store_to_map(t) {
+
+            t.plan(8);
+            
+            var map = new OpenLayers.Map("mappanel");
+            var layers = [new OpenLayers.Layer.Vector("a"),
+                          new OpenLayers.Layer.Vector("b"),
+                          new OpenLayers.Layer.Vector("c")];
+
+            var store = new GeoExt.data.LayerStore({
+                map: map,
+                layers: layers
+            });
+
+            t.eq(store.getCount(), 3, "three layers in store");
+            t.eq(map.layers.length, 3, "three layers on map");
+
+            t.eq(store.getAt(0).get("layer").name, "a", "first layer correct in store");
+            t.eq(map.layers[0].name, "a", "first layer correct on map");
+
+            t.eq(store.getAt(1).get("layer").name, "b", "second layer correct in store");
+            t.eq(map.layers[1].name, "b", "second layer correct on map");
+
+            t.eq(store.getAt(2).get("layer").name, "c", "third layer correct in store");
+            t.eq(map.layers[2].name, "c", "third layer correct on map");
+
+            map.destroy();
+        }
+
         function test_load_clear(t) {
             t.plan(2);
             

Modified: core/branches/geoext/0.5/tests/lib/GeoExt/widgets/Popup.html
===================================================================
--- core/branches/geoext/0.5/tests/lib/GeoExt/widgets/Popup.html	2009-06-26 06:59:34 UTC (rev 1158)
+++ core/branches/geoext/0.5/tests/lib/GeoExt/widgets/Popup.html	2009-06-29 09:38:26 UTC (rev 1159)
@@ -11,7 +11,7 @@
 
         function setupContext() {        
 
-            var map = new OpenLayers.Map();
+            var map = new OpenLayers.Map({panMethod: null}); // avoid tween panning for tests
             var layer = new OpenLayers.Layer("test", {isBaseLayer: true});
             map.addLayer(layer);
 
@@ -70,37 +70,54 @@
             pop.show();
 
             t.ok(Ext.getBody().child("div." + pop.popupCls),"viewport contains popup");
-            
+
             tearDown(context);
         }
 
         function test_anchorPopup(t) {
-            t.plan(4);
+            t.plan(5);
 
             var context = setupContext();
 
             var pop = popup(context.feature);
 
+            // show the popup and move the map to ensure popup is actually visible
             pop.show();
-
+            context.map.setCenter(new OpenLayers.LonLat(5, 45));
+            
+            var moves = 0;
             pop.on({
-                'move' : function(c,x,y){
-                    t.ok(true,"Move event fired on " + action); //should happen twice, on call to position()
+                move: function() {
+                    ++moves;
                 },
                 scope : this
             });
 
             t.ok(pop.getAnchorElement(), "Popup has anchor element");
 
-            var action = "map move";
-            context.map.events.triggerEvent("move");
-            
-            action = "popup collapse";
+            // move the map and confirm that popup moves
+            context.map.setCenter(new OpenLayers.LonLat(6, 45));
+            t.eq(moves, 1, "anchored popup moves once on map.setCenter");
+            moves = 0;
+
+            // anchored popup needs to reposition on collapse, resize and
+            // expand to keep the anchor point on the feature
+
+            // collapse popup and and confirm that it moves
             pop.collapse();
+            t.eq(moves, 1, "anchored popup moves once on collapse");
+            moves = 0;
 
-            action = "popup expand"
+            // expand popup and confirm that it moves
             pop.expand();
+            t.eq(moves, 1, "anchored popup moves once on expand");
+            moves = 0;
             
+            // resize popup and confirm that it moves
+            pop.setSize(100, 100);
+            t.eq(moves, 1, "anchored popup moves once on resize");
+            moves = 0;
+
             tearDown(context);
         }
 
@@ -113,7 +130,7 @@
             var pop = popup(context.feature, context.mapPanel);
 
             pop.show();
-        
+
             pop.collapse();
 
             var origPos = pop.getPosition();



More information about the Commits mailing list