Roundcube Community Forum

 

Roundcube 0.2 Stable Signature Fix

Started by a_magoon, February 16, 2009, 08:23:39 PM

Previous topic - Next topic

a_magoon

Hi guys,

Don't know whether this is the right category, so please move Admins if this should be elsewhere.

Our company had issues where clients wished for the signature to be located above the other messages. We paid for a developer to complete this for us, and what a job he did.

He has added another tick box inside Personal Settings where you can select to have the signature above the text or not. Here we are releasing it for the public to use as they'd like. There's a few modded files, but the originals are in the zip also.

Enjoy! Let me know how you all get on. Possibly add this to the actual package also Admins! Please read the readme also.

Cheers


lacri

Thx works fine for me !!!

my app.js are diffrent is the unpacked app.js the modification on unpacked app.js ...

remove this
if (this.env.signatures[id]['is_html'])
          {
          sig = this.env.signatures[id]['plain_text'];
          }
        if (sig.indexOf('-- ')!=0)
          sig = '-- \n'+sig;
        message += '\n\n'+sig;

with this

if (this.env.signatures[id]['is_html'])
          {
          sig = this.env.signatures[id]['plain_text'];
          }
        if (sig.indexOf('-- ')!=0)
          {
          sig = '-- \n'+sig;
          }
        if (this.env.signatures[id]["above_quoted"])
          {
 message = "\n\n"+sig + "\n\n"+message;
 }
        else
 {
          message += '\n\n'+sig;
          }

Napsty

Hi a_magoon

Thank you for stepping into this problem.
I've tried it and it works great in Text E-Mails. However, in HTML E-Mails the signature is still shown at the end of the Mail.

Tested with Firefox 3.0.6 and IE 8.

In IE 8 I get the following JavaScript error:

Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
app.js
Code: 0
Line: 3173
Char: 1

a_magoon

Thanks Rosali for placing this in Trac.

a_magoon

Hi Napsty,

I'll have him take another look as to why it doesn't work in HTML mode and post up a response when I hear more.

a_magoon

#6
Hi guys,

Here you go for the HTML part of the fix. Only need to update your app.js file.


Cheers.

Napsty

Superbe work!!!
Just tested it and it works smooth!

If I ever visit NZ I'll spend you some pints! ;D

a_magoon

No problem at all - nothing wrong with a good NZ brew :)

If we get any more commercial work done on Roundcube I'll post these up also.


Cheers.

lacri

Hi a_maagon,

my app.js are the unpacked and modified version,

can you post a diff or patch file from your app.js with html fix or post what you have modified in the file.

many thx and also sorry for the bad english

a_magoon

Hi Lacri,

Overwriting the first app.js with the second patched app.js file will give you the HTML functionality.

I'll have a look at including them into one file for you.

a_magoon

#11
Merged zip file - should work directly from this without having to apply both parts earlier in this thread.

Cheers,

lacri

Hi a_maagon,

the html fix isnt in the diff in your last post i have search in your postet app.js thx :)

here is the html fix for the uncompressed version from app.js

search

editor.getBody().appendChild(sigElem);


and replace with

if (this.env.signatures[id]["above_quoted"])
  {
  editor.getBody().insertBefore(sigElem, editor.getBody().firstChild);
  }
else
  {
  editor.getBody().appendChild(sigElem);
  }

ABerglund

In my experience, all these patches for moving the signature above the reply in HTML messages break the HTML word wrap. This one is no different.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA