X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c6bf21a9d054f29d788272767b7a77d58fe56aec..56336763dee8289d5f818f3d0df5826b84876a57:/app/views/site/edit.html.erb diff --git a/app/views/site/edit.html.erb b/app/views/site/edit.html.erb index 142d7a3f3..3565b0468 100644 --- a/app/views/site/edit.html.erb +++ b/app/views/site/edit.html.erb @@ -12,7 +12,7 @@ <% else %> <% content_for :greeting do %> <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %> -<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> | +<%= link_to_function t('layouts.home'), "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)", { :title => t('layouts.home_tooltip') } %> | <% end %> <% end %> @@ -65,7 +65,7 @@ zoom='14' if zoom.nil? window.onbeforeunload=function() { if (!changesaved) { - return "<%= t 'site.edit.potlatch_unsaved_changes' %>"; + return '<%= escape_javascript(t('site.edit.potlatch_unsaved_changes')) %>'; } } @@ -78,16 +78,17 @@ zoom='14' if zoom.nil? fo.addVariable('token','<%= session[:token] %>'); if (lat) { fo.addVariable('lat',lat); } if (lon) { fo.addVariable('long',lon); } - <% if params['gpx'] %>fo.addVariable('gpx' ,'<%= h(params['gpx'] ) %>');<% end %> - <% if params['way'] %>fo.addVariable('way' ,'<%= h(params['way'] ) %>');<% end %> - <% if params['node'] %>fo.addVariable('node','<%= h(params['node']) %>');<% end %> + <% if params['gpx'] %>fo.addVariable('gpx' ,'<%= h(params['gpx'] ) %>');<% end %> + <% if params['way'] %>fo.addVariable('way' ,'<%= h(params['way'] ) %>');<% end %> + <% if params['node'] %>fo.addVariable('node' ,'<%= h(params['node'] ) %>');<% end %> + <% if params['tileurl'] %>fo.addVariable('custombg','<%= h(params['tileurl']) %>');<% end %> fo.write("map"); } doSWF(<%= lat || 'null' %>,<%= lon || 'null' %>,<%= zoom %>); function setPosition(lat, lon, zoom) { - doSWF(lat, lon, zoom); + doSWF(lat, lon, zoom || 15); } function resizeContent() {