early this year as open-source software so that web developers producing Dhivehi websites can allow users to type Thaana straight into text entry fields without forcing them to switch keyboard using the relevant features on the user's computer operating system. The code has since made its way into many different Dhivehi websites. However, the code I released then was mostly as-is from it's original version which I had written back in 2003 which, sadly, means that its behavior could be a little bit unpredictable with certain modern browsers - especially Opera and Safari.
I've now rewritten the code with the intent of producing cleaner, easier-to-use code that works without fail on all modern browsers. This version is (more or less!) guaranteed to work, and has been tested, on Firefox 2+, Opera 9+, Internet Explorer 6+ and Safari 2+ and has also been tested on Windows, Mac and Linux operating systems.
As before, it is being released under the MIT License
, which allows its use in both personal and commercial applications as long as the copyright and license permission notice remains intact - so what the guy at basfoiy.com has done
is a definite no-no.
1. Link the file in the HEAD section of the page:
2. For any text input element (i.e INPUTs or TEXTAREAs), assign them the class name "thaanaKeyboardInput". You can assign further classes to the elements without ill-effect, if needed.
3. Using CSS, set any Unicode-compatible Dhivehi font (and size) to be used for the fields. You can easily do that by adding a class definition for the "thaanaKeyboardInput" class or by any other method of your choice.
4. The Thaana functionality would be automatically applied to any elements with the required class name when the page is loaded!
Check out the demonstration and testing page here
- original full source version (7.34 KB)
- minified version (2.01 KB)
I recommend you use the minified version.
As always, drop a line here if you use it and/or have problems or suggestions. Enjoy.
This version is now superseded by the new and improved v4.0