473,403 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Inquire again

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
2 1452
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Phil Powell | last post by:
I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes, the PHP script I run behaves according to this...
5
by: Bruce | last post by:
I have a number of forms that do significant work based on variables POSTed from the form. What is the common method of detecting and preventing this work from being done when the form is POSTed as...
7
by: ???????J | last post by:
Javascript may inquire the push down menu value, can I inquire the description? The following example, the variable($answer) can be get the menu1's value. For example, if I select first data,...
1
by: Jiten | last post by:
Hi Cor I spoke with u previously about this problem i had and u gave me some code that helped me. That code worked fine but i have now encountered another issuee that im hoping u may know how to...
8
by: jon morgan | last post by:
OK, I'm going to be brave. There is a bug in VS.Net 1.1 that causes random compiler errors. I have raised this issue in posts at least three time in the past couple of months without attracting...
11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do...
6
by: teedilo | last post by:
We have an application with a SQL Server 2000 back end that is fairly database intensive -- lots of fairly frequent queries, inserts, updates -- the gamut. The application does not make use of...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
5
by: Mike TI | last post by:
March 24, 2006 Hi all I am new to VB.NET and am using VB.NET 2005. I have an MDI form with a Split Container Control. On demand I am adding and removing User Controls on Panel 2. I am using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.