33 lines
780 B
JavaScript
33 lines
780 B
JavaScript
|
Ox.load.Geo = function(options, callback) {
|
||
|
|
||
|
Ox.loadJSON(Ox.PATH + 'Ox.Geo/Ox.Geo.json', function(data) {
|
||
|
|
||
|
Ox.COUNTRIES = data;
|
||
|
|
||
|
Ox.getCountryByCode = function(code) {
|
||
|
var country;
|
||
|
Ox.forEach(Ox.COUNTRIES, function(c) {
|
||
|
if (c.code == code) {
|
||
|
country = c;
|
||
|
return false;
|
||
|
}
|
||
|
});
|
||
|
return country;
|
||
|
};
|
||
|
|
||
|
Ox.getCountryByName = function(name) {
|
||
|
var country;
|
||
|
Ox.forEach(Ox.COUNTRIES, function(c) {
|
||
|
if (c.name == name) {
|
||
|
country = c;
|
||
|
return false;
|
||
|
}
|
||
|
});
|
||
|
return country;
|
||
|
};
|
||
|
|
||
|
callback(true);
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|