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 <% if @lat && @lon -%>
46 doSWF(<%= @lat %>,<%= @lon %>,16);
48 var params = OSM.mapParams();
49 doSWF(params.lat, params.lon, params.zoom || 17);
52 $(document).ready(function () {
53 $("body").on("click", "a.set_position", function () {
54 var data = $(this).data();
56 doSWF(data.lat, data.lon, data.zoom || 15);