labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r730733 - in /labs/magma/trunk/maps-google/src/main: java/org/apache/magma/maps/google/ resources/org/apache/magma/website/googlemaps/
Date Fri, 02 Jan 2009 14:22:20 GMT
Author: simoneg
Date: Fri Jan  2 06:22:19 2009
New Revision: 730733

URL: http://svn.apache.org/viewvc?rev=730733&view=rev
Log:
LABS-263 : fixs on maps javascript and CSS code

Modified:
    labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/AddMapLink.aj
    labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java
    labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.css
    labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.js

Modified: labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/AddMapLink.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/AddMapLink.aj?rev=730733&r1=730732&r2=730733&view=diff
==============================================================================
--- labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/AddMapLink.aj
(original)
+++ labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/AddMapLink.aj
Fri Jan  2 06:22:19 2009
@@ -14,11 +14,11 @@
 		args(stream) && within(SmartListProducer) && this(prod) {
 		try {
 			if (prod instanceof MappedSmartListProducer) {
-				stream.write("<a href=\"useMap-false\">".getBytes("UTF-8"));
+				stream.write("<a href=\"useMap-false\" class=\"MagmaGoogleMapsToListLink\">".getBytes("UTF-8"));
 				stream.write(new LocalizableString("Back to normal list").toString().getBytes("UTF-8"));
 				stream.write("</a>".getBytes("UTF-8"));							
 			} else if (prod.mappable) {
-				stream.write("<a href=\"useMap-true\">".getBytes("UTF-8"));
+				stream.write("<a href=\"useMap-true\" class=\"MagmaGoogleMapsToMapLink\">".getBytes("UTF-8"));
 				stream.write(new LocalizableString("Show on map").toString().getBytes("UTF-8"));
 				stream.write("</a>".getBytes("UTF-8"));							
 			}

Modified: labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java?rev=730733&r1=730732&r2=730733&view=diff
==============================================================================
--- labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java
(original)
+++ labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java
Fri Jan  2 06:22:19 2009
@@ -22,6 +22,9 @@
 		"<div class=\"MagmaGoogleMapListTab\"><ul>" +
 		"</ul></div>" +
 		"<div class=\"MagmaGoogleMap\"></div>" +
+		"<a class=\"MagmaGoogleMapDetailsLink\">" +
+		new LocalizableString("Details").toString() + 
+		"</a>" +
 		"</div>";
 
 	public <T> MappedSmartListProducer(Class<T> myclass, Collection<? extends
T> list) {

Modified: labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.css
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.css?rev=730733&r1=730732&r2=730733&view=diff
==============================================================================
--- labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.css
(original)
+++ labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.css
Fri Jan  2 06:22:19 2009
@@ -38,6 +38,10 @@
 	width: 10%;
 }
 
+.MagmaGoogleMapMarkerTip {
+	float: left;	
+}
+
 
 
 li.MappedElement {

Modified: labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.js
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.js?rev=730733&r1=730732&r2=730733&view=diff
==============================================================================
--- labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.js
(original)
+++ labs/magma/trunk/maps-google/src/main/resources/org/apache/magma/website/googlemaps/magmaGoogleMaps.js
Fri Jan  2 06:22:19 2009
@@ -6,8 +6,13 @@
 
 function createMarker(point,html) {
 	var marker = new GMarker(point);
+	marker._html_content = html;
+	marker.showInfos = function() {
+		this.openInfoWindowHtml(this._html_content);
+	}
 	GEvent.addListener(marker, "click", function() {
-		marker.openInfoWindowHtml(html);
+		//marker.openInfoWindowHtml(marker._html_content);
+		marker.showInfos();
 	});
 	return marker;
 }
@@ -62,12 +67,18 @@
 					data.text += '<b>' + headers[k] + '</b> : ' + stripHtml(cell.innerHTML)
+ '<br/>'; 
 				}
 			}
+			var a = $('a.MagmaGoogleMapDetailsLink').get(0);
+			a = a.cloneNode(true);
+			a.href = data.link;
 			if (data.coords && data.coords[0] != 0) {
 				var point = new GLatLng(data.coords[0], data.coords[1]);
-				var html = '<h1>' + data.header + '</h1><div>' + data.text + '</div>';
+				var html = '<div class="MagmaGoogleMapMarkerTip"><h1>' + data.header + '</h1><div>'
+ data.text + '</div>';
 				if (data.link && data.link != null && data.link != '') {
-					html += '<a href="' + data.link + '">&gt;</a>';
+					var tmpdiv = document.createElement('div');
+					tmpdiv.appendChild(a);
+					html += tmpdiv.innerHTML;
 				}
+				html += '</div>';
 				data.marker = createMarker(point, html);
           		map.addOverlay(data.marker);
           		bounds.extend(point);
@@ -77,7 +88,7 @@
           		li.className="MappedElement";
           		li.marker = data.marker;
           		data.marker.li = li;
-	          	jQuery(li).click(function() { this.marker.openInfoWindowHtml(html); return true;
});
+	          	jQuery(li).click(function() { this.marker.showInfos(); return true; });
           	} else {
           		li.className="NotMappedElement";          	
           	}
@@ -86,11 +97,7 @@
           	var txt = document.createTextNode(data.header);
           	div.appendChild(txt);
 			if (data.link && data.link != null && data.link != '') {
-				var link = document.createElement('a');
-				link.href = data.link;
-				var lnktxt = document.createTextNode('>');
-				link.appendChild(lnktxt);
-				li.appendChild(link);
+				li.appendChild(a);
 			}
           	sublistul.appendChild(li);
         } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message