From 241f0bc06466d18482607fc7b1fe10a69743cb2b Mon Sep 17 00:00:00 2001 From: rolux Date: Sun, 1 Apr 2012 23:08:35 +0200 Subject: [PATCH] in Geo module, actually use image symlinks; add Ox.getFlagByCountryCode method --- source/Ox.Geo/Ox.Geo.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/Ox.Geo/Ox.Geo.js b/source/Ox.Geo/Ox.Geo.js index e1930d8a..b6a153f5 100644 --- a/source/Ox.Geo/Ox.Geo.js +++ b/source/Ox.Geo/Ox.Geo.js @@ -125,7 +125,6 @@ Ox.load.Geo = function(options, callback) { > Ox.getCountryByCode('US').name 'United States' @*/ - Ox.getCountryByCode = function(code) { var country; code = code.toUpperCase(); @@ -147,7 +146,6 @@ Ox.load.Geo = function(options, callback) { > Ox.getCountryByGeoname('The Bottom, Saba, Bonaire, Sint Eustatius and Saba').code 'BQ' @*/ - Ox.getCountryByGeoname = function(geoname) { // fixme: UAE correction doesn't belong here, fix in map geoname = (geoname || '').replace(' - United Arab Emirates', ', United Arab Emirates') @@ -167,7 +165,6 @@ Ox.load.Geo = function(options, callback) { > Ox.getCountryByName('USA').code 'US' @*/ - Ox.getCountryByName = function(name) { var country; Ox.forEach(Ox.COUNTRIES, function(c) { @@ -179,6 +176,10 @@ Ox.load.Geo = function(options, callback) { return country; }; + Ox.getFlagByCountryCode = function(code, size) { + return Ox.PATH + 'Ox.Geo/png/flags/' + size + '/' + code + '.png'; + }; + /*@ Ox.getImageByGeoname Returns an image URL for a given geoname (type, size, geoname) -> Image URL @@ -186,10 +187,9 @@ Ox.load.Geo = function(options, callback) { size Image width (32, 256, 2048 (flag), 16, 256, 1024 (icon)) geoname Geoname @*/ - Ox.getFlagByGeoname = function(geoname, size) { var country = Ox.getCountryByGeoname(geoname), - code = country ? country.flag || country.code : 'NTHH'; + code = country ? country.code : 'NTHH'; return Ox.PATH + 'Ox.Geo/png/flags/' + size + '/' + code + '.png'; }; @@ -200,7 +200,6 @@ Ox.load.Geo = function(options, callback) { size Image width (32, 256, 2048 (flag), 16, 256, 1024 (icon)) language Language @*/ - Ox.getFlagByLanguage = function(language, size) { language = language .replace(' languages', '')