User: sits    
  Date: 05/06/02 04:31:03

  Modified:    bin      codestriker.pl.base
               html     codestriker.css codestriker.js
               lib/Codestriker/Action ViewTopicComments.pm
               lib/Codestriker/Http Render.pm Response.pm
               template/en/default editproject.html.tmpl
                        viewtopiccomments.html.tmpl
  Added:       lib/Codestriker/Template/Plugin FormatWhitespace.pm
  Log:
  Don't use <PRE> when displaying coment data, as now we don't enforce
  newlines when we rea din comments.  This is nice, as the comments will
  now fit depending on the width of the screen, allowing for wide code
  fragments to be displayed.
  
  A bunch of other minor cleanups.
  
  
  
  Index: codestriker.pl.base
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/bin/codestriker.pl.base,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- codestriker.pl.base       14 Feb 2005 10:14:19 -0000      1.18
  +++ codestriker.pl.base       2 Jun 2005 11:30:58 -0000       1.19
  @@ -62,6 +62,7 @@
   use Codestriker::Template::Plugin::AutomagicLinks;
   use Codestriker::Template::Plugin::JavascriptEscape;
   use Codestriker::Template::Plugin::StringObfuscator;
  +use Codestriker::Template::Plugin::FormatWhitespace;
   
   # Set the temp file location, if one has been specified.
   if (defined $Codestriker::tmpdir && $Codestriker::tmpdir ne '') {
  
  
  
  
  
  Index: codestriker.css
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/html/codestriker.css,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- codestriker.css   5 May 2005 09:35:25 -0000       1.12
  +++ codestriker.css   2 Jun 2005 11:30:59 -0000       1.13
  @@ -109,9 +109,9 @@
   /* Style comment listings. */
   TR.comments {background-color: #aaffaa; font-family: Helvetica, Arial} /* 
space */
   TR.commenth {background-color: #cccccc; font-family: Helvetica, Arial} /* 
header */
  -TR.commentb {background-color: #eeeeee} /* comment body */
  -TD.commentb {background-color: #eeeeee} /* comment body */
  -TR.commentc {background-color: #eeeeee} /* context */
  +TR.commentb {background-color: #eeeeee; font-family: monospace} /* comment 
body */
  +TD.commentb {background-color: #eeeeee; font-family: monospace} /* comment 
body */
  +TR.commentc {background-color: #eeeeee; font-family: monospace} /* context */
   
   /* Style for topic title headings. */
   
  
  
  
  
  
  Index: codestriker.js
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/html/codestriker.js,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- codestriker.js    25 May 2005 08:00:13 -0000      1.11
  +++ codestriker.js    2 Jun 2005 11:30:59 -0000       1.12
  @@ -1,6 +1,8 @@
   // Global settings for overLIB.
   ol_fgcolor = '#FFFFCC';
   ol_textsize = '2';
  +ol_width = 300;
  +ol_height= 150;
   
   // Codestriker XMLHttpRequest object that is used.
   var cs_request;
  @@ -289,7 +291,9 @@
                  '<iframe width="480" height="300" name="comment_frame" ' +
                  'src="javascript:top.add_comment_html(' +
                  file + ',' + line + ',' + new_value + ');">' +
  -                'Can\'t view iframe</iframe>';
  +                'This browser is not supported.  Please use ' +
  +                'a modern browser, such as Firefox or IE which ' +
  +                'supports iframes.</iframe>';
       overlib(html, STICKY, DRAGGABLE, ALTCUT, CENTERPOPUP, WIDTH, 480,
               HEIGHT, 300);
   }
  
  
  
  
  
  Index: ViewTopicComments.pm
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicComments.pm,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ViewTopicComments.pm      22 May 2005 11:26:29 -0000      1.15
  +++ ViewTopicComments.pm      2 Jun 2005 11:31:00 -0000       1.16
  @@ -134,6 +134,7 @@
       $vars->{'email'} = $email;
       $vars->{'comments'} = [EMAIL PROTECTED];
       $vars->{'users'} = [EMAIL PROTECTED];
  +    $vars->{'tabwidth'} = $tabwidth;
       
       # Push in the current filter combo box selections so the window remembers
       # what the user has currently set.
  
  
  
  
  
  Index: Render.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Render.pm,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Render.pm 22 May 2005 11:26:29 -0000      1.50
  +++ Render.pm 2 Jun 2005 11:31:00 -0000       1.51
  @@ -820,43 +820,6 @@
       return $query->a($params, $text);
   }
   
  -# Generate a string which represents a digest of all the comments made for a
  -# particular line number.  Used for "tool-tip" windows for line number links
  -# and/or setting the status bar.
  -sub get_comment_digest($$$$) {
  -    my ($self, $line, $filenumber, $new) = @_;
  -
  -    my $digest = "";
  -    my %comment_hash = %{ $self->{comment_hash} };
  -    my $key = "$filenumber|$line|$new";
  -    if (defined $comment_hash{$key}) {
  -     my @comments = @{ $comment_hash{$key} };
  -
  -     for (my $i = 0; $i <= $#comments; $i++) {
  -         my $comment = $comments[$i];
  -
  -         # Need to format the data appropriately for HTML display.
  -         my $data = HTML::Entities::encode($comment->{data});
  -         $data =~ s/\n/<br>/mg;
  -         $data =~ s/ /&nbsp;/mg;
  -         $data = tabadjust($self->{tabwidth}, $data, 1);
  -
  -         # Show each comment with the author and date in bold.
  -         $digest .= "<b>Comment from $comment->{author} ";
  -         $digest .= "on $comment->{date}</b><br>";
  -         $digest .= "$data";
  -
  -         # Add a newline at the end if required.
  -         if ($i < $#comments &&
  -             substr($digest, length($digest)-4, 4) ne '<br>') {
  -             $digest .= '<br>';
  -         }
  -     }
  -    }
  -
  -    return $digest;
  -}
  -
   # Start hook called when about to start rendering to a page.
   sub start($) {
       my ($self) = @_;
  @@ -1222,11 +1185,11 @@
       $_ = $input;
       if ($htmlmode) {
        1 while s/\t+/'&nbsp;' x
  -         (length($&) * $tabwidth - length($`) % $tabwidth)/e;
  +         (length($&) * $tabwidth - length($`) % $tabwidth)/eo;
       }
       else {
        1 while s/\t+/' ' x
  -         (length($&) * $tabwidth - length($`) % $tabwidth)/e;
  +         (length($&) * $tabwidth - length($`) % $tabwidth)/eo;
       }
       return $_;
   }
  
  
  
  
  
  Index: Response.pm
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Response.pm,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Response.pm       22 May 2005 10:56:17 -0000      1.32
  +++ Response.pm       2 Jun 2005 11:31:01 -0000       1.33
  @@ -381,9 +381,9 @@
   
            # Need to format the data appropriately for HTML display.
            my $data = HTML::Entities::encode($comment->{data});
  -         $data =~ s/\'/\\\'/mg;
  -         $data =~ s/\n/<br>/mg;
  -         $data =~ s/ /&nbsp;/mg;
  +         $data =~ s/\'/\\\'/mgo;
  +         $data =~ s/\n/<br>/mgo;
  +         $data =~ s/ \s+/'&nbsp;' x (length($&)-1)/emgo;
            $data = Codestriker::Http::Render::tabadjust($tabwidth, $data, 1);
   
            # Show each comment with the author and date in bold.
  
  
  
  
  
  Index: FormatWhitespace.pm
  ===================================================================
  RCS file: FormatWhitespace.pm
  diff -N FormatWhitespace.pm
  --- /dev/null 1 Jan 1970 00:00:00 -0000
  +++ FormatWhitespace.pm       2 Jun 2005 11:31:01 -0000       1.1
  @@ -0,0 +1,30 @@
  +package Codestriker::Template::Plugin::FormatWhitespace;
  +
  +# Simple template toolkit plugin module for formatting whitespace.
  +
  +use Template::Plugin::Filter;
  +use Codestriker;
  +
  +use base qw( Template::Plugin::Filter );
  +
  +sub filter {
  +    my ($self, $text) = @_;
  +
  +    # Get the tabwidth setting from the config.
  +    my $tabwidth = $self->{ _CONFIG }->{tabwidth};
  +
  +    # Replace newlines with <br>s.
  +    $text =~ s/\n/<br>/mgo;
  +
  +    # Replace consective spaces with &nbsp; entities.  Its important
  +    # start start with a leading space, so that the text can be
  +    # broken up when it appears inside a floating div or a table row.
  +    $text =~ s/ \s+/'&nbsp;' x (length($&)-1)/emgo;
  +
  +    # Replace tabs.
  +    $text = Codestriker::Http::Render::tabadjust($tabwidth, $text, 1);
  +    
  +    return $text;
  +}
  +
  +1;
  
  
  
  
  
  Index: editproject.html.tmpl
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/template/en/default/editproject.html.tmpl,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- editproject.html.tmpl     23 May 2005 11:54:00 -0000      1.20
  +++ editproject.html.tmpl     2 Jun 2005 11:31:02 -0000       1.21
  @@ -59,7 +59,7 @@
   [%# The project description input field #%]
   Project description: 
   <BR>
  -<TEXTAREA NAME="project_description" ROWS=6 COLS=70 WRAP="virtual"
  +<TEXTAREA NAME="project_description" ROWS=6 COLS=70 WRAP="physical"
        [% IF project_states.0 != project.state %]
                readonly
        [% END %]
  
  
  
  
  
  Index: viewtopiccomments.html.tmpl
  ===================================================================
  RCS file: 
/cvsroot/codestriker/codestriker/template/en/default/viewtopiccomments.html.tmpl,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- viewtopiccomments.html.tmpl       23 May 2005 11:54:00 -0000      1.21
  +++ viewtopiccomments.html.tmpl       2 Jun 2005 11:31:02 -0000       1.22
  @@ -1,6 +1,7 @@
   [%# Display a list of comments #%]
   
   [% USE AutomagicLinks %]
  +[% USE FormatWhitespace tabwidth = tabwidth %]
   
   [% PROCESS viewtopicheader.html.tmpl version = version
      help = "x586.html" topicview = 0 topicproperties = 0 topiccomments = 1
  @@ -165,7 +166,7 @@
   
       [% IF comment.context != '' %]
       <TR CLASS="commentc">
  -        <TD>&nbsp;<PRE>[% comment.context %]</PRE></TD>
  +        <TD>&nbsp;[% comment.context %]</TD>
       </TR>
       [% END %]
       [% last_fileline = comment.fileline %]
  @@ -177,7 +178,7 @@
           <TD>[% comment.author | html_entity %]&nbsp;[% comment.date | 
html_entity %]</TD>
       </TR>
       <TR CLASS="commentb">
  -        <TD><PRE>[% comment.data | html_entity | $AutomagicLinks 
%]</PRE></TD>
  +        <TD>[% comment.data | html_entity | $FormatWhitespace | 
$AutomagicLinks %]</TD>
       </TR>
   
   [% END %]
  
  
  


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to