Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Komzpa/OpenStreetMap.by
base: 6cb635d568
...
head fork: Komzpa/OpenStreetMap.by
compare: fa0ae32167
  • 2 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
11 helper.js
@@ -30,6 +30,17 @@ $().ready( function(){
+$("#osbreport").dialog(
+ {
+ autoOpen: false,
+ title: _('Report a problem on map'),
+ width: 750,
+ height: 480,
+ modal: true
+ }
+);
+$("#osbreport_send").click(reportOSB);
+
$("#downloadmaps").dialog(
View
BIN  img/osb_icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 js/context.js
@@ -63,6 +63,14 @@ function context_menu(e){
}
menu.push( $.contextMenu.separator);
+
+ var item = {};
+ item[ (_("Report a problem") + ((mmap.getZoom()<13)?(" ("+ _("please zoom in")+")"):''))] = {onclick:OSBmenu, icon:"/img/osb_icon.png", disabled: mmap.getZoom()<13};
+ menu.push(item);
+
+
+
+
if (josm_remote){
var item = {};
item[_("Edit via ")+josm_remote.application ] = {
View
7 js/i18n.js
@@ -82,6 +82,12 @@ i18n= {
"Edit on OpenStreetMap.org":"Правіць на OpenStreetMap.org",
"Route as bicycle":"Роварны маршрут",
"Route as car":"Аўтамабільны маршрут",
+ "Report a problem":"Паведаміць пра памылку тут",
+ "Report a problem on map":"Паведамленне пра памылку на мапе",
+ "Who are you?":"Хто вы?",
+ "Describe what's wrong":"Што не так",
+ "please zoom in":"калі ласка, павялічце мапу",
+ "Send report":"Даслаць паведамленне",
'':''
//"shoes shop": "абуак",
@@ -111,6 +117,7 @@ function refreshLocales(){
$('s').html(function(a,b){return _(b)});
$('a').html(function(a,b){return _(b)});
$('label').html(function(a,b){return _(b)});
+ $('button').html(function(a,b){return _(b)});
$('a').attr("title", function(a,b){return _(b)})
}
View
28 js/osbreport.js
@@ -0,0 +1,28 @@
+function OSBmenu(){
+ var username = "NoName";
+ if ($.cookie("username")){
+ username = $.cookie("username");
+ };
+ $("#osbreport_username").val(username);
+ $("#osbreport").dialog('open');
+ $("#osbreport_text").focus();
+}
+
+function osbResponse(errorMessage) {
+ if(errorMessage == undefined){
+ $("#osbreport_text").val("");
+ $("#osbreport_text").html("");
+ $("#osbreport").dialog('close');
+ }
+ else
+ alert("Error creating bug: "+errorMessage);
+}
+
+function reportOSB(){
+ var text = "";
+ text += "";
+ text += $("#osbreport_text").val();
+ text += " ["+$("#osbreport_username").val() + "@openstreetmap.by]";
+ $.cookie("username",$("#osbreport_username").val());
+ $.getJSON('http://openstreetbugs.schokokeks.org/api/0.1/addPOIexec?cb=?',{lat: wherenow.lat, lon: wherenow.lng, format: 'js', text: text}, function(data){});
+}
View
22 js/permalink.js
@@ -5,14 +5,17 @@ L.Control.Permalink = L.Class.extend({
},
onAdd: function(map) {
- this._container = L.DomUtil.create('div', 'leaflet-control-attribution');
- L.DomEvent.disableClickPropagation(this._container);
map.on('moveend', this._update, this);
this._map = map;
+ /*
+ this._container = L.DomUtil.create('div', 'leaflet-control-attribution');
+ L.DomEvent.disableClickPropagation(this._container);
+
+
this._href = L.DomUtil.create('a', null, this._container);
this._href.innerHTML = "Permalink";
this._set_center(this._params);
- this._update();
+ this._update();*/
if ("q" in this._params){
$('#searchbox').val(this._params.q);
search();
@@ -49,8 +52,7 @@ L.Control.Permalink = L.Class.extend({
this._params['via'] = routePoints.join(";");
this._params['vehicle'] = vehicle;
}
-
-
+
var url = [];
for (var i in this._params) {
@@ -60,7 +62,7 @@ L.Control.Permalink = L.Class.extend({
}
}
- this._href.setAttribute('href', this._url_base + "?" + url.join('&'));
+ //this._href.setAttribute('href', this._url_base + "?" + url.join('&'));
if (history.replaceState) { history.replaceState({},"",this._url_base + "?" + url.join('&')); };
},
@@ -108,15 +110,15 @@ L.Control.Permalink = L.Class.extend({
routePoints.push([parseFloat(i[j].split(",")[0]), parseFloat(i[j].split(",")[1])]);
};
}
-
+
vehicle = params.vehicle || $.cookie('vehicle');
-
+
if (this._centered) return;
-
+
if ((params.zoom == undefined) && ($.cookie('zoom')!= undefined)) { params.zoom = $.cookie('zoom')};
if ((params.lat == undefined) && ($.cookie('lat') != undefined)) { params.lat = $.cookie('lat') };
if ((params.lon == undefined) && ($.cookie('lon') != undefined)) { params.lon = $.cookie('lon') };
-
+
if (params.zoom == undefined ||
params.lat == undefined ||
params.lon == undefined) return;
View
16 templates/index.html
@@ -31,6 +31,7 @@
<script src="/js/jquery.contextmenu.js"></script>
<script src="/js/context.js"></script>
<script src="/js/route.js"></script>
+<script src="/js/osbreport.js"></script>
<script type="text/javascript">
var mmap;
@@ -119,6 +120,21 @@
<textarea id="embedtext" style="width:100%;font-size:medium" rows="5" readonly></textarea></div>
+<div id="osbreport">
+
+<form>
+<label for="osbreport_username">Who are you?</label><br>
+<input type="text" value="" id="osbreport_username" /><br>
+<label for="osbreport_text">Describe what's wrong:</label><br>
+<textarea id="osbreport_text" style="width:100%;font-size:medium" rows="5"></textarea><br>
+<button id="osbreport_send" type="button">Send report</button>
+
+</form>
+
+</div>
+
+
+
<div id="downloadmaps">
<ul>
<li><a href="#tabs-j2me">J2ME</a></li>
View
17 templates/indexb.html
@@ -31,6 +31,7 @@
<script src="/js/jquery.contextmenu.js"></script>
<script src="/js/context.js"></script>
<script src="/js/route.js"></script>
+<script src="/js/osbreport.js"></script>
<script type="text/javascript">
var mmap;
@@ -119,6 +120,21 @@
<textarea id="embedtext" style="width:100%;font-size:medium" rows="5" readonly></textarea></div>
+<div id="osbreport">
+
+<form>
+<label for="osbreport_username">Who are you?</label><br>
+<input type="text" value="" id="osbreport_username" /><br>
+<label for="osbreport_text">Describe what's wrong:</label><br>
+<textarea id="osbreport_text" style="width:100%;font-size:medium" rows="5"></textarea><br>
+<button id="osbreport_send" type="button">Send report</button>
+
+</form>
+
+</div>
+
+
+
<div id="downloadmaps">
<ul>
<li><a href="#tabs-j2me">J2ME</a></li>
@@ -168,6 +184,7 @@
center: new L.LatLng($latitude, $longitude),
zoom: $zoom
});
+ mmap.addControl(new L.Control.Permalink());

No commit comments for this range

Something went wrong with that request. Please try again.