-/*
- * Called as the user scrolls/zooms around to aniplate hrefs of the
- * view tab and various other links
- */
-function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,objid) {
- var toPrecision = zoomPrecision(zoom);
- var node;
-
- lat = toPrecision(lat);
- lon = toPrecision(lon);
-
- if (minlon) {
- minlon = toPrecision(minlon);
- minlat = toPrecision(minlat);
- maxlon = toPrecision(maxlon);
- maxlat = toPrecision(maxlat);
- }
-
- $(".geolink").each(function (index, link) {
- var args = getArgs(link.href);
-
- if ($(link).hasClass("llz")) {
- args.lat = lat;
- args.lon = lon;
- args.zoom = zoom;
- } else if (minlon && $(link).hasClass("bbox")) {
- args.bbox = minlon + "," + minlat + "," + maxlon + "," + maxlat;
- }
-
- if (layers && $(link).hasClass("layers")) {
- args.layers = layers;
- }
-
- if (objtype && $(link).hasClass("object")) {
- args[objtype] = objid;
- }
-
- var minzoom = $(link).data("minzoom");
- if (minzoom) {
- var name = link.id.replace(/anchor$/, "");
-
- $(link).off("click.minzoom");
-
- if (zoom >= minzoom) {
- $(link).attr("title", I18n.t("javascripts.site." + name + "_tooltip"));
- $(link).removeClass("disabled");
- } else {
- $(link).on("click.minzoom", function () { alert(I18n.t("javascripts.site." + name + "_zoom_alert")); return false; });
- $(link).attr("title", I18n.t("javascripts.site." + name + "_disabled_tooltip"));
- $(link).addClass("disabled");
- }
- }
-
- link.href = setArgs(link.href, args);
- });
-
- $("#shortlinkanchor").each(function () {
- var args = getArgs(this.href);
- var code = makeShortCode(lat, lon, zoom);
- var prefix = shortlinkPrefix();
-
- // Add ?{node,way,relation}=id to the arguments
- if (objtype && objid) {
- args[objtype] = objid;
- }
+function remoteEditHandler(bbox, select) {
+ var loaded = false,
+ query = {
+ left: bbox.getWest() - 0.0001,
+ top: bbox.getNorth() + 0.0001,
+ right: bbox.getEast() + 0.0001,
+ bottom: bbox.getSouth() - 0.0001
+ };
+
+ if (select) query.select = select;
+
+ var iframe = $('<iframe>')
+ .hide()
+ .appendTo('body')
+ .attr("src", "http://127.0.0.1:8111/load_and_zoom?" + querystring.stringify(query))
+ .on('load', function() {
+ $(this).remove();
+ loaded = true;
+ });