Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: a_magoon on February 16, 2009, 08:23:39 PM

Title: Roundcube 0.2 Stable Signature Fix
Post by: a_magoon on February 16, 2009, 08:23:39 PM
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
Title: Roundcube 0.2 Stable Signature Fix
Post by: rosali on February 17, 2009, 01:03:28 AM
#1485738 (Signature above text) ? RoundCube Webmail (http://trac.roundcube.net/ticket/1485738)
Title: Roundcube 0.2 Stable Signature Fix
Post by: lacri on February 17, 2009, 02:44:17 AM
Thx works fine for me !!!

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

remove this
Code: [Select]
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

Code: [Select]
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;
          }
Title: Roundcube 0.2 Stable Signature Fix
Post by: Napsty on February 17, 2009, 12:57:28 PM
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
Title: Roundcube 0.2 Stable Signature Fix
Post by: a_magoon on February 17, 2009, 03:47:56 PM
Thanks Rosali for placing this in Trac.
Title: Roundcube 0.2 Stable Signature Fix
Post by: a_magoon on February 17, 2009, 03:51:51 PM
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.
Title: HTML part of the fix
Post by: a_magoon on February 17, 2009, 04:55:32 PM
Hi guys,

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


Cheers.
Title: Roundcube 0.2 Stable Signature Fix
Post by: Napsty on February 18, 2009, 02:32:51 AM
Superbe work!!!
Just tested it and it works smooth!

If I ever visit NZ I'll spend you some pints! ;D
Title: Roundcube 0.2 Stable Signature Fix
Post by: a_magoon on February 18, 2009, 02:51:12 PM
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.
Title: Roundcube 0.2 Stable Signature Fix
Post by: lacri on February 18, 2009, 03:02:32 PM
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
Title: Roundcube 0.2 Stable Signature Fix
Post by: a_magoon on February 18, 2009, 04:01:51 PM
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.
Title: Roundcube 0.2 Stable Signature Fix
Post by: a_magoon on February 18, 2009, 04:16:50 PM
Merged zip file - should work directly from this without having to apply both parts earlier in this thread.

Cheers,
Title: Roundcube 0.2 Stable Signature Fix
Post by: lacri on February 19, 2009, 01:53:19 AM
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
Code: [Select]

editor.getBody().appendChild(sigElem);


and replace with
Code: [Select]

if (this.env.signatures[id]["above_quoted"])
  {
  editor.getBody().insertBefore(sigElem, editor.getBody().firstChild);
  }
else
  {
  editor.getBody().appendChild(sigElem);
  }
Title: Roundcube 0.2 Stable Signature Fix
Post by: ABerglund on February 23, 2009, 02:35:07 PM
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.
Title: Roundcube 0.2 Stable Signature Fix
Post by: bigworm on February 25, 2009, 12:34:44 PM
nice work!
Title: Roundcube 0.2 Stable Signature Fix
Post by: coolsilver on March 06, 2009, 08:28:07 AM
Quote from: ABerglund;17248
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.
Seems to me that if you have an HTML Signature, the body text and signature text does not leave a empty line without getting the font style i.e. Bold text. The very top line is the div tag for the signature and anything you type ends up in the div.

I have also seen the word wrap issues.
Title: Roundcube 0.2 Stable Signature Fix
Post by: zamri on March 08, 2009, 05:26:01 AM
I just think this mod should be made a plugin.
Title: Roundcube 0.2 Stable Signature Fix
Post by: schroederman on March 13, 2009, 02:02:09 PM
i will be the first to announce, sadly, this does NOT work with roundcube v 2.1

i have been playing with it all morning, not happening with my limited knowledge of .js files.

DO NOT upgrade your install if you want to keep this function.
Title: Roundcube 0.2 Stable Signature Fix
Post by: Napsty on March 17, 2009, 05:22:57 AM
oh noo! really?
i was just going to install the patch to my 0.2.1 roundcube! but wanted to check for new posts here to not destroy my working 0.2.1.

@a_magoon: is it possible to have the modification only by single line changes? like an overview of all codes which were added and/or replaced?
Title: Roundcube 0.2 Stable Signature Fix
Post by: pjamedia on March 18, 2009, 06:41:17 AM
Quote from: a_magoon;17136
Hi guys,

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


Cheers.

Aaron M
YourHOST NZ

Aaron,

I must thank you for posting this - it's an excellent mod and I think RC developers should really consider adding this to the core code.

One small issue though using sig in HTML messages when replying, It puts the sig at the top as designed but doesn't leave a blank line above it or move the cursor above the sig as the place you would want to start typing. Is there any quick way to tweak the code to let this happen?

I am using v0.2.1 **UPDATE** It does work fine on my 0.2.1 version - not sure what the difference with my install and the one mentioed 2 posts above is! I had to also install the updated app.js file included in a separate post in this thread to get this working though.

Thanks again,

Paul A
Title: Roundcube 0.2 Stable Signature Fix
Post by: pjamedia on March 23, 2009, 09:38:11 AM
Just noticed, When I reply to a HTML message with a HTML signature configured, when I start typing above the signature the words I type don't wrap in the window. I think its something to do with a
Code: [Select]
<pre></pre> tag which is wrapped around the signature. Any ideas how I could format the signature to avoid this?

Thanks, Paul
Title: Roundcube 0.2 Stable Signature Fix
Post by: pjamedia on March 25, 2009, 10:42:22 AM
I resolved this issue by editing the html code of the signature in the database itself, removing the PRE tags. Using the Identities editor causes the signature to be wrapped in PRE tags, and these don't support word wrapping.

UPDATE - I didn't realise that you can actually edit the html in the Identities panel! Doh!

This of course would not be an issue if the sig is placed at the very foot of the document As RC is designed to do, but placing it at the top using this mod means that you intend to add your reply directly before your sig, which means you are typing your reply within the PRE tags which form part of the signature code. I can't find a way around this by formatting the signature any differently in the identities editor as PRE tags are always added. This is an oversight therefore on the mod's design. Editing the sig in the database directly is a work around.

Thanks, Paul A
Title: Fix for signature above text
Post by: KenRJ on April 16, 2009, 02:23:19 AM
Quote from: a_magoon;17094
Hi guys,

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,

Aaron M
YourHOST NZ


I got on very well.

Just needed to discover two clarifications to the instructions:

1) don't forget to apply the patch.sql in the patches folder - another column is needed in the identities table:
ALTER TABLE `identities` ADD COLUMN `signature_above_quoted` tinyint(1) NOT NULL DEFAULT '0';

2) the tick box is under Personal Settings>Identities> and set the tick box for each identity.

Thank you Aaron and your freelancer.  It's a fix which should be in further releases even if only to stir discussion among purists.
Title: Roundcube 0.2 Stable Signature Fix
Post by: Anonymous on May 30, 2009, 11:15:58 AM
I guess I am a newbie at this, but where do I edit these files? Thanks.
Title: Error No. [0x01F4] ??
Post by: mlgreene on July 06, 2009, 08:35:44 PM
I went to the identities tab and selected the option to put signature at top of quoted message, but when i clicked save, the page just said "SERVICE CURRENTLY NOT AVAILABLE!  Error No. [0x01F4]"  

I replaced all files like explained.  I don't understand why it's not working though.
Title: Roundcube 0.2 Stable Signature Fix
Post by: rosali on July 07, 2009, 01:00:12 AM
Did you update the database table identities?

ALTER TABLE `identities` ADD COLUMN `signature_above_quoted` tinyint(1) NOT NULL DEFAULT '0';
Title: Roundcube 0.2 Stable Signature Fix
Post by: pjamedia on July 07, 2009, 06:37:59 PM
Will this mod work with the latest release 0.2.2 ??
I'd love it to work but looks like the code in the new app.js is a bit different from in 0.2.1

Thanks, Paul
Title: Now that 0.3-stable is out...
Post by: redmondtux on September 07, 2009, 05:50:13 PM
and plugins are supported, can this be made into a plugin?
Title: Roundcube 0.2 Stable Signature Fix
Post by: ABerglund on September 07, 2009, 08:23:05 PM
Quote from: redmondtux;21026
and plugins are supported, can this be made into a plugin?
I hope so...

http://www.roundcubeforum.net/api-based-plugins/5148-plugin-sig-above-reply-option.html
Title: sig_above doesn't work with version 0.3.1
Post by: cafeolai on February 09, 2010, 07:34:19 PM
$rcmail_config['sig_above'] doesn't work anymore in version 0.3.1.
any idea ? the file app.js seems very different from 0.3

thanks for your help .

Joel