X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2e2f2124728ca755b2db8f83f022eaea24b647f0..8cdee8e0c75e6e62742eabc19bd8559cb13d5072:/app/views/user/_friend_map.html.erb diff --git a/app/views/user/_friend_map.html.erb b/app/views/user/_friend_map.html.erb index 72f02bd61..a73bb53b8 100644 --- a/app/views/user/_friend_map.html.erb +++ b/app/views/user/_friend_map.html.erb @@ -2,7 +2,7 @@ <% if !@user.home_lat.nil? and !@user.home_lon.nil? %> <% if !@user.nearby.empty? %> <% @user.nearby.each do |nearby| %> - <% nearest_str += "nearest.push( { 'display_name' : '#{nearby.display_name}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %> + <% nearest_str += "nearest.push( { 'display_name' : '#{escape_javascript(nearby.display_name)}', 'home_lat' : #{nearby.home_lat}, 'home_lon' : #{nearby.home_lon} } );\n" %> <% end %> <% end %> <% end %> @@ -54,7 +54,7 @@ near_icon.url = OpenLayers.Util.getImagesLocation() + "marker-green.png";; var i = nearest.length; while( i-- ) { - var description = '<%= t 'user.friend_map.nearby mapper'%>'+nearest[i].display_name+'' + var description = i18n('<%= t 'user.friend_map.nearby mapper'%>', { nearby_user: ''+nearest[i].display_name+'' }); var nearmarker = addMarkerToMap(new OpenLayers.LonLat(nearest[i].home_lon, nearest[i].home_lat), near_icon.clone(), description); }