-
-
-
-
-
-
-
- View Data For Current Map View
+
diff --git a/app/views/browse/start.rjs b/app/views/browse/start.rjs
index 2c48c70ff..dbe70695f 100644
--- a/app/views/browse/start.rjs
+++ b/app/views/browse/start.rjs
@@ -1,8 +1,8 @@
-page.replace_html :sidebar_title, 'Browse'
+page.replace_html :sidebar_title, 'Data'
page.replace_html :sidebar_content, :partial => 'start'
page << <
= 16) {
+ }
+
+ function showData() {
+ if (mode == "manual") { return; }
+ if (map.getZoom() >= 15) {
useMap();
} else {
$("status").innerHTML = "Zoom in or Select an area of the map to view.";
@@ -42,7 +46,7 @@ page << < 0.25) {
- $("use_map").style.display = "none";
- } else {
- $("use_map").style.display = "inline";
- }
+ function loadHistory() {
+ this.link.href = "";
+ this.link.innerHTML = "Wait...";
+ new Ajax.Request("/api/0.5/"+this.type+"/"+this.feature.osm_id+"/history", {onComplete: OpenLayers.Function.bind(displayHistory, this)});
+ return false;
}
+ function displayHistory(request) {
+ if (currentFeature.osm_id != this.feature.osm_id || $("object").firstChild == objList) {
+ return false;
+ }
+ this.link.parentNode.parentNode.removeChild(this.link.parentNode);
+ var doc = request.responseXML;
+ var div = document.createElement("div");
+ var h3 = document.createElement("h3");
+ h3.appendChild(document.createTextNode("History"));
+ div.appendChild(h3);
+ var nodes = doc.getElementsByTagName(this.type);
+ var history = document.createElement("ul");
+ for (var i = 0; i < nodes.length; i++) {
+ var user = nodes[i].getAttribute("user") || "private user";
+ var timestamp = nodes[i].getAttribute("timestamp");
+ var item = document.createElement("li");
+ item.appendChild(document.createTextNode("Edited by " + user + " at " + timestamp));
+ history.appendChild(item);
+ }
+ div.appendChild(history);
+ $("object").appendChild(div);
+ }
+
start();
EOJ