1 <% if OSM_STATUS == :database_offline or OSM_STATUS == :api_offline %>
2 <p>The OpenStreetMap database is currently offline while
3 essential database maintenance work is carried out.
5 <% elsif OSM_STATUS == :api_readonly %>
6 <p>The OpenStreetMap database is currently in read-only mode while
7 essential database maintenance work is carried out.
9 <% elsif !@user.data_public? %>
10 <p>You haven't set your edits to be public.</p>
11 <p>You can't use the online editor unless you do so. You can set your edits as public from your
12 <%= link_to 'user page', {:controller => 'user', :action => 'account', :display_name => @user.display_name}%>.</p>
13 <p>(<a href="http://wiki.openstreetmap.org/index.php/Disabling_anonymous_edits">Find out why this is the case.</a>)</p>
15 <% content_for :greeting do %>
16 <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %>
17 <%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> |
21 <%= render :partial => 'sidebar', :locals => { :onopen => "resizeMap();", :onclose => "resizeMap();" } %>
22 <%= render :partial => 'search' %>
25 session[:token] = @user.tokens.create.token unless session[:token]
27 if params['mlon'] and params['mlat']
28 lon = h(params['mlon'])
29 lat = h(params['mlat'])
30 zoom = h(params['zoom'] || '14')
32 elsif @user and params['lon'].nil? and params['lat'].nil? and params['gpx'].nil?
37 lon = h(params['lon'] || 'null')
38 lat = h(params['lat'] || 'null')
39 zoom = h(params['zoom'] || '14')
44 You need a Flash player to use Potlatch, the
45 OpenStreetMap Flash editor. You can <a href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">download Flash Player from Adobe.com</a>.
47 <a href="http://wiki.openstreetmap.org/index.php/Editing">Several other options</a> are also available
48 for editing OpenStreetMap.
51 <%= javascript_include_tag 'swfobject.js' %>
52 <script type="text/javascript" defer="defer">
53 var brokenContentSize = $("content").offsetWidth == 0;
54 var fo = new SWFObject("/potlatch/potlatch.swf?d="+Math.round(Math.random()*1000), "potlatch", "100%", "100%", "6", "#FFFFFF");
55 // 700,600 for fixed size, 100%,100% for resizable
57 var winie=false; if (document.all && window.print) { winie=true; }
59 window.onbeforeunload=function() {
60 if (!changesaved && !winie) {
61 return "You have unsaved changes. (To save in Potlatch, you should deselect the current way or point.)";
65 function doSWF(lat,lon,sc) {
67 fo.addVariable('scale',sc);
68 fo.addVariable('token','<%= session[:token] %>');
69 if (lat) { fo.addVariable('lat',lat); }
70 if (lon) { fo.addVariable('long',lon); }
71 <% if params['gpx'] %>fo.addVariable('gpx' ,'<%= h(params['gpx'] ) %>');<% end %>
72 <% if params['way'] %>fo.addVariable('way' ,'<%= h(params['way'] ) %>');<% end %>
73 <% if params['node'] %>fo.addVariable('node','<%= h(params['node']) %>');<% end %>
77 doSWF(<%= lat || 'null' %>,<%= lon || 'null' %>,<%= zoom %>);
79 function setPosition(lat, lon, zoom) {
80 doSWF(lat, lon, zoom);
83 function resizeContent() {
84 var content = $("content");
85 var rightMargin = parseInt(getStyle(content, "right"));
86 var bottomMargin = parseInt(getStyle(content, "bottom"));
88 content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
89 content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
92 function resizeMap() {
93 var sidebar_width = $("sidebar").offsetWidth;
95 if (sidebar_width > 0) {
96 sidebar_width = sidebar_width + 5
99 $("map").style.left = (sidebar_width) + "px";
100 $("map").style.width = ($("content").offsetWidth - sidebar_width) + "px";
101 $("map").style.height = ($("content").offsetHeight - 2) + "px";
104 function handleResize() {
105 if (brokenContentSize) {
112 function maximiseMap() {
113 $("left").style.display = "none";
114 $("greeting").style.display = "none";
115 $("tabnav").style.display = "none";
117 $("content").style.top = "10px";
118 $("content").style.left = "10px";
123 function minimiseMap() {
124 $("left").style.display = "";
125 $("greeting").style.display = "";
126 $("tabnav").style.display = "";
128 $("content").style.top = "35px";
129 $("content").style.left = "192px";
136 window.onload = handleResize;
137 window.onresize = handleResize;