← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3757: Misc minor fixes.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 3757 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-05-26 16:34:05 +0200
message:
  Misc minor fixes.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Choropleth.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Point.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html	2011-05-19 08:26:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/index.html	2011-05-26 13:44:26 +0000
@@ -61,7 +61,7 @@
     </form>
     
     <!-- JavaScript -->
-        
+    
         <!-- ExtJS -->
         <script type="text/javascript" src="../resources/ext/adapter/ext/ext-base.js"></script>
         <script type="text/javascript" src="../resources/ext/ext-all.js"></script>

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js	2011-05-25 12:46:06 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js	2011-05-26 13:44:26 +0000
@@ -37,7 +37,13 @@
     window_position_x: 55,
     window_position_y: 41,
     
-	emptytext: '',
+//  GUI
+
+    feature_data_style_name: 'color:#000',
+    feature_data_style_value: 'color:#444',
+    feature_data_style_empty: 'color:#555',
+    
+    emptytext: '',
 	labelseparator: '',
 	
 //	DHIS variables
@@ -277,9 +283,9 @@
         return b.value-a.value;
     },
 
-    getLegendsJSON: function() {
+    getLegendsJSON: function() {   
         var json = '{"legends":[';
-        for(var i = 0; i < this.imageLegend.length; i++) {
+        for (var i = 0; i < this.imageLegend.length; i++) {
             json += '{';
             json += '"label": "' + this.imageLegend[i].label + '",';
             json += '"color": "' + this.imageLegend[i].color + '"';

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-05-25 12:46:06 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-05-26 13:44:26 +0000
@@ -271,7 +271,7 @@
         groupSet: groupSetStore,
         groupsByGroupSet: groupsByGroupSetStore
     };
-	
+    
 	/* Thematic layers */
     polygonLayer = new OpenLayers.Layer.Vector(G.conf.thematic_layer_1, {
         'visibility': false,
@@ -2663,7 +2663,7 @@
 		tooltip: 'Administrator settings',
 		disabled: !G.user.isAdmin,
         style: 'margin-top:1px',
-		handler: function() {
+		handler: function() {        
             if (!adminWindow.hidden) {
                 adminWindow.hide();
             }

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Choropleth.js	2011-05-25 12:46:06 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Choropleth.js	2011-05-25 13:20:20 +0000
@@ -63,15 +63,16 @@
     createColorInterpolation: function() {
         var numColors = this.classification.bins.length;
 		var mapLegendType = this.widget.form.findField('maplegendtype').getValue();
+        this.widget.imageLegend = [];
         
         this.colorInterpolation = mapLegendType == G.conf.map_legend_type_automatic ?
             mapfish.ColorRgb.getColorsArrayByRgbInterpolation(this.colors[0], this.colors[1], numColors) : this.widget.colorInterpolation;
-
+            
         for (var i = 0; i < this.classification.bins.length; i++) {
-            this.widget.imageLegend[i] = {
+            this.widget.imageLegend.push({
                 label: this.classification.bins[i].label.replace('&nbsp;&nbsp;', ' '),
                 color: this.colorInterpolation[i].toHexString()
-            };
+            });
         }
     },
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Point.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Point.js	2011-05-25 12:46:06 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/core/GeoStat/Point.js	2011-05-25 13:20:20 +0000
@@ -63,15 +63,16 @@
     createColorInterpolation: function() {
         var numColors = this.classification.bins.length;
 		var mapLegendType = this.widget.form.findField('maplegendtype').getValue();
+        this.widget.imageLegend = [];
         
         this.colorInterpolation = mapLegendType == G.conf.map_legend_type_automatic ?
             mapfish.ColorRgb.getColorsArrayByRgbInterpolation(this.colors[0], this.colors[1], numColors) : this.widget.colorInterpolation;
-
+            
         for (var i = 0; i < this.classification.bins.length; i++) {
-            this.widget.imageLegend[i] = {
+            this.widget.imageLegend.push({
                 label: this.classification.bins[i].label.replace('&nbsp;&nbsp;', ' '),
                 color: this.colorInterpolation[i].toHexString()
-            };
+            });
         }
     },
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2011-05-25 12:46:06 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2011-05-26 13:44:26 +0000
@@ -76,7 +76,7 @@
     
     isDrillDown: false,
 
-	imageLegend: [],
+	imageLegend: false,
     
     initComponent: function() {
     
@@ -990,9 +990,11 @@
     createSelectFeatures: function() {
         var scope = this;
         
-        var onHoverSelect = function onHoverSelect(feature) {
+        var onHoverSelect = function onHoverSelect(feature) {  
             if (feature.attributes.name) {
-                document.getElementById('featuredatatext').innerHTML = '<div style="color:black">' + feature.attributes.name + '</div><div style="color:#555">' + feature.attributes.value + '</div>';
+                document.getElementById('featuredatatext').innerHTML =
+                    '<div style="' + G.conf.feature_data_style_name + '">' + feature.attributes.name + '</div>' +
+                    '<div style="' + G.conf.feature_data_style_value + '">' + feature.attributes.value + '</div>';
             }
             else {
                 document.getElementById('featuredatatext').innerHTML = '';
@@ -1001,7 +1003,8 @@
         
         var onHoverUnselect = function onHoverUnselect(feature) {
             if (feature.attributes.name) {
-                document.getElementById('featuredatatext').innerHTML = '<div style="color:#666">' + G.i18n.no_feature_selected + '</div>';
+                document.getElementById('featuredatatext').innerHTML = 
+                    '<div style="' + G.conf.feature_data_style_empty + '">' + G.i18n.no_feature_selected + '</div>';
             }
             else {
                 document.getElementById('featuredatatext').innerHTML = '';

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js	2011-05-25 12:46:06 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Point.js	2011-05-26 13:44:26 +0000
@@ -76,7 +76,7 @@
     
     isDrillDown: false,
 
-	imageLegend: [],
+	imageLegend: false,
     
     initComponent: function() {
     
@@ -961,9 +961,11 @@
     createSelectFeatures: function() {
         var scope = this;
         
-        var onHoverSelect = function onHoverSelect(feature) {
+        var onHoverSelect = function onHoverSelect(feature) {  
             if (feature.attributes.name) {
-                document.getElementById('featuredatatext').innerHTML = '<div style="color:black">' + feature.attributes.name + '</div><div style="color:#555">' + feature.attributes.value + '</div>';
+                document.getElementById('featuredatatext').innerHTML =
+                    '<div style="' + G.conf.feature_data_style_name + '">' + feature.attributes.name + '</div>' +
+                    '<div style="' + G.conf.feature_data_style_value + '">' + feature.attributes.value + '</div>';
             }
             else {
                 document.getElementById('featuredatatext').innerHTML = '';
@@ -972,7 +974,8 @@
         
         var onHoverUnselect = function onHoverUnselect(feature) {
             if (feature.attributes.name) {
-                document.getElementById('featuredatatext').innerHTML = '<div style="color:#666">' + G.i18n.no_feature_selected + '</div>';
+                document.getElementById('featuredatatext').innerHTML = 
+                    '<div style="' + G.conf.feature_data_style_empty + '">' + G.i18n.no_feature_selected + '</div>';
             }
             else {
                 document.getElementById('featuredatatext').innerHTML = '';