mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
Removed geonames lookup. Close #360
This commit is contained in:
parent
5c28679b2c
commit
7f13c4e519
@ -1564,64 +1564,6 @@ OC.Contacts = OC.Contacts || {};
|
||||
$('body').bind('click', bodyListener);
|
||||
});
|
||||
});
|
||||
$elem.find('.value.city')
|
||||
.autocomplete({
|
||||
source: function( request, response ) {
|
||||
$.ajax({
|
||||
url: 'http://ws.geonames.org/searchJSON',
|
||||
dataType: 'jsonp',
|
||||
data: {
|
||||
featureClass: 'P',
|
||||
style: 'full',
|
||||
maxRows: 12,
|
||||
lang: $elem.data('lang'),
|
||||
name_startsWith: request.term
|
||||
},
|
||||
success: function( data ) {
|
||||
response( $.map( data.geonames, function( item ) {
|
||||
return {
|
||||
label: item.name + (item.adminName1 ? ', ' + item.adminName1 : '') + ', ' + item.countryName,
|
||||
value: item.name,
|
||||
country: item.countryName
|
||||
};
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
minLength: 2,
|
||||
select: function( event, ui ) {
|
||||
if(ui.item && $.trim($elem.find('.value.country').val()).length === 0) {
|
||||
$elem.find('.value.country').val(ui.item.country);
|
||||
}
|
||||
}
|
||||
});
|
||||
$elem.find('.value.country')
|
||||
.autocomplete({
|
||||
source: function(request, response) {
|
||||
$.ajax({
|
||||
url: 'http://ws.geonames.org/searchJSON',
|
||||
dataType: 'jsonp',
|
||||
data: {
|
||||
/*featureClass: "A",*/
|
||||
featureCode: 'PCLI',
|
||||
/*countryBias: "true",*/
|
||||
/*style: "full",*/
|
||||
lang: lang,
|
||||
maxRows: 12,
|
||||
name_startsWith: request.term
|
||||
},
|
||||
success: function( data ) {
|
||||
response( $.map( data.geonames, function( item ) {
|
||||
return {
|
||||
label: item.name,
|
||||
value: item.name
|
||||
};
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
minLength: 2
|
||||
});
|
||||
return $elem;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user