Index: trunk/extensions/Narayam/bn_inscript_rules.js |
— | — | @@ -0,0 +1,122 @@ |
| 2 | +/** |
| 3 | + * InScript regular expression rules table for Bengali script |
| 4 | + * According to CDAC's "Enhanced InScript Keyboard Layout 5.2" |
| 5 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 6 | + * @date 2010-12-12 |
| 7 | + * License: GPLv3, CC-BY-SA 3.0 |
| 8 | + */ |
| 9 | +if(tr_bn_inscript== undefined) var tr_bn_inscript = {}; |
| 10 | +else tr_bn_inscript = {}; |
| 11 | +tr_bn_inscript.text = "InScript"; |
| 12 | +tr_bn_inscript.description = "InScript layout for Bengali"; |
| 13 | +// Normal rules |
| 14 | +tr_bn_inscript.rules = [ |
| 15 | +['X', '', 'ঁ'], |
| 16 | +['x', '', 'ং'], |
| 17 | +['_', '', 'ঃ'], |
| 18 | +['D', '', 'অ'], |
| 19 | +['E', '', 'আ'], |
| 20 | +['F', '', 'ই'], |
| 21 | +['R', '', 'ঈ'], |
| 22 | +['G', '', 'উ'], |
| 23 | +['T', '', 'ঊ'], |
| 24 | +['\\+', '', 'ঋ'], |
| 25 | +['S', '', 'এ'], |
| 26 | +['W', '', 'ঐ'], |
| 27 | +['A', '', 'ও'], |
| 28 | +['Q', '', 'ঔ'], |
| 29 | +['k', '', 'ক'], |
| 30 | +['K', '', 'খ'], |
| 31 | +['i', '', 'গ'], |
| 32 | +['I', '', 'ঘ'], |
| 33 | +['U', '', 'ঙ'], |
| 34 | +[';', '', 'চ'], |
| 35 | +['\\:', '', 'ছ'], |
| 36 | +['p', '', 'জ'], |
| 37 | +['P', '', 'ঝ'], |
| 38 | +['\\}', '', 'ঞ'], |
| 39 | +["'", '', 'ট'], |
| 40 | +['"', '', 'ঠ'], |
| 41 | +['\\[', '', 'ড'], |
| 42 | +['\\{', '', 'ঢ'], |
| 43 | +['C', '', 'ণ'], |
| 44 | +['l', '', 'ত'], |
| 45 | +['L', '', 'থ'], |
| 46 | +['o', '', 'দ'], |
| 47 | +['O', '', 'ধ'], |
| 48 | +['v', '', 'ন'], |
| 49 | +['h', '', 'প'], |
| 50 | +['H', '', 'ফ'], |
| 51 | +['y', '', 'ব'], |
| 52 | +['Y', '', 'ভ'], |
| 53 | +['c', '', 'ম'], |
| 54 | +['\\?', '', 'য'], |
| 55 | +['j', '', 'র'], |
| 56 | +['J', '', 'ৎ'], |
| 57 | +['n', '', 'ল'], |
| 58 | +['M', '', 'শ'], |
| 59 | +['\\<', '', 'ষ'], |
| 60 | +['m', '', 'স'], |
| 61 | +['u', '', 'হ'], |
| 62 | +['\\]', '', '়'], |
| 63 | +['e', '', 'া'], |
| 64 | +['f', '', 'ি'], |
| 65 | +['r', '', 'ী'], |
| 66 | +['g', '', 'ু'], |
| 67 | +['t', '', 'ূ'], |
| 68 | +['\\=', '', 'ৃ'], |
| 69 | +['s', '', 'ে'], |
| 70 | +['w', '', 'ৈ'], |
| 71 | +['a', '', 'ো'], |
| 72 | +['q', '', 'ৌ'], |
| 73 | +['d', '', '্'], |
| 74 | +['/', '', 'য়'], |
| 75 | +['\\>', '', ''], |
| 76 | +['0', '', '০'], |
| 77 | +['1', '', '১'], |
| 78 | +['2', '', '২'], |
| 79 | +['3', '', '৩'], |
| 80 | +['4', '', '৪'], |
| 81 | +['5', '', '৫'], |
| 82 | +['6', '', '৬'], |
| 83 | +['7', '', '৭'], |
| 84 | +['8', '', '৮'], |
| 85 | +['9', '', '৯'], |
| 86 | +['z', '', 'ʼ'], |
| 87 | +['\\!', '', 'অ্যা'], |
| 88 | +['\\#', '', '্র'], |
| 89 | +['\\$', '', 'র্'], |
| 90 | +['\\%', '', 'জ্ঞ'], |
| 91 | +['\\^', '', 'ত্র'], |
| 92 | +['\\&', '', 'ক্ষ'], |
| 93 | +['\\*', '', 'শ্র'], |
| 94 | +['\\(', '', '\u200D'], |
| 95 | +['\\)', '', '\u200C'] |
| 96 | +]; |
| 97 | + |
| 98 | +// Extended layout for InScript. Works in Firefox only |
| 99 | +tr_bn_inscript.extended_keyboard = true; |
| 100 | +tr_bn_inscript.rules_x = [ |
| 101 | +['F', '', 'ঌ'], |
| 102 | +['\\>', '', 'ঽ'], |
| 103 | +['\\=', '', 'ৠ'], |
| 104 | +['l', '', 'ৎ'], |
| 105 | +['\\[', '', 'ড়'], |
| 106 | +['\\{', '', 'ঢ়'], |
| 107 | +['\\+', '', 'ৠ'], |
| 108 | +['R', '', 'ৡ'], |
| 109 | +['f', '', 'ৢ'], |
| 110 | +['r', '', 'ৣ'], |
| 111 | +['\\.', '', ''], |
| 112 | +['x', '', '৺'], |
| 113 | +['\\<', '', '৲'], |
| 114 | +[',', '', '৳'], |
| 115 | +['\\!', '', '৴'], |
| 116 | +['\\@', '', '৵'], |
| 117 | +['\\#', '', '৶'], |
| 118 | +['\\$', '', '৷'], |
| 119 | +['\\%', '', '৸'], |
| 120 | +['\\^', '', '৹'], |
| 121 | +['\\?', '', '৻'], |
| 122 | +['4', '', '₹'] |
| 123 | +]; |
Index: trunk/extensions/Narayam/Narayam.js |
— | — | @@ -0,0 +1,586 @@ |
| 2 | +/** |
| 3 | + * Narayam |
| 4 | + * Input field rewrioter tool for web pages |
| 5 | + * @author Junaid P V ([[user:Junaidpv]])(http://junaidpv.in) |
| 6 | + * @date 2010-12-18 (Based on naaraayam transliteration tool I first wrote on 2010-05-19) |
| 7 | + * @version 3.0 |
| 8 | + * Last update: 2010-11-28 |
| 9 | + * License: GPLv3, CC-BY-SA 3.0 |
| 10 | + */ |
| 11 | + |
| 12 | +var Narayam = {}; |
| 13 | + |
| 14 | +/** |
| 15 | + * from: http://stackoverflow.com/questions/3053542/how-to-get-the-start-and-end-points-of-selection-in-text-area/3053640#3053640 |
| 16 | + */ |
| 17 | +function GetCaretPosition(el) { |
| 18 | + var start = 0, end = 0, normalizedValue, range, |
| 19 | + textInputRange, len, endRange; |
| 20 | + |
| 21 | + if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") { |
| 22 | + start = el.selectionStart; |
| 23 | + end = el.selectionEnd; |
| 24 | + } else { |
| 25 | + range = document.selection.createRange(); |
| 26 | + if (range && range.parentElement() == el) { |
| 27 | + len = el.value.length; |
| 28 | + normalizedValue = el.value.replace(/\r\n/g, "\n"); |
| 29 | + |
| 30 | + // Create a working TextRange that lives only in the input |
| 31 | + textInputRange = el.createTextRange(); |
| 32 | + textInputRange.moveToBookmark(range.getBookmark()); |
| 33 | + |
| 34 | + // Check if the start and end of the selection are at the very end |
| 35 | + // of the input, since moveStart/moveEnd doesn't return what we want |
| 36 | + // in those cases |
| 37 | + endRange = el.createTextRange(); |
| 38 | + endRange.collapse(false); |
| 39 | + |
| 40 | + if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) { |
| 41 | + start = end = len; |
| 42 | + } else { |
| 43 | + start = -textInputRange.moveStart("character", -len); |
| 44 | + start += normalizedValue.slice(0, start).split("\n").length - 1; |
| 45 | + |
| 46 | + if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) { |
| 47 | + end = len; |
| 48 | + } else { |
| 49 | + end = -textInputRange.moveEnd("character", -len); |
| 50 | + end += normalizedValue.slice(0, end).split("\n").length - 1; |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + } |
| 55 | + return { |
| 56 | + start: start, |
| 57 | + end: end |
| 58 | + }; |
| 59 | +} |
| 60 | + |
| 61 | +/** |
| 62 | + * from: http://stackoverflow.com/questions/3274843/get-caret-position-in-textarea-ie |
| 63 | + */ |
| 64 | +function offsetToRangeCharacterMove(el, offset) { |
| 65 | + return offset - (el.value.slice(0, offset).split("\r\n").length - 1); |
| 66 | +} |
| 67 | +/** |
| 68 | + * IE part from: http://stackoverflow.com/questions/3274843/get-caret-position-in-textarea-ie |
| 69 | + */ |
| 70 | +function setCaretPosition (el, iCaretPos) |
| 71 | +{ |
| 72 | + if (document.selection) // IE |
| 73 | + { |
| 74 | + endOffset = startOffset=iCaretPos; |
| 75 | + var range = el.createTextRange(); |
| 76 | + var startCharMove = offsetToRangeCharacterMove(el, startOffset); |
| 77 | + range.collapse(true); |
| 78 | + if (startOffset == endOffset) { |
| 79 | + range.move("character", startCharMove); |
| 80 | + } else { |
| 81 | + range.moveEnd("character", offsetToRangeCharacterMove(el, endOffset)); |
| 82 | + range.moveStart("character", startCharMove); |
| 83 | + } |
| 84 | + range.select(); |
| 85 | + } |
| 86 | + else if (el.selectionStart || el.selectionStart == '0') // Firefox |
| 87 | + { |
| 88 | + el.setSelectionRange(iCaretPos, iCaretPos) |
| 89 | + } |
| 90 | +} |
| 91 | + |
| 92 | +function getAllTextInputs() { |
| 93 | + var inputs = document.getElementsByTagName('input'); |
| 94 | + var textInputs = []; |
| 95 | + var count = inputs.length; |
| 96 | + for(var i=0; i < count; i++) { |
| 97 | + element = inputs[i]; |
| 98 | + if(element.getAttribute('type')==='text' || element.getAttribute('type')==='search' || element.getAttribute('type')==='' || element.getAttribute('type')== undefined) { |
| 99 | + textInputs.push(element); |
| 100 | + } |
| 101 | + } |
| 102 | + return textInputs; |
| 103 | +} |
| 104 | + |
| 105 | +function getLastNChars(str, caretPosition, numberOfChars) |
| 106 | +{ |
| 107 | + if(caretPosition <= numberOfChars ) return str.substring(0,caretPosition); |
| 108 | + else return str.substring(caretPosition-numberOfChars,caretPosition); |
| 109 | +} |
| 110 | + |
| 111 | +function replaceTransStringAtCaret(control, oldStringLength, newString, selectionRange) |
| 112 | +{ |
| 113 | + var text = control.value; |
| 114 | + var newCaretPosition; |
| 115 | + // firefox always scrolls to topmost position, |
| 116 | + // to scroll manually we keep original scroll postion. |
| 117 | + if(control.scrollTop || control.scrollTop=='0') { |
| 118 | + var scrollTop = control.scrollTop; |
| 119 | + } |
| 120 | + if(text.length >= 1) { |
| 121 | + var firstStr = text.substring(0, selectionRange['start'] - oldStringLength + 1); |
| 122 | + var lastStr = text.substring(selectionRange['end'], text.length); |
| 123 | + control.value = firstStr+newString+ lastStr; |
| 124 | + newCaretPosition = firstStr.length+newString.length; |
| 125 | + setCaretPosition(control,newCaretPosition); |
| 126 | + } |
| 127 | + else { |
| 128 | + control.value = newString; |
| 129 | + newCaretPosition = newString.length; |
| 130 | + setCaretPosition(control,newCaretPosition); |
| 131 | + } |
| 132 | + // Manually scrolling in firefox, few tweeks or re-writing may require |
| 133 | + if (navigator.userAgent.indexOf("Firefox")!=-1) { |
| 134 | + var textLength = control.value.length; |
| 135 | + var cols = control.cols; |
| 136 | + if(newCaretPosition > (textLength-cols)) { |
| 137 | + //var height = parseInt(window.getComputedStyle(control,null).getPropertyValue('height')); |
| 138 | + var fontsize = parseInt(window.getComputedStyle(control,null).getPropertyValue('font-size')); |
| 139 | + //var lineheight = height/fontsize; |
| 140 | + control.scrollTop = scrollTop+fontsize; |
| 141 | + } else control.scrollTop = scrollTop; |
| 142 | + } |
| 143 | +} |
| 144 | + |
| 145 | +/** |
| 146 | + * This function will take a string to check against regular expression rules in the rules array. |
| 147 | + * It will return a two memeber array, having given string as first member and replacement string as |
| 148 | + * second memeber. If corresponding replacement could not be found then second string will be too given string |
| 149 | +*/ |
| 150 | +function transli(lastpart,e, tr_rules) |
| 151 | +{ |
| 152 | + var rulesCount = tr_rules.length; |
| 153 | + var part1 = lastpart; |
| 154 | + var part2 = lastpart; |
| 155 | + var triple; |
| 156 | + for(var i=0 ; i < rulesCount; i++) |
| 157 | + { |
| 158 | + triple = tr_rules[i]; |
| 159 | + var previousKeysMatch = true; |
| 160 | + var presentSeq = '(.*)'+triple[0]+'$'; |
| 161 | + var replaceSeq = '$1'+triple[2]; |
| 162 | + if(triple[1].length > 0) { |
| 163 | + previousKeysMatch = (new RegExp('.*'+triple[1]+'$')).test(Narayam.previous_sequence[(e.currentTarget || e.srcElement).id ]); |
| 164 | + } |
| 165 | + if((new RegExp(presentSeq)).test(lastpart) && previousKeysMatch) |
| 166 | + { |
| 167 | + part1 = lastpart; |
| 168 | + part2 = lastpart.replace(RegExp(presentSeq), replaceSeq); |
| 169 | + break; |
| 170 | + } |
| 171 | + } |
| 172 | + var pair = new Array(part1, part2); |
| 173 | + return pair; |
| 174 | +} |
| 175 | +/** |
| 176 | + * from: http://www.javascripter.net/faq/settinga.htm |
| 177 | + */ |
| 178 | +function setCookie(cookieName,cookieValue,nDays) { |
| 179 | + var today = new Date(); |
| 180 | + var expire = new Date(); |
| 181 | + if (nDays==null || nDays==0) nDays=1; |
| 182 | + expire.setTime(today.getTime() + 3600000*24*nDays); |
| 183 | + document.cookie = cookieName+"="+escape(cookieValue)+ ";expires="+expire.toGMTString()+";path=/"; |
| 184 | +} |
| 185 | +/** |
| 186 | + * from: http://www.javascripter.net/faq/readinga.htm |
| 187 | + */ |
| 188 | +function readCookie(cookieName) { |
| 189 | + var theCookie=""+document.cookie; |
| 190 | + var ind=theCookie.indexOf(cookieName); |
| 191 | + if (ind==-1 || cookieName=="") return ""; |
| 192 | + var ind1=theCookie.indexOf(';',ind); |
| 193 | + if (ind1==-1) ind1=theCookie.length; |
| 194 | + return unescape(theCookie.substring(ind+cookieName.length+1,ind1)); |
| 195 | +} |
| 196 | + |
| 197 | +Narayam.enableTrasliteration = function(enable) { |
| 198 | + if(enable==undefined) { |
| 199 | + enable = true; |
| 200 | + } |
| 201 | + var cookieValue; |
| 202 | + Narayam.enabled = enable; |
| 203 | + var count= Narayam.elements.length; |
| 204 | + for(var i=0; i < count; i++) { |
| 205 | + var element = Narayam.elements[i]; |
| 206 | + if(!element.style) { |
| 207 | + element.style = new CSS2Properties(); |
| 208 | + } |
| 209 | + if(Narayam.enabled) { |
| 210 | + //Narayam.elementBorders[element.id] = element.style.border; |
| 211 | + element.style.border = Narayam.border; |
| 212 | + //Narayam.elementBackColors[element.id] = element.style.backgroundColor; |
| 213 | + element.style.backgroundColor = Narayam.back_color; |
| 214 | + } |
| 215 | + if(element.style && !Narayam.enabled) { |
| 216 | + //Narayam.elementBorders[element.id] = element.style.border; |
| 217 | + element.style.border = Narayam.elementBorders[element.id]; |
| 218 | + //Narayam.elementBackColors[element.id] = element.style.backgroundColor; |
| 219 | + element.style.backgroundColor = Narayam.elementBackColors[element.id]; |
| 220 | + } |
| 221 | + } |
| 222 | + if(enable) { |
| 223 | + |
| 224 | + //Narayam.temp_disable = false; |
| 225 | + cookieValue = 1; |
| 226 | + } |
| 227 | + else { |
| 228 | + cookieValue = 0; |
| 229 | + } |
| 230 | + if(Narayam.checkboxElement) { |
| 231 | + Narayam.checkboxElement.checked = enable; |
| 232 | + } |
| 233 | + setCookie(Narayam.prefix+'enabled', cookieValue); |
| 234 | +} |
| 235 | + |
| 236 | +// stop propagation of given event |
| 237 | +function stopPropagation(event) { |
| 238 | + event.cancelBubble = true; |
| 239 | + event.returnValue = false; |
| 240 | + //event.stopPropagation works in Firefox. |
| 241 | + if (event.stopPropagation) event.stopPropagation(); |
| 242 | + if(event.preventDefault) event.preventDefault(); |
| 243 | +} |
| 244 | + |
| 245 | +function shortKeyPressed(event) { |
| 246 | + var e = event || window.event; |
| 247 | + var targetElement; |
| 248 | + if(e.target) targetElement=e.target; |
| 249 | + else if(e.srcElement) targetElement=e.srcElement; |
| 250 | + var code; |
| 251 | + if (e.keyCode) code = e.keyCode; |
| 252 | + else if (e.which) code = e.which; |
| 253 | + |
| 254 | + var controlKey = false; |
| 255 | + var shiftKey = false; |
| 256 | + var altKey = false; |
| 257 | + var metaKey = false; |
| 258 | + if(e.ctrlKey) controlKey = true; |
| 259 | + if(e.shiftKey) shiftKey = true; |
| 260 | + if(e.altKey) altKey = true; |
| 261 | + if(e.metaKey) metaKey = true; |
| 262 | + var shortcut = Narayam.shortcut; |
| 263 | + // If shortkey has been specified |
| 264 | + if((shortcut.controlkey || shortcut.shiftkey || shortcut.altkey || shortcut.metakey) && |
| 265 | + (shortcut.controlkey==controlKey && shortcut.shiftkey==shiftKey && shortcut.altkey==altKey && shortcut.metakey==metaKey) && |
| 266 | + String.fromCharCode(code).toLowerCase()==shortcut.key.toLowerCase()) |
| 267 | + { |
| 268 | + Narayam.enableTrasliteration(!Narayam.enabled ); |
| 269 | + stopPropagation(e); |
| 270 | + return false; |
| 271 | + } |
| 272 | + return true; |
| 273 | +} |
| 274 | +// event listener for trasliterattion textfield |
| 275 | +// also listen for Ctrl+M combination to disable and enable trasliteration |
| 276 | +function tiKeyPressed(event) { |
| 277 | + var e = event || window.event; |
| 278 | + var keyCode; |
| 279 | + if (e.keyCode) keyCode = e.keyCode; |
| 280 | + else if (e.which) keyCode = e.which; |
| 281 | + |
| 282 | + //var charCode = e.charCode || e.keyCode; |
| 283 | + var charCode; |
| 284 | + if (e.keyCode) charCode = e.keyCode; |
| 285 | + else if (e.which) charCode = e.which; |
| 286 | + |
| 287 | + var targetElement = (e.currentTarget || e.srcElement); |
| 288 | + |
| 289 | + if (keyCode == 8 ) { |
| 290 | + Narayam.previous_sequence[targetElement.id] = ''; |
| 291 | + return true; |
| 292 | + } // Backspace |
| 293 | + // If this keystroke is a function key of any kind, do not filter it |
| 294 | + if (e.charCode == 0 || e.which ==0 ) return true; // Function key (Firefox and Opera), e.charCode for Firefox and e.which for Opera |
| 295 | + // If control or alt or meta key pressed |
| 296 | + if(e.ctrlKey || (e.altKey && !Narayam.current_scheme.extended_keyboard) || e.metaKey) { |
| 297 | + //if (navigator.userAgent.indexOf("Firefox")!=-1) { |
| 298 | + // return shortKeyPressed(event); |
| 299 | + //} |
| 300 | + return true; |
| 301 | + } |
| 302 | + if (charCode < 32) return true; // ASCII control character |
| 303 | + if(Narayam.enabled ) |
| 304 | + { |
| 305 | + |
| 306 | + var c = String.fromCharCode(charCode); |
| 307 | + var selectionRange = GetCaretPosition(targetElement); |
| 308 | + var lastSevenChars = getLastNChars(targetElement.value, selectionRange['start'], Narayam.check_str_length); |
| 309 | + var oldString; |
| 310 | + var newString; |
| 311 | + /* |
| 312 | + if(charCode ==62 && Narayam.previous_sequence[targetElement.id ].substring(Narayam.previous_sequence[targetElement.id ].length-1)=="<") |
| 313 | + { |
| 314 | + oldString = "<>"; |
| 315 | + newString = ""; |
| 316 | + Narayam.temp_disable = !Narayam.temp_disable; |
| 317 | + }*/ |
| 318 | + //else { |
| 319 | + //if(!Narayam.temp_disable) |
| 320 | + //{ |
| 321 | + var transPair; |
| 322 | + if(Narayam.current_scheme.extended_keyboard && e.altKey) { |
| 323 | + transPair = transli(lastSevenChars+c, e, Narayam.current_scheme.rules_x); |
| 324 | + } |
| 325 | + else transPair = transli(lastSevenChars+c, e, Narayam.current_scheme.rules); |
| 326 | + oldString = transPair[0]; |
| 327 | + newString = transPair[1]; |
| 328 | + //} |
| 329 | + /* |
| 330 | + else |
| 331 | + { |
| 332 | + oldString = c; |
| 333 | + newString = c; |
| 334 | + }*/ |
| 335 | + //} |
| 336 | + replaceTransStringAtCaret(targetElement, oldString.length, newString , selectionRange); |
| 337 | + Narayam.previous_sequence[targetElement.id ] += c; |
| 338 | + if(Narayam.previous_sequence[targetElement.id ].length > Narayam.check_str_length ) Narayam.previous_sequence[targetElement.id ] = Narayam.previous_sequence[targetElement.id ].substring(Narayam.previous_sequence[targetElement.id ].length-Narayam.check_str_length); |
| 339 | + stopPropagation(e); |
| 340 | + return false; |
| 341 | + } |
| 342 | + return true; |
| 343 | +} |
| 344 | + |
| 345 | +function tiKeyDown(event) { |
| 346 | + var e = event || window.event; |
| 347 | + var targetElement; |
| 348 | + if(e.target) targetElement=e.target; |
| 349 | + else if(e.srcElement) targetElement=e.srcElement; |
| 350 | + if(Narayam.current_scheme.extended_keyboard && e.altKey && !e.ctrlKey && !e.metaKey /*&& Narayam.temp_disable*/) stopPropagation(e); |
| 351 | + else if(e.ctrlKey || e.altKey || e.metaKey) { |
| 352 | + return shortKeyPressed(event); |
| 353 | + } |
| 354 | + return true; |
| 355 | +} |
| 356 | +/** |
| 357 | + * This is the function to which call during window load event for trasliterating textfields. |
| 358 | + * The funtion will accept any number of HTML tag IDs of textfields. |
| 359 | +*/ |
| 360 | +function inputRewrite(elements) { |
| 361 | + var len = elements.length; |
| 362 | + for(var i=0;i<len; i++) |
| 363 | + { |
| 364 | + var element = elements[i]; |
| 365 | + // if given element has no id set |
| 366 | + // we assing a temporary value |
| 367 | + if(element.id ==undefined || element.id.length == 0) { |
| 368 | + element.id = 'irtempid-'+Narayam.id; |
| 369 | + Narayam.id = Narayam.id + 1; |
| 370 | + } |
| 371 | + if(element) |
| 372 | + { |
| 373 | + Narayam.elements.push(element); |
| 374 | + Narayam.previous_sequence[element.id] = ''; |
| 375 | + if(element.style) { |
| 376 | + Narayam.elementBorders[element.id] = element.style.border; |
| 377 | + Narayam.elementBackColors[element.id] = element.style.backgroundColor; |
| 378 | + |
| 379 | + } |
| 380 | + if(Narayam.enabled) { |
| 381 | + element.style.border = Narayam.border; |
| 382 | + element.style.backgroundColor = Narayam.back_color |
| 383 | + } |
| 384 | + if (element.addEventListener){ |
| 385 | + element.addEventListener('keydown', tiKeyDown, false); |
| 386 | + element.addEventListener('keypress', tiKeyPressed, false); |
| 387 | + } else if (element.attachEvent){ |
| 388 | + element.attachEvent('onkeydown', tiKeyDown); |
| 389 | + element.attachEvent("onkeypress", tiKeyPressed); |
| 390 | + } |
| 391 | + } |
| 392 | + } |
| 393 | +} |
| 394 | + |
| 395 | +function transOptionOnClick(event) |
| 396 | +{ |
| 397 | + var e = event || window.event; |
| 398 | + var checkbox = (e.currentTarget || e.srcElement); |
| 399 | + if(checkbox.checked) |
| 400 | + { |
| 401 | + Narayam.enableTrasliteration(true); |
| 402 | + } |
| 403 | + else |
| 404 | + { |
| 405 | + Narayam.enableTrasliteration(false); |
| 406 | + } |
| 407 | +} |
| 408 | + |
| 409 | + |
| 410 | +function writingStyleLBChanged(event) { |
| 411 | + var e = event || window.event; |
| 412 | + var listBox = (e.currentTarget || e.srcElement); |
| 413 | + Narayam.current_scheme = Narayam.schemes[listBox.selectedIndex]; |
| 414 | + setCookie(Narayam.prefix+'default-index', listBox.selectedIndex); |
| 415 | +} |
| 416 | + |
| 417 | +// Narayam setup and initialization code |
| 418 | +Narayam.shortcut = {}; |
| 419 | +Narayam.checkbox = {}; |
| 420 | +// memory for previus key sequence |
| 421 | +Narayam.previous_sequence = {}; |
| 422 | +Narayam.elements = []; |
| 423 | +Narayam.elementBorders = {}; |
| 424 | +Narayam.elementBackColors = {}; |
| 425 | +// To generate ids for elements that have no id assigned |
| 426 | +Narayam.id = 0; |
| 427 | + |
| 428 | +// shortcut key settings |
| 429 | +Narayam.shortcut.toString = function() { |
| 430 | + var parts= []; |
| 431 | + if(this.controlkey) parts.push('Ctrl'); |
| 432 | + if(this.shiftkey) parts.push('Shift'); |
| 433 | + if(this.altkey) parts.push('Alt'); |
| 434 | + if(this.metakey) parts.push('Meta'); |
| 435 | + parts.push(this.key.toUpperCase()); |
| 436 | + return parts.join('+'); |
| 437 | +} |
| 438 | + |
| 439 | +/** |
| 440 | + * This functions is to synchronize Narayam state from cookie |
| 441 | + */ |
| 442 | +Narayam.translitStateSynWithCookie = function() { |
| 443 | + var state = parseInt(readCookie(Narayam.prefix+'enabled' )); |
| 444 | + var enable = Narayam.enabled; |
| 445 | + if(state == 1) enable=true; |
| 446 | + else if(state==0) enable =false; |
| 447 | + Narayam.enableTrasliteration(enable); |
| 448 | + var schemeIndex = parseInt(readCookie(Narayam.prefix+'default-index')); |
| 449 | + if(schemeIndex > 0 && schemeIndex < Narayam.schemes.length) { |
| 450 | + Narayam.listBox.selectedIndex = schemeIndex; |
| 451 | + } |
| 452 | + else Narayam.listBox.selectedIndex = Narayam.default_scheme_index; |
| 453 | + Narayam.current_scheme = Narayam.schemes[Narayam.listBox.selectedIndex]; |
| 454 | +} |
| 455 | +/* Settings */ |
| 456 | +Narayam.shortcut = { |
| 457 | + controlkey: false, |
| 458 | + altkey: false, |
| 459 | + shiftkey: false, |
| 460 | + metakey: false, |
| 461 | + key: '', // eg: 'M' |
| 462 | + toString: function() { |
| 463 | + var parts= []; |
| 464 | + if(Narayam.shortcut.controlkey) parts.push('Ctrl'); |
| 465 | + if(Narayam.shortcut.shiftkey) parts.push('Shift'); |
| 466 | + if(Narayam.shortcut.altkey) parts.push('Alt'); |
| 467 | + if(Narayam.shortcut.metakey) parts.push('Meta'); |
| 468 | + parts.push(Narayam.shortcut.key.toUpperCase()); |
| 469 | + return parts.join('+'); |
| 470 | + } |
| 471 | +}; |
| 472 | +Narayam.checkbox = { |
| 473 | + text: '', // eg: 'To toggle ('+ Narayam.shortcut.toString()+ ')' |
| 474 | + href: '', // eg: 'http://ml.wikipedia.org/wiki/Help:Typing' |
| 475 | + tooltip: '' // eg: 'To write Malayalam use this tool, shortcut: ('+ Narayam.shortcut.toString()+ ')' |
| 476 | +}; |
| 477 | +//Narayam.default_state = true; |
| 478 | +Narayam.schemes = []; // eg: [tr_ml, tr_ml_inscript] |
| 479 | +Narayam.default_scheme_index = 0; // eg: 0 |
| 480 | +Narayam.enabled = true; |
| 481 | +Narayam.prefix = 'narayam-'; |
| 482 | +Narayam.check_str_length = 6; |
| 483 | +Narayam.back_color = '#FDFDCD'; |
| 484 | +Narayam.border = '2px inset #FDBBBB'; |
| 485 | + |
| 486 | +Narayam.init = function() { |
| 487 | + Narayam.current_scheme = Narayam.schemes[Narayam.default_scheme_index]; |
| 488 | + this.translitStateSynWithCookie(); |
| 489 | +} |
| 490 | + |
| 491 | +Narayam.prepareMultiSchemeListBox = function() { |
| 492 | + this.listBox = document.createElement("select"); |
| 493 | + if (this.listBox.addEventListener) |
| 494 | + this.listBox.addEventListener("change", writingStyleLBChanged, false); |
| 495 | + else if (this.listBox.attachEvent) |
| 496 | + this.listBox.attachEvent("onchange", writingStyleLBChanged); |
| 497 | + var numOfSchemes = Narayam.schemes.length; |
| 498 | + for(var i=0; i < numOfSchemes; i++) { |
| 499 | + var schemeOption = document.createElement("option"); |
| 500 | + schemeOption.appendChild( document.createTextNode(Narayam.schemes[i].text) ); |
| 501 | + schemeOption.value = Narayam.schemes[i].text; |
| 502 | + if(Narayam.default_scheme_index==i) schemeOption.selected=true; |
| 503 | + this.listBox.appendChild( schemeOption ); |
| 504 | + } |
| 505 | +} |
| 506 | + |
| 507 | +Narayam.prepareCheckBoxWithLabel = function() { |
| 508 | + var checkbox = document.createElement("input"); |
| 509 | + checkbox.type = "checkbox"; |
| 510 | + checkbox.id = this.prefix+'cb'; |
| 511 | + checkbox.value = 'searchInput'; // specifying curresponding input filed. |
| 512 | + checkbox.checked = Narayam.enabled; |
| 513 | + this.checkboxElement = checkbox; |
| 514 | + |
| 515 | + if (checkbox.addEventListener) |
| 516 | + checkbox.addEventListener("click", transOptionOnClick, false); |
| 517 | + else if (checkbox.attachEvent) |
| 518 | + checkbox.attachEvent("onclick", transOptionOnClick); |
| 519 | + |
| 520 | + var label = document.createElement('label'); |
| 521 | + var linktohelp = document.createElement ('a'); |
| 522 | + linktohelp.href= this.checkbox.href; |
| 523 | + linktohelp.title= this.checkbox.tooltip; |
| 524 | + linktohelp.appendChild( document.createTextNode(this.checkbox.text) ); |
| 525 | + label.appendChild(linktohelp); |
| 526 | + |
| 527 | + this.checkboxWL = document.createElement('span'); |
| 528 | + this.checkboxWL.style.padding = 0; |
| 529 | + this.checkboxWL.id = this.prefix+'cbwl'; |
| 530 | + this.checkboxWL.style.margin = 0; |
| 531 | + this.checkboxWL.appendChild(checkbox); |
| 532 | + this.checkboxWL.appendChild(label); |
| 533 | +} |
| 534 | + |
| 535 | +function setupNarayamForvector() { |
| 536 | + Narayam.prepareMultiSchemeListBox(); |
| 537 | + Narayam.prepareCheckBoxWithLabel(); |
| 538 | + //Narayam.listBox.style.width = '10em'; |
| 539 | + Narayam.checkboxWL.style.fontSize = '80%'; |
| 540 | + var span = document.createElement("span"); |
| 541 | + span.style.position = 'absolute'; |
| 542 | + span.style.top = '1.4em'; |
| 543 | + span.style.right = '0.5em'; |
| 544 | + //span.style.right = '0em'; |
| 545 | + span.appendChild(Narayam.listBox); |
| 546 | + span.appendChild(Narayam.checkboxWL); |
| 547 | + var container = document.getElementById('p-search'); |
| 548 | + var searchform = document.getElementById('searchform'); |
| 549 | + container.insertBefore(span,searchform); |
| 550 | + //var searchInput = document.getElementById('searchInput'); |
| 551 | + Narayam.init(); |
| 552 | +} |
| 553 | +/* |
| 554 | +function setupNarayamForvector() { |
| 555 | + Narayam.prepareMultiSchemeListBox(); |
| 556 | + Narayam.prepareCheckBoxWithLabel(); |
| 557 | + Narayam.listBox.style.width = '9em'; |
| 558 | + var mwPanel = document.getElementById('mw-panel'); |
| 559 | + var pNavigation = document.getElementById('p-navigation'); |
| 560 | + var h5 = document.createElement('h5'); |
| 561 | + h5.appendChild(document.createTextNode('Narayam')); |
| 562 | + var bodyDiv = document.createElement('div'); |
| 563 | + var label = document.createElement('label'); |
| 564 | + label.appendChild(document.createTextNode('Input method:')); |
| 565 | + bodyDiv.appendChild(label); |
| 566 | + bodyDiv.appendChild(document.createElement('br')); |
| 567 | + bodyDiv.appendChild(Narayam.listBox); |
| 568 | + bodyDiv.appendChild(document.createElement('br')); |
| 569 | + bodyDiv.appendChild(Narayam.checkboxWL); |
| 570 | + bodyDiv.className = 'body'; |
| 571 | + var portalDiv = document.createElement('div'); |
| 572 | + portalDiv.className = 'portal'; |
| 573 | + portalDiv.appendChild(h5); |
| 574 | + portalDiv.appendChild(bodyDiv); |
| 575 | + mwPanel.insertBefore(portalDiv, pNavigation) |
| 576 | +}*/ |
| 577 | + |
| 578 | +function setupNarayamFormonobook() { |
| 579 | + Narayam.prepareMultiSchemeListBox(); |
| 580 | + Narayam.prepareCheckBoxWithLabel(); |
| 581 | + Narayam.listBox.style.width = '9em'; |
| 582 | + var searchform = document.getElementById('searchform'); |
| 583 | + var searchInput = document.getElementById('searchInput'); |
| 584 | + searchform.insertBefore(Narayam.listBox, searchInput); |
| 585 | + searchform.insertBefore(Narayam.checkboxWL, searchInput); |
| 586 | + Narayam.init(); |
| 587 | +} |
\ No newline at end of file |
Index: trunk/extensions/Narayam/ml_inscript_rules.js |
— | — | @@ -0,0 +1,80 @@ |
| 2 | +/** |
| 3 | + * Inscript regular expression rules table for Malayalam |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 5 | + * @date 2010-09-08 |
| 6 | + * License: GPLv3 |
| 7 | + */ |
| 8 | +if(tr_ml_inscript== undefined) var tr_ml_inscript = {}; |
| 9 | +else tr_ml_inscript = {}; |
| 10 | +tr_ml_inscript.text = "InScript"; |
| 11 | +tr_ml_inscript.description = "Malayalam InScript"; |
| 12 | + // Normal rules |
| 13 | +tr_ml_inscript.rules = [ |
| 14 | +['`', '','ൊ'], |
| 15 | +['~', '','ഓ'], |
| 16 | +['_', '','ഃ'], |
| 17 | +['=', '','ൃ'], |
| 18 | +['\\+', '','ഋ'], |
| 19 | +['\\\\', '','\u200C'], |
| 20 | +['q', '','ൗ'], |
| 21 | +['Q', '','ഔ'], |
| 22 | +['w', '','ൈ'], |
| 23 | +['W', '','ഐ'], |
| 24 | +['e', '','ാ'], |
| 25 | +['E', '','ആ'], |
| 26 | +['r', '','ീ'], |
| 27 | +['R', '','ഈ'], |
| 28 | +['t', '','ൂ'], |
| 29 | +['T', '','ഊ'], |
| 30 | +['y', '','ബ'], |
| 31 | +['Y', '','ഭ'], |
| 32 | +['u', '','ഹ'], |
| 33 | +['U', '','ങ'], |
| 34 | +['i', '','ഗ'], |
| 35 | +['I', '','ഘ'], |
| 36 | +['o', '','ദ'], |
| 37 | +['O', '','ധ'], |
| 38 | +['p', '','ജ'], |
| 39 | +['P', '','ഝ'], |
| 40 | +['\\[', '','ഡ'], |
| 41 | +['\\{', '','ഢ'], |
| 42 | +['\\]', '','\u200d'], |
| 43 | +['\\}', '','ഞ'], |
| 44 | +['a', '','ോ'], |
| 45 | +['A', '','ഓ'], |
| 46 | +['s', '','േ'], |
| 47 | +['S', '','ഏ'], |
| 48 | +['d', '','്'], |
| 49 | +['D', '','അ'], |
| 50 | +['f', '','ി'], |
| 51 | +['F', '','ഇ'], |
| 52 | +['g', '','ു'], |
| 53 | +['G', '','ഉ'], |
| 54 | +['h', '','പ'], |
| 55 | +['H', '','ഫ'], |
| 56 | +['j', '','ര'], |
| 57 | +['J', '','റ'], |
| 58 | +['k', '','ക'], |
| 59 | +['K', '','ഖ'], |
| 60 | +['l', '','ത'], |
| 61 | +['L', '','ഥ'], |
| 62 | +[';', '','ച'], |
| 63 | +[':', '','ഛ'], |
| 64 | +['\'', '','ട'], |
| 65 | +['"', '','ഠ'], |
| 66 | +['z', '','െ'], |
| 67 | +['Z', '','എ'], |
| 68 | +['x', '','ം'], |
| 69 | +['c', '','മ'], |
| 70 | +['C', '','ണ'], |
| 71 | +['v', '','ന'], |
| 72 | +['V', '', 'ഒ'], |
| 73 | +['b', '','വ'], |
| 74 | +['B', '','ഴ'], |
| 75 | +['n', '','ല'], |
| 76 | +['N', '','ള'], |
| 77 | +['m', '','സ'], |
| 78 | +['M', '','ശ'], |
| 79 | +['<', '','ഷ'], |
| 80 | +['/', '','യ'] |
| 81 | +]; |
\ No newline at end of file |
Index: trunk/extensions/Narayam/sa_rules.js |
— | — | @@ -0,0 +1,158 @@ |
| 2 | +/** |
| 3 | + * Trasliteration regular expression rules table for Sanskrit |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 5 | + * @date 2010-10-12 |
| 6 | + * License: GPLv3, CC-BY-SA 3.0 |
| 7 | + */ |
| 8 | +if(tr_sa== undefined) var tr_sa = {}; |
| 9 | +else tr_sa = {}; |
| 10 | +tr_sa.text = "Transliteration"; |
| 11 | +tr_sa.description = "Sanskrit transliteration"; |
| 12 | + // Normal rules |
| 13 | +tr_sa.rules = [ |
| 14 | +['क्h','c','च्'], |
| 15 | +['\\\\([A-Za-z\\>_~\\.0-9])','\\\\','$2'], |
| 16 | + |
| 17 | +['([क-ह]़?)्a', '','$2'], |
| 18 | +['([क-ह]़?)्A', '','$2ा'], |
| 19 | +['([क-ह]़?)a', '','$2ा'], |
| 20 | +['([क-ह]़?)्i', '','$2ि'], |
| 21 | +['([क-ह]़?)(्I|िi|ॆe)', '','$2ी'], |
| 22 | +['([क-ह]़?)्u', '','$2ु'], |
| 23 | +['([क-ह]़?)(ुu|्U|ॊo)', '','$2ू'], |
| 24 | +['([क-ह]़?)्R', '','$2ृ'], |
| 25 | +['([क-ह]़?)ृR', '','$2ॄ'], |
| 26 | +['([क-ह]़?)्ळ्l', '','$2ॢ'], |
| 27 | +['([क-ह]़?)ॢl', '','$2ॣ'], |
| 28 | +['([क-ह]़?)ॆ\\^', '','$2ॅ'], |
| 29 | +['([क-ह]़?)्e', '','$2ॆ'], |
| 30 | +['([क-ह]़?)्E', '','$2े'], |
| 31 | +['([क-ह]़?)ॊ\\^', '','$2ॉ'], |
| 32 | +['([क-ह]़?)i', '','$2ै'], |
| 33 | +['([क-ह]़?)्o', '','$2ॊ'], |
| 34 | +['([क-ह]़?)्O', '','$2ो'], |
| 35 | +['([क-ह]़?)u', '','$2ौ'], |
| 36 | +['([क-ह]़?)ृa', '','$2्ऱ'], |
| 37 | +['([क-ह]़?)ृA', '','$2्ऱा'], |
| 38 | +['([क-ह]़?)ृi', '','$2्ऱि'], |
| 39 | +['([क-ह]़?)ृI', '','$2्ऱी'], |
| 40 | +['([क-ह]़?)ृu', '','$2्ऱु'], |
| 41 | +['([क-ह]़?)ृU', '','$2्ऱू'], |
| 42 | +['([क-ह]़?)ृ\\^', '','$2्ऱॅ'], |
| 43 | +['([क-ह]़?)ृe', '','$2्ऱॆ'], |
| 44 | +['([क-ह]़?)ृE', '','$2्ऱे'], |
| 45 | +['([क-ह]़?)ृo', '','$2्ऱॊ'], |
| 46 | +['([क-ह]़?)ृO', '','$2्ऱो'], |
| 47 | +['([क-ह]़?)ृ\\~', '','$2्ऱ्'], |
| 48 | +['([क-ह])्\\`', '','$2़्'], |
| 49 | + |
| 50 | +['अa', '','आ'], |
| 51 | +['(ऒo|उu)', '','ऊ'], |
| 52 | +['ऎ\\^', '','ऍ'], |
| 53 | +['अi', '','ऐ'], |
| 54 | +['अ\\^', '','ॲ'], |
| 55 | +['(इi|ऎe)', '','ई'], |
| 56 | +['ऒ\\^', '','ऑ'], |
| 57 | +['अu', '','औ'], |
| 58 | +['ऋR', '','ॠ'], |
| 59 | +['ळ्l', '','ऌ'], |
| 60 | +['ऌl', '','ॡ'], |
| 61 | +['ं\\^', '','ँ'], |
| 62 | +['ंm', '','ँ'], |
| 63 | +['ओM', '','ॐ'], |
| 64 | + |
| 65 | +['क्h', '','ख्'], |
| 66 | +['ग्h', '','घ्'], |
| 67 | +['न्g', '','ङ्'], |
| 68 | +['च्h', '','छ्'], |
| 69 | +['ज्h', '','झ्'], |
| 70 | +['न्j', '','ञ्'], |
| 71 | +['ट्h', '','ठ्'], |
| 72 | +['ड्h', '','ढ्'], |
| 73 | +['त्h', '','थ्'], |
| 74 | +['द्h', '','ध्'], |
| 75 | +['प्h', '','फ्'], |
| 76 | +['ब्h', '','भ्'], |
| 77 | +['ऋa', '','ऱ'], |
| 78 | +['ऋA', '','ऱा'], |
| 79 | +['ऋi', '','ऱि'], |
| 80 | +['ऋI', '','ऱी'], |
| 81 | +['ऋu', '','ऱु'], |
| 82 | +['ऋU', '','ऱू'], |
| 83 | +['ऋ\\^', '','ऱॅ'], |
| 84 | +['ऋe', '','ऱॆ'], |
| 85 | +['ऋE', '','ऱे'], |
| 86 | +['ऋo', '','ऱॊ'], |
| 87 | +['ऋO', '','ऱो'], |
| 88 | +['ऋ\\~', '','ऱ्'], |
| 89 | + |
| 90 | +['स्h', '','ष्'], |
| 91 | +['क़्h', '','ख़्'], |
| 92 | +['ज़्h', '','ऴ्'], |
| 93 | +['।\\.', '','॥'], |
| 94 | + |
| 95 | +['a', '','अ'], |
| 96 | +['b', '','ब्'], |
| 97 | +['c', '','क्'], |
| 98 | +['d', '','द्'], |
| 99 | +['e', '','ऎ'], |
| 100 | +['(f|F)', '','फ़्'], |
| 101 | +['g', '','ग्'], |
| 102 | +['h', '','ह्'], |
| 103 | +['i', '','इ'], |
| 104 | +['j', '','ज्'], |
| 105 | +['k', '','क्'], |
| 106 | +['l', '','ल्'], |
| 107 | +['m', '','म्'], |
| 108 | +['n', '','न्'], |
| 109 | +['o', '','ऒ'], |
| 110 | +['p', '','प्'], |
| 111 | +['q', '','क़्'], |
| 112 | +['r', '','र्'], |
| 113 | +['s', '','स्'], |
| 114 | +['t', '','त्'], |
| 115 | +['u', '','उ'], |
| 116 | +['(v|w)', '','व्'], |
| 117 | +['x', '','क्ष्'], |
| 118 | +['y', '','य्'], |
| 119 | +['(z|Z)', '','ज़्'], |
| 120 | +['A', '','आ'], |
| 121 | +['B', '','ब्ब्'], |
| 122 | +['C', '','क्क्'], |
| 123 | +['D', '','ड्'], |
| 124 | +['E', '','ए'], |
| 125 | +//'F', '','फ्'], |
| 126 | +['G', '','ग्ग्'], |
| 127 | +['H', '','ः'], |
| 128 | +['I', '','ई'], |
| 129 | +['J', '','ज्ज्'], |
| 130 | +['K', '','क्क्'], |
| 131 | +['L', '','ळ्'], |
| 132 | +['M', '','ं'], |
| 133 | +['N', '','ण्'], |
| 134 | +['O', '','ओ'], |
| 135 | +['P', '','प्प्'], |
| 136 | +//'Q', '','अ'], |
| 137 | +['R', '','ऋ'], |
| 138 | +['S', '','श्'], |
| 139 | +['T', '','ट्'], |
| 140 | +['U', '','ऊ'], |
| 141 | +['(V|W)', '','व्व्'], |
| 142 | +['X', '','क्ष्'], |
| 143 | +['Y', '','य्य्'], |
| 144 | +//'z', '','अ' |
| 145 | +['0', '','०'], |
| 146 | +['1', '','१'], |
| 147 | +['2', '','२'], |
| 148 | +['3', '','३'], |
| 149 | +['4', '','४'], |
| 150 | +['5', '','५'], |
| 151 | +['6', '','६'], |
| 152 | +['7', '','७'], |
| 153 | +['8', '','८'], |
| 154 | +['9', '','९'], |
| 155 | +['~', '','्'], |
| 156 | +['\\.', '','।'], |
| 157 | +['//', '','ऽ'], |
| 158 | +['\\`', '','़'] |
| 159 | +]; |
\ No newline at end of file |
Index: trunk/extensions/Narayam/ta_rules.js |
— | — | @@ -0,0 +1,106 @@ |
| 2 | +/** |
| 3 | + * Trasliteration regular expression rules table for Tamil |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 5 | + * @date 2010-11-21 |
| 6 | + * License: GPLv3, CC-BY-SA 3.0 |
| 7 | + */ |
| 8 | +if(tr_ta== undefined) var tr_ta = {}; |
| 9 | +else tr_ta = {}; |
| 10 | +tr_ta.text = "எழுத்துபெயர்ப்பு"; |
| 11 | +tr_ta.description = "Tamil transliteration"; |
| 12 | + // Normal rules |
| 13 | +tr_ta.rules = [ |
| 14 | +['ச்h','h','ச்ஹ்',], |
| 15 | +['ழ்h','h','ழ்ஹ்',], |
| 16 | + |
| 17 | + //'(ஸ்ரிi|ஸ்ர்I)', '','', |
| 18 | + |
| 19 | +['([க-ஹ])்a', '','$2'], |
| 20 | +['([க-ஹ])(்A|a)', '','$2ா'], |
| 21 | +['([க-ஹ])்i', '','$2ி'], |
| 22 | +['([க-ஹ])(்I|ிi)', '','$2ீ'], |
| 23 | +['([க-ஹ])்u', '','$2ு'], |
| 24 | +['([க-ஹ])(்U|ுu)', '','$2ூ'], |
| 25 | +['([க-ஹ])்e', '','$2ெ'], |
| 26 | +['([க-ஹ])(்E|ெe)', '','$2ே'], |
| 27 | +['([க-ஹ])i', '','$2ை'], |
| 28 | +['([க-ஹ])்o', '','$2ொ'], |
| 29 | +['([க-ஹ])(்O|ொo)', '','$2ோ'], |
| 30 | +['([க-ஹ])u', '','$2ௌ'], |
| 31 | + |
| 32 | +['([அ-ஹ][ெ-்]?)n', '','$2ன்'], |
| 33 | + |
| 34 | +['அa', '','ஆ'], |
| 35 | +['இi', '','ஈ'], |
| 36 | +['உu', '','ஊ'], |
| 37 | +['எe', '','ஏ'], |
| 38 | +['அi', '','ஐ'], |
| 39 | +['ஒo', '','ஓ'], |
| 40 | +['அu', '','ஔ'], |
| 41 | + |
| 42 | +['(ந்|ன்)g', '','ங்'], |
| 43 | +['(ந்|ன்)j', '','ஞ்'], |
| 44 | +['ச்h', '','ச்'], |
| 45 | +['ழ்h', '','ழ்'], |
| 46 | +['ட்h', '','த்'], |
| 47 | +['ஸ்h', '','ஷ்'], |
| 48 | + |
| 49 | +['a', '','அ'], |
| 50 | +['c', '','ச்'], |
| 51 | +['d', '','ட்'], |
| 52 | +['e', '','எ'], |
| 53 | +['h', '','ஹ்'], |
| 54 | +['i', '','இ'], |
| 55 | +['j', '','ஜ்'], |
| 56 | +['k', '','க்'], |
| 57 | +['l', '','ல்'], |
| 58 | +['m', '','ம்'], |
| 59 | +['n', '','ந்'], |
| 60 | +['o', '','ஒ'], |
| 61 | +['p', '','ப்'], |
| 62 | +['q', '','ஃ'], |
| 63 | +['r', '','ர்'], |
| 64 | +['s', '','ச்'], |
| 65 | +['t', '','ட்'], |
| 66 | +['u', '','உ'], |
| 67 | +['v', '','வ்'], |
| 68 | +['w', '','ந்'], |
| 69 | +['y', '','ய்'], |
| 70 | +['z', '','ழ்'], |
| 71 | +['A', '','ஆ'], |
| 72 | + |
| 73 | +['C', '','க்க்'], |
| 74 | +['E', '','ஏ'], |
| 75 | +['H', '','ஃ'], |
| 76 | +['I', '','ஈ'], |
| 77 | +['J', '','ஜ்ஜ்'], |
| 78 | +['K', '','க்'], |
| 79 | +['L', '','ள்'], |
| 80 | +['M', '','ம்ம்'], |
| 81 | +['N', '','ண்'], |
| 82 | +['O', '','ஓ'], |
| 83 | +['P', '','ப்ப்'], |
| 84 | +['R', '','ற்'], |
| 85 | +['S', '','ஸ்'], |
| 86 | +['T', '','ட்'], |
| 87 | +['U', '','ஊ'], |
| 88 | +['(V|W)', '','வ்வ்'], |
| 89 | +['Y', '','ய்ய்'], |
| 90 | +['Z', '','ஶ்'], |
| 91 | + |
| 92 | +['~', '','்'], |
| 93 | + |
| 94 | +['\\\\0', '','\u0be6'], |
| 95 | +['\\\\1', '','௧'], |
| 96 | +['\\\\2', '','௨'], |
| 97 | +['\\\\3', '','௩'], |
| 98 | +['\\\\4', '','௪'], |
| 99 | +['\\\\5', '','௫'], |
| 100 | +['\\\\6', '','௬'], |
| 101 | +['\\\\7', '','௭'], |
| 102 | +['\\\\8', '','௮'], |
| 103 | +['\\\\9', '','௯'], |
| 104 | +['10\\\\', '','\u0BF0'], |
| 105 | +['100\\\\', '','\u0BF1'], |
| 106 | +['1000\\\\', '','\u0BF2'] |
| 107 | +]; |
\ No newline at end of file |
Index: trunk/extensions/Narayam/bn_avro_rules.js |
— | — | @@ -0,0 +1,163 @@ |
| 2 | +/** |
| 3 | + * Avro layout regular expression rules table for Bengali script |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 5 | + * @date 2010-12-05 |
| 6 | + * License: GPLv3, CC-BY-SA 3.0 |
| 7 | + */ |
| 8 | +if(tr_bn_avro== undefined) var tr_bn_avro = {}; |
| 9 | +else tr_bn_avro = {}; |
| 10 | +tr_bn_avro.text = "Avro"; |
| 11 | +tr_bn_avro.description = "Avro transliteration scheme for Begnali"; |
| 12 | +// Normal rules |
| 13 | +tr_bn_avro.rules = [ |
| 14 | +['([ক-হড়ঢ়য়])্?ররi','[^o`]', '$2ৃ'], |
| 15 | +['ররi','[^o`]', 'ঋ'], |
| 16 | + |
| 17 | +['(([ক-হড়ঢ়য়])|য়)o','[^o`]', '$2'], // য় cannot be included in the range, why? everywhere else it is OK! |
| 18 | +['([ক-হড়ঢ়য়])a','[^o`]', '$2া'], |
| 19 | +['([ক-হড়ঢ়য়])i','[^o`]', '$2ি'], |
| 20 | +['([ক-হড়ঢ়য়])I','[^o`]', '$2ী'], |
| 21 | +['([ক-হড়ঢ়য়])u','[^o`]', '$2ু'], |
| 22 | +['([ক-হড়ঢ়য়])U','[^o`]', '$2ূ'], |
| 23 | +['([ক-হড়ঢ়য়])o','[o`]', '$2ু'], |
| 24 | +['([ক-হড়ঢ়য়])e','[^o`]', '$2ে'], |
| 25 | +['([ক-হড়ঢ়য়])োI','[^o`]', '$2ৈ'], |
| 26 | +['([ক-হড়ঢ়য়])O','[^o`]', '$2ো'], |
| 27 | +['([ক-হড়ঢ়য়])োU','[^o`]', '$2ৌ'], |
| 28 | + |
| 29 | +//'চচh','[^o`]', 'চ্চ'], |
| 30 | + |
| 31 | +['([কঙলষস])(k|K)','[^o`]','$2্ক'], |
| 32 | +['([ঙদল])(g|G)','[^o`]','$2্গ'], |
| 33 | +['গg','[^o`]','জ্ঞ'], |
| 34 | +['([চশ])c','[^o`]','$2্চ'], |
| 35 | +['([জঞব])j','[^o`]','$2্জ'], |
| 36 | +['নj','[^o`]','ঞ্জ'], |
| 37 | +['([কটণনপলষস])T','[^o`]','$2্ট'], |
| 38 | +['([ডণনল])D','[^o`]','$2্ড'], |
| 39 | +['([গষহ])N','[^o`]','$2্ণ'], |
| 40 | +['([কতনপশসহ])t','[^o`]','$2্ত'], |
| 41 | +['([দনব])d','[^o`]','$2্দ'], |
| 42 | +['([গঘণতধনপমশসহ])n','[^o`]','$2্ন'], |
| 43 | +['([পমলস])p','[^o`]','$2্প'], |
| 44 | +['([বমল])b','[^o`]','$2্ব'], |
| 45 | +['([দম])(v|V)','[^o`]','$2্ভ'], |
| 46 | +['([কগঙটণতদধনমলশষসহ])m','[^o`]','$2্ম'], |
| 47 | +['([ক-ঘচ-ঝট-যলশ-হড়ঢ়য়])r','[^o`]','$2্র'], |
| 48 | +['([কগপ-বমলশসহ])l','[^o`]','$2্ল'], |
| 49 | +['([কনপ])s','[^o`]','$2্স'], |
| 50 | +['([ক-হড়ঢ়য়])w','[^o`]','$2্ব'], |
| 51 | +['([ক-হড়ঢ়য়])y','[^o`]','$2্য'], |
| 52 | +['নc','[^o`]','ঞ্চ'], |
| 53 | + |
| 54 | +['ত`','`' ,'ৎ'], |
| 55 | + |
| 56 | +['ক্ক(h|H)','[^o`]','ক্ষ'], |
| 57 | +['কশ(h|H)','[^o`]','ক্ষ'], |
| 58 | +//'([অ-ঔা-ৌ])ররk','[^o]','$2র্ক'], |
| 59 | + |
| 60 | +['ররk','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ক'], |
| 61 | +['ররg','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্গ'], |
| 62 | +['ররc','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্চ'], |
| 63 | +['ররj','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্জ'], |
| 64 | +['ররT','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ট'], |
| 65 | +['ররD','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ড'], |
| 66 | +['ররN','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ণ'], |
| 67 | +['ররt','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ত'], |
| 68 | +['ররd','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্দ'], |
| 69 | +['ররn','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ন'], |
| 70 | +['ররp','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্প'], |
| 71 | +['ররf','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ফ'], |
| 72 | +['ররb','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ব'], |
| 73 | +['ররv','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ভ'], |
| 74 | +['ররm','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ম'], |
| 75 | +['ররz','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্য'], |
| 76 | +['ররl','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ল'], |
| 77 | +['ররS','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্শ'], |
| 78 | +['ররs','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্স'], |
| 79 | +['ররh','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্হ'], |
| 80 | +['ররR','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্ড়'], |
| 81 | +['রর(y|Y)','(o|a|i|I|u|U|e|O|OI|OU|rri)rr','র্য়'], |
| 82 | + |
| 83 | +['শ(h|H)','S', 'ষ'], |
| 84 | + |
| 85 | +['অo','[^`]', 'উ'], |
| 86 | +['এe','[^o`]', 'ঈ'], |
| 87 | + |
| 88 | +['কh','[^o`]', 'খ'], |
| 89 | +['গh','[^o`]', 'ঘ'], |
| 90 | +['ণg','[^o`]', 'ঙ'], |
| 91 | +['চh','[^o`]', 'ছ'], |
| 92 | +['জh','[^o`]', 'ঝ'], |
| 93 | +['ণG','[^o`]', 'ঞ'], |
| 94 | +['টh','[^o`]', 'ঠ'], |
| 95 | +['ডh','[^o`]', 'ঢ'], |
| 96 | +['তh','[^o`]', 'থ'], |
| 97 | +['দh','[^o`]', 'ধ'], |
| 98 | +['পh','[^o`]', 'ফ'], |
| 99 | +['বh','[^o`]', 'ভ'], |
| 100 | +['(সh)','[^o`]', 'শ'], |
| 101 | +['ড়h','[^o`]', 'ঢ়'], |
| 102 | +['ত্`','[^o`]', 'ৎ'], |
| 103 | +['নg','[^o`]', 'ং'], |
| 104 | +['ঃ`','[^o`]', ':'], |
| 105 | +['ররi','[^o`]', 'ঋ'], |
| 106 | +['ওI','[^o`]', 'ঐ'], |
| 107 | +['ওU','[^o`]', 'ঔ'], |
| 108 | + |
| 109 | +['(k|K)','' ,'ক'], |
| 110 | +['(g|G)','' ,'গ'], |
| 111 | +['(c|C)','' ,'চ'], |
| 112 | +['j','' ,'জ'], |
| 113 | +['T','' ,'ট'], |
| 114 | +['D','' ,'ড'], |
| 115 | +['N','' ,'ণ'], |
| 116 | +['t','' ,'ত'], |
| 117 | +['d','' ,'দ'], |
| 118 | +['n','' ,'ন'], |
| 119 | +['(p|P)','' ,'প'], |
| 120 | +['f','' ,'ফ'], |
| 121 | +['(b|B)','' ,'ব'], |
| 122 | +['(v|V)','' ,'ভ'], |
| 123 | +['(m|M)','' ,'ম'], |
| 124 | +['z','' ,'য'], |
| 125 | +['r','' ,'র'], |
| 126 | +['(l|L)','' ,'ল'], |
| 127 | +['S','' ,'শ'], |
| 128 | +['s','' ,'স'], |
| 129 | +['(h|H)','' ,'হ'], |
| 130 | +['R','' ,'ড়'], |
| 131 | +['(y|Y)','' ,'য়'], |
| 132 | + |
| 133 | +['Z','' ,'্য'], |
| 134 | + |
| 135 | +['o','' ,'অ'], |
| 136 | +['(a|A)','' ,'আ'], |
| 137 | +['i','' ,'ই'], |
| 138 | +['I','' ,'ঈ'], |
| 139 | +['u','' ,'উ'], |
| 140 | +['U','' ,'ঊ'], |
| 141 | +['e','' ,'এ'], |
| 142 | +['O','' ,'ও'], |
| 143 | + |
| 144 | +['0','' ,'০'], |
| 145 | +['1','' ,'১'], |
| 146 | +['2','' ,'২'], |
| 147 | +['3','' ,'৩'], |
| 148 | +['4','' ,'৪'], |
| 149 | +['5','' ,'৫'], |
| 150 | +['6','' ,'৬'], |
| 151 | +['7','' ,'৭'], |
| 152 | +['8','' ,'৮'], |
| 153 | +['9','' ,'৯'], |
| 154 | + |
| 155 | +['\\\\\\.','' ,'.'], |
| 156 | + |
| 157 | +[',,','' ,'্'], |
| 158 | +['\\:','' ,'ঃ'], |
| 159 | +['\\^','' ,'ঁ'], |
| 160 | +['\\.','' ,'।'], |
| 161 | +['\\$','' ,'৳'], |
| 162 | +['ঃ`','' ,':'], |
| 163 | +['`','' ,''] |
| 164 | +]; |
\ No newline at end of file |
Index: trunk/extensions/Narayam/ta99_rules.js |
— | — | @@ -0,0 +1,186 @@ |
| 2 | +/** |
| 3 | + * Regular expression rules table for Tamil 99 input method |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 5 | + * @date 2010-11-20 |
| 6 | + * License: GPLv3, CC-BY-SA 3.0 |
| 7 | + */ |
| 8 | +if(tr_ta99== undefined) var tr_ta99 = {}; |
| 9 | +else tr_ta99 = {}; |
| 10 | +tr_ta99.text = "தமிழ்99"; |
| 11 | +tr_ta99.description = "Tamil99 input method"; |
| 12 | + // Normal rules |
| 13 | +tr_ta99.rules = [ |
| 14 | +['([க-ஹ])h','a', '$2க'], |
| 15 | +['([க-ஹ])b','a', '$2ங'], |
| 16 | +['([க-ஹ])\\[','a', '$2ச'], |
| 17 | +['([க-ஹ])E','a', '$2ஜ'], |
| 18 | +['([க-ஹ])\\]','a', '$2ஞ'], |
| 19 | +['([க-ஹ])o','a', '$2ட'], |
| 20 | +['([க-ஹ])p','a', '$2ண'], |
| 21 | +['([க-ஹ])l','a', '$2த'], |
| 22 | +['([க-ஹ]);','a', '$2ந'], |
| 23 | +['([க-ஹ])i','a', '$2ன'], |
| 24 | +['([க-ஹ])j','a', '$2ப'], |
| 25 | +['([க-ஹ])k','a', '$2ம'], |
| 26 | +["([க-ஹ])'",".*a$", '$2ய'], |
| 27 | +['([க-ஹ])m','a', '$2ர'], |
| 28 | +['([க-ஹ])u','a', '$2ற'], |
| 29 | +['([க-ஹ])n','a', '$2ல'], |
| 30 | +['([க-ஹ])y','a', '$2ள'], |
| 31 | +['([க-ஹ])/','a', '$2ழ'], |
| 32 | +['([க-ஹ])v','a', '$2வ'], |
| 33 | +// void |
| 34 | +['([க-ஹ])W','a', '$2ஷ'], |
| 35 | +['([க-ஹ])Q','a', '$2ஸ'], |
| 36 | +['([க-ஹ])R','a', '$2ஹ'], |
| 37 | + |
| 38 | + |
| 39 | +['க்கh', '','க்கக்'], |
| 40 | +['ங்ஙb', '','ங்ஙங்'], |
| 41 | +['ச்ச\\[', '','ச்சச்'], |
| 42 | +['ஜ்ஜE', '','ஜ்ஜஜ்'], |
| 43 | +['ஞ்ஞ\\]', '','ஞ்ஞஞ்'], |
| 44 | +['ட்டo', '','ட்டட்'], |
| 45 | +['ண்ணp', '','ண்ணண்'], |
| 46 | +['த்தl', '','த்தத்'], |
| 47 | +['ந்ந;', '','ந்நந்'], |
| 48 | +['ன்னi', '','ன்னன்'], |
| 49 | +['ப்பj', '','ப்பப்'], |
| 50 | +['ம்மk', '','ம்மம்'], |
| 51 | +["ய்ய'$", '','ய்யய்'], |
| 52 | +['ர்ரm', '','ர்ரர்'], |
| 53 | +['ற்றu', '','ற்றற்'], |
| 54 | +['ல்லn', '','ல்லல்'], |
| 55 | +['ள்ளy', '','ள்ளள்'], |
| 56 | +['ழ்ழ/', '','ழ்ழழ்'], |
| 57 | +['வ்வv', '','வ்வவ்'], |
| 58 | +// void |
| 59 | +['ஷ்ஷW', '','ஷ்ஷஷ்'], |
| 60 | +['ஸ்ஸQ', '','ஸ்ஸஸ்'], |
| 61 | +['ஹ்ஹR', '','ஹ்ஹஹ்'], |
| 62 | + |
| 63 | +['([க-ஹ])q', '','$2ா'], |
| 64 | +['([க-ஹ])s', '','$2ி'], |
| 65 | +['([க-ஹ])w', '','$2ீ'], |
| 66 | +['([க-ஹ])d', '','$2ு'], |
| 67 | +['([க-ஹ])e', '','$2ூ'], |
| 68 | +['([க-ஹ])g', '','$2ெ'], |
| 69 | +['([க-ஹ])t', '','$2ே'], |
| 70 | +['([க-ஹ])r', '','$2ை'], |
| 71 | +['([க-ஹ])c', '','$2ொ'], |
| 72 | +['([க-ஹ])x', '','$2ோ'], |
| 73 | +['([க-ஹ])z', '','$2ௌ'], |
| 74 | + |
| 75 | +['([க-ஹ])a', '','$2'], |
| 76 | + |
| 77 | +['கh', '','க்க'], |
| 78 | +['ஙb', '','ங்ங'], |
| 79 | +['ச\\[', '','ச்ச'], |
| 80 | +['ஜE', '','ஜ்ஜ'], |
| 81 | +['ஞ\\]', '','ஞ்ஞ'], |
| 82 | +['டo', '','ட்ட'], |
| 83 | +['ணp', '','ண்ண'], |
| 84 | +['தl', '','த்த'], |
| 85 | +['ந;', '','ந்ந'], |
| 86 | +['னi', '','ன்ன'], |
| 87 | +['பj', '','ப்ப'], |
| 88 | +['மk', '','ம்ம'], |
| 89 | +["ய'$", '','ய்ய'], |
| 90 | +['ரm', '','ர்ர'], |
| 91 | +['றu', '','ற்ற'], |
| 92 | +['லn', '','ல்ல'], |
| 93 | +['ளy', '','ள்ள'], |
| 94 | +['ழ/', '','ழ்ழ'], |
| 95 | +['வv', '','வ்வ'], |
| 96 | +// void |
| 97 | +['ஷW', '','ஷ்ஷ'], |
| 98 | +['ஸQ', '','ஸ்ஸ'], |
| 99 | +['ஹR', '','ஹ்ஹ'], |
| 100 | + |
| 101 | +['நl', '','ந்த'], |
| 102 | +['ஙh', '','ங்க'], |
| 103 | +['னu', '','ன்ற'], |
| 104 | +['ணo', '','ண்ட'], |
| 105 | +['ஞ\\[', '','ஞ்ச'], |
| 106 | +['மj', '','ம்ப'], |
| 107 | + |
| 108 | +['q', '','ஆ'], |
| 109 | +['w', '','ஈ'], |
| 110 | +['e', '','ஊ'], |
| 111 | +['r', '','ஐ'], |
| 112 | +['t', '','ஏ'], |
| 113 | +['y', '','ள'], |
| 114 | +['u', '','ற'], |
| 115 | +['i', '','ன'], |
| 116 | +['o', '','ட'], |
| 117 | +['p', '','ண'], |
| 118 | +['\\[', '','ச'], |
| 119 | +['\\]', '','ஞ'], |
| 120 | + |
| 121 | +['a', '','அ'], |
| 122 | +['s', '','இ'], |
| 123 | +['d', '','உ'], |
| 124 | +['f', '','்'], |
| 125 | +['g', '','எ'], |
| 126 | +['h', '','க'], |
| 127 | +['j', '','ப'], |
| 128 | +['k', '','ம'], |
| 129 | +['l', '','த'], |
| 130 | +[';', '','ந'], |
| 131 | +["'", '','ய'], |
| 132 | + |
| 133 | +['z', '','ஔ'], |
| 134 | +['x', '','ஓ'], |
| 135 | +['c', '','ஒ'], |
| 136 | +['v', '','வ'], |
| 137 | +['b', '','ங'], |
| 138 | +['n', '','ல'], |
| 139 | +['m', '','ர'], |
| 140 | +//',', '','ஆ'], |
| 141 | +//'\\.', '','ஆ'], |
| 142 | +['/', '','ழ'], |
| 143 | + |
| 144 | +['Q', '','ஸ'], |
| 145 | +['W', '','ஷ'], |
| 146 | +['E', '','ஜ'], |
| 147 | +['R', '','ஹ'], |
| 148 | +['T', '','க்ஷ'], |
| 149 | +['Y', '','ஸ்ரீ'], |
| 150 | +['U', '','ற'], |
| 151 | +['I', '','ன'], |
| 152 | +['O', '','['], |
| 153 | +['P', '',']'], |
| 154 | +//'\\{', '','ஆ'], |
| 155 | +//'\\}', '','ஆ'], |
| 156 | + |
| 157 | +['A', '','௹'], |
| 158 | +['S', '','௺'], |
| 159 | +['D', '','௸'], |
| 160 | +['F', '','ஃ'], |
| 161 | +['G', '','எ'], |
| 162 | +['H', '','க'], |
| 163 | +['J', '','ப'], |
| 164 | +['K', '','"'], |
| 165 | +['L', '',','], |
| 166 | +['\\:', '',';'], |
| 167 | +['"', '',"'"], |
| 168 | + |
| 169 | +['Z', '','௳'], |
| 170 | +['X', '','௴'], |
| 171 | +['C', '','௵'], |
| 172 | +['V', '','௶'], |
| 173 | +['B', '','௷'], |
| 174 | +['N', '','ல'], |
| 175 | +['M', '','ர'], |
| 176 | + |
| 177 | +['\\\\0', '','\u0be6'], |
| 178 | +['\\\\1', '','௧'], |
| 179 | +['\\\\2', '','௨'], |
| 180 | +['\\\\3', '','௩'], |
| 181 | +['\\\\4', '','௪'], |
| 182 | +['\\\\5', '','௫'], |
| 183 | +['\\\\6', '','௬'], |
| 184 | +['\\\\7', '','௭'], |
| 185 | +['\\\\8', '','௮'], |
| 186 | +['\\\\9', '','௯'] |
| 187 | +]; |
Index: trunk/extensions/Narayam/Narayam.i18n.php |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation file for extension Narayam |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + * @author Junaid P V <http://junaidpv.in> |
| 8 | + * @copyright 2010 Junaid P V |
| 9 | + * @license GNU General Public Licence 3.0 or later |
| 10 | + */ |
| 11 | + |
| 12 | +$messages = array(); |
| 13 | + |
| 14 | +/** English |
| 15 | + * @author Junaid P V |
| 16 | + */ |
| 17 | +$messages['en'] = array( |
| 18 | + 'narayam-toggle-ime' => 'To toggle IM', |
| 19 | + 'narayam-help-page' => 'Help:Typing', |
| 20 | + 'narayam-checkbox-tooltip' => 'To toggle input method On and Off', |
| 21 | + 'narayam-ml' => 'Malayalam Transliteration', |
| 22 | + 'narayam-ml-inscript' => 'Malayalam InScript', |
| 23 | + 'narayam-sa' => 'Sanskrit Transliteration', |
| 24 | + 'narayam-ta99' => 'Tamil99', |
| 25 | + 'narayam-ta' => 'Tamil Transliteration', |
| 26 | + 'narayam-bn-avro' => 'Bengali Avro', |
| 27 | + 'narayam-bn-inscript' => 'Bengali InScript', |
| 28 | + 'narayam-bn-nkb' => 'Bengali NKB', |
| 29 | +); |
| 30 | + |
| 31 | +/** Malayalam |
| 32 | + * @author Junaid P V |
| 33 | + */ |
| 34 | +$messages['ml'] = array( |
| 35 | + 'narayam-toggle-ime' => 'ഇൻപുട്ട് മെത്തേഡ്', |
| 36 | + 'narayam-help-page' => 'Help:എഴുത്ത്', |
| 37 | + 'narayam-checkbox-tooltip' => 'ഇൻപുട്ട് മെത്തേഡ് നിയന്ത്രിക്കാൻ ഇതുപയോഗിക്കുക', |
| 38 | + 'narayam-ml' => 'മലയാളം ലിപ്യന്തരണം', |
| 39 | + 'narayam-ml-inscript' => 'മലയാളം ഇൻസ്ക്രിപ്റ്റ്', |
| 40 | + 'narayam-sa' => 'സംസ്കൃതം ലിപ്യന്തരണം', |
| 41 | + 'narayam-ta99' => 'തമിഴ്99', |
| 42 | + 'narayam-ta' => 'തമിഴ് ലിപ്യന്തരണം', |
| 43 | + 'narayam-bn-avro' => 'ബംഗാളി അവ്രൊ', |
| 44 | + 'narayam-bn-inscript' => 'ബംഗാളി ഇൻസ്ക്രിപ്റ്റ്', |
| 45 | + 'narayam-bn-nkb' => 'ബംഗാളി നാഷണൽ കീബോർഡ്', |
| 46 | +); |
Index: trunk/extensions/Narayam/ml_rules.js |
— | — | @@ -0,0 +1,330 @@ |
| 2 | +/** |
| 3 | + * Trasliteration regular expression rules table for Malayalam |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) with extensive advise from Thachan Makan ([[user:Thachan.makan]]) |
| 5 | + * @date 2010-05-19 (update: 2010-12-11) |
| 6 | + * License: GPLv3, CC-BY-SA 3.0 |
| 7 | + */ |
| 8 | +if(tr_ml== undefined) var tr_ml = {}; |
| 9 | +else tr_ml = {}; |
| 10 | +tr_ml.text = "Transliteration"; |
| 11 | +tr_ml.description = "Malayalam transliteration"; |
| 12 | +// Normal rules |
| 13 | +tr_ml.rules = [ |
| 14 | +['(\u200c)+a', '', 'അ'], |
| 15 | +['(\u200c)+A', '', 'ആ'], |
| 16 | +['(\u200c)+i', '', 'ഇ'], |
| 17 | +['(\u200c)+u', '', 'ഉ'], |
| 18 | +['(\u200c)+U', '', 'ഊ'], |
| 19 | +['(\u200c)+R', '', 'ഋ'], |
| 20 | +['(\u200c)+e', '', 'എ'], |
| 21 | +['(\u200c)+E', '', 'ഏ'], |
| 22 | +['(\u200c)+I', '', 'ഐ'], |
| 23 | +['(\u200c)+o', '', 'ഒ'], |
| 24 | +['(\u200c)+O', '', 'ഓ'], |
| 25 | +['(\u200c)+H', '', 'ഃ'], |
| 26 | +['ൻൿh','nc','ഞ്ച്'], |
| 27 | +['ൿh','c', 'ച്'], |
| 28 | +['ക്ക്h','cc', 'ച്ച്'], |
| 29 | +['ല്പ്p','lp','ൽപ്പ്'], |
| 30 | + |
| 31 | +['\\\\([A-Za-z\\>_~])','\\\\','$2'], |
| 32 | + |
| 33 | +['([ക-ഹ])്R', '', '$2ൃ'], |
| 34 | +['ന്ന്j', '', 'ഞ്ഞ്'], |
| 35 | +['ന്ന്g', '', 'ങ്ങ്'], |
| 36 | +['റ്റ്h', '', 'ത്'], |
| 37 | +['റ്റ്t', '', 'ട്ട്'], |
| 38 | +['ന്റ്h', '', 'ന്ത്'], |
| 39 | +['([ക-ഹ])്ല്l', 'L', '$2\u0d62'], |
| 40 | +['([ക-ഹ])\u0d62l', '', '$2\u0d63'], |
| 41 | +['([അ-ഊഌഎ-ഐഒ-ഹ])([ഽ-ൂെ-ൌൗ])+R', '', '$2$3റ്'], |
| 42 | +['([ക-ഹ])ൃa', '', '$2്ര'], |
| 43 | +['([ക-ഹ])ൃA', '', '$2്രാ'], |
| 44 | +['([ക-ഹ])ൃi', '', '$2്രി'], |
| 45 | +['([ക-ഹ])ൃI', '', '$2്രീ'], |
| 46 | +['([ക-ഹ])ൃu', '', '$2്രു'], |
| 47 | +['([ക-ഹ])ൃU', '', '$2്രൂ'], |
| 48 | +['([ക-ഹ])ൃe', '', '$2്രെ'], |
| 49 | +['([ക-ഹ])ൃE', '', '$2്രേ'], |
| 50 | +['([ക-ഹ])ൃo', '', '$2്രൊ'], |
| 51 | +['([ക-ഹ])ൃO', '', '$2്രോ'], |
| 52 | +['([ക-ഹ])്(l|L)', '', '$2്ല്'], |
| 53 | +['അa', '', 'ആ'], |
| 54 | +['അi', '', 'ഐ'], |
| 55 | +['അu', '', 'ഔ'], |
| 56 | +['ഇi', '', 'ഈ'], |
| 57 | +['ഉu', '', 'ഊ'], |
| 58 | +['ഊo', '', 'ഊഊ'], |
| 59 | +['ഋR', '', 'ൠ'], |
| 60 | +['ഋa', '', 'റ'], |
| 61 | +['ഋA', '', 'റാ'], |
| 62 | +['ഋi', '', 'റി'], |
| 63 | +['ഋI', '', 'റീ'], |
| 64 | +['ഋu', '', 'റു'], |
| 65 | +['ഋU', '', 'റൂ'], |
| 66 | +['ഋe', '', 'റെ'], |
| 67 | +['ഋE', '', 'റേ'], |
| 68 | +['ഋo', '', 'റൊ'], |
| 69 | +['ഋO', '', 'റോ'], |
| 70 | +['ഋ~', '', 'റ്'], |
| 71 | +['ഌl', '', 'ൡ'], |
| 72 | +['എe', '', 'ഈ'], |
| 73 | +['ഒo', '', 'ഊ'], |
| 74 | +['ാa', '', 'ാാ'], |
| 75 | +['ീi', '', 'ീീ'], |
| 76 | +['ൂu', '', 'ൂൂ'], |
| 77 | +['ൂo', '', 'ൂൂ'], |
| 78 | +['ൄR', '', 'ൄൄ'], |
| 79 | +['േE', '', 'േേ'], |
| 80 | +['ോO', '', 'ോോ'], |
| 81 | +['ൗu', '', 'ൗൗ'], |
| 82 | +['\u0d62\\^', '', '\u0d63'], |
| 83 | +['\u0d63\\^', '', '\u0d63\u0d63'], |
| 84 | +['ക്h', '', 'ഖ്'], |
| 85 | +['ഗ്h', '', 'ഘ്'], |
| 86 | +['ൻg', '', 'ങ്'], |
| 87 | +['ച്h', '', 'ഛ്'], |
| 88 | +['ജ്h', '', 'ഝ്'], |
| 89 | +['ട്h', '', 'ഠ്'], |
| 90 | +['ഡ്h', '', 'ഢ്'], |
| 91 | +['ത്h', '', 'ഥ്'], |
| 92 | +['ദ്h', '', 'ധ്'], |
| 93 | +['പ്h', '', 'ഫ്'], |
| 94 | +['ബ്h', '', 'ഭ്'], |
| 95 | +['ംa', '', 'മ'], |
| 96 | +['ംA', '', 'മാ'], |
| 97 | +['ംi', '', 'മി'], |
| 98 | +['ംI', '', 'മീ'], |
| 99 | +['ംu', '', 'മു'], |
| 100 | +['ംU', '', 'മൂ'], |
| 101 | +['ംR', '', 'മൃ'], |
| 102 | +['ംe', '', 'മെ'], |
| 103 | +['ംE', '', 'മേ'], |
| 104 | +['ംo', '', 'മൊ'], |
| 105 | +['ംO', '', 'മോ'], |
| 106 | +['ംm', '', 'മ്മ്'], |
| 107 | +['([^സ])ംr', '', '$2മ്ര്'], |
| 108 | +['ംp', '', 'മ്പ്'], |
| 109 | +['([^സ])ം(l|L)', '', '$2മ്ല്'], |
| 110 | +['ം~', '', 'മ്'], |
| 111 | +['([^സ])ംn', '', '$2മ്ന്'], |
| 112 | +['([^സ])ംy', '', '$2മ്യ്'], |
| 113 | +['സ്h', '', 'ഷ്'], |
| 114 | +['ശ്h', '', 'ഴ്'], |
| 115 | +['ൺ\\\\\\\\', '', 'ണ്\u200d'], // old style chillu N |
| 116 | +['ൺ~', '', 'ണ്'], |
| 117 | +['ൺR', '', 'ണൃ'], |
| 118 | +['ൺN', '', 'ണ്ണ്'], |
| 119 | +['ൺT', '', 'ണ്ട്'], |
| 120 | +['ൺD', '', 'ണ്ഡ്'], |
| 121 | +['ൺy', '', 'ണ്യ്'], |
| 122 | +['ൺv', '', 'ണ്വ്'], |
| 123 | +['ൺm', '', 'ണ്മ്'], |
| 124 | +['ൻ\\\\\\\\', '', 'ന്\u200d'], // old style chillu n |
| 125 | +['ൻ~', '', 'ന്'], |
| 126 | +['ൻr', '', 'ന്ര്'], |
| 127 | +['ൻR', '', 'നൃ'], |
| 128 | +['ൻk', '', 'ങ്ക്'], |
| 129 | +['ൻj', '', 'ഞ്'], |
| 130 | +['ൻn', '', 'ന്ന്'], |
| 131 | +['ൻd', '', 'ന്ദ്'], |
| 132 | +['ൻt', '', 'ന്റ്'], |
| 133 | +['ൻm', '', 'ന്മ്'], |
| 134 | +['ൻL', '', 'ന്ല്'], |
| 135 | +['ൻv', '', 'ന്വ്'], |
| 136 | +['ൻy', '', 'ന്യ്'], |
| 137 | +['ർ\\\\\\\\', '', 'ര്\u200d'], // old style chill r |
| 138 | +['ർ~', '', 'ര്'], |
| 139 | +['ർr', '', 'റ്'], |
| 140 | +['ർR', '', 'രൃ'], |
| 141 | +['ർy', '', 'ര്യ്'], |
| 142 | +['ൽ\\\\\\\\', '', 'ല്\u200d'], // old style chillu l |
| 143 | +['ൽ~', '', 'ല്'], |
| 144 | +['ൽR', '', 'ലൃ'], |
| 145 | +['ൽ(l|L)', '', 'ല്ല്'], |
| 146 | +['ൽp', '', 'ല്പ്'], |
| 147 | +['ൽy', '', 'ല്യ്'], |
| 148 | +['ൽv', '', 'ല്വ്'], |
| 149 | +['ൾ\\\\\\\\', '', 'ള്\u200d'], // old style chillu L |
| 150 | +['ൾ~', '', 'ള്'], |
| 151 | +['ൾR', '', 'ളൃ'], |
| 152 | +['ൾL', '', 'ള്ള്'], |
| 153 | +['ൾy', '', 'ള്യ്'], |
| 154 | +['ൾl', '', 'ഌ'], |
| 155 | +['ൿ\\\\\\\\', '', 'ക്\u200d'], // old style chillu k |
| 156 | +['ൿR', '', 'കൃ'], |
| 157 | +['ൿy', '', 'ക്യ്'], |
| 158 | +['ൿ(l|L)', '', 'ക്ല്'], |
| 159 | +['ൿv', '', 'ക്വ്'], |
| 160 | +['ൿ(k|c)', '', 'ക്ക്'], |
| 161 | +['([ക-ഹ])a', '', '$2ാ'], |
| 162 | +['([ക-ഹ])്a', '', '$2'], |
| 163 | +['ൺa', '', 'ണ'], |
| 164 | +['ൻa', '', 'ന'], |
| 165 | +['ർa', '', 'ര'], |
| 166 | +['ൽa', '', 'ല'], |
| 167 | +['ൾa', '', 'ള'], |
| 168 | +['ൿa', '', 'ക'], |
| 169 | +['([ക-ഹ])്A', '', '$2ാ'], |
| 170 | +['ൺA', '', 'ണാ'], |
| 171 | +['ൻA', '', 'നാ'], |
| 172 | +['ർA', '', 'രാ'], |
| 173 | +['ൽA', '', 'ലാ'], |
| 174 | +['ൾA', '', 'ളാ'], |
| 175 | +['ൿA', '', 'കാ'], |
| 176 | +['([ക-ഹ])്i', '', '$2ി'], |
| 177 | +['ൺi', '', 'ണി'], |
| 178 | +['ൻi', '', 'നി'], |
| 179 | +['ർi', '', 'രി'], |
| 180 | +['ൽi', '', 'ലി'], |
| 181 | +['ൾi', '', 'ളി'], |
| 182 | +['ൿi', '', 'കി'], |
| 183 | +['([ക-ഹ])്I', '', '$2ീ'], |
| 184 | +['ൺI', '', 'ണീ'], |
| 185 | +['ൻI', '', 'നീ'], |
| 186 | +['ർI', '', 'രീ'], |
| 187 | +['ൽI', '', 'ലീ'], |
| 188 | +['ൾI', '', 'ളീ'], |
| 189 | +['ൿI', '', 'കീ'], |
| 190 | +['([ക-ഹ])ിi', '', '$2ീ'], |
| 191 | +['([ക-ഹ])െe', '', '$2ീ'], |
| 192 | +['([ക-ഹ])്u', '', '$2ു'], |
| 193 | +['ൺu', '', 'ണു'], |
| 194 | +['ൻu', '', 'നു'], |
| 195 | +['ർu', '', 'രു'], |
| 196 | +['ൽu', '', 'ലു'], |
| 197 | +['ൾu', '', 'ളു'], |
| 198 | +['ൿu', '', 'കു'], |
| 199 | +['([ക-ഹ])്U', '', '$2ൂ'], |
| 200 | +['([ക-ഹ])ുu', '', '$2ൂ'], |
| 201 | +['ൺU', '', 'ണൂ'], |
| 202 | +['ൻU', '', 'നൂ'], |
| 203 | +['ർU', '', 'രൂ'], |
| 204 | +['ൽU', '', 'ലൂ'], |
| 205 | +['ൾU', '', 'ളൂ'], |
| 206 | +['ൿU', '', 'കൂ'], |
| 207 | +['([ക-ഹ])ൊo', '', '$2ൂ'], |
| 208 | +['([ക-ഹ])ൃR', '', '$2ൄ'], |
| 209 | +['([ക-ഹ])്e', '', '$2െ'], |
| 210 | +['ൺe', '', 'ണെ'], |
| 211 | +['ൻe', '', 'നെ'], |
| 212 | +['ർe', '', 'രെ'], |
| 213 | +['ൽe', '', 'ലെ'], |
| 214 | +['ൾe', '', 'ളെ'], |
| 215 | +['ൿe', '', 'കെ'], |
| 216 | +['([ക-ഹ])്E', '', '$2േ'], |
| 217 | +['ൺE', '', 'ണേ'], |
| 218 | +['ൻE', '', 'നേ'], |
| 219 | +['ർE', '', 'രേ'], |
| 220 | +['ൽE', '', 'ലേ'], |
| 221 | +['ൾE', '', 'ളേ'], |
| 222 | +['ൿE', '', 'കേ'], |
| 223 | +['([ക-ഹ])i', '', '$2ൈ'], |
| 224 | +['([ക-ഹ])്o', '', '$2ൊ'], |
| 225 | +['ൺo', '', 'ണൊ'], |
| 226 | +['ൻo', '', 'നൊ'], |
| 227 | +['ർo', '', 'രൊ'], |
| 228 | +['ൽo', '', 'ലൊ'], |
| 229 | +['ൾo', '', 'ളൊ'], |
| 230 | +['ൿo', '', 'കൊ'], |
| 231 | +['([ക-ഹ])്O', '', '$2ോ'], |
| 232 | +['ൺO', '', 'ണോ'], |
| 233 | +['ൻO', '', 'നോ'], |
| 234 | +['ർO', '', 'രോ'], |
| 235 | +['ൽO', '', 'ലോ'], |
| 236 | +['ൾO', '', 'ളോ'], |
| 237 | +['ൿO', '', 'കോ'], |
| 238 | +['([ക-ഹ])u', '', '$2ൗ'], |
| 239 | +['([ക-ഹ])U', '', '$2ൌ'], |
| 240 | +['([അ-്])m', '', '$2ം'], |
| 241 | +['\\\\0', '', '൦'], // escape to ml digit 0 by \0 |
| 242 | +['\\\\1', '', '൧'], // escape to ml digit 1 by \1 |
| 243 | +['\\\\2', '', '൨'], // escape to ml digit 2 by \2 |
| 244 | +['\\\\3', '', '൩'], // escape to ml digit 3 by \3 |
| 245 | +['\\\\4', '', '൪'], // escape to ml digit 4 by \4 |
| 246 | +['\\\\5', '', '൫'], // escape to ml digit 5 by \5 |
| 247 | +['\\\\6', '', '൬'], // escape to ml digit 6 by \6 |
| 248 | +['\\\\7', '', '൭'], // escape to ml digit 7 by \7 |
| 249 | +['\\\\8', '', '൮'], // escape to ml digit 8 by \8 |
| 250 | +['\\\\9', '', '൯'], // escape to ml digit 9 by \9 |
| 251 | +['മ്\\\\', '', 'ം'], |
| 252 | +['ആ\\\\', '', 'ാ'], |
| 253 | +['ഇ\\\\', '', 'ി'], |
| 254 | +['ഈ\\\\', '', 'ീ'], |
| 255 | +['ഉ\\\\', '', 'ു'], |
| 256 | +['ഊ\\\\', '', 'ൂ'], |
| 257 | +['ഋ\\\\', '', 'ൃ'], |
| 258 | +['ൠ\\\\', '', 'ൄ'], |
| 259 | +['എ\\\\', '', 'െ'], |
| 260 | +['ഏ\\\\', '', 'േ'], |
| 261 | +['ഐ\\\\', '', 'ൈ'], |
| 262 | +['ഒ\\\\', '', 'ൊ'], |
| 263 | +['ഓ\\\\', '', 'ോ'], |
| 264 | +['ഔ\\\\', '', 'ൗ'], |
| 265 | +['ൗ\\\\', '', 'ൌ'], |
| 266 | +['ഌ\\\\', '', 'ൢ'], |
| 267 | +['ൡ\\\\', '', 'ൣ'], |
| 268 | +['(([ൺ-ൿം])\u200c+)?A', '', '$3ആ'], |
| 269 | +['(([ൺ-ൿം])\u200c+)?B', '', '$3ബ്ബ്'], |
| 270 | +['(([ൺ-ൿം])\u200c+)?C', '', '$3ച്ച്'], |
| 271 | +['(([ൺ-ൿം])\u200c+)?D', '', '$3ഡ്'], |
| 272 | +['(([ൺ-ൿം])\u200c+)?E', '', '$3ഏ'], |
| 273 | +['(([ൺ-ൿം])\u200c+)?F', '', '$3ഫ്'], |
| 274 | +['(([ൺ-ൿം])\u200c+)?G', '', '$3ഗ്ഗ്'], |
| 275 | +['(([ൺ-ൿം])\u200c+)?H', '', '$3ഃ'], |
| 276 | +['(([ൺ-ൿം])\u200c+)?I', '', '$3ഐ'], |
| 277 | +['(([ൺ-ൿം])\u200c+)?J', '', '$3ജ്ജ്'], |
| 278 | +['(([ൺ-ൿം])\u200c+)?K', '', '$3ക്ക്'], |
| 279 | +['(([ൺ-ൿം])\u200c+)?L', '', '$3ൾ'], |
| 280 | +['(([ൺ-ൿം])\u200c+)?M', '', '$3മ്മ്'], |
| 281 | +['(([ൺ-ൿം])\u200c+)?N', '', '$3ൺ'], |
| 282 | +['(([ൺ-ൿം])\u200c+)?O', '', '$3ഓ'], |
| 283 | +['(([ൺ-ൿം])\u200c+)?P', '', '$3പ്പ്'], |
| 284 | +['(([ൺ-ൿം])\u200c+)?Q', '', '$3ക്യ്'], |
| 285 | +['(([ൺ-ൿം])\u200c+)?R', '', '$3ഋ'], |
| 286 | +['(([ൺ-ൿം])\u200c+)?(S|z)', '', '$3ശ്'], |
| 287 | +['(([ൺ-ൿം])\u200c+)?T', '', '$3ട്'], |
| 288 | +['(([ൺ-ൿം])\u200c+)?U', '', '$3ഊ'], |
| 289 | +['(([ൺ-ൿം])\u200c+)?(V|W)', '', '$3വ്വ്'], |
| 290 | +['(([ൺ-ൿം])\u200c+)?X', '', '$3ക്ഷ്'], |
| 291 | +['(([ൺ-ൿം])\u200c+)?Y', '', '$3യ്യ്'], |
| 292 | +['(([ൺ-ൿം])\u200c+)?Z', '', '$3ശ്ശ്'], |
| 293 | +['(([ൺ-ൿം])\u200c+)?a', '', '$3അ'], |
| 294 | +['(([ൺ-ൿം])\u200c+)?b', '', '$3ബ്'], |
| 295 | +['(([ൺ-ൿം])\u200c+)?c', '', '$3ൿ'], |
| 296 | +['(([ൺ-ൿം])\u200c+)?d', '', '$3ദ്'], |
| 297 | +['(([ൺ-ൿം])\u200c+)?e', '', '$3എ'], |
| 298 | +['(([ൺ-ൿം])\u200c+)?f', '', '$3ഫ്'], |
| 299 | +['(([ൺ-ൿം])\u200c+)?g', '', '$3ഗ്'], |
| 300 | +['(([ൺ-ൿം])\u200c+)?h', '', '$3ഹ്'], |
| 301 | +['(([ൺ-ൿം])\u200c+)?i', '', '$3ഇ'], |
| 302 | +['(([ൺ-ൿം])\u200c+)?j', '', '$3ജ്'], |
| 303 | +['(([ൺ-ൿം])\u200c+)?k', '', '$3ക്'], |
| 304 | +['(([ൺ-ൿം])\u200c+)?l', '', '$3ൽ'], |
| 305 | +['(([ൺ-ൿം])\u200c+)?m', '', '$3മ്'], |
| 306 | +['(([ൺ-ൿം])\u200c+)?n', '', '$3ൻ'], |
| 307 | +['(([ൺ-ൿം])\u200c+)?o', '', '$3ഒ'], |
| 308 | +['(([ൺ-ൿം])\u200c+)?p', '', '$3പ്'], |
| 309 | +['(([ൺ-ൿം])\u200c+)?q', '', '$3ക്ക്'], |
| 310 | +['(([ൺ-ൿം])\u200c+)?r', '', '$3ർ'], |
| 311 | +['(([ൺ-ൿം])\u200c+)?s', '', '$3സ്'], |
| 312 | +['(([ൺ-ൿം])\u200c+)?t', '', '$3റ്റ്'], // tta according to 5.1 |
| 313 | +['(([ൺ-ൿം])\u200c+)?u', '', '$3ഉ'], |
| 314 | +['(([ൺ-ൿം])\u200c+)?(v|w)', '', '$3വ്'], |
| 315 | +['(([ൺ-ൿം])\u200c+)?x', '', '$3ക്ഷ്'], |
| 316 | +['(([ൺ-ൿം])\u200c+)?y', '', '$3യ്'], |
| 317 | +['(([ൺ-ൿം])\u200c+)?~', '', '$3്'], |
| 318 | +['(\u200C)*_', '', '\u200c'], |
| 319 | +['//', '', 'ऽ'], |
| 320 | +['1/4\\\\', '', '൳'], |
| 321 | +['1/2\\\\', '', '൴'], |
| 322 | +['3/4\\\\', '', '൵'], |
| 323 | +['10\\\\', '', '\u0D70'], |
| 324 | +['100\\\\', '', '\u0D71'], |
| 325 | +['1000\\\\', '', '\u0D72'], |
| 326 | +['\\-\\-\\-\\\\', '', '—'], // em dash |
| 327 | +['\\-\\-\\\\', '', '–'], // en dash |
| 328 | +['\\\\\\-', '', '−'], |
| 329 | +['\\\\\\*', '', '×'], |
| 330 | +['\\\\/', '', '÷'] |
| 331 | +]; |
Index: trunk/extensions/Narayam/Narayam.php |
— | — | @@ -0,0 +1,203 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * NAME |
| 6 | + * Narayam |
| 7 | + * |
| 8 | + * SYNOPSIS |
| 9 | + * |
| 10 | + * INSTALL |
| 11 | + * Put this whole directory under your Mediawiki extensions directory |
| 12 | + * Then add this line to LocalSettings.php to load the extension |
| 13 | + * |
| 14 | + * require_once("$IP/extensions/Narayam.php"); |
| 15 | + * |
| 16 | + * After above line configure its working using these settings |
| 17 | + * |
| 18 | + * $wgNarayamConfig['shortcut_controlkey'] = true; |
| 19 | + * $wgNarayamConfig['shortcut_altkey'] = false; |
| 20 | + * $wgNarayamConfig['shortcut_shiftkey'] = false; |
| 21 | + * $wgNarayamConfig['shortcut_metakey'] = false; |
| 22 | + * $wgNarayamConfig['shortcut_key'] = 'M'; |
| 23 | + * $wgNarayamConfig['schemes'] = array('ml', 'ml_inscript'); |
| 24 | + * $wgNarayamConfig['default_scheme_index'] = 0; |
| 25 | + * $wgNarayamConfig['enabled'] = true; |
| 26 | + * |
| 27 | + * Currently Vector and Monobook skins are supported |
| 28 | + * |
| 29 | + * AUTHOR |
| 30 | + * Junaid P V <http://junaidpv.in> |
| 31 | + * |
| 32 | + * @package extensions |
| 33 | + * @version 0.1 |
| 34 | + * @copyright Copyright 2010 Junaid P V |
| 35 | + * @license GPLv3 |
| 36 | + */ |
| 37 | +if (!defined('MEDIAWIKI')) { |
| 38 | + exit(1); |
| 39 | +} |
| 40 | + |
| 41 | +// register extension credits |
| 42 | +$wgExtensionCredits['other'][] = array( |
| 43 | + 'name' => 'Narayam', |
| 44 | + 'version' => 0.1, |
| 45 | + 'author' => 'Junaid P V (http://junaidpv.in)', |
| 46 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Narayam', |
| 47 | + 'description' => 'Allows to add custom input methods for input fields.' |
| 48 | +); |
| 49 | + |
| 50 | +$wgNarayamConfig['shortcut_controlkey'] = true; |
| 51 | +$wgNarayamConfig['shortcut_altkey'] = false; |
| 52 | +$wgNarayamConfig['shortcut_shiftkey'] = false; |
| 53 | +$wgNarayamConfig['shortcut_metakey'] = false; |
| 54 | +$wgNarayamConfig['shortcut_key'] = 'M'; |
| 55 | +//$wgNarayamConfig['default_state'] = true; |
| 56 | +$wgNarayamConfig['schemes'] = array('ml', 'ta99', 'ml_inscript'); |
| 57 | +$wgNarayamConfig['default_scheme_index'] = 0; |
| 58 | +$wgNarayamConfig['enabled'] = true; |
| 59 | + |
| 60 | +// localization |
| 61 | +$wgExtensionMessagesFiles['Narayam'] = dirname(__FILE__) . '/Narayam.i18n.php'; |
| 62 | + |
| 63 | +/** |
| 64 | + * Narayam class |
| 65 | + * |
| 66 | + * (implements singleten pattern) |
| 67 | + * |
| 68 | + * @authorJunaid P V |
| 69 | + * @since 0.1 |
| 70 | + */ |
| 71 | +class Narayam { |
| 72 | + |
| 73 | + /** |
| 74 | + * One and only one instance of this class |
| 75 | + * @var Narayam |
| 76 | + */ |
| 77 | + private static $_instance; |
| 78 | + /** |
| 79 | + * |
| 80 | + * @var OutputPage |
| 81 | + */ |
| 82 | + private $_out; |
| 83 | + /** |
| 84 | + * |
| 85 | + * @var Skin |
| 86 | + */ |
| 87 | + private $_sk; |
| 88 | + /** |
| 89 | + * Only skins listed here are supported |
| 90 | + * @var array |
| 91 | + */ |
| 92 | + private $_supportedSkins = array('vector', 'monobook'); |
| 93 | + |
| 94 | + /** |
| 95 | + * implemtns singleten pattern so direct object creation is prevented. |
| 96 | + */ |
| 97 | + private function __construct() { |
| 98 | + |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Returns one and only object of the class |
| 103 | + * @return Narayam |
| 104 | + */ |
| 105 | + public static function getInstance() { |
| 106 | + if (!(self::$_instance instanceof self)) { |
| 107 | + self::$_instance = new self(); |
| 108 | + } |
| 109 | + return self::$_instance; |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * Hook function for the event 'BeforePageDisplay' |
| 114 | + * @param OutputPage $out |
| 115 | + * @param Skin $sk |
| 116 | + */ |
| 117 | + public function onBeforePageDisplay(&$out, &$sk) { |
| 118 | + // If current skin is not supported do nothing |
| 119 | + if (!in_array($sk->getSkinName(), $this->_supportedSkins)) { |
| 120 | + return true; |
| 121 | + } |
| 122 | + global $wgJsMimeType, $wgScriptPath, $wgNarayamConfig; |
| 123 | + $this->_out = $out; |
| 124 | + $this->_sk = $sk; |
| 125 | + // add script tag for each scheme |
| 126 | + foreach ($wgNarayamConfig['schemes'] as $scheme) { |
| 127 | + $out->addScript("<script type=\"{$wgJsMimeType}\" src=\"" . $wgScriptPath . "/extensions/Narayam/{$scheme}_rules.js\"></script>\n"); |
| 128 | + } |
| 129 | + |
| 130 | + // Load Narayam.js file |
| 131 | + $out->addScript("<script type=\"{$wgJsMimeType}\" src=\"" . $wgScriptPath . "/extensions/Narayam/Narayam.js\"></script>\n"); |
| 132 | + |
| 133 | + // Place generated JS code according to configuration settings |
| 134 | + $scriptTag = '<script type="' . $wgJsMimeType . '">' . $this->getInitJSCode() . '</script>'; |
| 135 | + $out->addScript($scriptTag); |
| 136 | + return true; |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + * Generate JavaScript code according to configuration settings |
| 141 | + * |
| 142 | + * @global array $wgNarayamConfig |
| 143 | + * @param Skin $skinName |
| 144 | + * @return string Generated JS code |
| 145 | + */ |
| 146 | + private function getInitJSCode() { |
| 147 | + global $wgNarayamConfig; |
| 148 | + $str = "Narayam.shortcut.controlkey= " . Narayam::boolToString($wgNarayamConfig['shortcut_controlkey']) . ";\n"; |
| 149 | + $str .= "Narayam.shortcut.altkey= " . Narayam::boolToString($wgNarayamConfig['shortcut_altkey']) . ";\n"; |
| 150 | + $str .= "Narayam.shortcut.shiftkey= " . Narayam::boolToString($wgNarayamConfig['shortcut_shiftkey']) . ";\n"; |
| 151 | + $str .= "Narayam.shortcut.metakey= " . Narayam::boolToString($wgNarayamConfig['shortcut_metakey']) . ";\n"; |
| 152 | + $str .= sprintf("Narayam.shortcut.key= '%s';\n", $wgNarayamConfig['shortcut_key']); |
| 153 | + $str .= sprintf("Narayam.checkbox.text= '%s ('+Narayam.shortcut.toString()+')';\n", wfMsgForContent('narayam-toggle-ime') /* $wgNarayamConfig['checkbox']['text'] */); |
| 154 | + $title = Title::newFromText(wfMsgForContent('narayam-help-page')); |
| 155 | + $str .= sprintf("Narayam.checkbox.href= '%s';\n", $title->getFullURL()); |
| 156 | + $str .= sprintf("Narayam.checkbox.tooltip= '%s';\n", wfMsgForContent('narayam-checkbox-tooltip')); |
| 157 | + //$str .= 'Narayam.default_state = ' . Narayam::boolToString($wgNarayamConfig['default_state']) . ";\n"; |
| 158 | + $str .= "Narayam.schemes = [\n"; |
| 159 | + $schemeCount = count($wgNarayamConfig['schemes']); |
| 160 | + for ($i = 0; $i < $schemeCount; $i++) { |
| 161 | + $str .= sprintf('tr_%s', $wgNarayamConfig['schemes'][$i]); |
| 162 | + if ($i < ($schemeCount - 1)) { |
| 163 | + $str .= ', '; |
| 164 | + } |
| 165 | + } |
| 166 | + $str .= "];\n"; |
| 167 | + $str .= sprintf("Narayam.default_scheme_index = %d;", $wgNarayamConfig['default_scheme_index']); |
| 168 | + for ($i = 0; $i < $schemeCount; $i++) { |
| 169 | + $str .= sprintf("tr_%s.text = '%s';\n", $wgNarayamConfig['schemes'][$i], wfMsg('narayam-' . str_replace('_', '-', $wgNarayamConfig['schemes'][$i]))); |
| 170 | + } |
| 171 | + |
| 172 | + $str .= 'Narayam.enabled = ' . Narayam::boolToString($wgNarayamConfig['enabled']) . ";\n"; |
| 173 | + |
| 174 | + $str .= "function irSetup() {\n"; |
| 175 | + $str .= "var elements = getAllTextInputs();\n"; |
| 176 | + $str .= "inputRewrite(elements);\n"; |
| 177 | + $str .= "elements = document.getElementsByTagName('textarea');"; |
| 178 | + $str .= "inputRewrite(elements);\n"; |
| 179 | + //$str .= sprintf("Narayam.init(%d);\n", $wgNarayamConfig['default_scheme_index']); |
| 180 | + if (in_array($this->_sk->getSkinName(), $this->_supportedSkins)) { |
| 181 | + $str .= 'setupNarayamFor' . $this->_sk->getSkinName() . "();\n"; |
| 182 | + } |
| 183 | + $str .= "}\n"; |
| 184 | + $str .= "if (window.addEventListener){\n"; |
| 185 | + $str .= "window.addEventListener('load', irSetup, false);\n"; |
| 186 | + $str .= "} else if (window.attachEvent){\n"; |
| 187 | + $str .= "window.attachEvent('onload', irSetup);\n"; |
| 188 | + $str .= "}"; |
| 189 | + return $str; |
| 190 | + } |
| 191 | + |
| 192 | + /** |
| 193 | + * Convert return string representation of give bool value |
| 194 | + * @param bool $value |
| 195 | + * @return string |
| 196 | + */ |
| 197 | + public static function boolToString($value) { |
| 198 | + return ($value) ? 'true' : 'false'; |
| 199 | + } |
| 200 | + |
| 201 | +} |
| 202 | + |
| 203 | +// register hook function |
| 204 | +$wgHooks['BeforePageDisplay'][] = Narayam::getInstance(); |
Index: trunk/extensions/Narayam/bn_nkb_rules.js |
— | — | @@ -0,0 +1,131 @@ |
| 2 | +/** |
| 3 | + * Regular expression rules table for Bengali National Keyboard |
| 4 | + * @author Junaid P V ([[user:Junaidpv]]) |
| 5 | + * @date 2010-12-13 |
| 6 | + * License: GPLv3, CC-BY-SA 3.0 |
| 7 | + */ |
| 8 | +if(tr_bn_nkb== undefined) var tr_bn_nkb = {}; |
| 9 | +else tr_bn_nkb = {}; |
| 10 | +tr_bn_nkb.text = "NKB"; |
| 11 | +tr_bn_nkb.description = "Bengali National Keyboard"; |
| 12 | +// Normal rules |
| 13 | +tr_bn_nkb.rules = [ |
| 14 | +['1', '', '১'], |
| 15 | +['2', '', '২'], |
| 16 | +['3', '', '৩'], |
| 17 | +['4', '', '৪'], |
| 18 | +['5', '', '৫'], |
| 19 | +['6', '', '৬'], |
| 20 | +['7', '', '৭'], |
| 21 | +['8', '', '৮'], |
| 22 | +['9', '', '৯'], |
| 23 | +['0', '', '০'], |
| 24 | + |
| 25 | +['q', '', 'ঙ'], |
| 26 | +['w', '', 'য'], |
| 27 | +['e', '', 'ড'], |
| 28 | +['r', '', 'প'], |
| 29 | +['t', '', 'ট'], |
| 30 | +['y', '', 'চ'], |
| 31 | +['u', '', 'জ'], |
| 32 | +['i', '', 'হ'], |
| 33 | +['o', '', 'গ'], |
| 34 | +['p', '', 'ড়'], |
| 35 | + |
| 36 | +['a', '', 'ৃ'], |
| 37 | +['s', '', 'ু'], |
| 38 | +['d', '', 'ি'], |
| 39 | +['f', '', 'ব'], |
| 40 | +['g', '', '্'], |
| 41 | +['h', '', 'া'], |
| 42 | +['j', '', 'ক'], |
| 43 | +['k', '', 'ত'], |
| 44 | +['l', '', 'দ'], |
| 45 | + |
| 46 | +['z', '', 'ঁ'], |
| 47 | +['x', '', 'ো'], |
| 48 | +['c', '', 'ে'], |
| 49 | +['v', '', 'র'], |
| 50 | +['b', '', 'ন'], |
| 51 | +['n', '', 'স'], |
| 52 | +['m', '', 'ম'], |
| 53 | + |
| 54 | +['Q', '', 'ং'], |
| 55 | +['W', '', 'য়'], |
| 56 | +['E', '', 'ঢ'], |
| 57 | +['R', '', 'ফ'], |
| 58 | +['T', '', 'ঠ'], |
| 59 | +['Y', '', 'ছ'], |
| 60 | +['U', '', 'ঝ'], |
| 61 | +['I', '', 'ঞ'], |
| 62 | +['O', '', 'ঘ'], |
| 63 | +['P', '', 'ঢ়'], |
| 64 | + |
| 65 | +['A', '', 'ৗ'], |
| 66 | +['S', '', 'ূ'], |
| 67 | +['D', '', 'ী'], |
| 68 | +['F', '', 'ভ'], |
| 69 | +['G', '', '।'], |
| 70 | +['H', '', 'অ'], |
| 71 | +['J', '', 'খ'], |
| 72 | +['K', '', 'থ'], |
| 73 | +['L', '', 'ধ'], |
| 74 | + |
| 75 | +['Z', '', 'ঃ'], |
| 76 | +['X', '', 'ৌ'], |
| 77 | +['C', '', 'ৈ'], |
| 78 | +['V', '', 'ল'], |
| 79 | +['B', '', 'ণ'], |
| 80 | +['N', '', 'ষ'], |
| 81 | +['M', '', 'শ'] |
| 82 | +]; |
| 83 | + |
| 84 | +// Extended layout for National Keyboard. Works in Firefox only |
| 85 | +tr_bn_nkb.extended_keyboard = true; |
| 86 | +tr_bn_nkb.rules_x = [ |
| 87 | +['1', '', '৴'], |
| 88 | +['2', '', '৵'], |
| 89 | +['3', '', '৶'], |
| 90 | +['4', '', '৳'], |
| 91 | +['5', '', '৷'], |
| 92 | +['6', '', '৸'], |
| 93 | +['7', '', 'ं'], |
| 94 | +['0', '', '৹'], |
| 95 | +['\\-', '', '\u200C'], |
| 96 | +['\\=', '', '\u200D'], |
| 97 | + |
| 98 | +['q', '', 'ৢ'], |
| 99 | +['w', '', '্য'], |
| 100 | +['e', '', 'ৄ'], |
| 101 | +['i', '', 'ঽ'], |
| 102 | + |
| 103 | +['a', '', 'ঋ'], |
| 104 | +['s', '', 'উ'], |
| 105 | +['d', '', 'ই'], |
| 106 | +['f', '', 'ৰ'], |
| 107 | +['g', '', '॥'], |
| 108 | +['h', '', 'আ'], |
| 109 | +['j', '', ''], |
| 110 | +['k', '', 'ঢ'], |
| 111 | +['l', '', 'ঌ'], |
| 112 | + |
| 113 | +['z', '', '৺'], |
| 114 | +['x', '', 'ও'], |
| 115 | +['c', '', 'এ'], |
| 116 | +['v', '', '্র'], |
| 117 | +['\\.', '', '়'], |
| 118 | + |
| 119 | +['\\$', '', '৲'], |
| 120 | +['\\^', '', ''], |
| 121 | + |
| 122 | +['Q', '', 'ৣ'], |
| 123 | + |
| 124 | +['A', '', 'ৠ'], |
| 125 | +['S', '', 'ঊ'], |
| 126 | +['D', '', 'ঈ'], |
| 127 | +['F', '', 'ৱ'], |
| 128 | +['L', '', 'ৡ'], |
| 129 | + |
| 130 | +['X', '', 'ঔ'], |
| 131 | +['C', '', 'ঐ'] |
| 132 | +]; |