123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- (function( $ ){
- var la2li = {
- "1":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐ข","0":"๐ซ"}}}},
- "2":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐ฃ","0":"๐ฌ"}}}},
- "3":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐ค","0":"๐ญ"}}}},
- "4":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐ฅ","0":"๐ฎ"}}}},
- "5":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐ฆ","0":"๐ฏ"}}}},
- "6":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐ง","0":"๐ฐ"}}}},
- "7":{"~":"๐","0":{"~":"๐","0":{"~":"๐","0":{"~":"๐จ","0":"๐ฑ"}}}},
- "8":{"~":"๐","0":{"~":"๐","0":{"~":"๐ ","0":{"~":"๐ฉ","0":"๐ฒ"}}}},
- "9":{"~":"๐","0":{"~":"๐","0":{"~":"๐ก","0":{"~":"๐ช","0":"๐ณ"}}}},
- "a": { "~": "๐", "i": "๐", "lv": "๐
","mph": "๐จ","rom": "๐","u": "๐" },
-
- "b": { "i": {"g": "๐",},"o": {"s": {"~": "๐","f": "๐","m": "๐"}}},
-
- "c": {"a": {"p": {"~": "๐","f": "๐","m": "๐","s": "๐"}},"e": {"l": "๐ฏ","n": { "t": "๐"} ,"r": {"v": "๐" }},"u": {"m": {"i": {"n": "๐"}},"r": "๐"},"y": {"p": "๐"}},
- "d": {"a": {"~": "๐
","g": "๐",},"e": {"~": "๐","c": "๐","m": {"i": {"l": "๐ซ",}}},"i": "๐","m": {"i": {"l": "๐ฃ",}},"o": "๐","u": {"~": "๐","c": "๐","m": {"i": {"l": "๐ฌ"}},"o": "๐"},"w": {"e": "๐","o": "๐" }},
-
- "e": "๐",
- "h": {"a":"๐"},
-
- "i": "๐",
- "j": {"a": "๐","e": "๐","o": "๐"},
-
- "k": {"a": "๐","e": "๐","i": "๐","o": "๐","u": "๐"},
- "m": {"a": "๐","e": "๐","i": "๐","o": "๐","u": "๐"},
- "n": {"a": "๐","e": "๐","i": "๐","o": "๐","u": "๐","w": {"a":"๐
"}},
- "o": "๐",
-
- "p": {"a": "๐","e": "๐","h": {"u":"๐"},"i": "๐ ","o": "๐ก","t": {"e":"๐"},"u": "๐ข"},
- "q": {"a": "๐ฃ","e": "๐ค","i": "๐ฅ","o": "๐ฆ"},
- "r": {"a": {"~" : "๐จ","i" : "๐"},"e": "๐ฉ","i": "๐ช","o": "๐ซ","u": "๐ฌ","y": {"a" : "๐","o": "๐"}},
- "s": {"a": "๐ญ","e": "๐ฎ","i": "๐ฏ","o": "๐ฐ","u": "๐ฑ"},
- "t": {"a": "๐ฒ","e": "๐ณ","i": "๐ด","o": "๐ต","u": "๐ถ","w": {"e" : "๐", "o" : "๐"},"y": {"a": "๐"}},
- "u": "๐",
-
- "w": {"a": "๐ท","e": "๐ธ","i": "๐น","o": "๐บ"},
-
- "z": {"a": "๐ผ","e": "๐ฝ","o": "๐ฟ"}
- };
- var li2la = {
- "\ud800" :
- {"\udc00": "a",
- "\udc01": "e",
- "\udc02": "i",
- "\udc03": "o",
- "\udc04": "u",
- "\udc05": "da",
- "\udc06": "de",
- "\udc07": "di",
- "\udc08": "do",
- "\udc09": "du",
- "\udc0a": "ja",
- "\udc0b": "je",
- "\udc0d": "jo",
- "\udc0f": "ka",
- "\udc10": "ke",
- "\udc11": "ki",
- "\udc12": "ko",
- "\udc13": "ku",
- "\udc14": "ma",
- "\udc15": "me",
- "\udc16": "mi",
- "\udc17": "mo",
- "\udc18": "mu",
- "\udc19": "na",
- "\udc1a": "ne",
- "\udc1b": "ni",
- "\udc1c": "no",
- "\udc1d": "nu",
- "\udc1e": "pa",
- "\udc1f": "pe",
- "\udc20": "pi",
- "\udc21": "po",
- "\udc22": "pu",
- "\udc23": "qa",
- "\udc24": "qe",
- "\udc25": "qi",
- "\udc26": "qo",
- "\udc28": "ra",
- "\udc29": "re",
- "\udc2a": "ri",
- "\udc2b": "ro",
- "\udc2c": "ru",
- "\udc2d": "sa",
- "\udc2e": "se",
- "\udc2f": "si",
- "\udc30": "so",
- "\udc31": "su",
- "\udc32": "ta",
- "\udc33": "te",
- "\udc34": "ti",
- "\udc35": "to",
- "\udc36": "tu",
- "\udc37": "wa",
- "\udc38": "we",
- "\udc39": "wi",
- "\udc3a": "wo",
- "\udc3c": "za",
- "\udc3d": "ze",
- "\udc3f": "zo",
- "\udc40": "ha",
- "\udc41": "ai",
- "\udc42": "au",
- "\udc43": "dwe",
- "\udc44": "dwo",
- "\udc45": "nwa",
- "\udc46": "phu",
- "\udc47": "pte",
- "\udc48": "rya",
- "\udc49": "rai",
- "\udc4a": "ryo",
- "\udc4b": "tya",
- "\udc4c": "twe",
- "\udc4d": "two",
- "\udc52": "cap",
- "\udc80": "vir",
- "\udc81": "mul",
- "\udc82": "cerv",
- "\udc83": "equ",
- }
- };
- var la2cy = {
- "a": "๐ ",
-
- "b": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ก","u": "๐ ข"},
-
- "d": {"a": "๐ ญ","e": "๐ ฎ","i": "๐ ฏ","o": "๐ ฐ","u": "๐ ฑ"},
-
- "e": "๐ ",
- "g": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ","u": "๐ "},
-
- "i": "๐ ",
- "j": {"a": "๐
","o": "๐ "},
-
- "k": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ","u": "๐ "},
- "kh": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ","u": "๐ "},
- "l": {"a": "๐ ","e": "๐","i": "๐ ","o": "๐ ","u": "๐ "},
- "m": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ","u": "๐ "},
- "n": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ","u": "๐ "},
- "ks": {"a": "๐ ท","e": "๐ ธ"},
- "o": "๐ ",
-
- "p": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ก","u": "๐ ข"},
- "ph": {"a": "๐ ","e": "๐ ","i": "๐ ","o": "๐ ก","u": "๐ ข"},
- "r": {"a": "๐ ฃ","e": "๐ ค","i": "๐ ฅ","o": "๐ ฆ","u": "๐ ง"},
- "s": {"a": "๐ จ","e": "๐ ฉ","i": "๐ ช","o": "๐ ซ","u": "๐ ฌ"},
- "t": {"a": "๐ ญ","e": "๐ ฎ","i": "๐ ฏ","o": "๐ ฐ","u": "๐ ฑ"},
- "th": {"a": "๐ ญ","e": "๐ ฎ","i": "๐ ฏ","o": "๐ ฐ","u": "๐ ฑ"},
- "u": "๐ ",
-
- "w": {"a": "๐ ฒ","e": "๐ ณ","i": "๐ ด","o": "๐ ต"},
-
- "z": {"a": "๐ ผ","o": "๐ ฟ"}
- };
- var cy2la = {
- "\ud802":
- {
- "\udc00": "a",
- "\udc01": "e",
- "\udc02": "i",
- "\udc03": "o",
- "\udc04": "u",
- "\udc32": "wa",
- "\udc33": "we",
- "\udc34": "wi",
- "\udc35": "wo",
- "\udc3C": "za",
- "\udc3F": "zo",
- "\udc05": "ja",
- "\udc08": "jo",
- "\udc0A": "ka",
- "\udc0B": "ke",
- "\udc0C": "ki",
- "\udc0D": "ko",
- "\udc0E": "ku",
- "\udc0F": "la",
- "\udc10": "le",
- "\udc11": "li",
- "\udc12": "lo",
- "\udc13": "lu",
- "\udc14": "ma",
- "\udc15": "me",
- "\udc16": "mi",
- "\udc17": "mo",
- "\udc18": "mu",
- "\udc19": "na",
- "\udc1A": "ne",
- "\udc1B": "ni",
- "\udc1C": "no",
- "\udc1D": "nu",
- "\udc37": "kse",
- "\udc38": "ksi",
- "\udc1E": "pa",
- "\udc1F": "pe",
- "\udc20": "pi",
- "\udc21": "po",
- "\udc22": "pu",
- "\udc23": "ra",
- "\udc24": "re",
- "\udc25": "ri",
- "\udc26": "ro",
- "\udc27": "ru",
- "\udc28": "sa",
- "\udc29": "se",
- "\udc2A": "si",
- "\udc2B": "so",
- "\udc2C": "su",
- "\udc2D": "ta",
- "\udc2E": "te",
- "\udc2F": "ti",
- "\udc30": "to",
- "\udc31": "tu",
- }
- };
- var converterMap = la2li;
- function doconvert(src) {
- function traverse(i, chars, ws) {
- var c = src[i];
- if (c in chars) {
- if (chars[c] instanceof Array)
- return (ws ? chars[c][1] : chars[c][0]) + traverse(i + 1, converterMap);
- else if (chars[c] instanceof Object)
- return traverse(i + 1, chars[c], ws);
- else
- return chars[c] + traverse(i + 1, converterMap);
- }
- else if ('~' in chars) {
- if (chars['~'] instanceof Array)
- return (ws ? chars['~'][1] : chars['~'][0]) + traverse(i, converterMap);
- else
- return chars['~'] + traverse(i, converterMap);
- }
- else if (c) {
- return c + traverse(i + 1, converterMap, c == ' ');
- }
- return "";
- }
- return traverse(0, converterMap, true);
- }
- function translate() {
- var src = $("#source").val();
- $("#destination").val(doconvert(src));
- }
- function changeDictionary() {
- converterMap = eval($('#source-map').val());
- translate();
- }
- var htmlForm = ' \
- <div class="lbt overlay"></div> \
- <div class="lbt window"> \
- <h4>ฮฮตฯฮฑฮณฯฮฑฯฮญฮฑฯ ฯฮทฯ ฮฯฮฑฮผฮผฮนฮบฮฎฯ ฮ</h4> \
- <hr /> \
- <table style="width: 100%;"> \
- <tr> \
- <td> \
- ฮฮตฯฮฌฮณฯฮฑฯฮต:<select style="width: 100%;" id="source-map"> \
- <option value="la2li">ฮฮฑฯฮนฮฝฮนฮบฮฎ ฮฯฮฑฯฮฎ ฯฮต ฮฯฮฑฮผฮผฮนฮบฮฎ ฮ</options> \
- <option value="li2la">ฮฯฮฑฮผฮผฮนฮบฮฎ ฮ ฯฮต ฮฮฑฯฮนฮฝฮนฮบฮฎ ฮฯฮฑฯฮฎ</options> \
- <option value="la2cy">ฮฮฑฯฮนฮฝฮนฮบฮฎ ฮฯฮฑฯฮฎ ฯฮต ฮฯ
ฯฯฮนฮฑฮบฯ ฯฯ
ฮปฮปฮฑฮฒฮฌฯฮนฮฟ</options> \
- <option value="cy2la">ฮฯ
ฯฯฮนฮฑฮบฯ ฯฯ
ฮปฮปฮฑฮฒฮฌฯฮนฮฟ ฯฮต ฮฮฑฯฮนฮฝฮนฮบฮฎ ฮฯฮฑฯฮฎ</options> \
- </select> \
- </tr> \
- <tr> \
- <td><textarea id="source" style="width: 100%;"></textarea></td> \
- <td><textarea id="destination" style="width: 100%;"></textarea></td> \
- </tr> \
- </table> \
- <br>a \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐
" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐ฃ" class="key" /> \
- <input type="button" value="๐จ" class="key" /> \
- <input type="button" value="๐ญ" class="key" /> \
- <input type="button" value="๐ฒ" class="key" /> \
- <input type="button" value="๐ท" class="key" /> \
- <input type="button" value="๐ผ" class="key" /> \
- <br>e \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐ค" class="key" /> \
- <input type="button" value="๐ฉ" class="key" /> \
- <input type="button" value="๐ฎ" class="key" /> \
- <input type="button" value="๐ณ" class="key" /> \
- <input type="button" value="๐ธ" class="key" /> \
- <input type="button" value="๐ฝ" class="key" /> \
- <br>i \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐ " class="key" /> \
- <input type="button" value="๐ฅ" class="key" /> \
- <input type="button" value="๐ช" class="key" /> \
- <input type="button" value="๐ฏ" class="key" /> \
- <input type="button" value="๐ด" class="key" /> \
- <input type="button" value="๐น" class="key" /> \
- <br>o \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐ก" class="key" /> \
- <input type="button" value="๐ฆ" class="key" /> \
- <input type="button" value="๐ซ" class="key" /> \
- <input type="button" value="๐ฐ" class="key" /> \
- <input type="button" value="๐ต" class="key" /> \
- <input type="button" value="๐บ" class="key" /> \
- <input type="button" value="๐ฟ" class="key" /> \
- <br>u \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐" class="key" /> \
- <input type="button" value="๐ข" class="key" /> \
- <input type="button" value="๐ฌ" class="key" /> \
- <input type="button" value="๐ฑ" class="key" /> \
- <input type="button" value="๐ถ" class="key" /> \
- </div> \
- ';
- $.fn.lbt = function(options) {
- var settings = $.extend({}, options);
- if (settings['window-holder']) {
- $(document).ready(onResize);
- $(window).resize(onResize);
- $(settings['window-holder']).html(htmlForm);
- $('.lbt.overlay').click(hidePopup);
- this.click(showPopup);
- }
- else {
- this.html(htmlForm);
- $('.lbt.window').show();
- $('.lbt.window').css("position", "relative");
- }
- $('#source').change(translate);
- $('#source').keyup(translate);
- $('#source-map').change(changeDictionary);
- $('.key').click(function(e) {
- if (converterMap = la2li )
- { $('#source-map').val('li2la');
- converterMap = li2la;
- }
- var phoneme = $(this).attr('value');
- $('#source').val($('#source').val()+ phoneme);
- translate();
- });
- };
- })( jQuery );
|