Created
July 29, 2015 13:18
-
-
Save arslanbekov/f1064ec7352939484bda to your computer and use it in GitHub Desktop.
maps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = (function() { | |
var me = {}; | |
me.list = { | |
'ku': [ | |
{'egd':['bars','Кто-то еще']}, | |
{'cont':'bars'}, | |
{'oo':['irtech']}, | |
{'spo':'Аверс'}, | |
], | |
'da': [ | |
{'egd':['dnevnik','irtech','Еще кто-то']}, | |
{'cont':'dnevnik'}, | |
{'oo':'РиК'}, | |
{'odo':'irtech'}, | |
], | |
'kr': [ | |
{'egd':['bars']}, | |
{'cont':'dnevnik'}, | |
{'oo':'bars'}, | |
{'odo':'bars'}, | |
{'doo':'dnevnik'}, | |
], | |
}; | |
me.init = function (){ | |
}; | |
me.getProductsByRegion = function(region) { | |
if (typeof me.list[region] !== "undefined") | |
{ | |
list = []; | |
for (k in me.list[region]) { | |
list.push(k); | |
} | |
return list; | |
} | |
}; | |
me.getRegionsByProduct = function(product) { | |
result = []; | |
for (reg in me.list) { | |
for (i in me.list[reg]) { | |
if (typeof me.list[reg][i][product] !== "undefined") | |
{ | |
result.push(reg); | |
break; | |
} | |
} | |
} | |
return result; | |
} | |
return me; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment