X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b4c0bfd8fa324a4c9d8b24e8753d134524ea61c7..2fad5f7c92055755e0a662ed22943b7d3f92e909:/public/javascripts/site.js diff --git a/public/javascripts/site.js b/public/javascripts/site.js index 75c3eb539..e7ef320bc 100644 --- a/public/javascripts/site.js +++ b/public/javascripts/site.js @@ -1,28 +1,28 @@ function updatelinks(lon,lat,zoom) { - var links = new Array(); - links['viewanchor'] = '/index.html'; - //links['editanchor'] = 'edit.html'; - links['uploadanchor'] = '/traces'; - links['loginanchor'] = '/login.html'; - links['logoutanchor'] = '/logout.html'; - links['registeranchor'] = '/create-account.html'; - - var node; - var anchor; - for (anchor in links) { - node = document.getElementById(anchor); - if (! node) { continue; } - node.href = links[anchor] + "?lat=" + lat + "&lon=" + lon + "&zoom=" + zoom; - } + var links = new Array(); + links['viewanchor'] = '/index.html'; + //links['editanchor'] = 'edit.html'; + links['uploadanchor'] = '/traces'; + links['loginanchor'] = '/login.html'; + links['logoutanchor'] = '/logout.html'; + links['registeranchor'] = '/create-account.html'; + + var node; + var anchor; + for (anchor in links) { + node = document.getElementById(anchor); + if (! node) { continue; } + node.href = links[anchor] + "?lat=" + lat + "&lon=" + lon + "&zoom=" + zoom; + } - node = document.getElementById("editanchor"); - if (node) { + node = document.getElementById("editanchor"); + if (node) { if ( zoom >= 14) { - node.href = '/edit.html?lat=' + lat + '&lon=' + lon + "&zoom=" + zoom; - node.style.fontStyle = 'normal'; + node.href = '/edit.html?lat=' + lat + '&lon=' + lon + "&zoom=" + zoom; + node.style.fontStyle = 'normal'; } else { - node.href = 'javascript:alert("zoom in to edit map");'; - node.style.fontStyle = 'italic'; - } + node.href = 'javascript:alert("zoom in to edit map");'; + node.style.fontStyle = 'italic'; } + } }