Author Topic: Rich Text Editor  (Read 9488 times)

Offline nipun_jain

  • Jr. Member
  • **
  • Posts: 21
Rich Text Editor
« on: July 13, 2006, 03:23:16 PM »
I am using the latest SVN release of rouncube and wanted to add HTML editor facility fo composing mails.

I integrated tinyMCE Rich Text Editor with Roundcube. It correctly shows the required toolbars in the compose text area. But the problem is that, when I compose a HTML message using tinyMCE, then on sending the mail, RoundCube asks if I want to send the message without any text whereas the text does exist in the message body.

If I choose to ignore this message and send the mail anyway, then I do receive the email sent at the recipient's address, but in plain ASCII, that is with all the HTML source shown instead of a HTML message.

Anybody having any idea as to how to resolve this?

Offline rewen

  • Newbie
  • *
  • Posts: 1
Re: Rich Text Editor
« Reply #1 on: July 15, 2006, 12:13:01 PM »
I've never looked at the source code, nor am I in any way affiliated with Roundcube, but I would think that you need to modify the email output headers so that they send proper HTML email. HTML mail has different headers than text only.

Offline nipun_jain

  • Jr. Member
  • **
  • Posts: 21
Re: Rich Text Editor
« Reply #2 on: July 16, 2006, 03:09:25 PM »
Okay, I have not solved both the problems, that is roundcube does not ask if I want to send an empty message and the recepient gets the HTML output and not the code.

There are just a few tiny bugs now. The googiespell spell checker does not work (maybe roundcube doesnt recognise the message body, the no body warning was removed using a dirty hack :( )

Well, that can be solved if I use the tinyMCE's built in spell checker but the problem is that I want to use googiespell as that would involve rc recognising the html body and would also solve the no message warning elegantly.

Can anyone tell how to make rc recognise the tinyMCE textarea?

There is another minor bug. When I click on send, the message text in the message body disappears in the compose area but the recipient still gets the message. Anyway to solve this?

PS: If I work everything out, I will post a tutorial here on integrating tinyMCE with roundcube

Offline humam

  • Newbie
  • *
  • Posts: 6
Re: Rich Text Editor
« Reply #3 on: July 19, 2006, 09:55:55 AM »
for the first problem
you need to remove "check for empty body" section from program/js/app.js
I mean remove these :
Code: [Select]
// check for empty body
  if (input_message.value=='')
   {
   if (!confirm(this.get_label('nobodywarning')))
    {
    input_message.focus();
    return false;
    }
   }

  return true;
  };

for the second problem
comment this line in sendmail.inc file at line ??? like this
Code: [Select]
//$MAIL_MIME->setTXTBody($message_body, FALSE, TRUE);   and add these lines instead

   
Code: [Select]
$MAIL_MIME->setTXTBody(eregi_replace("
", chr(13).chr(10), $message_body), FALSE, TRUE);
$MAIL_MIME->setHTMLBody($message_body, FALSE, TRUE);

Offline nipun_jain

  • Jr. Member
  • **
  • Posts: 21
Re: Rich Text Editor
« Reply #4 on: July 19, 2006, 01:25:13 PM »
Will try and update you guys here.

Offline EricS

  • Jr. Member
  • **
  • Posts: 45
Re: Rich Text Editor
« Reply #5 on: July 20, 2006, 11:53:12 AM »
I've actually done quite a bit of work on integrating TinyMCE, and have solved these problems and others. Check out the following post:

http://roundcubeforum.net/index.php?topic=179.0

Conversely, if you've done things that I've overlooked, I'd like to hear about it! :)

Offline nipun_jain

  • Jr. Member
  • **
  • Posts: 21
Re: Rich Text Editor
« Reply #6 on: July 20, 2006, 12:18:57 PM »
I actually got an email from Thomas poiting out that you were too working with this and he gave me the link to your post at the dev mailing list. I have downloaded your already patched setup and would try it within an hour. I ll see how we differed in implementation of using tinyMCE as the Rich Text Editor. I also have gotten around both the problems, but seeing that I am not really a developer, I have just used a few hacks to accomplish it. I was reading your code which seems more elegant. Anyways, I ll post my review and some screenshots here soon. If you will, I think it would be better to post a tutorial or a patch here.

Offline nipun_jain

  • Jr. Member
  • **
  • Posts: 21
Re: Rich Text Editor
« Reply #7 on: July 20, 2006, 01:26:36 PM »
Tested your install. You have one of the same bug as I have. Let's discuss in detail:

1. I had a problem sending the messages as html before which I solved. It works fine with your release too.

2. I had a problem with RounCube recognizing the text in the message body due to which it gave an empty message warning. Found a workaround that too. It works fine with your release too.

3. I could not get spell check (googiespell) to work after integrating tinyMCE. Same is the problem with your release.

4. In my integration, clicking on send makes the message body blank though the recepient got the message intact. There is no such problem with your release.

Now I don't know which files you edited so I cannot read all your changes / hacks unless I run a diff against your files. Since I am currenlty in windows, if you don't mind, can you post which files you edited so other members and I can look into your code and find a solution to this googiespell problem (if it exists that is).

Offline EricS

  • Jr. Member
  • **
  • Posts: 45
Re: Rich Text Editor
« Reply #8 on: July 23, 2006, 11:06:10 PM »
The entire diff is pretty big (since the tiny_mce directory shows up as new files). However, I did a diff that excludes the program/js/tiny_mce directory, and posted it here:

http://stadtherr.bounceme.net/files/rc_with_tinymce_rev280.patch

-Eric

Offline Coaxus

  • Newbie
  • *
  • Posts: 1
Re: Rich Text Editor
« Reply #9 on: December 17, 2006, 08:07:00 PM »
Hey. I just installed roundcube and came looking for a rich-text editor and Voila! :D

Excuse my ignorance, but I was curious regarding how exactly to implement this on an existing roundcube installation - or is it better to start again?

Thanks in advance and my apologies for the necro work on this thread, but I didn't see my queries worthy of a totally new thread.

Offline jpingle

  • Jr. Member
  • **
  • Posts: 77
Re: Rich Text Editor
« Reply #10 on: December 17, 2006, 08:36:40 PM »
If you obtain one of the later SVN revisions (I suggest the most current one) it has TinyMCE integrated so you do not have to patch it. TinyMCE was integrated as of SVN revision 344.

If you are not familiar with Subversion, there are some unofficial snapshots here: http://roundcubeforum.net/forum/index.php?topic=23.0

If you know how to use Subversion, you can checkout a copy of RoundCube directly. See http://trac.roundcube.net/trac.cgi/wiki/Dev_SVN

There are still some minor issues, but overall people are happy with it. Myself, I prefer to keep my mail plain text, but my users disagree :)