By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

Inquire again

P: n/a
I posted a similar question quite a while ago, but didn't get positive
answer. Beofore turning to other approaches, I would like to check
again. Following is what I like to do:

Chinese is a tone language. There are four tones that are referred to
as Tone 1 through Tone 4. The language is usually written with an
ideographic script of characters. But there is a less-used alphabetic
writing that consists of the 26 letters for English and 4 diacritics
for the 4 tones.

I like to develop a very simple word processor contained preferably in
a textarea of form. When the numbers 1 to 4 are typed after a letter
spelling, they will become a superscript. This is a must because that
when reading the script, the tone marks are not part of the spelling
process as the letters are. They only indicate a feature of the sound.
Therefore, by nature they are diacritics. If appearing after letter
spellings as regular-sized numbers, they would obstruct the smooth
spelling process. Native speakers of Chinese don't like that.

I know MS Keyboard Layout Creator may accomplish this. But I like to
know whether this can also be done with Javascript, because I intend to
put the program on the Internet for other people to test and discuss
it.

Another thing is that if the numbers 1 to 4 do not immediately follow
an alphabetic letter, they will appear as regular-sized numbers. I
don't think I have the ability to do the programing on the MSKLC.

I am a very slow learner for Javascript, in fact for any programing
language. But I am still interested to learn Javascript for its
usefulness on the Internet. So first of all, I like to know whether or
not this can be accomplished with Javasript, no matter how difficult or
complicated the programing would be.

Thanks in advance.
Dung Ping

Sep 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Dung Ping said the following on 9/18/2005 1:44 PM:
I posted a similar question quite a while ago, but didn't get positive
answer. Beofore turning to other approaches, I would like to check
again. Following is what I like to do:

Chinese is a tone language. There are four tones that are referred to
as Tone 1 through Tone 4. The language is usually written with an
ideographic script of characters. But there is a less-used alphabetic
writing that consists of the 26 letters for English and 4 diacritics
for the 4 tones.

I like to develop a very simple word processor contained preferably in
a textarea of form. When the numbers 1 to 4 are typed after a letter
spelling, they will become a superscript. This is a must because that
when reading the script, the tone marks are not part of the spelling
process as the letters are. They only indicate a feature of the sound.
Therefore, by nature they are diacritics. If appearing after letter
spellings as regular-sized numbers, they would obstruct the smooth
spelling process. Native speakers of Chinese don't like that.
You wouldn't be able to do it in a textarea of a form because you can
not superscript in a text area. Its text-only and making it a
superscript it requires HTML so you can't. What you can do is use a DIV
tag with contentEditable (IE only, MOZ has a comparative feature). Its a
DIV tag that you can edit the content. You would need an onkeydown event
handler on the DIV that checked to see if the key pressed was 1-4 and
replace it with <sup>#</sup>.
Another thing is that if the numbers 1 to 4 do not immediately follow
an alphabetic letter, they will appear as regular-sized numbers. I
don't think I have the ability to do the programing on the MSKLC.


Do you want to allow this:

"This is a 1 test"

Or disallow it?

If you want to allow it, then you add a check in your onkeydown function
to check to see what the previous character was. If it was a space, keep
going. If not, make it superscript.

If you dont want to allow it, then you also handle that in the function.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 18 '05 #2

P: n/a
Randy Webb wrote:
Dung Ping said the following on 9/18/2005 1:44 PM:
I posted a similar question quite a while ago, but didn't get positive
answer. Beofore turning to other approaches, I would like to check
again. Following is what I like to do:

Chinese is a tone language. There are four tones that are referred to
as Tone 1 through Tone 4. The language is usually written with an
ideographic script of characters. But there is a less-used alphabetic
writing that consists of the 26 letters for English and 4 diacritics
for the 4 tones.

I like to develop a very simple word processor contained preferably in
a textarea of form. When the numbers 1 to 4 are typed after a letter
spelling, they will become a superscript. This is a must because that
when reading the script, the tone marks are not part of the spelling
process as the letters are. They only indicate a feature of the sound.
Therefore, by nature they are diacritics. If appearing after letter
spellings as regular-sized numbers, they would obstruct the smooth
spelling process. Native speakers of Chinese don't like that.
You wouldn't be able to do it in a textarea of a form because you can
not superscript in a text area. Its text-only and making it a
superscript it requires HTML so you can't. What you can do is use a DIV
tag with contentEditable (IE only, MOZ has a comparative feature). Its a
DIV tag that you can edit the content. You would need an onkeydown event
handler on the DIV that checked to see if the key pressed was 1-4 and
replace it with <sup>#</sup>.


My understanding is this contenEditable would allow people to type in
an area in the HTML page, just like typing in the textarea of a form.
I will try this step first, then the next. Thanks a lot.
Another thing is that if the numbers 1 to 4 do not immediately follow
an alphabetic letter, they will appear as regular-sized numbers. I
don't think I have the ability to do the programing on the MSKLC.
Do you want to allow this:

"This is a 1 test"

Or disallow it?

If you want to allow it, then you add a check in your onkeydown function
to check to see what the previous character was. If it was a space, keep
going. If not, make it superscript.

If you dont want to allow it, then you also handle that in the function.


--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly


Sep 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.