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 makes it possible for HTML text input and textarea fields (and similar) to accept Thaana without having to require the user to switch the keyboard language on their computer. Such a feature contributes for a better user experience as the user can simply enter Dhivehi without the extra hassle. The code has been tested with no problems found on Firefox 1/2/3 and Internet Explorer 5/6/7.

If you would like a demo, I recommend you check out the text entry box at Radheef.com and see the HTML behind it. A few developers seem to have already adopted my code as at Radheef.com and utilized it in their work - haamadaily.com, sangudaily.com and jazeera.com.mv and haveeru.com.mv is using the code far as I know.

I originally wrote this around 2002 while experimenting with different methods of Thaana entry for the web. The version I'm releasing here, marked as version 2.0, is a modified version from 2006. It is being released under the MIT License.

- Download unicodehandler-2.0.js

Usage

1. Link the file in the HEAD section of the page:
<script type="text/javascript" src="/unicodehandler.js"></script>

2. Attach the handler to any text INPUT, TEXTAREA or editable DIV tag:
<textarea rows="1" onkeypress="return juk_HandleKeyPress(event);"></textarea>

3. Set any Unicode-compatible Dhivehi font to be used for the field using CSS.

4. That's it!

Drop a line here if you use it and/or have problems. Enjoy.

Update (16-Aug-2008): This version is now superseded by the new and improved v3.0.

Trackbacks

  1. 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 u

Comments

Display comments as (Linear | Threaded)

  1. ajaaibu says:

    thats cooool.. man every single work of ya is very useful. :-)

  2. jaa says:

    thanks :-)

  3. nattu says:

    Thanks a lot man.

    Very very useful. I have been using it on couple of webs.

    Currently on www.haveeru.com.mv/video, but its a big part of the new webs which is going to be launched this year.

    A must of anything which accepts thaana inputs.

  4. gaanagaa says:

    Nice....

    Great to see many Maldivian sites going Unicode. Jazeera is really something. Sad to the so called "Leader" haveeru trailing them.

    Haveeru has been in Beta for ages, and its turinig out to be an Ad junkyard. Their article page with the biggest ad on the internet.

    The link on the main page about some "Jaisham" has been there for more than a month. Nothing interesting happened since then?

  5. primary0 says:

    I'm using this on mvheadlines.com
    Thanks for this! :-)

  6. jaa says:

    :-) You run mvheadlines? I love the site but why don't you group similar news together?

  7. primary0 says:

    yeah that's the plan. though i found it to be not very easy, but it can be done and will be. got some other ideas for it too.

  8. wadday says:

    if the sql has the records in english_ascii is it possible to get the sql query using dhivehi_unicode ??

  9. jaa says:

    It can be done, sort of, using procedures but there is no inbuilt functionality in any of the databases that would do this.

    If you are building a web-based system using PHP, then try using my Thaana conversions class to do the job: http://www.jawish.org/blog/archives/318-Thaana-conversions-class-for-PHP-5-v0.3.html


Add Comment


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