2 <%= t 'site.edit.flash_player_required' %>
5 <%= javascript_include_tag 'swfobject.js' %>
7 <% token = @user.access_token(POTLATCH2_KEY) %>
9 <script type="text/javascript" defer="defer">
10 var brokenContentSize = $("content").offsetWidth == 0;
11 var fo = new SWFObject("/potlatch2/potlatch2.swf?d="+Math.round(Math.random()*1000), "potlatch", "100%", "100%", "9", "#FFFFFF");
12 // 700,600 for fixed size, 100%,100% for resizable
15 window.onbeforeunload=function() {
17 return '<%= escape_javascript(t('site.edit.potlatch_unsaved_changes')) %>';
21 function markChanged(a) { changesaved=a; }
23 function doSWF(lat,lon,zoom) {
24 fo.addParam("base","/potlatch2");
25 if (lat) { fo.addVariable("lat",lat); }
26 if (lon) { fo.addVariable("lon",lon); }
27 fo.addVariable("zoom",zoom);
28 fo.addVariable("api","http://<%= SERVER_URL %>/api/<%= API_VERSION %>/");
29 fo.addVariable("policy","http://<%= SERVER_URL %>/api/crossdomain.xml");
30 fo.addVariable("connection","XML");
31 fo.addVariable("oauth_token","<%= token.token %>");
32 fo.addVariable("oauth_token_secret","<%= token.secret %>");
33 fo.addVariable("oauth_consumer_key","<%= token.client_application.key %>");
34 fo.addVariable("oauth_consumer_secret","<%= token.client_application.secret %>");
35 fo.addVariable("maximise_function","maximiseMap");
36 fo.addVariable("minimise_function","minimiseMap");
40 doSWF(<%= @lat || 'null' %>,<%= @lon || 'null' %>,<%= @zoom %>);
42 function setPosition(lat, lon, zoom) {
43 doSWF(lat, lon, zoom || 15);