2 <div id="potlatch"><%= raw t 'site.edit.flash_player_required' %></div>
5 <%= javascript_include_tag 'swfobject.js' %>
7 <% session[:token] = @user.tokens.create.token unless session[:token] and UserToken.find_by_token(session[:token]) %>
9 <script type="text/javascript" defer="defer">
11 var winie=false; if (document.all && window.print) { winie=true; }
13 window.onbeforeunload=function() {
15 return '<%= escape_javascript(t('site.edit.potlatch_unsaved_changes')) %>';
19 function markChanged(a) { changesaved=a; }
21 function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,object) {
22 updateLinks({ lon: lon, lat: lat }, zoom);
24 var hash = OSM.formatHash({ lon: lon, lat: lat, zoom: zoom });
25 if (hash !== location.hash) {
26 location.replace(hash);
30 function doSWF(lat,lon,sc) {
34 flashvars.winie = winie;
36 flashvars.token = '<%= session[:token] %>';
37 if (lat) { flashvars.lat = lat; }
38 if (lon) { flashvars.long = lon; }
39 <% if params['gpx'] %>flashvars.gpx = '<%= h(params['gpx'] ) %>';<% end %>
40 <% if params['way'] %>flashvars.way = '<%= h(params['way'] ) %>';<% end %>
41 <% if params['node'] %>flashvars.node = '<%= h(params['node'] ) %>';<% end %>
42 <% if params['tileurl'] %>flashvars.custombg = '<%= h(params['tileurl']) %>';<% end %>
47 attributes.id = "potlatch";
48 attributes.bgcolor = "#FFFFFF";
50 swfobject.embedSWF("<%= asset_path("/potlatch/potlatch.swf") %>", "potlatch", "100%", "100%", "6","<%= asset_path("expressInstall.swf") %>", flashvars, params, attributes);
51 // 700,600 for fixed size, 100%,100% for resizable
54 <% if @lat && @lon -%>
55 doSWF(<%= @lat %>, <%= @lon %>, <%= @zoom %>);
57 var mapParams = OSM.mapParams();
58 doSWF(mapParams.lat, mapParams.lon, mapParams.zoom || 17);