From: Kai Krueger Date: Sat, 30 Apr 2011 02:49:38 +0000 (-0600) Subject: Merge branch 'openstreetbugs' of git://git.openstreetmap.org/rails into openstreetbugs2 X-Git-Tag: live~6160^2~184 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/a6f45adede24e47b113dcf0f33e701478076f1b7?hp=0a3087cd7dbf3c4ce98afe9e086aca50d19325cd Merge branch 'openstreetbugs' of git://git.openstreetmap.org/rails into openstreetbugs2 --- diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 27ecf1fa7..b668627a0 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -25,7 +25,7 @@
@@ -150,7 +150,8 @@ end cookieLifetime : 1000, cookiePath : "/my/map/", permalinkURL : "http://www.openstreetmap.org/", - theme : "/stylesheets/openstreetbugs.css" + theme : "/stylesheets/openstreetbugs.css", + visibility : false }); map.addLayer(map.osbLayer); @@ -163,6 +164,9 @@ end lBug.addEventListener('click',function (e) { map.osbControl.activate(); document.getElementById("OpenLayers.Map_18_OpenLayers_Container").style.cursor = "crosshair" },false); + map.events.register("zoomend",map,function () { var zoom = map.getZoom(); var lBug = document.getElementById('ReportBug') + if (zoom > 11) { lBug.style.visibility = 'visible';} else {lBug.style.visibility = "hidden";}}); + <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 667a6faeb..6b6c37036 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1183,7 +1183,6 @@ en: your_bug: "{{commenter}} has left a comment on one of your map bug reports near {{place}}." commented_bug: "{{commenter}} has left a comment on a map bug report you have commented on. The bug is near {{place}}." details: "More details about the bug report can be found at {{URL}}." - message: inbox: title: "Inbox" @@ -1914,10 +1913,11 @@ en: Mark as fixed: Mark as fixed Cancel: Cancel Create OpenStreetBug: Create OpenStreetBug - Create bug: Create bug - Bug description: Bug description - Create: Create + Create bug: Report a problem with the map + Bug description: Problem description + Create: Report problem Permalink: Permalink Login: Login Details: Details + edityourself: You can also edit the map directly your self diff --git a/public/javascripts/openstreetbugs.js b/public/javascripts/openstreetbugs.js index 378c2ce32..a8aba9be7 100644 --- a/public/javascripts/openstreetbugs.js +++ b/public/javascripts/openstreetbugs.js @@ -294,8 +294,8 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, var marker = feature.createMarker(); marker.feature = feature; marker.events.register("click", feature, this.markerClick); - marker.events.register("mouseover", feature, this.markerMouseOver); - marker.events.register("mouseout", feature, this.markerMouseOut); + //marker.events.register("mouseover", feature, this.markerMouseOver); + //marker.events.register("mouseout", feature, this.markerMouseOut); this.addMarker(marker); this.bugs[id] = feature; @@ -317,7 +317,7 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, var newContent = document.createElement("div"); el1 = document.createElement("h3"); - el1.appendChild(document.createTextNode(closed ? i18n("javascripts.osb.Fixed Error") : i18n("javascripts.osb.Unresolved Error"))); + el1.appendChild(document.createTextNode(putAJAXMarker.bugs[id][2] ? i18n("javascripts.osb.Fixed Error") : i18n("javascripts.osb.Unresolved Error"))); el1.appendChild(document.createTextNode(" [")); el2 = document.createElement("a"); @@ -367,6 +367,7 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, el2.className = (i == 0 ? "osb-description" : "osb-comment"); el2.appendChild(document.createTextNode(putAJAXMarker.bugs[id][1][i])); el1.appendChild(el2); + if (i == 0) { el2 = document.createElement("br"); el1.appendChild(el2);}; } containerDescription.appendChild(el1); @@ -375,7 +376,7 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, el1 = document.createElement("p"); el1.className = "osb-fixed"; el2 = document.createElement("em"); - el2.appendChild(document.createTextNode(i18n("javascripts.osb.Has been fixed."))); + el2.appendChild(document.createTextNode(i18n("javascripts.osb.Has been fixed"))); el1.appendChild(el2); containerDescription.appendChild(el1); } @@ -420,7 +421,9 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, el1.appendChild(el2); el2 = document.createElement("dd"); var inputComment = document.createElement("textarea"); - inputComment.setAttribute("cols",40); + inputComment.setAttribute("cols",40); + inputComment.setAttribute("rows",3); + el2.appendChild(inputComment); el1.appendChild(el2); @@ -430,7 +433,8 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, el1.className = "buttons"; el2 = document.createElement("li"); el3 = document.createElement("input"); - el3.setAttribute("type", "submit"); + el3.setAttribute("type", "button"); + el3.onclick = function(){ this.form.onsubmit(); return false; }; el3.value = i18n("javascripts.osb.Add comment"); el2.appendChild(el3); el1.appendChild(el2); @@ -653,7 +657,6 @@ OpenLayers.Control.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Control, { newContent.appendChild(el1); var el_form = document.createElement("form"); - el_form.onsubmit = function() { control.osbLayer.createBug(lonlatApi, inputDescription.value); marker.feature = null; feature.destroy(); return false; }; el1 = document.createElement("dl"); el2 = document.createElement("dt"); @@ -677,6 +680,8 @@ OpenLayers.Control.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Control, { el3.appendChild(document.createTextNode(i18n("javascripts.osb.Login"))); el2.appendChild(el3); el1.appendChild(el2); + el2 = document.createElement("br"); + el1.appendChild(el2); el2 = document.createElement("dt"); el2.appendChild(document.createTextNode(i18n("javascripts.osb.Bug description"))); @@ -684,18 +689,32 @@ OpenLayers.Control.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Control, { el2 = document.createElement("dd"); var inputDescription = document.createElement("textarea"); inputDescription.setAttribute("cols",40); + inputDescription.setAttribute("rows",3); el2.appendChild(inputDescription); el1.appendChild(el2); el_form.appendChild(el1); el1 = document.createElement("div"); el2 = document.createElement("input"); - el2.setAttribute("type", "submit"); + el2.setAttribute("type", "button"); el2.value = i18n("javascripts.osb.Create"); + el2.onclick = function() { control.osbLayer.createBug(lonlatApi, inputDescription.value); marker.feature = null; feature.destroy(); return false; }; + el1.appendChild(el2); + el2 = document.createElement("input"); + el2.setAttribute("type", "button"); + el2.value = i18n("javascripts.osb.Cancel"); + el2.onclick = function(){ feature.destroy(); }; el1.appendChild(el2); el_form.appendChild(el1); newContent.appendChild(el_form); + el2 = document.createElement("hr"); + el1.appendChild(el2); + el2 = document.createElement("a"); + el2.setAttribute("href","edit"); + el2.appendChild(document.createTextNode(i18n("javascripts.osb.edityourself"))); + el1.appendChild(el2); + feature.data.popupContentHTML = newContent; var popup = feature.createPopup(true); popup.events.register("close", this, function(){ feature.destroy(); }); diff --git a/public/stylesheets/large.css b/public/stylesheets/large.css index a1efa8583..cb2fe29b6 100644 --- a/public/stylesheets/large.css +++ b/public/stylesheets/large.css @@ -18,3 +18,7 @@ .olControlPanZoom { display: none; } + +a.reportProblem { + font-size:150%; +}