2011-04-27 19:24:33 +00:00
|
|
|
Ox.load.Geo = function(options, callback) {
|
|
|
|
|
2011-05-07 15:56:29 +00:00
|
|
|
Ox.getJSON(Ox.PATH + 'Ox.Geo/json/Ox.Geo.json', function(data) {
|
2011-04-27 19:24:33 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|