1
0
Fork 0
forked from 0x2620/oxjs

better sorting of geonames

This commit is contained in:
rolux 2011-05-24 14:50:16 +02:00
commit 32b2da184a
4 changed files with 49 additions and 19 deletions

View file

@ -155,6 +155,18 @@ Ox.load.Geo = function(options, callback) {
return country;
};
/*@
Ox.reverseGeoname <f> Reverses a geoname
@*/
Ox.reverseGeoname = function(geoname) {
return geoname
.replace('Bonaire, Saint Eustatius and Saba', 'Bonaire Saint Eustatius and Saba')
.split(', ')
.reverse()
.join(', ')
.replace('Bonaire Saint Eustatius and Saba', 'Bonaire, Saint Eustatius and Saba');
};
callback(true);
});