[Rt-commit] rt branch, 4.2-on-4.0/message-box-include-signature-before-quote, updated. rt-4.0.8rc1-4-gac812a8

? sunnavy sunnavy at bestpractical.com
Wed Oct 24 11:59:04 EDT 2012


The branch, 4.2-on-4.0/message-box-include-signature-before-quote has been updated
       via  ac812a89f3adae7600064c54402668b03d1393e0 (commit)
       via  9a784468491ccfcc0a46f480d84ab9ab9dc4a3f7 (commit)
      from  4ee66aa44b932c5d406789cdd1f33eb39263e035 (commit)

Summary of changes:
 share/html/Elements/MessageBox | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 9a784468491ccfcc0a46f480d84ab9ab9dc4a3f7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Oct 24 23:24:36 2012 +0800

    remove the unnecessary "\" because browsers ignore the first newline
    
    see also #21152

diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index 477d7c4..9aa69e2 100755
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<textarea autocomplete="off" class="messagebox" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>">\
+<textarea autocomplete="off" class="messagebox" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>">
 % $m->comp('/Articles/Elements/IncludeArticle', %ARGS) if $IncludeArticle;
 % $m->callback( %ARGS, SignatureRef => \$signature );
 <% $Default || '' %><% RT->Config->Get('MessageBoxIncludeSignatureBeforeQuote', $session{CurrentUser}) ? ( $signature . ( $message =~ /\S/ ? "\n$message" : $message ) ) : ( $message . $signature ) %></textarea>

commit ac812a89f3adae7600064c54402668b03d1393e0
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Oct 24 23:40:57 2012 +0800

    tweak spaces around signature thanks to best practices from chmrr++
    
    chomping is to make things more consistent to process.
    
    details:
    
    most signatures don't have trailing newlines, so more than one "\n" is
    necessary between the sig and the quote.  Finally, having a blank line (or
    two) before the "-- \n" means there's an obvious place to click and start
    typing.
    
    with signature-before-quote, I get:
        BLANKLINE
        BLANKLINE
        --
        Foo
        Bar
    
        On Oct 18, you wrote:
        > ...
    
    That is, starting with two blank lines -- click on the first one, start
    typing.
    
    With the standard signature-after, I'd get:
        On Oct 18, you wrote:
        > ...
        BLANKLINE
        BLANKLINE
        BLANKLINE
        --
        Foo
        Bar
    
    ..with three blank lines in the middle -- click on the second one, start
    typing.  And if there's nothing to quote, regardless of the preference,
    I get:
        BLANKLINE
        BLANKLINE
        --
        Foo
        Bar
    
    ..with a similar click-on-the-first-line use case.

diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index 9aa69e2..73befb8 100755
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -48,7 +48,7 @@
 <textarea autocomplete="off" class="messagebox" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>">
 % $m->comp('/Articles/Elements/IncludeArticle', %ARGS) if $IncludeArticle;
 % $m->callback( %ARGS, SignatureRef => \$signature );
-<% $Default || '' %><% RT->Config->Get('MessageBoxIncludeSignatureBeforeQuote', $session{CurrentUser}) ? ( $signature . ( $message =~ /\S/ ? "\n$message" : $message ) ) : ( $message . $signature ) %></textarea>
+<% $Default || '' %><% RT->Config->Get('MessageBoxIncludeSignatureBeforeQuote', $session{CurrentUser}) ? ( "\n\n$signature\n\n" . $message ) : ( $message .  "\n\n$signature" ) %></textarea>
 % $m->callback( %ARGS, CallbackName => 'AfterTextArea' );
 <%INIT>
 
@@ -58,10 +58,12 @@ if ( $QuoteTransaction ) {
     my $transaction = RT::Transaction->new( $session{'CurrentUser'} );
     $transaction->Load( $QuoteTransaction );
     $message = $transaction->Content( Quote => 1 );
+    chomp $message;
 }
 
 my $signature = '';
 if ( $IncludeSignature and my $text = $session{'CurrentUser'}->UserObj->Signature ) {
+    chomp $text;
 	$signature = "-- \n". $text;
 }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list