SwapnilSurve / openmeetings

Automatically exported from code.google.com/p/openmeetings
0 stars 0 forks source link

Hyphenation issue in chat module #338

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of OpenMeetings are you running?
SVN 909

What's your operating system on client and server side?
Both Windows XP (IE7 / Firefox 2) and Ubuntu (Epiphany 2.20.1 / Firefox 2)
on client-side
Both Windows XP and Debian on server-side

Is it a problem related to the client/usability or server-side?
Client / Usability

Description:
Enter a long text in the chat module. The line will break on, let's say the
Nth character.

If the Nth character is inside a word, the word will be splitted.

I'm not saying that hyphenation should set up with dictionnaries for every
languages :)

But words should not be cut. When the text reaches the end of the line, the
 word that contains the Nth character should go entirely to the next line.

Not really important, but it would be a good polish making OpenMeetings
look even more professionnal. :)

Original issue reported on code.google.com by mathieu....@uperto.com on 5 Mar 2008 at 4:22

GoogleCodeExporter commented 9 years ago
This would help to solve issue 295:
http://code.google.com/p/openmeetings/issues/detail?id=295

Original comment by mathieu....@uperto.com on 6 Mar 2008 at 11:21

GoogleCodeExporter commented 9 years ago
Here is a patch.

I totally rewrote the method measureLine() that displays the messages in the 
chat
module (client-side).

Basically, it will only break lines between 2 words (separated by a space), 
unless a
single word is longer than the line. In that case it will break on the Nth 
character
of the word, the one that reaches the end of the line (as it was previously).

The patch is made against the fresh new trunk, even if I said earlier I was 
using
rev909 (Cedric and I just switched), so if you want, you could apply it right 
now.

Here is a link for future evolution: http://www.mnn.ch/hyph/hyphenation1.html
Looks like someone ported the LaTeX hyphenation system in Javascript ^_^

Original comment by mathieu....@uperto.com on 6 Mar 2008 at 6:04

Attachments:

GoogleCodeExporter commented 9 years ago
Patch added to SVN at r

please write Debug-Statements according to the CodingGuideline
Debug.write...
to
if ($debug) Debug.write...

Could this Function be optimized?

For example if you take this text:
chat Message: :)  asdasdasd ad a dasd asd  (clever)   asdasdad sdasda sda 
(clever)  
:)   (good)   (sleep)   (c)   (good)  sdas asdasdasdas asd asd as (clever)   :) 

(good)   (sleep)   (c)   (good)  das dasasd asdasdas (clever)   :)   (good)   
(sleep)
  (c)   (good)  da asdas da asdasdasdas a (clever)   :)   (good)   (sleep)   (c)  
(good)  ds sa d

the Client needs up to 3-4 seconds to render this message. CPU is at 100% for 
that
period of time. Could it be optimized? If you load the Message History with 
more then
two of these messages the client will break/crash cause it takes to long to 
measure
Line-Width.

Original comment by seba.wag...@gmail.com on 8 Mar 2008 at 1:29

GoogleCodeExporter commented 9 years ago
Patch added to SVN at r1036

Original comment by seba.wag...@gmail.com on 8 Mar 2008 at 1:30

GoogleCodeExporter commented 9 years ago
No sorry at r1044

Original comment by seba.wag...@gmail.com on 8 Mar 2008 at 1:31

GoogleCodeExporter commented 9 years ago

Original comment by seba.wag...@gmail.com on 8 Mar 2008 at 1:54

GoogleCodeExporter commented 9 years ago
Ok for the if ($debug). I'll check the guidelines page for next patches ;)

For optimizations, I'll try to see what I can do, but first I have to solve 
issue337.

Original comment by mathieu....@uperto.com on 10 Mar 2008 at 9:41

GoogleCodeExporter commented 9 years ago
The algorithm I used was dumb. It worked instantly for short messages, but the 
time
it needed grew exponentially with the length of the message to display -_-'

Here is a patch with a new algorithm. It will be a little slower for short 
messages
(still seems to display nearly instantly), but the needed time to display will 
remain
almost constant while the message length increases. :)

I tested it, works fine, but I'd rather have someone reviewing it.

Original comment by mathieu....@uperto.com on 13 Mar 2008 at 9:36

Attachments:

GoogleCodeExporter commented 9 years ago
Since the time it is here, I suppose someone has reviewed it...

Commited to SVN rev1142

Original comment by mathieu....@uperto.com on 19 Mar 2008 at 9:19

GoogleCodeExporter commented 9 years ago

Original comment by seba.wag...@gmail.com on 29 Aug 2011 at 8:02