Javascript Thaana Keyboard version 3.0

I released my Javascript Unicode Keyboard Handler for Thaana 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.

I am a big fan of separating code from design, so in keeping with that ideal this new version uses a more modern way of assigning the Thaana keyboard functionality in favour of inline javascript event handling used by the previous version (look below for an example). Since everything needs a spunky name I've also changed the old name to the more descriptive "Javascript Thaana Keyboard", which future versions of the script will maintain.

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.

Usage:

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!

Demo:

Check out the demonstration and testing page here.

Download:

- 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. :-)

Update (20-Oct-2008): This version is now superseded by the new and improved v4.0.

Trackbacks

  1. Javascript Unicode Keyboard Handler for Thaana

    Here's something that is probably going to be very useful to the Maldivian web developers working on Unicode-based Thaana web pages. It is a Javascript utility function that translates keystrokes into the appropriate Unicode Thaana characters. Hence, it m

Comments

Display comments as (Linear | Threaded)

  1. Jaheen says:

    thumbs up to you bro! :-D
    and boo's to that guy at basfoiy.com!!

  2. Nattu says:

    Kool. Thanks a lot man. I have to upgrade a lot of stuffs.. and will use that :-P..

  3. Iyas says:

    This is something that is very useful. I have some suggestions:

    recognize Ctrl-C and Ctrl-V commands. because when we try to copy texts via keyboard it doesn't work.

    and another keyboard for phonetic/typewriter.

  4. jaa says:

    Hi Iyas,

    Thank you for the comment. Please be aware that recent versions of my Javascript Thaana Keyboard, i.e. version 4.0 and 4.1, does already support Ctrl key combinations as well as the phonetic/typerwriter keyboards. Check them out at http://www.jawish.org/blog/archives/326-Javascript-Thaana-Keyboard-version-4.1.html

  5. shany says:

    how can i change joon=mla to dhivehi site.

  6. jaa says:

    You will need to edit a bit whatever templates you use. This post should help you get started:
    http://www.jawish.org/blog/archives/255-Guide-to-using-Thaana-on-the-WWW.html


Add Comment


HTML-Tags will be converted to Entities.
Standard emoticons like :-) and ;-) are converted to images.