We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 42601b1f authored by Sarven Capadisli's avatar Sarven Capadisli

Some JS cleaning up for NoticeLocationAttach (which fixes also fixes a

few bugs in WebKit)
parent 187a7087
...@@ -494,7 +494,7 @@ var SN = { // StatusNet ...@@ -494,7 +494,7 @@ var SN = { // StatusNet
$.cookie(SN.C.S.NoticeDataGeoCookie, 'disabled'); $.cookie(SN.C.S.NoticeDataGeoCookie, 'disabled');
} }
function getJSONgeocodeURL(geocodeURL, data, position) { function getJSONgeocodeURL(geocodeURL, data) {
$.getJSON(geocodeURL, data, function(location) { $.getJSON(geocodeURL, data, function(location) {
var lns, lid; var lns, lid;
...@@ -509,7 +509,7 @@ var SN = { // StatusNet ...@@ -509,7 +509,7 @@ var SN = { // StatusNet
} }
if (typeof(location.name) == 'undefined') { if (typeof(location.name) == 'undefined') {
NLN_text = position.coords.latitude + ';' + position.coords.longitude; NLN_text = data.lat + ';' + data.lon;
} }
else { else {
NLN_text = location.name; NLN_text = location.name;
...@@ -571,7 +571,7 @@ var SN = { // StatusNet ...@@ -571,7 +571,7 @@ var SN = { // StatusNet
token: $('#token').val() token: $('#token').val()
}; };
getJSONgeocodeURL(geocodeURL, data, position); getJSONgeocodeURL(geocodeURL, data);
}, },
function(error) { function(error) {
...@@ -593,12 +593,12 @@ var SN = { // StatusNet ...@@ -593,12 +593,12 @@ var SN = { // StatusNet
else { else {
if (NLat.length > 0 && NLon.length > 0) { if (NLat.length > 0 && NLon.length > 0) {
var data = { var data = {
'lat': NLat, lat: NLat,
'lon': NLon, lon: NLon,
'token': $('#token').val() token: $('#token').val()
}; };
getJSONgeocodeURL(geocodeURL, data, position); getJSONgeocodeURL(geocodeURL, data);
} }
else { else {
removeNoticeDataGeo(); removeNoticeDataGeo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment