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 doSWF(lat,lon,sc) {
25 flashvars.winie = winie;
27 flashvars.token = '<%= session[:token] %>';
28 if (lat) { flashvars.lat = lat; }
29 if (lon) { flashvars.long = lon; }
30 <% if params['gpx'] %>flashvars.gpx = '<%= h(params['gpx'] ) %>';<% end %>
31 <% if params['way'] %>flashvars.way = '<%= h(params['way'] ) %>';<% end %>
32 <% if params['node'] %>flashvars.node = '<%= h(params['node'] ) %>';<% end %>
33 <% if params['tileurl'] %>flashvars.custombg = '<%= h(params['tileurl']) %>';<% end %>
38 attributes.id = "potlatch";
39 attributes.bgcolor = "#FFFFFF";
41 swfobject.embedSWF("<%= asset_path("/potlatch/potlatch.swf") %>", "potlatch", "100%", "100%", "6","<%= asset_path("expressInstall.swf") %>", flashvars, params, attributes);
42 // 700,600 for fixed size, 100%,100% for resizable
45 doSWF(<%= @lat || 'null' %>,<%= @lon || 'null' %>,<%= @zoom %>);
47 function setPosition(lat, lon, zoom) {
48 doSWF(lat, lon, zoom || 15);