Detect with regex if emoji is country flag - javascript

I've been trying to make a regex that that can detect if an emoji is a country flag or not. I want the regex to match all country flags (from πŸ‡¦πŸ‡¨ Ascension Island, to πŸ‡ΏπŸ‡Ό Zimbabwe).
My approach was putting all the country flags one by one in the regex. I was hoping that someone could show me a better way of doing it.

A country flag emoji corresponds to a pair of native symbols (two letters) that identify the country (eg. FR for France - see list).
What you can do is use a regex that match any combination of these letters. Of course, this will include non-existent country codes (eg. ZZ), but this should exclude any other emoji.
So here it is:
var reg = /[\uD83C][\uDDE6-\uDDFF][\uD83C][\uDDE6-\uDDFF]/;
reg.test("πŸ˜€"); // false
reg.test("πŸ‡¦πŸ‡¨"); // true

Since the flags are essentially created from two Unicode characters, a possible option would be str.match(/[πŸ‡¦-πŸ‡Ώ]{2}/u), assuming that str contains the string. The two values in the range expression are U+1F1E6 (Regional Indicator Symbol Letter A) and U+1F1FF (Regional Indicator Symbol Letter Z), both available since Unicode 6.0.
The major drawback of this solution is the fact it matches all possible combinations of those indicator symbols and thus does not guarantee the indicator to represent a valid contry, eg. πŸ‡¦πŸ‡¦ would be matched as well as πŸ‡¦πŸ‡¨.

To keep the regex precise you can only build regex ranges.
var country_emoji_ranges = ['\\u{1F1E6}[\\u{1F1E9}-\\u{1F1EC}\\u{1F1EE}\\u{1F1F1}\\u{1F1F2}\\u{1F1F4}\\u{1F1F6}-\\u{1F1FA}\\u{1F1FC}\\u{1F1FD}\\u{1F1FF}]',
'\\u{1F1E7}[\\u{1F1E6}\\u{1F1E7}\\u{1F1E9}-\\u{1F1EF}\\u{1F1F1}-\\u{1F1F4}\\u{1F1F6}-\\u{1F1F9}\\u{1F1FB}\\u{1F1FC}\\u{1F1FE}\\u{1F1FF}]',
'\\u{1F1E8}[\\u{1F1E6}\\u{1F1E8}\\u{1F1E9}\\u{1F1EB}-\\u{1F1EE}\\u{1F1F0}-\\u{1F1F4}\\u{1F1F7}\\u{1F1FA}-\\u{1F1FF}]',
'\\u{1F1E9}[\\u{1F1EA}\\u{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1FB}\u{1F1E6}, \u{1F1FB}\u{1F1E8}, \u{1F1FB}\u{1F1EA}, \u{1F1FB}\u{1F1EC}, \u{1F1FB}\u{1F1EE}, \u{1F1FB}\u{1F1F3}, \u{1F1FB}\u{1F1FA}, \u{1F1FC}\u{1F1EB}, \u{1F1FC}\u{1F1F8}, \u{1F1FE}\u{1F1EA}, \u{1F1FE}\u{1F1F9}, \u{1F1FF}\u{1F1E6}, \u{1F1FF}\u{1F1F2}, \u{1F1FF}\u{1F1FC}";
console.log(text.match(country_emoji_rx).length);
In case you want to match those in JS environments that do not support u flag you may use a transpiled version:
/(?:\uD83C\uDDE6)(?:\uD83C[\uDDE9-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|(?:\uD83C\uDDE7)(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|(?:\uD83C\uDDE8)(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF4\uDDF7\uDDFA-\uDDFF])|(?:\uD83C\uDDE9)(?:\uD83C[\uDDEA\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|(?:\uD83C\uDDEA)(?:\uD83C[\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDF9])|(?:\uD83C\uDDEB)(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|(?:\uD83C\uDDEC)(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|(?:\uD83C\uDDED)(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|(?:\uD83C\uDDEE)(?:\uD83C[\uDDE9-\uDDF4\uDDF6-\uDDF9])|(?:\uD83C\uDDEF)(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C\uDDF0)(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|(?:\uD83C\uDDF1)(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF8-\uDDFB\uDDFE])|(?:\uD83C\uDDF2)(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|(?:\uD83C\uDDF3)(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|(?:\uD83C\uDDF4)(?:\uD83C\uDDF2)|(?:\uD83C\uDDF5)(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|(?:\uD83C\uDDF6)(?:\uD83C\uDDE6)|(?:\uD83C\uDDF7)(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|(?:\uD83C\uDDF8)(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|(?:\uD83C\uDDF9)(?:\uD83C[\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|(?:\uD83C\uDDFA)(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF8\uDDFE\uDDFF])|(?:\uD83C\uDDFB)(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|(?:\uD83C\uDDFC)(?:\uD83C[\uDDEB\uDDF8])|(?:\uD83C\uDDFE)(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C\uDDFF)(?:\uD83C[\uDDE6\uDDF2\uDDFC])/g

Related

Javascript: Array does not work when it is a little long

I want to replace Chinese characters to unicode and the unicode to pinyin (pronunciations of those characters) so that I can make Hansi (Persianized pronunciations). I do this using arrays. I don't have any problem with this:
// here i got the chinese character and replaced it with unicode
var chini = document.getElementById("ch1").value.charCodeAt(0);
var chiniuni= chini.toString(16);
var mapUni1 = {
"3007":"ling2", "4e00":"yi1", "4e01":"ding1", "4e02":"kao3", "4e03":"qi1", "4e04":"shang4---shang3", "4e05":"xia4", "4e06":"---", "4e07":"wan4---mo4", "4e08":"zhang4", "4e09":"san1", "4e0a":"shang4---shang3", "4e0b":"xia4", "4e0c":"ji1", "4e0d":"bu4", "4e0e":"yu3---yu4", "4e0f":"mian3", "4e10":"gai4","4e11":"chou3", "4e12":"chou3", "4e13":"zhuan1", "4e14":"qie3---ju1", "4e15":"pi1", "4e16":"shi4", "4e17":"shi4", "4e18":"qiu1", "4e19":"bing3", "4e1a":"ye4", "4e1b":"cong2", "4e1c":"dong1",
};
var roo = new RegExp(Object.keys(mapUni1).join("|"),"gi");
pinyin = chiniuni.toLowerCase().replace(roo, function(matched){
return mapUni1[matched];
});
document.getElementById("bbb").innerHTML = pinyin
check it here: https://jsfiddle.net/6j7k5dqw/
But since there are a lot of Chinese characters (21000 in my work), the array must be a little long, and I read that it can be much much longer. But in my case, when I put a little more in the array, the code does not work at all:
var chini = document.getElementById("ch1").value.charCodeAt(0);
var chiniuni= chini.toString(16);
var mapUni1 = {
"3007":"ling2", "4e00":"yi1", "4e01":"ding1", "4e02":"kao3", "4e03":"qi1", "4e04":"shang4---shang3", "4e05":"xia4", "4e06":"---", "4e07":"wan4---mo4", "4e08":"zhang4", "4e09":"san1", "4e0a":"shang4---shang3", "4e0b":"xia4", "4e0c":"ji1", "4e0d":"bu4", "4e0e":"yu3---yu4", "4e0f":"mian3", "4e10":"gai4","4e11":"chou3", "4e12":"chou3", "4e13":"zhuan1", "4e14":"qie3---ju1", "4e15":"pi1", "4e16":"shi4", "4e17":"shi4", "4e18":"qiu1", "4e19":"bing3", "4e1a":"ye4", "4e1b":"cong2", "4e1c":"dong1", "4e1d":"si1", "4e1e":"cheng2", "4e1f":"diu1", "4e20":"qiu1", "4e21":"liang3", "4e22":"diu1", "4e23":"you3", "4e24":"liang3", "4e25":"yan2", "4e26":"bing4", "4e27":"sang1---sang4", "4e28":"shu4", "4e29":"jiu1", "4e2a":"ge4", "4e2b":"ya1", "4e2c":"qiang2---pan2", "4e2d":"zhong1---zhong4", "4e2e":"ji3", "4e2f":"jie4", "4e30":"feng1", "4e31":"guan4", "4e32":"chuan4", "4e33":"chan3", "4e34":"lin2", "4e35":"zhuo1", "4e36":"zhu3", "4e37":"---", "4e38":"wan2",
"4e39":"dan1", "4e3a":"wei4---wei2", "4e3b":"zhu3", "4e3c":"jing3---dan3", "4e3d":"li4---li2", "4e3e":"ju3", "4e3f":"pie3", "4e40":"fu2", "4e41":"yi2", "4e42":"yi4---ai4", "4e43":"nai3", "4e44":"---", "4e45":"jiu3", "4e46":"jiu3", "4e47":"tuo1", "4e48":"yao1---mo2", "4e49":"yi4", "4e4a":"---", "4e4b":"zhi1", "4e4c":"wu1---wu4", "4e4d":"zha4", "4e4e":"hu1", "4e4f":"fa2", "4e50":"le4---yue4", "4e51":"zhong4", "4e52":"ping1", "4e53":"pang1", "4e54":"qiao2", "4e55":"hu3---hu4", "4e56":"guai1", "4e57":"cheng2---sheng4", "4e58":"cheng2---sheng4", "4e59":"yi3", "4e5a":"yin3", "4e5b":"---", "4e5c":"mie1---nie4", "4e5d":"jiu3", "4e5e":"qi3", "4e5f":"ye3", "4e60":"xi2", "4e61":"xiang1", "4e62":"gai4", "4e63":"diu1", "4e64":"---", "4e65":"---", "4e66":"shu1", "4e67":"---", "4e68":"shi3", "4e69":"ji1", "4e6a":"nang1", "4e6b":"jia1", "4e6c":"---", "4e6d":"shi2", "4e6e":"---", "4e6f":"---", "4e70":"mai3", "4e71":"luan4", "4e72":"---", "4e73":"ru3", "4e74":"xi3", "4e75":"yan3", "4e76":"fu3", "4e77":"sha1", "4e78":"na3", "4e79":"gan1---qian2", "4e7a":"---", "4e7b":"---", "4e7c":"---", "4e7d":"---", "4e7e":"gan1---qian2", "4e7f":"zhi4", "4e80":"gui1---jun1---qiu1", "4e81":"gan1", "4e82":"luan4", "4e83":"lin3", "4e84":"yi4", "4e85":"jue2", "4e86":"liao3---le5", "4e87":"---", "4e88":"yu2---yu3", "4e89":"zheng1", "4e8a":"shi4", "4e8b":"shi4", "4e8c":"er4", "4e8d":"chu4", "4e8e":"yu2", "4e8f":"kui1", "4e90":"yu2", "4e91":"yun2", "4e92":"hu4", "4e93":"qi2", "4e94":"wu3", "4e95":"jing3", "4e96":"si4",
"4e97":"sui4", "4e98":"gen4", "4e99":"gen4---geng4", "4e9a":"ya4", "4e9b":"xie1", "4e9c":"ya4", "4e9d":"qi2", "4e9e":"ya4---ya3", "4e9f":"ji2---qi4", "4ea0":"tou2", "4ea1":"wang2---wu2", "4ea2":"kang4", "4ea3":"ta4", "4ea4":"jiao1", "4ea5":"hai4", "4ea6":"yi4", "4ea7":"chan3", "4ea8":"heng1", "4ea9":"mu3", "4eaa":"---", "4eab":"xiang3", "4eac":"jing1", "4ead":"ting2", "4eae":"liang4", "4eaf":"heng1", "4eb0":"jing1", "4eb1":"ye4", "4eb2":"qin1---qing4", "4eb3":"bo4", "4eb4":"you4", "4eb5":"xie4", "4eb6":"dan3", "4eb7":"lian2", "4eb8":"duo3", "4eb9":"wei3---wei4", "4eba":"ren2", "4ebb":"ren2", "4ebc":"ji2", "4ebd":"---", "4ebe":"wang2", "4ebf":"yi4", "4ec0":"shi2---shen2", "4ec1":"ren2", "4ec2":"le4", "4ec3":"ding1", "4ec4":"ze4", "4ec5":"jin3---jin4", "4ec6":"pu1---pu2", "4ec7":"chou2---qiu2", "4ec8":"ba1", "4ec9":"zhang3", "4eca":"jin1", "4ecb":"jie4", "4ecc":"bing1", "4ecd":"reng2", "4ece":"cong2", "4ecf":"fo2---fu2", "4ed0":"san3", "4ed1":"lun2", "4ed2":"---", "4ed3":"cang1", "4ed4":"zi3", "4ed5":"shi4", "4ed6":"ta1", "4ed7":"zhang4", "4ed8":"fu4", "4ed9":"xian1", "4eda":"xian1", "4edb":"cha4", "4edc":"hong2", "4edd":"tong2", "4ede":"ren4", "4edf":"qian1", "4ee0":"gan3", "4ee1":"yi4---ge1", "4ee2":"di2", "4ee3":"dai4", "4ee4":"ling4---ling2---ling3", "4ee5":"yi3", "4ee6":"chao4", "4ee7":"chang2", "4ee8":"sa1", "4ee9":"shang4", "4eea":"yi2", "4eeb":"mu4",
"4eec":"men5---men2", "4eed":"ren4", "4eee":"jia3---jia4", "4eef":"chao4", "4ef0":"yang3", "4ef1":"qian2", "4ef2":"zhong4", "4ef3":"pi3", "4ef4":"wan4", "4ef5":"wu3", "4ef6":"jian4", "4ef7":"jia4", "4ef8":"yao3", "4ef9":"feng1", "4efa":"cang1", "4efb":"ren4---ren2", "4efc":"wang2", "4efd":"fen4", "4efe":"di1", "4eff":"fang3", "4f00":"zhong1", "4f01":"qi3---qi4", "4f02":"pei4", "4f03":"yu2", "4f04":"diao4", "4f05":"dun4", "4f06":"wen4", "4f07":"yi4", "4f08":"xin3", "4f09":"kang4", "4f0a":"yi1", "4f0b":"ji2", "4f0c":"ai4", "4f0d":"wu3", "4f0e":"ji4", "4f0f":"fu2", "4f10":"fa2---fa1", "4f11":"xiu1", "4f12":"jin4", "4f13":"bei1", "4f14":"chen2", "4f15":"fu1", "4f16":"tang3", "4f17":"zhong4", "4f18":"you1", "4f19":"huo3", "4f1a":"hui4---kuai4", "4f1b":"yu3", "4f1c":"cui4---zu2", "4f1d":"yun2", "4f1e":"san3", "4f1f":"wei3", "4f20":"zhuan4", "4f21":"che1", "4f22":"ya2", "4f23":"xian4", "4f24":"shang1", "4f25":"chang1", "4f26":"lun2", "4f27":"cang1---chen5", "4f28":"xun4", "4f29":"xin4", "4f2a":"wei3", "4f2b":"zhu4", "4f2c":"chi3", "4f2d":"xuan2", "4f2e":"nao2---nu3", "4f2f":"bo2---bai3", "4f30":"gu1---gu4", "4f31":"ni3", "4f32":"ni4", "4f33":"xie4", "4f34":"ban4", "4f35":"xu4", "4f36":"ling2", "4f37":"zhou4", "4f38":"shen1", "4f39":"qu1", "4f3a":"si4---ci4", "4f3b":"beng1", "4f3c":"si4---shi4", "4f3d":"jia1---qie2", "4f3e":"pi1", "4f3f":"yi4", "4f40":"si4---shi4", "4f41":"ai3", "4f42":"zheng1---zheng4", "4f43":"dian4---tian2", "4f44":"han2", "4f45":"mai4", "4f46":"dan4", "4f47":"zhu4", "4f48":"bu4", "4f49":"qu1", "4f4a":"bi3", "4f4b":"shao4", "4f4c":"ci3", "4f4d":"wei4", "4f4e":"di1", "4f4f":"zhu4", "4f50":"zuo3",
"4f51":"you4", "4f52":"yang1", "4f53":"ti3", "4f54":"zhan4", "4f55":"he2---he4", "4f56":"bi4", "4f57":"tuo2", "4f58":"she2", "4f59":"yu2---tu2", "4f5a":"yi4---die2", "4f5b":"fo2---fu2", "4f5c":"zuo1", "4f5d":"kou4", "4f5e":"ning4", "4f5f":"tong2", "4f60":"ni3", "4f61":"xuan1---san3", "4f62":"ju4", "4f63":"yong4---yong1", "4f64":"wa3", "4f65":"qian1", "4f66":"---", "4f67":"ka3", "4f68":"---", "4f69":"pei4", "4f6a":"huai2", "4f6b":"he4", "4f6c":"lao3", "4f6d":"xiang2", "4f6e":"ge2", "4f6f":"yang2", "4f70":"bai3", "4f71":"fa3", "4f72":"ming2", "4f73":"jia1", "4f74":"er4---nai4", "4f75":"bing4", "4f76":"ji2", "4f77":"heng2", "4f78":"huo2", "4f79":"gui3", "4f7a":"quan2", "4f7b":"tiao1---tiao2", "4f7c":"jiao3---jia3", "4f7d":"ci4", "4f7e":"yi4", "4f7f":"shi3", "4f80":"xing2", "4f81":"shen1", "4f82":"tuo1", "4f83":"kan3", "4f84":"zhi2", "4f85":"gai1---kai1", "4f86":"lai2", "4f87":"yi2", "4f88":"chi3", "4f89":"kua1---kua3", "4f8a":"guang1", "4f8b":"li4", "4f8c":"yin1", "4f8d":"shi4", "4f8e":"mi3", "4f8f":"zhu1", "4f90":"xu4", "4f91":"you4", "4f92":"an1", "4f93":"lu4", "4f94":"mou2", "4f95":"er2", "4f96":"lun2", "4f97":"dong4", "4f98":"cha4", "4f99":"chi4", "4f9a":"xun4", "4f9b":"gong1---gong4", "4f9c":"zhou1", "4f9d":"yi1", "4f9e":"ru3", "4f9f":"jian4", "4fa0":"xia2", "4fa1":"jia4---jie4", "4fa2":"zai4", "4fa3":"lu":"3", "4fa4":"---", "4fa5":"jiao3---yao2", "4fa6":"zhen1", "4fa7":"ce4", "4fa8":"qiao2", "4fa9":"kuai4", "4faa":"chai2", "4fab":"ning4", "4fac":"nong2", "4fad":"jin3---jin4", "4fae":"wu3", "4faf":"hou2---hou4", "4fb0":"jiong3", "4fb1":"cheng3", "4fb2":"zhen4", "4fb3":"cuo4", "4fb4":"chou3", "4fb5":"qin1", "4fb6":"lu":"3", "4fb7":"ju2", "4fb8":"shu4", "4fb9":"ting3", "4fba":"shen4", "4fbb":"tuo1", "4fbc":"bo2", "4fbd":"nan2", "4fbe":"hao1", "4fbf":"bian4---pian2", "4fc0":"tui3", "4fc1":"yu3", "4fc2":"xi4", "4fc3":"cu4", "4fc4":"e2---e4", "4fc5":"qiu2", "4fc6":"xu2", "4fc7":"kuang3", "4fc8":"ku4", "4fc9":"wu2", "4fca":"jun4", "4fcb":"yi4", "4fcc":"fu3", "4fcd":"lang2", "4fce":"zu3", "4fcf":"qiao4", "4fd0":"li4", "4fd1":"yong3", "4fd2":"hun4", "4fd3":"jing4", "4fd4":"xian4", "4fd5":"san4", "4fd6":"pai3", "4fd7":"su2", "4fd8":"fu2", "4fd9":"xi1", "4fda":"li3", "4fdb":"mian3", "4fdc":"ping1---ping2", "4fdd":"bao3", "4fde":"yu2", "4fdf":"si4---qi2", "4fe0":"xia2", "4fe1":"xin4---shen1", "4fe2":"xiu1", "4fe3":"yu3", "4fe4":"ti4", "4fe5":"che1", "4fe6":"chou2", "4fe7":"---", "4fe8":"yan3", "4fe9":"lia3---liang3", "4fea":"li4", "4feb":"lai2", "4fec":"si1", "4fed":"jian3",
"4fee":"xiu1", "4fef":"fu3", "4ff0":"he2", "4ff1":"ju4---ju1", "4ff2":"xiao4", "4ff3":"pai2", "4ff4":"jian4", "4ff5":"biao3", "4ff6":"chu4", "4ff7":"fei4", "4ff8":"feng4", "4ff9":"ya4", "4ffa":"an3", "4ffb":"bei4", "4ffc":"yu4---zhou1", "4ffd":"xin1", "4ffe":"bi3", "4fff":"chi2", "5000":"chang1", "5001":"zhi1", "5002":"bing4", "5003":"zan2", "5004":"yao2", "5005":"cui4", "5006":"lia3---liang3", "5007":"wan3", "5008":"lai2", "5009":"cang1", "500a":"zong3", "500b":"ge4", "500c":"guan1", "500d":"bei4", "500e":"tian1", "500f":"shu1", "5010":"shu1", "5011":"men5---men2", "5012":"dao3---dao4", "5013":"tan2", "5014":"jue2---jue4", "5015":"chui2", "5016":"xing4", "5017":"peng2", "5018":"tang3---chang2", "5019":"hou4", "501a":"yi3", "501b":"qi1", "501c":"ti4", "501d":"gan4", "501e":"jing4---liang4", "501f":"jie4", "5020":"xu1", "5021":"chang4---chang1", "5022":"jie2", "5023":"fang3", "5024":"zhi2", "5025":"kong1---kong3", "5026":"juan4", "5027":"zong1", "5028":"ju4", "5029":"qian4", "502a":"ni2", "502b":"lun2", "502c":"zhuo1---zhuo2", "502d":"wo1", "502e":"luo3", "502f":"song1", "5030":"leng2", "5031":"hun4", "5032":"dong1", "5033":"zi4", "5034":"ben4", "5035":"wu3", "5036":"ju4---ju1", "5037":"nai4", "5038":"cai3", "5039":"jian3", "503a":"zhai4", "503b":"ye1", "503c":"zhi2", "503d":"sha4", "503e":"qing1", "503f":"---", "5040":"ying1", "5041":"cheng1---cheng4", "5042":"qian2", "5043":"yan3", "5044":"nuan4", "5045":"zhong4", "5046":"chun3", "5047":"jia3---jia4", "5048":"jie2---ji4", "5049":"wei3", "504a":"yu3", "504b":"bing4", "504c":"ruo4", "504d":"ti2", "504e":"wei1", "504f":"pian1", "5050":"yan4", "5051":"feng1", "5052":"tang3", "5053":"wo4", "5054":"e4", "5055":"xie2", "5056":"che3", "5057":"sheng3", "5058":"kan3", "5059":"di4", "505a":"zuo4", "505b":"cha1", "505c":"ting2", "505d":"bei1", "505e":"ye4", "505f":"huang2", "5060":"yao3", "5061":"zhan4", "5062":"qiu1", "5063":"yan1",
"5064":"you2", "5065":"jian4", "5066":"xu3", "5067":"zha1", "5068":"chai1", "5069":"fu4", "506a":"bi1", "506b":"zhi4", "506c":"zong3", "506d":"mian3", "506e":"ji2", "506f":"yi3", "5070":"xie4", "5071":"xun2", "5072":"si1", "5073":"duan1", "5074":"ce4", "5075":"zhen1", "5076":"ou3", "5077":"tou1", "5078":"tou1", "5079":"bei4", "507a":"za2---zan2", "507b":"lu":"3---lou2", "507c":"jie2", "507d":"wei4", "507e":"fen4", "507f":"chang2", "5080":"gui1---kui3", "5081":"sou3", "5082":"chi3", "5083":"su4", "5084":"xia1", "5085":"fu4", "5086":"yuan4", "5087":"rong3", "5088":"li4", "5089":"ru4", "508a":"yun3", "508b":"gou4", "508c":"ma4", "508d":"bang4---bang1", "508e":"dian1", "508f":"tang2", "5090":"hao1", "5091":"jie2", "5092":"xi1", "5093":"shan1", "5094":"qian4", "5095":"jue2", "5096":"cang1---chen5", "5097":"chu4", "5098":"san3", "5099":"bei4", "509a":"xiao4", "509b":"yong2", "509c":"yao2", "509d":"ta4", "509e":"suo1", "509f":"wang1", "50a0":"fa2", "50a1":"bing4---bing1", "50a2":"jia1", "50a3":"tai4", "50a4":"zai4", "50a5":"tang3", "50a6":"---", "50a7":"bin1", "50a8":"chu3", "50a9":"nuo2", "50aa":"zan1", "50ab":"lei3", "50ac":"cui1", "50ad":"yong1---yong4", "50ae":"zao1", "50af":"zong3", "50b0":"peng2", "50b1":"song3", "50b2":"ao4", "50b3":"chuan2---zhuan4", "50b4":"yu3", "50b5":"zhai4", "50b6":"zu2", "50b7":"shang1", "50b8":"qiang3", "50b9":"qiang1", "50ba":"chi4", "50bb":"sha3", "50bc":"han4", "50bd":"zhang1", "50be":"qing1", "50bf":"yan4", "50c0":"di4", "50c1":"xi1", "50c2":"lu":"3---lou2", "50c3":"bei4", "50c4":"piao1", "50c5":"jin3---jin4", "50c6":"lian3", "50c7":"lu4", "50c8":"man4", "50c9":"qian1", "50ca":"xian1", "50cb":"qiu2", "50cc":"ying2", "50cd":"dong4", "50ce":"zhuan4", "50cf":"xiang4", "50d0":"shan3", "50d1":"qiao2", "50d2":"jiong3", "50d3":"tui2", "50d4":"zun3", "50d5":"pu2---pu1", "50d6":"xi1", "50d7":"lao4", "50d8":"chang3", "50d9":"guang1", "50da":"liao2", "50db":"qi1", "50dc":"deng4", "50dd":"chan2", "50de":"wei3", "50df":"zhang3", "50e0":"fan1", "50e1":"hui4", "50e2":"chuan3", "50e3":"tie3", "50e4":"dan4", "50e5":"jiao3---yao2", "50e6":"jiu4", "50e7":"seng1", "50e8":"fen4", "50e9":"xian4", "50ea":"jue2", "50eb":"e4", "50ec":"jiao1", "50ed":"jian4", "50ee":"tong2", "50ef":"lin2", "50f0":"bo2---fu2", "50f1":"gu4", "50f2":"xian1", "50f3":"su4", "50f4":"xian4", "50f5":"jiang1", "50f6":"min3", "50f7":"ye4", "50f8":"jin4", "50f9":"jia4", "50fa":"qiao4", "50fb":"pi4", "50fc":"feng1", "50fd":"zhou4", "50fe":"ai4", "50ff":"sai4", "5100":"yi2", "5101":"jun4---juan4", "5102":"nong2", "5103":"shan4", "5104":"yi4", "5105":"dang1", "5106":"jing3", "5107":"xuan1", "5108":"kuai4", "5109":"jian3", "510a":"chu4", "510b":"dan1", "510c":"jiao3", "510d":"sha3", "510e":"zai4---zai3", "510f":"---", "5110":"bin4---bin1", "5111":"an4", "5112":"ru2", "5113":"tai2", "5114":"chou2", "5115":"chai2", "5116":"lan2", "5117":"ni3", "5118":"jin3", "5119":"qian1", "511a":"meng2", "511b":"wu3", "511c":"neng2", "511d":"qiong2", "511e":"ni3",
};
var roo = new RegExp(Object.keys(mapUni1).join("|"),"gi");
pinyin = chiniuni.toLowerCase().replace(roo, function(matched){
return mapUni1[matched];
});
document.getElementById("bbb").innerHTML = pinyin
See it here: https://jsfiddle.net/drm65da5/
P.S: I know about difficulties of arrays but I have my own reasons to do this only in this way, so please do not suggest to use different methods. Thanks.
The long object has an extra colon at:
"507b":"lu":"3---lou2",
^
And probably more. I can't provide a solution because it's up to you which of the strings above is the key and its value. Generally, always look at the console, first. It's the initial place for debugging.

How to handle a large number of replaces?

I would like to know if there is a better way to handle a large number of jquery/javascript replaces. This is what my code currently looks like and I will be adding more words/phrases to it. I am wondering if I should be doing some sort of loop with the words in an array or an object? Or should the words maybe even be kept in a different file?
input = input.replace(/\band\b/g, "&")
//COMMON ABREVIATIONS
.replace(/\bwith\b/g, "w/")
.replace(/\bwithout\b/g, "w/o")
.replace(/\bpeople\b/g, "ppl")
.replace(/\bbecause\b/g, "b/c")
.replace(/\bestablished\b/g, "est.")
.replace(/\bstreet\b/gi, "St.")
.replace(/\bavenue\b/gi, "Ave.")
.replace(/\bparkway\b/gi, "Pkwy.")
.replace(/\blane\b/gi, "Ln.")
.replace(/\bboulevard\b/gi, "Blvd.")
.replace(/\bassociates\b/gi, "Assoc.")
.replace(/\bretweet\b/gi, "RT")
.replace(/\bapartment\b/gi, "Apt.")
.replace(/\bdirect message\b/gi, "DM")
.replace(/\bphoto credit\b/, "PC")
.replace(/\bphoto cred\b/, "PC");
I've found something, but unfortunately it doesn't catch phrases with two words. It's something wrong with the RegEx, I bet.
var input = {
'band': "&",
'with': "w/",
'without': "w/o",
'people': "ppl",
'because': "b/c",
'established': "est.",
'street': "St.",
'avenue': "Ave.",
'parkway': "Pkwy.",
'lane': "Ln.",
'boulevard': "Blvd.",
'associates': "Assoc.",
'retweet': "RT",
'apartment': "Apt.",
'direct message': "DM",
'photo credit': "PC",
'photo cred': "PC"
};
console.log('band with'.replace(/\w+/gi, match => input[match]));

how can convert string to hash using jquery

list = "{"mins_spent_in_stor":"{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":273,"PM 01:00":0,"PM 02:00":30,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}","store_hr_opt":"{"00:0C:66:20:0E:3A":{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":5,"PM 01:00":0,"PM 02:00":0,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}}"}"
I need to convert this string into hash, but when am using this command JSON.parse(list), i'm getting this error
SyntaxError: Unexpected token A,
Please anyone help me..
I got it to work with a couple of replaces:
var list = '{"mins_spent_in_stor":"{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":273,"PM 01:00":0,"PM 02:00":30,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}","store_hr_opt":"{"00:0C:66:20:0E:3A":{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":5,"PM 01:00":0,"PM 02:00":0,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}}"}'.replace(/\"\{/g,"{").replace(/}\"/g,"}");
But that is by no means an elegant or good solution and is only likely to work on this particular input and will break if you get any other garbled JSON string.
So you should really fix the source of the data.
http://jsonlint.com/ is a nice tool to quickly check if a JSON is valid.

What Kind of compressing is that

This is the code of the compressed file!
It's clearly obfuscated and it's hard to dechiffer
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 G(b,a){b.N().V(G,n.o.2Z);4.I=b;4.2E=b.N().2y();4.M=a;4.C=t;4.q=t;4.16=t;4.1o=w;4.K(b.v())}G.6.2F=5(){7 d=4;7 g;7 f;4.q=3A.3u("1Y");4.q.5p=4.2E;9(4.1o){4.2a()}4.4O().4H.4B(4.q);4.2X=n.o.u.1G(4.v(),"4b",5(){f=g});n.o.u.1E(4.q,"42",5(){g=H;f=w});n.o.u.1E(4.q,"2M",5(e){g=w;9(!f){7 c;7 b;7 a=d.I.N();n.o.u.X(a,"2M",d.I);n.o.u.X(a,"3V",d.I);9(a.2B()){b=a.1y();c=d.I.1s();a.v().1V(c);1U(5(){a.v().1V(c);9(b!==t&&(a.v().17()>b)){a.v().3F(b+1)}},3z)}e.3w=H;9(e.2j){e.2j()}}});n.o.u.1E(4.q,"2U",5(){7 a=d.I.N();n.o.u.X(a,"2U",d.I)});n.o.u.1E(4.q,"2L",5(){7 a=d.I.N();n.o.u.X(a,"2L",d.I)})};G.6.2Q=5(){9(4.q&&4.q.3e){4.1F();n.o.u.3b(4.2X);n.o.u.57(4.q);4.q.3e.4Z(4.q);4.q=t}};G.6.38=5(){9(4.1o){7 a=4.28(4.C);4.q.U.1J=a.y+"z";4.q.U.1H=a.x+"z"}};G.6.1F=5(){9(4.q){4.q.U.36="2V"}4.1o=w};G.6.2a=5(){9(4.q){7 e="";7 c=4.3g.4j(" ");7 b=12(c[0].1N(),10);7 d=12(c[1].1N(),10);7 a=4.28(4.C);4.q.U.43=4.2P(a);e="<41 3Z=\'"+4.2O+"\' U=\'20: 1Z; 1J: "+d+"z; 1H: "+b+"z; ";9(!4.I.N().1l){e+="3Y: 3X("+(-1*d)+"z, "+((-1*b)+4.1r)+"z, "+((-1*d)+4.1k)+"z, "+(-1*b)+"z);"}e+="\'>";4.q.3W=e+"<1Y U=\'"+"20: 1Z;"+"1J: "+4.1X[0]+"z;"+"1H: "+4.1X[1]+"z;"+"3T: "+4.2D+";"+"1O-1f: "+4.2z+"z;"+"1O-3P: "+4.2v+";"+"1O-3N: "+4.2t+";"+"1O-U: "+4.2s+";"+"1w-3I: "+4.2o+";"+"1w-3E: 1h;"+"1x: "+4.1r+"z;"+"3B-1u:"+4.1k+"z;"+"\'>"+4.16.1w+"</1Y>";9(1Q 4.16.14==="15"||4.16.14===""){4.q.14=4.I.N().2G()}L{4.q.14=4.16.14}4.q.U.36=""}4.1o=H};G.6.3i=5(a){4.16=a;7 b=A.3p(0,a.2T-1);b=A.22(4.M.p-1,b);7 c=4.M[b];4.2O=c.3f;4.1k=c.1u;4.1r=c.1x;4.1X=c.5m||[0,0];4.2c=c.5g||[12(4.1k/2,10),12(4.1r/2,10)];4.2D=c.5b||"55";4.2z=c.51||11;4.2o=c.4V||"2V";4.2t=c.4T||"4R";4.2s=c.4N||"4K";4.2v=c.4J||"4I,4G-4F";4.3g=c.4D||"0 0"};G.6.3h=5(a){4.C=a};G.6.2P=5(b){7 a=[];a.Y("4A: 4y;");a.Y("20: 1Z; 1J: "+b.y+"z; 1H: "+b.x+"z;");a.Y("1x: "+4.1r+"z; 1u: "+4.1k+"z;");j a.4v("")};G.6.28=5(b){7 a=4.37().1P(b);a.x-=4.2c[1];a.y-=4.2c[0];a.x=12(a.x,10);a.y=12(a.y,10);j a};5 D(a){4.W=a;4.Q=a.v();4.T=a.3c();4.13=a.2S();4.18=a.3a();4.k=[];4.C=t;4.2e=t;4.Z=F G(4,a.23())}D.6.45=5(){j 4.k.p};D.6.1D=5(){j 4.k};D.6.2R=5(){j 4.C};D.6.v=5(){j 4.Q};D.6.N=5(){j 4.W};D.6.1s=5(){7 i;7 b=F n.o.1m(4.C,4.C);7 a=4.1D();B(i=0;i<a.p;i++){b.V(a[i].S())}j b};D.6.1C=5(){4.Z.K(t);4.k=[];21 4.k};D.6.1B=5(e){7 i;7 c;7 b;9(4.2N(e)){j w}9(!4.C){4.C=e.S();4.25()}L{9(4.18){7 l=4.k.p+1;7 a=(4.C.O()*(l-1)+e.S().O())/l;7 d=(4.C.19()*(l-1)+e.S().19())/l;4.C=F n.o.1q(a,d);4.25()}}e.1p=H;4.k.Y(e);c=4.k.p;b=4.W.1y();9(b!==t&&4.Q.17()>b){9(e.v()!==4.Q){e.K(4.Q)}}L 9(c<4.13){9(e.v()!==4.Q){e.K(4.Q)}}L 9(c===4.13){B(i=0;i<c;i++){4.k[i].K(t)}}L{e.K(t)}4.2K();j H};D.6.2J=5(a){j 4.2e.2I(a.S())};D.6.25=5(){7 a=F n.o.1m(4.C,4.C);4.2e=4.W.2f(a)};D.6.2K=5(){7 c=4.k.p;7 a=4.W.1y();9(a!==t&&4.Q.17()>a){4.Z.1F();j}9(c<4.13){4.Z.1F();j}7 b=4.W.23().p;7 d=4.W.2H()(4.k,b);4.Z.3h(4.C);4.Z.3i(d);4.Z.2a()};D.6.2N=5(a){7 i;9(4.k.1d){j 4.k.1d(a)!==-1}L{B(i=0;i<4.k.p;i++){9(a===4.k[i]){j H}}}j w};5 8(a,c,b){4.V(8,n.o.2Z);c=c||[];b=b||{};4.k=[];4.E=[];4.1j=[];4.1e=t;4.1i=w;4.T=b.3U||3S;4.13=b.3R||2;4.1W=b.2C||t;4.M=b.3Q||[];4.2d=b.14||"";4.1z=H;9(b.2A!==15){4.1z=b.2A}4.18=w;9(b.2k!==15){4.18=b.2k}4.1a=w;9(b.2x!==15){4.1a=b.2x}4.1l=w;9(b.2w!==15){4.1l=b.2w}4.1I=b.3O||8.2u;4.1t=b.3L||8.2g;4.1c=b.3J||8.2r;4.1T=b.3H||8.2p;4.1R=b.3G||8.2n;4.1v=b.3D||8.2m;4.1S=b.3C||"P";9(3K.3y.3M().1d("3x")!==-1){4.1R=4.1v}4.2q();4.2l(c,H);4.K(a)}8.6.2F=5(){7 a=4;4.1e=4.v();4.1i=H;4.1b();4.1j=[n.o.u.1G(4.v(),"3v",5(){a.1A(w);9(4.17()===(4.2i("3t")||0)||4.17()===4.2i("2C")){n.o.u.X(4,"2h")}}),n.o.u.1G(4.v(),"2h",5(){a.1n()})]};8.6.2Q=5(){7 i;B(i=0;i<4.k.p;i++){9(4.k[i].v()!==4.1e){4.k[i].K(4.1e)}}B(i=0;i<4.E.p;i++){4.E[i].1C()}4.E=[];B(i=0;i<4.1j.p;i++){n.o.u.3b(4.1j[i])}4.1j=[];4.1e=t;4.1i=w};8.6.38=5(){};8.6.2q=5(){7 i,1f;9(4.M.p>0){j}B(i=0;i<4.1c.p;i++){1f=4.1c[i];4.M.Y({3f:4.1I+(i+1)+"."+4.1t,1u:1f,1x:1f})}};8.6.3s=5(){7 i;7 a=4.1D();7 b=F n.o.1m();B(i=0;i<a.p;i++){b.V(a[i].S())}4.v().1V(b)};8.6.3c=5(){j 4.T};8.6.3r=5(a){4.T=a};8.6.2S=5(){j 4.13};8.6.3q=5(a){4.13=a};8.6.1y=5(){j 4.1W};8.6.40=5(a){4.1W=a};8.6.23=5(){j 4.M};8.6.3o=5(a){4.M=a};8.6.2G=5(){j 4.2d};8.6.3n=5(a){4.2d=a};8.6.2B=5(){j 4.1z};8.6.3m=5(a){4.1z=a};8.6.3a=5(){j 4.18};8.6.44=5(a){4.18=a};8.6.3l=5(){j 4.1a};8.6.3k=5(a){4.1a=a};8.6.3j=5(){j 4.1l};8.6.48=5(a){4.1l=a};8.6.5o=5(){j 4.1t};8.6.5n=5(a){4.1t=a};8.6.5l=5(){j 4.1I};8.6.5k=5(a){4.1I=a};8.6.5i=5(){j 4.1c};8.6.5h=5(a){4.1c=a};8.6.2H=5(){j 4.1T};8.6.5f=5(a){4.1T=a};8.6.5e=5(){j 4.1v};8.6.5d=5(a){4.1v=a};8.6.2y=5(){j 4.1S};8.6.5c=5(a){4.1S=a};8.6.1D=5(){j 4.k};8.6.5a=5(){j 4.k.p};8.6.59=5(){j 4.E};8.6.54=5(){j 4.E.p};8.6.1B=5(b,a){4.2b(b);9(!a){4.1n()}};8.6.2l=5(b,a){7 c;B(c 39 b){9(b.50(c)){4.2b(b[c])}}9(!a){4.1n()}};8.6.2b=5(b){9(b.4X()){7 a=4;n.o.u.1G(b,"4W",5(){9(a.1i){4.1p=w;a.1b()}})}b.1p=w;4.k.Y(b)};8.6.4U=5(c,a){7 b=4.29(c);9(!a&&b){4.1b()}j b};8.6.4S=5(a,c){7 i,r;7 b=w;B(i=0;i<a.p;i++){r=4.29(a[i]);b=b||r}9(!c&&b){4.1b()}j b};8.6.29=5(b){7 i;7 a=-1;9(4.k.1d){a=4.k.1d(b)}L{B(i=0;i<4.k.p;i++){9(b===4.k[i]){a=i;4Q}}}9(a===-1){j w}b.K(t);4.k.4P(a,1);j H};8.6.4M=5(){4.1A(H);4.k=[]};8.6.1b=5(){7 a=4.E.4L();4.E=[];4.1A(w);4.1n();1U(5(){7 i;B(i=0;i<a.p;i++){a[i].1C()}},0)};8.6.2f=5(d){7 f=4.37();7 c=F n.o.1q(d.27().O(),d.27().19());7 a=F n.o.1q(d.24().O(),d.24().19());7 e=f.1P(c);e.x+=4.T;e.y-=4.T;7 g=f.1P(a);g.x-=4.T;g.y+=4.T;7 b=f.32(e);7 h=f.32(g);d.V(b);d.V(h);j d};8.6.1n=5(){4.26(0)};8.6.1A=5(a){7 i,J;B(i=0;i<4.E.p;i++){4.E[i].1C()}4.E=[];B(i=0;i<4.k.p;i++){J=4.k[i];J.1p=w;9(a){J.K(t)}}};8.6.30=5(b,e){7 R=4E;7 g=(e.O()-b.O())*A.1K/1M;7 f=(e.19()-b.19())*A.1K/1M;7 a=A.1L(g/2)*A.1L(g/2)+A.31(b.O()*A.1K/1M)*A.31(e.O()*A.1K/1M)*A.1L(f/2)*A.1L(f/2);7 c=2*A.4C(A.2Y(a),A.2Y(1-a));7 d=R*c;j d};8.6.35=5(b,a){j a.2I(b.S())};8.6.33=5(c){7 i,d,P,1h;7 a=4z;7 b=t;B(i=0;i<4.E.p;i++){P=4.E[i];1h=P.2R();9(1h){d=4.30(1h,c.S());9(d<a){a=d;b=P}}}9(b&&b.2J(c)){b.1B(c)}L{P=F D(4);P.1B(c);4.E.Y(P)}};8.6.26=5(e){7 i,J;7 d;7 c=4;9(!4.1i){j}9(e===0){n.o.u.X(4,"4x",4);9(1Q 4.1g!=="15"){4w(4.1g);21 4.1g}}9(4.v().17()>3){d=F n.o.1m(4.v().1s().24(),4.v().1s().27())}L{d=F n.o.1m(F n.o.1q(34.4u,-2W.4t),F n.o.1q(-34.4s,2W.4r))}7 a=4.2f(d);7 b=A.22(e+4.1R,4.k.p);B(i=e;i<b;i++){J=4.k[i];9(!J.1p&&4.35(J,a)){9(!4.1a||(4.1a&&J.4q())){4.33(J)}}}9(b<4.k.p){4.1g=1U(5(){c.26(b)},0)}L{21 4.1g;n.o.u.X(4,"4Y",4)}};8.6.V=5(d,c){j(5(b){7 a;B(a 39 b.6){4.6[a]=b.6[a]}j 4}).4p(d,[c])};8.2p=5(a,c){7 f=0;7 b="";7 d=a.p.4o();7 e=d;4n(e!==0){e=12(e/10,10);f++}f=A.22(f,c);j{1w:d,2T:f,14:b}};8.2n=52;8.2m=4m;8.2u="4l://n-o-4k-58-4i.4h.4g/4f/4e/4d/4c/m";8.2g="4a";8.2r=[53,56,5j,49,47];9(1Q 3d.6.1N!==\'5\'){3d.6.1N=5(){j 4.46(/^\\s+|\\s+$/g,\'\')}}',62,336,'||||this|function|prototype|var|MarkerClusterer|if||||||||||return|markers_|||google|maps|length|div_|||null|event|getMap|false|||px|Math|for|center_|Cluster|clusters_|new|ClusterIcon|true|cluster_|marker|setMap|else|styles_|getMarkerClusterer|lat|cluster|map_||getPosition|gridSize_|style|extend|markerClusterer_|trigger|push|clusterIcon_|||parseInt|minClusterSize_|title|undefined|sums_|getZoom|averageCenter_|lng|ignoreHidden_|repaint|imageSizes_|indexOf|activeMap_|size|timerRefStatic|center|ready_|listeners_|height_|enableRetinaIcons_|LatLngBounds|redraw_|visible_|isAdded|LatLng|width_|getBounds|imageExtension_|height|batchSizeIE_|text|width|getMaxZoom|zoomOnClick_|resetViewport_|addMarker|remove|getMarkers|addDomListener|hide|addListener|left|imagePath_|top|PI|sin|180|trim|font|fromLatLngToDivPixel|typeof|batchSize_|clusterClass_|calculator_|setTimeout|fitBounds|maxZoom_|anchorText_|div|absolute|position|delete|min|getStyles|getSouthWest|calculateBounds_|createClusters_|getNorthEast|getPosFromLatLng_|removeMarker_|show|pushMarkerTo_|anchorIcon_|title_|bounds_|getExtendedBounds|IMAGE_EXTENSION|idle|get|stopPropagation|averageCenter|addMarkers|BATCH_SIZE_IE|BATCH_SIZE|textDecoration_|CALCULATOR|setupStyles_|IMAGE_SIZES|fontStyle_|fontWeight_|IMAGE_PATH|fontFamily_|enableRetinaIcons|ignoreHidden|getClusterClass|textSize_|zoomOnClick|getZoomOnClick|maxZoom|textColor_|className_|onAdd|getTitle|getCalculator|contains|isMarkerInClusterBounds|updateIcon_|mouseout|click|isMarkerAlreadyAdded_|url_|createCss|onRemove|getCenter|getMinimumClusterSize|index|mouseover|none|178|boundsChangedListener_|sqrt|OverlayView|distanceBetweenPoints_|cos|fromDivPixelToLatLng|addToClosestCluster_|85|isMarkerInBounds_|display|getProjection|draw|in|getAverageCenter|removeListener|getGridSize|String|parentNode|url|backgroundPosition_|setCenter|useStyle|getEnableRetinaIcons|setIgnoreHidden|getIgnoreHidden|setZoomOnClick|setTitle|setStyles|max|setMinimumClusterSize|setGridSize|fitMapToMarkers|minZoom|createElement|zoom_changed|cancelBubble|msie|userAgent|100|document|line|clusterClass|batchSizeIE|align|setZoom|batchSize|calculator|decoration|imageSizes|navigator|imageExtension|toLowerCase|weight|imagePath|family|styles|minimumClusterSize|60|color|gridSize|clusterclick|innerHTML|rect|clip|src|setMaxZoom|img|mousedown|cssText|setAverageCenter|getSize|replace|90|setEnableRetinaIcons|78|png|bounds_changed|images|markerclustererplus|trunk|svn|com|googlecode|v3|split|utility|https|500|while|toString|apply|getVisible|00048865625|08136444384544|48388434375|02070771743472|join|clearTimeout|clusteringbegin|pointer|40000|cursor|appendChild|atan2|backgroundPosition|6371|serif|sans|overlayMouseTarget|Arial|fontFamily|normal|slice|clearMarkers|fontStyle|getPanes|splice|break|bold|removeMarkers|fontWeight|removeMarker|textDecoration|dragend|getDraggable|clusteringend|removeChild|hasOwnProperty|textSize|2000||getTotalClusters|black||clearInstanceListeners|library|getClusters|getTotalMarkers|textColor|setClusterClass|setBatchSizeIE|getBatchSizeIE|setCalculator|anchorIcon|setImageSizes|getImageSizes|66|setImagePath|getImagePath|anchorText|setImageExtension|getImageExtension|className'.split('|'),0,{}))
you can use this http://matthewfl.com/unPacker.html to unpack
It worked to me
What you see there is called JavaScript-minification.
What minification does:
Delete line breaks and whitespaces
Replace long object names with one character names
Other minor optimizations that result in less code
This way the size of the script is reduced remarkably. One example of a library that allows minification but also deminification is UglifyJS.

missing ; after for-loop condition

Mozilla Firefox error console is telling me over and over again that:
missing ; after for-loop condition
Here is my JavaScript file (compressed) and I cannot find any error there:
$(document).ready(function(){$('#nav ul li, table tr').mouseover(function(){$(this).addClass('hover')});$('#nav ul li, table tr').mouseout(function(){$(this).removeClass('hover')})});$(document).ready(function(){$('.input-submit').button()});$(document).ready(function(){$('a[rel=external]').click(function(){$(this).attr('target','_top')});$('a[rel=external-new-window]').unbind('click').click(function(){window.open($(this).attr('href'),'','width=800, height=600, scrollbars=1');return false})});$(document).ready(function(){$('.clickable').click(function(){var href=$(this).attr('rel');if(href){window.location=href}})});function browserdetect(){var a=navigator.userAgent.toLowerCase();if(this.isIE=a.indexOf("msie")>-1)this.ieVer=/msie\s(\d\.\d)/.exec(a)[1],this.quirksMode=!document.compatMode||document.compatMode.indexOf("BackCompat")>-1,this.get_style=function(a,c){if(!(c in a.currentStyle))return"";var d=/^([\d.]+)(\w*)/.exec(a.currentStyle[c]);if(!d)return a.currentStyle[c];if(d[1]==0)return"0";if(d[2]&&d[2]!=="px"){var e=a.style.left,f=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=d[1]+d[2];d[0]=a.style.pixelLeft;a.style.left=e;a.runtimeStyle.left=f}return d[0]},this.supportsCorners=this.ieVer>=9;else if(this.ieVer=this.quirksMode=0,this.get_style=function(a,c){c=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(a,"").getPropertyValue(c)},this.isSafari=a.indexOf("safari")!=-1,this.isWebKit=a.indexOf("webkit")!=-1,this.isOp="opera"in window)this.supportsCorners=(this.isOp=window.opera.version())>=10.5;else{if(!this.isWebkit&&!(this.isMoz=a.indexOf("firefox")!==-1))for(a=document.childNodes.length;--a>=0;)if("style"in document.childNodes[a]){this.isMoz="MozBorderRadius"in document.childNodes[a].style;break}this.supportsCorners=this.isWebKit||this.isMoz}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e$$5){}function curvyCnrSpec(a){this.selectorText=a;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=!0}curvyCnrSpec.prototype.setcorner=function(a,b,c,d){a?(a=a.charAt(0)+b.charAt(0),this[a+"R"]=parseInt(c),this[a+"u"]=d):(this.tlR=this.trR=this.blR=this.brR=parseInt(c),this.tlu=this.tru=this.blu=this.bru=d)};curvyCnrSpec.prototype.get=function(a){if(/^(t|b)(l|r)(R|u)$/.test(a))return this[a];if(/^(t|b)(l|r)Ru$/.test(a))return a=a.charAt(0)+a.charAt(1),this[a+"R"]+this[a+"u"];if(/^(t|b)Ru?$/.test(a)){var b=a.charAt(0);b+=this[b+"lR"]>this[b+"rR"]?"l":"r";b=this[b+"R"];a.length===3&&a.charAt(2)==="u"&&(b+=this.u);return b}throw Error("Don't recognize property "+a);};curvyCnrSpec.prototype.radiusdiff=function(a){if(a!=="t"&&a!=="b")throw Error("Param must be 't' or 'b'");return Math.abs(this[a+"lR"]-this[a+"rR"])};curvyCnrSpec.prototype.setfrom=function(a){this.tlu=this.tru=this.blu=this.bru="px";if("tl"in a)this.tlR=a.tl.radius;if("tr"in a)this.trR=a.tr.radius;if("bl"in a)this.blR=a.bl.radius;if("br"in a)this.brR=a.br.radius;if("antiAlias"in a)this.antiAlias=a.antiAlias};curvyCnrSpec.prototype.cloneOn=function(a){var b=["tl","tr","bl","br"],c=0,d,e;for(d in b)if(!isNaN(d)&&(e=this[b[d]+"u"],e!==""&&e!=="px")){c=new curvyCnrSpec;break}if(c){var f,g,k=curvyBrowser.get_style(a,"left");for(d in b)if(!isNaN(d)){f=b[d];e=this[f+"u"];g=this[f+"R"];if(e!=="px"){var l=a.style.left;a.style.left=g+e;g=a.style.pixelLeft;a.style.left=l}c[f+"R"]=g;c[f+"u"]="px"}a.style.left=k}else c=this;return c};curvyCnrSpec.prototype.radiusSum=function(a){if(a!=="t"&&a!=="b")throw Error("Param must be 't' or 'b'");return this[a+"lR"]+this[a+"rR"]};curvyCnrSpec.prototype.radiusCount=function(a){var b=0;this[a+"lR"]&&++b;this[a+"rR"]&&++b;return b};curvyCnrSpec.prototype.cornerNames=function(){var a=[];this.tlR&&a.push("tl");this.trR&&a.push("tr");this.blR&&a.push("bl");this.brR&&a.push("br");return a};function operasheet(a){var a=document.styleSheets.item(a).ownerNode.text,a=a.replace(/\/\*(\n|\r|.)*?\*\//g,""),b=RegExp("^\\s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg"),c;for(this.rules=[];(c=b.exec(a))!==null;){for(var d=RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),e,f=new curvyCnrSpec(c[1]);(e=d.exec(c[2]))!==null;)e[1]!=="z-"&&f.setcorner(e[3],e[4],e[5],e[6]);this.rules.push(f)}}operasheet.contains_border_radius=function(a){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var a,b,c,d,e;if(typeof arguments[0]!=="object")throw curvyCorners.newError("First parameter of curvyCorners() must be an object.");if(arguments[0]instanceof curvyCnrSpec){if(d=arguments[0],!d.selectorText&&typeof arguments[1]==="string")d.selectorText=arguments[1]}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string")throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.");b=arguments[1];typeof b!=="string"&&(b="");b!==""&&b.charAt(0)!=="."&&"autoPad"in arguments[0]&&(b="."+b);d=new curvyCnrSpec(b);d.setfrom(arguments[0])}if(d.selectorText){e=0;var f=d.selectorText.replace(/\s+$/,"").split(/,\s*/);c=[];for(a=0;a<f.length;++a){if((b=f[a].lastIndexOf("#"))!==-1)f[a]=f[a].substr(b);c=c.concat(curvyCorners.getElementsBySelector(f[a].split(/\s+/)))}}else e=1,c=arguments;a=e;for(b=c.length;a<b;++a)if(e=c[a],f=!1,e.className?(f=e.className.indexOf("curvyIgnore")!==-1)||(e.className+=" curvyIgnore"):e.className="curvyIgnore",!f){if(e.className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined")curvyCorners.redrawList=[];curvyCorners.redrawList.push({node:e,spec:d,copy:e.cloneNode(!1)})}(new curvyObject(d,e)).applyCorners()}}curvyCorners.prototype.applyCornersToAll=function(){throw curvyCorners.newError("This function is now redundant. Just call curvyCorners(). See documentation.");};curvyCorners.redraw=function(){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.");var a=curvyCorners.block_redraw;curvyCorners.block_redraw=!0;for(var b in curvyCorners.redrawList)if(!isNaN(b)){var c=curvyCorners.redrawList[b];if(c.node.clientWidth){for(var d=c.copy.cloneNode(!1),e=c.node.firstChild;e!==null;e=e.nextSibling)if(e.className.indexOf("autoPadDiv")!==-1)break;if(!e){curvyCorners.alert("Couldn't find autoPad DIV");break}c.node.parentNode.replaceChild(d,c.node);for(var f=e.getElementsByTagName("script"),g=f.length-1;g>=0;--g)f[g].parentNode.removeChild(f[g]);for(;e.firstChild;)d.appendChild(e.removeChild(e.firstChild));c=new curvyObject(c.spec,c.node=d);c.applyCorners()}}curvyCorners.block_redraw=a}};curvyCorners.adjust=function(a,b,c){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.");var d,e=curvyCorners.redrawList.length;for(d=0;d<e;++d)if(curvyCorners.redrawList[d].node===a)break;if(d===e)throw curvyCorners.newError("Object not redrawable");a=curvyCorners.redrawList[d].copy}b.indexOf(".")===-1?a[b]=c:eval("obj."+b+"='"+c+"'")};curvyCorners.handleWinResize=function(){curvyCorners.block_redraw||curvyCorners.redraw()};curvyCorners.setWinResize=function(a){curvyCorners.block_redraw=!a};curvyCorners.newError=function(a){return Error("curvyCorners Error:\n"+a)};curvyCorners.alert=function(a){(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose)&&alert(a)};function curvyObject(a,b){var c;this.box=b;this.settings=a;this.topContainer=this.bottomContainer=this.shell=c=null;var d=this.box.clientWidth;if("canHaveChildren"in this.box&&!this.box.canHaveChildren||this.box.tagName==="TABLE")throw Error(this.errmsg("You cannot apply corners to "+this.box.tagName+" elements.","Error"));if(!d&&curvyBrowser.isIE)this.box.style.zoom=1,d=this.box.clientWidth;if(!d&&curvyBrowser.get_style(this.box,"display")==="inline")this.box.style.display="inline-block",curvyCorners.alert(this.errmsg("Converting inline element to inline-block","warning")),d=this.box.clientWidth;if(!d){if(!this.box.parentNode)throw this.newError("box has no parent!");for(c=this.box;c=c.parentNode){if(!c||c.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(curvyBrowser.get_style(c,"display")==="none")break}var e=c.style.display;c.style.display="block";d=this.box.clientWidth}if(d){a instanceof curvyCnrSpec?this.spec=a.cloneOn(this.box):(this.spec=new curvyCnrSpec(""),this.spec.setfrom(this.settings));var f=curvyBrowser.get_style(this.box,"borderTopWidth"),g=curvyBrowser.get_style(this.box,"borderBottomWidth"),k=curvyBrowser.get_style(this.box,"borderLeftWidth"),l=curvyBrowser.get_style(this.box,"borderRightWidth"),s=curvyBrowser.get_style(this.box,"borderTopColor"),y=curvyBrowser.get_style(this.box,"borderBottomColor"),q=curvyBrowser.get_style(this.box,"borderLeftColor"),o=curvyBrowser.get_style(this.box,"borderRightColor"),E=curvyBrowser.get_style(this.box,"borderTopStyle"),F=curvyBrowser.get_style(this.box,"borderBottomStyle"),G=curvyBrowser.get_style(this.box,"borderLeftStyle"),H=curvyBrowser.get_style(this.box,"borderRightStyle"),C=curvyBrowser.get_style(this.box,"backgroundColor"),D=curvyBrowser.get_style(this.box,"backgroundImage"),I=curvyBrowser.get_style(this.box,"backgroundRepeat"),p,t;this.box.currentStyle&&this.box.currentStyle.backgroundPositionX?(p=curvyBrowser.get_style(this.box,"backgroundPositionX"),t=curvyBrowser.get_style(this.box,"backgroundPositionY")):(p=curvyBrowser.get_style(this.box,"backgroundPosition"),p=p.split(" "),t=p.length===2?p[1]:0,p=p[0]);var J=curvyBrowser.get_style(this.box,"position"),K=curvyBrowser.get_style(this.box,"paddingTop"),L=curvyBrowser.get_style(this.box,"paddingBottom"),M=curvyBrowser.get_style(this.box,"paddingLeft"),N=curvyBrowser.get_style(this.box,"paddingRight"),w=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null,x=this.spec.get("tR"),z=this.spec.get("bR"),u=function(a){if(typeof a==="number")return a;if(typeof a!=="string")throw Error("unexpected styleToNPx type "+typeof a);var c=/^[-\d.]([a-z]+)$/.exec(a);if(c&&c[1]!="px")throw Error("Unexpected unit "+c[1]);if(isNaN(a=parseInt(a)))a=0;return a};try{this.borderWidth=u(f),this.borderWidthB=u(g),this.borderWidthL=u(k),this.borderWidthR=u(l),this.boxColour=curvyObject.format_colour(C),this.topPadding=u(K),this.bottomPadding=u(L),this.leftPadding=u(M),this.rightPadding=u(N),this.boxWidth=d,this.boxHeight=this.box.clientHeight,this.borderColour=curvyObject.format_colour(s),this.borderColourB=curvyObject.format_colour(y),this.borderColourL=curvyObject.format_colour(q),this.borderColourR=curvyObject.format_colour(o),this.borderString=this.borderWidth+"px "+E+" "+this.borderColour,this.borderStringB=this.borderWidthB+"px "+F+" "+this.borderColourB,this.borderStringL=this.borderWidthL+"px "+G+" "+this.borderColourL,this.borderStringR=this.borderWidthR+"px "+H+" "+this.borderColourR,this.backgroundImage=D!="none"?D:"",this.backgroundRepeat=I}catch(O){throw this.newError(O.message);}var A=this.boxHeight,B=d;if(curvyBrowser.isOp){var v;p=u(p);t=u(t);p&&(v=B+this.borderWidthL+this.borderWidthR,p>v&&(p=v),p=v/p*100+"%");t&&(v=A+this.borderWidth+this.borderWidthB,t>v&&(t=v),t=v/t*100+"%")}curvyBrowser.quirksMode||(this.boxWidth-=this.leftPadding+this.rightPadding,this.boxHeight-=this.topPadding+this.bottomPadding);this.contentContainer=document.createElement("div");if(w)this.contentContainer.style.filter=w;for(;this.box.firstChild;)this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild));if(J!="absolute")this.box.style.position="relative";this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=B+this.borderWidthL+this.borderWidthR+"px";this.box.style.height=A+this.borderWidth+this.borderWidthB+"px";var i=document.createElement("div");i.style.position="absolute";if(w)i.style.filter=w;i.style.width=curvyBrowser.quirksMode?B+this.borderWidthL+this.borderWidthR+"px":B+"px";i.style.height=A+this.borderWidth+this.borderWidthB-x-z<=0?"0":A+this.borderWidth+this.borderWidthB-x-z+"px";i.style.padding="0";i.style.top=x+"px";i.style.left="0";if(this.borderWidthL)i.style.borderLeft=this.borderStringL;if(this.borderWidth&&!x)i.style.borderTop=this.borderString;if(this.borderWidthR)i.style.borderRight=this.borderStringR;if(this.borderWidthB&&!z)i.style.borderBottom=this.borderStringB;i.style.backgroundColor=C;i.style.backgroundImage=this.backgroundImage;i.style.backgroundRepeat=this.backgroundRepeat;i.style.direction="ltr";this.shell=this.box.appendChild(i);d=curvyBrowser.get_style(this.shell,"width");if(d===""||d==="auto"||d.indexOf("%")!==-1)throw this.newError("Shell width is "+d);this.boxWidth=d!==""&&d!="auto"&&d.indexOf("%")==-1?parseInt(d):this.shell.clientWidth;this.applyCorners=function(){this.backgroundPosX=this.backgroundPosY=0;if(this.backgroundObject){var a=function(a,c,b){if(a===0)return 0;if(a==="right"||a==="bottom")return b-c;if(a==="center")return(b-c)/2;if(a.indexOf("%")>0)return(b-c)*100/parseInt(a);return u(a)};this.backgroundPosX=a(p,this.backgroundObject.width,B);this.backgroundPosY=a(t,this.backgroundObject.height,A)}else if(this.backgroundImage)this.backgroundPosX=u(p),this.backgroundPosY=u(t);if(x)i=document.createElement("div"),i.style.width=this.boxWidth+"px",i.style.fontSize="1px",i.style.overflow="hidden",i.style.position="absolute",i.style.paddingLeft=this.borderWidth+"px",i.style.paddingRight=this.borderWidth+"px",i.style.height=x+"px",i.style.top=-x+"px",i.style.left=-this.borderWidthL+"px",this.topContainer=this.shell.appendChild(i);if(z)i=document.createElement("div"),i.style.width=this.boxWidth+"px",i.style.fontSize="1px",i.style.overflow="hidden",i.style.position="absolute",i.style.paddingLeft=this.borderWidthB+"px",i.style.paddingRight=this.borderWidthB+"px",i.style.height=z+"px",i.style.bottom=-z+"px",i.style.left=-this.borderWidthL+"px",this.bottomContainer=this.shell.appendChild(i);var a=this.spec.cornerNames(),b;for(b in a)if(!isNaN(b)){var d=a[b],f=this.spec[d+"R"],k,g,l;d=="tr"||d=="tl"?(k=this.borderColour,l=this.borderWidth):(k=this.borderColourB,l=this.borderWidthB);g=f-l;var n=document.createElement("div");n.style.height=this.spec.get(d+"Ru");n.style.width=this.spec.get(d+"Ru");n.style.position="absolute";n.style.fontSize="1px";n.style.overflow="hidden";var m,j,o,s=w?parseInt(/alpha\(opacity.(\d+)\)/.exec(w)[1]):100;for(m=0;m<f;++m){var y=m+1>=g?-1:Math.floor(Math.sqrt(Math.pow(g,2)-Math.pow(m+1,2)))-1;if(g!=f)var h=m>=g?-1:Math.ceil(Math.sqrt(Math.pow(g,2)-Math.pow(m,2))),q=m+1>=f?-1:Math.floor(Math.sqrt(Math.pow(f,2)-Math.pow(m+1,2)))-1;var C=m>=f?-1:Math.ceil(Math.sqrt(Math.pow(f,2)-Math.pow(m,2)));y>-1&&this.drawPixel(m,0,this.boxColour,s,y+1,n,!0,f);if(g!=f)if(this.spec.antiAlias){for(j=y+1;j<h;++j)this.backgroundImage!==""?(o=curvyObject.pixelFraction(m,j,g)*100,this.drawPixel(m,j,k,s,1,n,o>=30,f)):this.boxColour!=="transparent"?(o=curvyObject.BlendColour(this.boxColour,k,curvyObject.pixelFraction(m,j,g)),this.drawPixel(m,j,o,s,1,n,!1,f)):this.drawPixel(m,j,k,s>>1,1,n,!1,f);q>=h&&(h==-1&&(h=0),this.drawPixel(m,h,k,s,q-h+1,n,!1,0));o=k;j=q}else q>y&&this.drawPixel(m,y+1,k,s,q-y,n,!1,0);else o=this.boxColour,j=y;if(this.spec.antiAlias&&this.boxColour!=="transparent")for(;++j<C;)this.drawPixel(m,j,o,curvyObject.pixelFraction(m,j,f)*s,1,n,l<=0,f)}v=0;for(k=n.childNodes.length;v<k;++v){g=n.childNodes[v];l=parseInt(g.style.top);m=parseInt(g.style.left);s=parseInt(g.style.height);if(d=="tl"||d=="bl")g.style.left=f-m-1+"px";if(d=="tr"||d=="tl")g.style.top=f-s-l+"px";g.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage)switch(d){case"tr":g.style.backgroundPosition=this.backgroundPosX-this.borderWidthL+f-B-m+"px "+(this.backgroundPosY+s+l+this.borderWidth-f)+"px";break;case"tl":g.style.backgroundPosition=this.backgroundPosX-f+m+1+this.borderWidthL+"px "+(this.backgroundPosY-f+s+l+this.borderWidth)+"px";break;case"bl":g.style.backgroundPosition=this.backgroundPosX-f+m+1+this.borderWidthL+"px "+(this.backgroundPosY-A-this.borderWidth+(curvyBrowser.quirksMode?l:-l)+f)+"px";break;case"br":g.style.backgroundPosition=curvyBrowser.quirksMode?this.backgroundPosX-this.borderWidthL-B+f-m+"px "+(this.backgroundPosY-A-this.borderWidth+l+f)+"px":this.backgroundPosX-this.borderWidthL-B+f-m+"px "+(this.backgroundPosY-A-this.borderWidth+f-l)+"px"}}switch(d){case"tl":n.style.top=n.style.left="0";this.topContainer.appendChild(n);break;case"tr":n.style.top=n.style.right="0";this.topContainer.appendChild(n);break;case"bl":n.style.bottom=n.style.left="0";this.bottomContainer.appendChild(n);break;case"br":n.style.bottom=n.style.right="0",this.bottomContainer.appendChild(n)}}b={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(var r in b)if(typeof r!=="function"&&this.spec.get(r+"R")){if(b[r]){j=this.spec[r+"lR"]<this.spec[r+"rR"]?r+"l":r+"r";h=document.createElement("div");h.style.height=b[r]+"px";h.style.width=this.spec.get(j+"Ru");h.style.position="absolute";h.style.fontSize="1px";h.style.overflow="hidden";h.style.backgroundColor=this.boxColour;if(w)h.style.filter=w;h.style.backgroundImage=this.backgroundImage;h.style.backgroundRepeat=this.backgroundRepeat;switch(j){case"tl":h.style.bottom=h.style.left="0";h.style.borderLeft=this.borderStringL;h.style.backgroundPosition=this.backgroundPosX+"px "+(this.borderWidth+this.backgroundPosY-this.spec.tlR)+"px";this.topContainer.appendChild(h);break;case"tr":h.style.bottom=h.style.right="0";h.style.borderRight=this.borderStringR;h.style.backgroundPosition=this.backgroundPosX-this.boxWidth+this.spec.trR+"px "+(this.borderWidth+this.backgroundPosY-this.spec.trR)+"px";this.topContainer.appendChild(h);break;case"bl":h.style.top=h.style.left="0";h.style.borderLeft=this.borderStringL;h.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-this.borderWidth-this.boxHeight+b[r]+this.spec.blR)+"px";this.bottomContainer.appendChild(h);break;case"br":h.style.top=h.style.right="0",h.style.borderRight=this.borderStringR,h.style.backgroundPosition=this.borderWidthL+this.backgroundPosX-this.boxWidth+this.spec.brR+"px "+(this.backgroundPosY-this.borderWidth-this.boxHeight+b[r]+this.spec.brR)+"px",this.bottomContainer.appendChild(h)}}j=document.createElement("div");if(w)j.style.filter=w;j.style.position="relative";j.style.fontSize="1px";j.style.overflow="hidden";j.style.width=this.fillerWidth(r);j.style.backgroundColor=this.boxColour;j.style.backgroundImage=this.backgroundImage;j.style.backgroundRepeat=this.backgroundRepeat;switch(r){case"t":if(this.topContainer){j.style.height=curvyBrowser.quirksMode?100+x+"px":100+x-this.borderWidth+"px";j.style.marginLeft=this.spec.tlR?this.spec.tlR-this.borderWidthL+"px":"0";j.style.borderTop=this.borderString;if(this.backgroundImage)h=this.spec.tlR?this.borderWidthL+this.backgroundPosX-this.spec.tlR+"px ":this.backgroundPosX+"px ",j.style.backgroundPosition=h+this.backgroundPosY+"px",this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-x+this.borderWidthL)+"px";this.topContainer.appendChild(j)}break;case"b":if(this.bottomContainer){j.style.height=curvyBrowser.quirksMode?z+"px":z-this.borderWidthB+"px";j.style.marginLeft=this.spec.blR?this.spec.blR-this.borderWidthL+"px":"0";j.style.borderBottom=this.borderStringB;if(this.backgroundImage)h=this.spec.blR?this.backgroundPosX+this.borderWidthL-this.spec.blR+"px ":this.backgroundPosX+"px ",j.style.backgroundPosition=h+(this.backgroundPosY-A-this.borderWidth+z)+"px";this.bottomContainer.appendChild(j)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";r=B;curvyBrowser.quirksMode||(r-=this.leftPadding+this.rightPadding);this.contentContainer.style.width=r+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(c)c.style.display=e};if(this.backgroundImage&&(p=this.backgroundCheck(p),t=this.backgroundCheck(t),this.backgroundObject))this.backgroundObject.holdingElement=this,this.dispatch=this.applyCorners,this.applyCorners=function(){this.backgroundObject.complete?this.dispatch():this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}else curvyCorners.alert(this.errmsg("zero-width box, cannot display","error")),this.applyCorners=function(){}}curvyObject.prototype.backgroundCheck=function(a){if(a==="top"||a==="left"||parseInt(a)===0)return 0;if(!/^[-\d.]+px$/.test(a)&&!this.backgroundObject)this.backgroundObject=new Image,this.backgroundObject.src=function(a){var c=/url\("?([^'"]+)"?\)/.exec(a);return c?c[1]:a}(this.backgroundImage);return a};curvyObject.dispatch=function(a){if("dispatch"in a)a.dispatch();else throw a.newError("No dispatch function");};curvyObject.prototype.drawPixel=function(a,b,c,d,e,f,g,k){var l=document.createElement("div");l.style.height=e+"px";l.style.width="1px";l.style.position="absolute";l.style.fontSize="1px";l.style.overflow="hidden";e=this.spec.get("tR");l.style.backgroundColor=c;if(g&&this.backgroundImage!=="")l.style.backgroundImage=this.backgroundImage,l.style.backgroundPosition="-"+(this.boxWidth-(k-a)+this.borderWidth)+"px -"+(this.boxHeight+e+b-this.borderWidth)+"px";d!=100&&curvyObject.setOpacity(l,d);l.style.top=b+"px";l.style.left=a+"px";f.appendChild(l)};curvyObject.prototype.fillerWidth=function(a){var b;b=curvyBrowser.quirksMode?0:this.spec.radiusCount(a)*this.borderWidthL;if((a=this.boxWidth-this.spec.radiusSum(a)+b)<0)throw this.newError("Radius exceeds box width");return a+"px"};curvyObject.prototype.errmsg=function(a,b){var c="\ntag: "+this.box.tagName;this.box.id&&(c+="\nid: "+this.box.id);this.box.className&&(c+="\nclass: "+this.box.className);var d;(d=this.box.parentNode)===null?c+="\n(box has no parent)":(c+="\nParent tag: "+d.tagName,d.id&&(c+="\nParent ID: "+d.id),d.className&&(c+="\nParent class: "+d.className));b===void 0&&(b="warning");return"curvyObject "+b+":\n"+a+c};curvyObject.prototype.newError=function(a){return Error(this.errmsg(a,"exception"))};curvyObject.IntToHex=function(a){var b=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return b[a>>>4]+""+b[a&15]};curvyObject.BlendColour=function(a,b,c){if(a==="transparent"||b==="transparent")throw this.newError("Cannot blend with transparent");a.charAt(0)!=="#"&&(a=curvyObject.format_colour(a));b.charAt(0)!=="#"&&(b=curvyObject.format_colour(b));var d=parseInt(a.substr(1,2),16),e=parseInt(a.substr(3,2),16),a=parseInt(a.substr(5,2),16),f=parseInt(b.substr(1,2),16),g=parseInt(b.substr(3,2),16),b=parseInt(b.substr(5,2),16);if(c>1||c<0)c=1;d=Math.round(d*c+f*(1-c));d>255&&(d=255);d<0&&(d=0);e=Math.round(e*c+g*(1-c));e>255&&(e=255);e<0&&(e=0);c=Math.round(a*c+b*(1-c));c>255&&(c=255);c<0&&(c=0);return"#"+curvyObject.IntToHex(d)+curvyObject.IntToHex(e)+curvyObject.IntToHex(c)};curvyObject.pixelFraction=function(a,b,c){c*=c;var d=Array(2),e=Array(2),f=0,g="",k=Math.sqrt(c-Math.pow(a,2));k>=b&&k<b+1&&(g="Left",d[f]=0,e[f]=k-b,++f);k=Math.sqrt(c-Math.pow(b+1,2));k>=a&&k<a+1&&(g+="Top",d[f]=k-a,e[f]=1,++f);k=Math.sqrt(c-Math.pow(a+1,2));k>=b&&k<b+1&&(g+="Right",d[f]=1,e[f]=k-b,++f);k=Math.sqrt(c-Math.pow(b,2));k>=a&&k<a+1&&(g+="Bottom",d[f]=k-a,e[f]=0);switch(g){case"LeftRight":a=Math.min(e[0],e[1])+(Math.max(e[0],e[1])-Math.min(e[0],e[1]))/2;break;case"TopRight":a=1-(1-d[0])*(1-e[1])/2;break;case"TopBottom":a=Math.min(d[0],d[1])+(Math.max(d[0],d[1])-Math.min(d[0],d[1]))/2;break;case"LeftBottom":a=e[0]*d[1]/2;break;default:a=1}return a};curvyObject.rgb2Array=function(a){return a.substring(4,a.indexOf(")")).split(/,\s*/)};curvyObject.rgb2Hex=function(a){try{var b=curvyObject.rgb2Array(a),c=parseInt(b[0]),d=parseInt(b[1]),e=parseInt(b[2]),f="#"+curvyObject.IntToHex(c)+curvyObject.IntToHex(d)+curvyObject.IntToHex(e)}catch(g){throw a="getMessage"in g?g.getMessage():g.message,Error("Error ("+a+") converting RGB value to Hex in rgb2Hex");}return f};curvyObject.setOpacity=function(a,b){b=b==100?99.999:b;if(curvyBrowser.isSafari&&a.tagName!="IFRAME"){var c=curvyObject.rgb2Array(a.style.backgroundColor),d=parseInt(c[0]),e=parseInt(c[1]),c=parseInt(c[2]);a.style.backgroundColor="rgba("+d+", "+e+", "+c+", "+b/100+")"}else if(typeof a.style.opacity!=="undefined")a.style.opacity=b/100;else if(typeof a.style.MozOpacity!=="undefined")a.style.MozOpacity=b/100;else if(typeof a.style.filter!=="undefined")a.style.filter="alpha(opacity="+b+")";else if(typeof a.style.KHTMLOpacity!=="undefined")a.style.KHTMLOpacity=b/100};curvyCorners.addEvent=function(a,b,c,d){if(a.addEventListener)return a.addEventListener(b,c,d),!0;if(a.attachEvent)return a.attachEvent("on"+b,c);a["on"+b]=c;return!1};if(typeof addEvent==="undefined")addEvent=curvyCorners.addEvent;curvyObject.getComputedColour=function(a){var b=document.createElement("DIV");b.style.backgroundColor=a;document.body.appendChild(b);if(window.getComputedStyle)return a=document.defaultView.getComputedStyle(b,null).getPropertyValue("background-color"),b.parentNode.removeChild(b),a.substr(0,3)==="rgb"&&(a=curvyObject.rgb2Hex(a)),a;else{var c=document.body.createTextRange();c.moveToElementText(b);c.execCommand("ForeColor",!1,a);a=c.queryCommandValue("ForeColor");a="rgb("+(a&255)+", "+((a&65280)>>8)+", "+((a&16711680)>>16)+")";b.parentNode.removeChild(b);return curvyObject.rgb2Hex(a)}};curvyObject.format_colour=function(a){a!==""&&a!=="transparent"&&(a.substr(0,3)==="rgb"?a=curvyObject.rgb2Hex(a):a.charAt(0)!=="#"?a=curvyObject.getComputedColour(a):a.length===4&&(a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)));return a};curvyCorners.getElementsByClass=function(a,b){var c=[];b===void 0&&(b=document);var a=a.split("."),d="*";a.length===1?(d=a[0],a=!1):(a[0]&&(d=a[0]),a=a[1]);var e,f;if(d.charAt(0)==="#")(e=document.getElementById(d.substr(1)))&&c.push(e);else if(e=b.getElementsByTagName(d),f=e.length,a)for(var g=RegExp("(^|\\s)"+a+"(\\s|$)"),d=0;d<f;++d)g.test(e[d].className)&&c.push(e[d]);else for(d=0;d<f;++d)c.push(e[d]);return c};curvyCorners.getElementsBySelector=function(a,b){var c;c=a[0];b===void 0&&(b=document);if(c.indexOf("#")===-1)c=curvyCorners.getElementsByClass(c,b);else{c=b.getElementById(c.substr(1));if(!c)return[];c=[c]}if(a.length>1){for(var d=[],e=c.length;--e>=0;)d=d.concat(curvyCorners.getElementsBySelector(a.slice(1),c[e]));c=d}return c};if(curvyBrowser.supportsCorners){var curvyCornersNoAutoScan=!0;curvyCorners.init=function(){}}else curvyCorners.scanStyles=function(){function a(a){if(!parseInt(a))return"px";return/^[\d.]+(\w+)$/.exec(a)[1]}var b,c,d;if(curvyBrowser.isIE){var e=function(c){var b=c.style,d,e,f,q;curvyBrowser.ieVer>6?(d=b["-moz-border-radius"]||0,e=b["-moz-border-radius-topright"]||0,f=b["-moz-border-radius-topleft"]||0,q=b["-moz-border-radius-bottomright"]||0,b=b["-moz-border-radius-bottomleft"]||0):(d=b["moz-border-radius"]||0,e=b["moz-border-radius-topright"]||0,f=b["moz-border-radius-topleft"]||0,q=b["moz-border-radius-bottomright"]||0,b=b["moz-border-radius-bottomleft"]||0);if(d){var o=d.split("/"),o=o[0].split(/\s+/);o[o.length-1]===""&&o.pop();switch(o.length){case 3:f=o[0];e=b=o[1];q=o[2];d=!1;break;case 2:f=q=o[0],e=b=o[1],d=!1;case 1:break;case 4:f=o[0];e=o[1];q=o[2];b=o[3];d=!1;break;default:curvyCorners.alert("Illegal corners specification: "+d)}}if(d||f||e||q||b)c=new curvyCnrSpec(c.selectorText),d?c.setcorner(null,null,parseInt(d),a(d)):(e&&c.setcorner("t","r",parseInt(e),a(e)),f&&c.setcorner("t","l",parseInt(f),a(f)),b&&c.setcorner("b","l",parseInt(b),a(b)),q&&c.setcorner("b","r",parseInt(q),a(q))),curvyCorners(c)};for(b=0;b<document.styleSheets.length;++b)try{if(document.styleSheets[b].imports)for(c=0;c<document.styleSheets[b].imports.length;++c)for(d=0;d<document.styleSheets[b].imports[c].rules.length;++d)e(document.styleSheets[b].imports[c].rules[d]);for(c=0;c<document.styleSheets[b].rules.length;++c)e(document.styleSheets[b].rules[c])}catch(f){typeof curvyCornersVerbose!=="undefined"&&curvyCornersVerbose&&alert(f.message+" - ignored")}}else if(curvyBrowser.isOp)for(b=0;b<document.styleSheets.length;++b){if(operasheet.contains_border_radius(b))for(c in d=new operasheet(b),d.rules)isNaN(c)||curvyCorners(d.rules[c])}else curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox/Opera")},curvyCorners.init=function(){if(!arguments.callee.done){arguments.callee.done=!0;if(curvyBrowser.isWebKit&&curvyCorners.init.timer)clearInterval(curvyCorners.init.timer),curvyCorners.init.timer=null;curvyCorners.scanStyles()}};if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===!1)curvyBrowser.isOp?document.addEventListener("DOMContentLoaded",curvyCorners.init,!1):curvyCorners.addEvent(window,"load",curvyCorners.init,!1);
Perhaps the compression messed something up? I just opened the uncompressed code in Eclipse and there are no errors.
Instead of opening your uncompressed code in Eclipse, open it in JSHint, fix the errors and I'll bet your problem goes away. Make sure you configure your options to indicate you're using jQuery.
The code is virtually un-readable in the compressed format, but there are some for() loops without the two semicolons.
If you search for the word for( in the code, you should find them. One is about a third of the way through, and reads for(c=this.box;c=c.parentNode).
I didn't have time to keep searching, but I suspect there are more.
If the code is working prior to being compressed then I suspect you're correct about the compressor being faulty. What compressor did you use?
There are many locations in your code where you did not use the ; jslint reports about 10, this is killing for compression. those errors probably chain react to a mis-interpretation of the file by the javascript engine.
In for(var d=RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),e,f=new curvyCnrSpec(c[1]);(e=d.exec(c[2]))!==null;)e[1]!=="z-"&&f.setcorner(e[3],e[4],e[5],e[6])
The semicolon after null should come after the closing parenthesis. This would be a lot easier to spot if your code was not formatted all on one line.
EDIT: Disregard this, it is totally wrong.
With same problem, found a comma instead of semi-colon.
for(i = 0, i < x.length; i++)

Categories

Resources