← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12587: (GIS) Plugin fixes.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 12587 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-10-11 13:47:46 +0200
message:
  (GIS) Plugin fixes.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js	2013-10-10 11:40:44 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/map.js	2013-10-11 11:44:58 +0000
@@ -575,7 +575,7 @@
 				window.destroy();
 			}
 			window = Ext.create('Ext.window.Window', {
-				cls: 'gis-window-widget-feature',
+				cls: 'gis-window-widget-feature gis-plugin',
 				preventHeader: true,
 				shadow: false,
 				resizable: false,
@@ -834,6 +834,7 @@
 				Ext.create('Ext.menu.Item', {
 					text: 'Float up',
 					iconCls: 'gis-menu-item-icon-float',
+					cls: 'gis-plugin',
 					disabled: !att.hasCoordinatesUp,
 					handler: function() {
 						drill(att.grandParentId, att.grandParentParentGraph, parseInt(att.level) - 1);
@@ -842,7 +843,7 @@
 				Ext.create('Ext.menu.Item', {
 					text: 'Drill down',
 					iconCls: 'gis-menu-item-icon-drill',
-					cls: 'gis-menu-item-first',
+					cls: 'gis-menu-item-first gis-plugin',
 					disabled: !att.hasCoordinatesDown,
 					handler: function() {
 						drill(att.id, att.parentGraph, parseInt(att.level) + 1);
@@ -891,6 +892,7 @@
 			menuItems[menuItems.length - 1].addCls('gis-menu-item-last');
 
 			menu = new Ext.menu.Menu({
+				baseCls: 'gis-plugin',
 				shadow: false,
 				showSeparator: false,
 				defaults: {
@@ -1061,7 +1063,7 @@
 		window = Ext.create('Ext.window.Window', {
 			title: GIS.i18n.measure_distance,
 			layout: 'fit',
-			cls: 'gis-container-default',
+			cls: 'gis-container-default gis-plugin',
 			bodyStyle: 'text-align: center',
 			width: 130,
 			minWidth: 130,
@@ -1069,8 +1071,8 @@
 			items: label,
 			listeners: {
 				show: function() {
-					var x = gis.viewport.eastRegion.x - this.getWidth() - 5,
-						y = 60;
+					var x = gis.viewport.eastRegion.getPosition()[0] - this.getWidth() - 3,
+						y = gis.viewport.centerRegion.getPosition()[1] + 26;
 					this.setPosition(x, y);
 				},
 				destroy: function() {
@@ -4073,10 +4075,11 @@
 			return true;
 		};
 
-		applyCss = function(contextPath) {			
-			var css = 'body { font-family: arial, sans-serif, liberation sans, consolas; font-size: 11px; } \n';
+		applyCss = function(contextPath) {
+			var css = '.gis-plugin, .gis-plugin * { font-family: arial, sans-serif, liberation sans, consolas; } \n';
 			css += '.x-panel-body { font-size: 11px; } \n';
 			css += '.x-panel-header { height: 30px; padding: 7px 4px 4px 7px; border: 0 none; } \n';
+			css += '.gis-container-default .x-window-body { padding: 5px; background: #fff; } \n';
 			css += '.olControlPanel { position: absolute; top: 0; right: 0; border: 0 none; } \n';
 			css += '.olControlButtonItemActive { background: #556; color: #fff; width: 24px; height: 24px; opacity: 0.75; filter: alpha(opacity=75); -ms-filter: "alpha(opacity=75)"; cursor: pointer; cursor: hand; text-align: center; font-size: 21px !important; text-shadow: 0 0 1px #ddd; } \n';
 			css += '.olControlPanel.zoomIn { right: 72px; } \n';
@@ -4098,7 +4101,7 @@
 			css += '.gis-window-widget-feature { padding: 0; border: 0 none; border-radius: 0; background: transparent; box-shadow: none; } \n';
 			css += '.gis-window-widget-feature .x-window-body-default { border: 0 none; background: transparent; } \n';
 			css += '.gis-window-widget-feature .x-window-body-default .x-panel-body-default { border: 0 none; background: #556; opacity: 0.92; filter: alpha(opacity=92); -ms-filter: "alpha(opacity=92)"; padding: 5px 8px 5px 8px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; color: #fff; font-weight: bold; letter-spacing: 1px; } \n';
-			css += '.x-menu-body { border-color: #bbb; border-radius: 2px; padding: 0; background-color: #fff !important; } \n';
+			css += '.x-menu-body { border:1px solid #bbb; border-radius: 2px; padding: 0; background-color: #fff !important; } \n';
 			css += '.x-menu-item-active .x-menu-item-link {	border-radius: 0; border-color: #e1e1e1; background-color: #e1e1e1; background-image: none; } \n';
 			css += '.x-menu-item-link { padding: 4px 5px 4px 26px; } \n';
 			css += '.x-menu-item-text { color: #111; } \n';
@@ -4142,6 +4145,7 @@
 				renderTo: el,
 				width: el.getWidth(),
 				height: el.getHeight(),
+				cls: 'gis-plugin',
 				layout: {
 					type: 'hbox',
 					align: 'stretch'
@@ -4278,6 +4282,10 @@
 
 	GIS.getMap = GIS.plugin.getMap;
 
+	DHIS = Ext.isObject(DHIS) ? DHIS : {};
+
+	DHIS.getMap = GIS.plugin.getMap;
+
 })();
 
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html	2013-10-08 17:58:45 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/index.html	2013-10-11 11:44:58 +0000
@@ -24,7 +24,7 @@
     <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false";></script>
 
     <script type="text/javascript" src="../../dhis-web-commons/javascripts/ext/ext-all.js"></script>
-    <script type="text/javascript" src="scripts/openlayers/OpenLayers.js"></script>
+    <script type="text/javascript" src="../../dhis-web-commons/javascripts/openlayers/OpenLayers.js"></script>
     <script type="text/javascript" src="scripts/custom.js"></script>
 
     <script type="text/javascript" src="../../dhis-web-commons/javascripts/periodTypeNoDep.js"></script>

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-10-08 17:58:45 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/core.js	2013-10-11 11:44:58 +0000
@@ -183,7 +183,7 @@
 				window.destroy();
 			}
 			window = Ext.create('Ext.window.Window', {
-				cls: 'gis-window-widget-feature',
+				cls: 'gis-window-widget-feature gis-plugin',
 				preventHeader: true,
 				shadow: false,
 				resizable: false,
@@ -442,6 +442,7 @@
 				Ext.create('Ext.menu.Item', {
 					text: 'Float up',
 					iconCls: 'gis-menu-item-icon-float',
+					cls: 'gis-plugin',
 					disabled: !att.hasCoordinatesUp,
 					handler: function() {
 						drill(att.grandParentId, att.grandParentParentGraph, parseInt(att.level) - 1);
@@ -450,7 +451,7 @@
 				Ext.create('Ext.menu.Item', {
 					text: 'Drill down',
 					iconCls: 'gis-menu-item-icon-drill',
-					cls: 'gis-menu-item-first',
+					cls: 'gis-menu-item-first gis-plugin',
 					disabled: !att.hasCoordinatesDown,
 					handler: function() {
 						drill(att.id, att.parentGraph, parseInt(att.level) + 1);
@@ -499,6 +500,7 @@
 			menuItems[menuItems.length - 1].addCls('gis-menu-item-last');
 
 			menu = new Ext.menu.Menu({
+				baseCls: 'gis-plugin',
 				shadow: false,
 				showSeparator: false,
 				defaults: {
@@ -669,7 +671,7 @@
 		window = Ext.create('Ext.window.Window', {
 			title: GIS.i18n.measure_distance,
 			layout: 'fit',
-			cls: 'gis-container-default',
+			cls: 'gis-container-default gis-plugin',
 			bodyStyle: 'text-align: center',
 			width: 130,
 			minWidth: 130,
@@ -677,8 +679,8 @@
 			items: label,
 			listeners: {
 				show: function() {
-					var x = gis.viewport.eastRegion.x - this.getWidth() - 5,
-						y = 60;
+					var x = gis.viewport.eastRegion.getPosition()[0] - this.getWidth() - 3,
+						y = gis.viewport.centerRegion.getPosition()[1] + 26;
 					this.setPosition(x, y);
 				},
 				destroy: function() {

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js	2013-10-10 11:40:44 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/plugin.js	2013-10-11 11:44:58 +0000
@@ -36,9 +36,10 @@
 		};
 
 		applyCss = function(contextPath) {
-			var css = 'body { font-family: arial, sans-serif, liberation sans, consolas; font-size: 11px; } \n';
+			var css = '.gis-plugin, .gis-plugin * { font-family: arial, sans-serif, liberation sans, consolas; } \n';
 			css += '.x-panel-body { font-size: 11px; } \n';
 			css += '.x-panel-header { height: 30px; padding: 7px 4px 4px 7px; border: 0 none; } \n';
+			css += '.gis-container-default .x-window-body { padding: 5px; background: #fff; } \n';
 			css += '.olControlPanel { position: absolute; top: 0; right: 0; border: 0 none; } \n';
 			css += '.olControlButtonItemActive { background: #556; color: #fff; width: 24px; height: 24px; opacity: 0.75; filter: alpha(opacity=75); -ms-filter: "alpha(opacity=75)"; cursor: pointer; cursor: hand; text-align: center; font-size: 21px !important; text-shadow: 0 0 1px #ddd; } \n';
 			css += '.olControlPanel.zoomIn { right: 72px; } \n';
@@ -60,7 +61,7 @@
 			css += '.gis-window-widget-feature { padding: 0; border: 0 none; border-radius: 0; background: transparent; box-shadow: none; } \n';
 			css += '.gis-window-widget-feature .x-window-body-default { border: 0 none; background: transparent; } \n';
 			css += '.gis-window-widget-feature .x-window-body-default .x-panel-body-default { border: 0 none; background: #556; opacity: 0.92; filter: alpha(opacity=92); -ms-filter: "alpha(opacity=92)"; padding: 5px 8px 5px 8px; border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; color: #fff; font-weight: bold; letter-spacing: 1px; } \n';
-			css += '.x-menu-body { border-color: #bbb; border-radius: 2px; padding: 0; background-color: #fff !important; } \n';
+			css += '.x-menu-body { border:1px solid #bbb; border-radius: 2px; padding: 0; background-color: #fff !important; } \n';
 			css += '.x-menu-item-active .x-menu-item-link {	border-radius: 0; border-color: #e1e1e1; background-color: #e1e1e1; background-image: none; } \n';
 			css += '.x-menu-item-link { padding: 4px 5px 4px 26px; } \n';
 			css += '.x-menu-item-text { color: #111; } \n';
@@ -104,6 +105,7 @@
 				renderTo: el,
 				width: el.getWidth(),
 				height: el.getHeight(),
+				cls: 'gis-plugin',
 				layout: {
 					type: 'hbox',
 					align: 'stretch'
@@ -239,4 +241,8 @@
 	};
 
 	GIS.getMap = GIS.plugin.getMap;
+
+	DHIS = Ext.isObject(DHIS) ? DHIS : {};
+
+	DHIS.getMap = GIS.plugin.getMap;
 });