UI Patch - Add whitespace at top of MessageBox if it's a reply/comment

Hi rt-users,

Here’s a quick patch I made to add some whitespace to the top of the message
when replying to a message. It makes it easier to just start typing if you
have FCKeditor set to StartupFocus.

— MessageBox 2009-01-28 21:37:01.000000000 -0500
+++ /usr/local/share/request-tracker3.8/html/Elements/MessageBox
2009-01-28 22:28:23.000000000 -0500
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}

% $m->callback( %ARGS );
-<% $Default || ‘’ %><% $message %><% $signature %>
+<% $Default || ‘’ %><% $whitespace %><% $message %><% $signature
%>
<%INIT>

my $message = ‘’;
@@ -63,6 +63,10 @@
$signature = “-- \n”. $text;
}

+my $whitespace = ‘’;
+if ( $message ) {

  • $whitespace = “\n\n\n”;
    +}
    </%INIT>
    <%ARGS>
    $QuoteTransaction => undef

BTW, I caught on that making changes in
local/html/NoAuth/RichText/FCKeditor/fckconfig.js doesn’t work; where’s the
best place to override the FCKeditor configuration to enable the option
FCKConfig.StartupFocus = true; ? Even better, how about making this the
default option, as no other fields seem to get the focus anyway.


Adam Tingle

Be careful. This patch will break rt’s empty reply detection.Adam Tingle adamtingle@gmail.com wrote:

Hi rt-users,

Here’s a quick patch I made to add some whitespace to the top of the message
when replying to a message. It makes it easier to just start typing if you
have FCKeditor set to StartupFocus.

— MessageBox 2009-01-28 21:37:01.000000000 -0500
+++ /usr/local/share/request-tracker3.8/html/Elements/MessageBox
2009-01-28 22:28:23.000000000 -0500
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}

\ % $m->callback( %ARGS ); -<% $Default || '' %><% $message %><% $signature %>

+<% $Default || ‘’ %><% $whitespace %><% $message %><% $signature
%>
<%INIT>

my $message = ‘’;
@@ -63,6 +63,10 @@
$signature = “-- \n”. $text;
}

+my $whitespace = ‘’;
+if ( $message ) {

  • $whitespace = “\n\n\n”;
    +}
    </%INIT>
    <%ARGS>
    $QuoteTransaction => undef

BTW, I caught on that making changes in
local/html/NoAuth/RichText/FCKeditor/fckconfig.js doesn’t work; where’s the
best place to override the FCKeditor configuration to enable the option
FCKConfig.StartupFocus = true; ? Even better, how about making this the
default option, as no other fields seem to get the focus anyway.



Adam Tingle


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Thanks for the heads-up, but how does the empty reply detection work? It
doesn’t seem to do anything if I remove the patch. I click reply, click
update ticket, and my ‘empty reply’ is recorded. Is it an option I have to
turn on?

Be careful. This patch will break rt’s empty reply detection.

Adam Tingle adamtingle@gmail.com wrote:

Hi rt-users,

Here’s a quick patch I made to add some whitespace to the top of the
message
when replying to a message. It makes it easier to just start typing if you
have FCKeditor set to StartupFocus.

— MessageBox 2009-01-28 21:37:01.000000000 -0500
+++ /usr/local/share/request-tracker3.8/html/Elements/MessageBox
2009-01-28 22:28:23.000000000 -0500
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}

\ % $m->callback( %ARGS ); -<% $Default || '' %><% $message %><% $signature %>

+<% $Default || ‘’ %><% $whitespace %><% $message %><% $signature
%>
<%INIT>

my $message = ‘’;
@@ -63,6 +63,10 @@
$signature = “-- \n”. $text;
}

+my $whitespace = ‘’;
+if ( $message ) {

  • $whitespace = “\n\n\n”;
    +}
    </%INIT>
    <%ARGS>
    $QuoteTransaction => undef

BTW, I caught on that making changes in
local/html/NoAuth/RichText/FCKeditor/fckconfig.js doesn’t work; where’s
the
best place to override the FCKeditor configuration to enable the option
FCKConfig.StartupFocus = true; ? Even better, how about making this the
default option, as no other fields seem to get the focus anyway.



Adam Tingle


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Sent from my Android phone with K-9. Please excuse my brevity.


Adam Tingle

This is patching the wrong way, but it’s the right decision. I’m
hating having to manually move the cursor in front of the signature
and end a newline before typing.

I think the right patch would be to add the whitespace at the same
place that “-- \n” is added to the beginning of the signature. This
is only added if the signature exists, and thus would be the easy fix.On Jan 28, 2009, at 8:15 PM, Adam Tingle wrote:

Thanks for the heads-up, but how does the empty reply detection
work? It doesn’t seem to do anything if I remove the patch. I click
reply, click update ticket, and my ‘empty reply’ is recorded. Is it
an option I have to turn on?

  • Adam

On Wed, Jan 28, 2009 at 10:58 PM, Jesse Vincent <jesse@bestpractical.com wrote:
Be careful. This patch will break rt’s empty reply detection.

Adam Tingle adamtingle@gmail.com wrote:

Hi rt-users,

Here’s a quick patch I made to add some whitespace to the top of
the message
when replying to a message. It makes it easier to just start typing
if you
have FCKeditor set to StartupFocus.

— MessageBox 2009-01-28 21:37:01.000000000 -0500
+++ /usr/local/share/request-tracker3.8/html/Elements/MessageBox
2009-01-28 22:28:23.000000000 -0500
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Sent from my Android phone with K-9. Please excuse my brevity.



Adam Tingle


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

In specific, I believe that this would be the better patch:

— html/Elements/MessageBox_orig 2009-01-28 23:48:34.000000000
-0800
+++ html/Elements/MessageBox 2009-01-28 23:48:45.000000000 -0800
@@ -60,7 +60,7 @@

my $signature = ‘’;
if ( $IncludeSignature and my $text = $session{‘CurrentUser’}-

UserObj->Signature ) {

  •   $signature = "-- \n". $text;
    
  •   $signature = "\n\n\n-- \n". $text;
    

    }

    </%INIT>

Jesse: I can’t find any place where the Signature and “-- \n” are
being used for empty reply comparison. Can you point me in the right
direction? The obvious fix is \s+--\s\n + Signature but I can’t
find where this should go.On Jan 28, 2009, at 11:43 PM, Jo Rhett wrote:

This is patching the wrong way, but it’s the right decision. I’m
hating having to manually move the cursor in front of the signature
and end a newline before typing.

I think the right patch would be to add the whitespace at the same
place that “-- \n” is added to the beginning of the signature. This
is only added if the signature exists, and thus would be the easy fix.

On Jan 28, 2009, at 8:15 PM, Adam Tingle wrote:

Thanks for the heads-up, but how does the empty reply detection
work? It doesn’t seem to do anything if I remove the patch. I click
reply, click update ticket, and my ‘empty reply’ is recorded. Is it
an option I have to turn on?

  • Adam

On Wed, Jan 28, 2009 at 10:58 PM, Jesse Vincent <jesse@bestpractical.com wrote:
Be careful. This patch will break rt’s empty reply detection.

Adam Tingle adamtingle@gmail.com wrote:

Hi rt-users,

Here’s a quick patch I made to add some whitespace to the top of
the message
when replying to a message. It makes it easier to just start
typing if you
have FCKeditor set to StartupFocus.

— MessageBox 2009-01-28 21:37:01.000000000 -0500
+++ /usr/local/share/request-tracker3.8/html/Elements/MessageBox
2009-01-28 22:28:23.000000000 -0500
@@ -47,7 +47,7 @@
%# END BPS TAGGED BLOCK }}}

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Sent from my Android phone with K-9. Please excuse my brevity.



Adam Tingle


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

In specific, I believe that this would be the better patch:

Jo,

lib/RT/Interface/Web.pm sub ProcessUpdateMessage is the code I was
thinking of.

-jesse

I don’t think this should be merged into base, as it promotes top-posting.

Jerrad Pierce wrote:

I don’t think this should be merged into base, as it promotes top-posting.

Not to be a “me-too” or anything, but I want to whole-heartedly agree
with the above. Top-posting has seriously gotten out of hand (thanks
Outlook(!!)) and should be discouraged at all times.

Kind Regards,

Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England

I don’t think this should be merged into base, as it promotes top-
posting.

The patch adds blank lines before the signature. The signature is at
the bottom of the message…

The only time this would qualify as “top-posting” is when the reply or
comment is done without any previous comment, and which case it’s not
really top-posting.

Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source
and other randomness

I don’t think this should be merged into base, as it promotes top-posting.

The patch adds blank lines before the signature. The signature is at the
bottom of the message…

The only time this would qualify as “top-posting” is when the reply or
comment is done without any previous comment, and which case it’s not really
top-posting.

I think you guys convinced me that top-posting is a bad idea when it comes
to RT: I didn’t clue in right away that the reply link at the top of the
ticket creates a reply without quoting anything. Since the ticket has the
entire history, usually there’s no need to reply with previous messages
quoted.

I think Jo is on the right track though. I didn’t have signatures enabled
before, but now that I do I see the problem. When you click ‘reply’ to a
message, the blank lines are inserted between the end of the quoted message
and the signature, but when you click ‘reply’ at the top of the ticket or
create a new ticket, the signature is the only text in the message. It would
be handy to have the whitespace included there instead.


Adam Tingle