- }
-
- node = document.getElementById("historyanchor");
- if (node) {
- if (zoom >= 11) {
- var args = new Object();
- //set bbox param from 'extents' object
- if (typeof minlon == "number" &&
- typeof minlat == "number" &&
- typeof maxlon == "number" &&
- typeof maxlat == "number") {
-
- minlon = Math.round(minlon * decimals) / decimals;
- minlat = Math.round(minlat * decimals) / decimals;
- maxlon = Math.round(maxlon * decimals) / decimals;
- maxlat = Math.round(maxlat * decimals) / decimals;
- args.bbox = minlon + "," + minlat + "," + maxlon + "," + maxlat;
- }
-
- node.href = setArgs("/history", args);
- node.style.fontStyle = 'normal';
- } else {
- node.href = 'javascript:alert("zoom in to see editing history");';
- node.style.fontStyle = 'italic';
+
+ if (layers && link.hasClassName("layers")) {
+ args.layers = layers;
+ }
+
+ if (objtype && link.hasClassName("object")) {
+ args[objtype] = objid;
+ }
+
+ if (link.hasClassName("minzoom[0-9]+")) {
+ $w(link.className).each(function (classname) {
+ if (match = classname.match(/^minzoom([0-9]+)$/)) {
+ var minzoom = match[1];
+ var name = link.id.replace(/anchor$/, "");
+
+ if (zoom >= minzoom) {
+ link.onclick = null;
+ link.title = i18n("javascripts.site." + name + "_tooltip");
+ link.removeClassName("disabled");
+ } else {
+ link.onclick = function () { alert(i18n("javascripts.site." + name + "_zoom_alert")); return false; };
+ link.title = i18n("javascripts.site." + name + "_disabled_tooltip");
+ link.addClassName("disabled");
+ }
+ }
+ });