-function updatelinks(loc, zoom, layers, bounds, object) {
- var toPrecision = zoomPrecision(zoom);
- bounds = normalBounds(bounds);
- var node;
-
- var lat = toPrecision(loc.lat),
- lon = toPrecision(loc.lon || loc.lng);
-
- if (bounds) {
- var minlon = toPrecision(bounds.getWest()),
- minlat = toPrecision(bounds.getSouth()),
- maxlon = toPrecision(bounds.getEast()),
- maxlat = toPrecision(bounds.getNorth());
- }
-
- $(".geolink").each(setGeolink);
- $("#shortlinkanchor").each(setShortlink);
-
- function setGeolink(index, link) {
- var args = getArgs(link.href);
-
- if ($(link).hasClass("llz")) {
- $.extend(args, {
- lat: lat,
- lon: lon,
- zoom: zoom
- });
- } else if (minlon && $(link).hasClass("bbox")) {
- $.extend(args, {
- bbox: minlon + "," + minlat + "," + maxlon + "," + maxlat
- });
- }
-
- if (layers && $(link).hasClass("layers")) {
- args.layers = layers;
- }
-
- if (object && $(link).hasClass("object")) {
+window.updateLinks = function (loc, zoom, layers, object) {
+ $(".geolink").each(function(index, link) {
+ var href = link.href.split(/[?#]/)[0],
+ args = querystring.parse(link.search.substring(1)),
+ editlink = $(link).hasClass("editlink");
+
+ delete args.node;
+ delete args.way;
+ delete args.relation;
+ delete args.changeset;
+
+ if (object && editlink) {