Thread: [Codestriker-commits] CVS update: codestriker/template/en/default viewtopic.html.tmpl
Brought to you by:
sits
|
From: <si...@us...> - 2008-02-28 06:26:20
|
User: sits
Date: 08/02/27 22:26:19
Modified: html codestriker.css
lib/Codestriker/Action ViewTopic.pm
lib/Codestriker/Http Render.pm
template/en/default viewtopic.html.tmpl
Log:
First step in removing code out of Render.pm into templates. At the moment
this just handles the initial top links and the file table of contents.
Index: codestriker.css
===================================================================
RCS file: /cvsroot/codestriker/codestriker/html/codestriker.css,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- codestriker.css 29 Jun 2007 07:13:59 -0000 1.14
+++ codestriker.css 28 Feb 2008 06:26:18 -0000 1.15
@@ -54,6 +54,9 @@
/* Changed file */
TD.cf {background-color: #ffff77}
+/* Patch file */
+TD.pf {background-color: #ffff77}
+
/* Changed blank text */
TD.cb {background-color: #eeee77; font-family: Helvetica, Arial; font-size: smaller}
Index: ViewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopic.pm,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- ViewTopic.pm 2 Jul 2007 09:54:12 -0000 1.52
+++ ViewTopic.pm 28 Feb 2008 06:26:18 -0000 1.53
@@ -136,8 +136,6 @@
$fview = -1;
}
}
- $vars->{'mode'} = $mode;
- $vars->{'brmode'} = $brmode;
$vars->{'states'} = \@Codestriker::topic_states;
$vars->{'default_state'} = $topic->{state};
@@ -151,58 +149,90 @@
# Obtain the link to download the actual document text.
$vars->{'download_url'} = $url_builder->download_url($topicid);
- # Fire the template on the topic heading information.
- my $template = Codestriker::Http::Template->new("viewtopic");
- $template->process($vars);
-
- # The rest of the output is non-template driven, as it is quite
- # complex.
-
- # Give the user the option of swapping between diff view modes.
- # If there are no files associated with the review, remove this
- # option.
- my $coloured_url =
+ # Obtain the links for the different viewing modes.
+ $vars->{'coloured_mode_url'} =
$url_builder->view_url($topicid, -1, $Codestriker::COLOURED_MODE,
$brmode, $fview);
- my $coloured_mono_url =
+ $vars->{'coloured_mono_mode_url'} =
$url_builder->view_url($topicid, -1,
$Codestriker::COLOURED_MONO_MODE, $brmode, $fview);
- my $br_normal_url =
+ $vars->{'br_normal_mode_url'} =
$url_builder->view_url($topicid, -1, $mode,
$Codestriker::LINE_BREAK_NORMAL_MODE, $fview);
- my $br_assist_url =
+ $vars->{'br_assist_mode_url'} =
$url_builder->view_url($topicid, -1, $mode,
$Codestriker::LINE_BREAK_ASSIST_MODE, $fview);
-
+
+ # Set template variables relating to coloured mode.
if ($mode == $Codestriker::COLOURED_MODE) {
- print " View in " .
- $query->a({href=>$coloured_mono_url}, "monospace font") .
- " | ";
- } elsif ($mode == $Codestriker::COLOURED_MONO_MODE) {
- print " View in " .
- $query->a({href=>$coloured_url}, "variable-width font") .
- " | ";
+ $vars->{'mode'} = 'coloured';
+ } elsif ($mode == $Codestrikier::COLOURED_MONO_MODE) {
+ $vars->{'mode'} = 'coloured_mono';
+ } else {
+ $vars->{'mode'} = 'unknown';
}
+ # Set template variables relating to line breaking mode.
if ($brmode == $Codestriker::LINE_BREAK_NORMAL_MODE) {
- print " View with " .
- $query->a({href=>$br_assist_url}, "minimal screen width") . ".";
+ $vars->{'brmode'} = 'normal';
} elsif ($brmode == $Codestriker::LINE_BREAK_ASSIST_MODE) {
- print " View with " .
- $query->a({href=>$br_normal_url}, "minimal line breaks") . ".";
+ $vars->{'brmode'} = 'assist';
+ } else {
+ $vars->{'brmode'} = 'unknown';
}
- print " | ";
- # Display the option to change the tab width.
+ # Set varibles relating to tab-width setting.
my $newtabwidth = ($tabwidth == 4) ? 8 : 4;
- my $change_tabwidth_url;
- $change_tabwidth_url =
+ $vars->{'tabwidth'} = $tabwidth;
+ $vars->{'newtabwidth'} = $newtabwidth;
+ $vars->{'change_tabwidth_url'} =
$url_builder->view_url_extended($topicid, -1, $mode, $newtabwidth,
"", "", 0, $brmode, $fview);
- print " Tab width set to $tabwidth (";
- print $query->a({href=>"$change_tabwidth_url"},"change to $newtabwidth");
- print ")\n";
+ # Set the display all, display single URLs.
+ $vars->{'display_all_files_url'} =
+ $url_builder->view_url($topicid, -1, $mode, $brmode, -1);
+ $vars->{'display_single_file_url'} =
+ $url_builder->view_url($topicid, -1, $mode, $brmode, 0);
+ $vars->{'fview'} = $fview;
+
+ # Setup the filetable template variable for displaying the table of
+ # contents.
+ my @filetable = ();
+ for (my $i = 0; $i <= $#filenames; $i++) {
+ my $filerow = {};
+ my $filename = $filenames[$i];
+ $filerow->{filename} = $filename;
+ $filerow->{numchanges} = $numchanges[$i];
+ $filerow->{href_filename_url} =
+ $url_builder->view_url($topicid, -1, $mode, $brmode, $i) .
+ "#" . $filename;
+ $filerow->{anchor_filename_url} =
+ $url_builder->view_url($topicid, -1, $mode, $brmode, -1) .
+ "#" . $filename;
+ $filerow->{binary} = $binary[$i];
+
+ my $revision = $revisions[$i];
+ if ($revision eq $Codestriker::ADDED_REVISION) {
+ $filerow->{revision} = 'added';
+ } elsif ($revision eq $Codestriker::REMOVED_REVISION) {
+ $filerow->{revision} = 'removed';
+ } elsif ($revision eq $Codestriker::PATCH_REVISION) {
+ $filerow->{revision} = 'patch';
+ } else {
+ $filerow->{revision} = $revision;
+ }
+
+ push @filetable, $filerow;
+ }
+ $vars->{'filetable'} = \@filetable;
+
+ # Fire the template for generating the view topic screen.
+ my $template = Codestriker::Http::Template->new("viewtopic");
+ $template->process($vars);
+
+ # The rest of the output is non-template driven, as it is quite
+ # complex.
print $query->p if ($mode == $Codestriker::NORMAL_MODE);
Index: Render.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Render.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- Render.pm 26 Feb 2008 08:32:17 -0000 1.54
+++ Render.pm 28 Feb 2008 06:26:18 -0000 1.55
@@ -909,88 +909,8 @@
my ($self) = @_;
my $query = $self->{query};
- my $topic = $self->{topic};
- my $mode = $self->{mode};
- my $brmode = $self->{brmode};
- my $fview = $self->{fview};
- my $display_all_url =
- $self->{url_builder}->view_url($topic, -1, $mode, $brmode, -1);
- my $display_single_url =
- $self->{url_builder}->view_url($topic, -1, $mode, $brmode, 0);
- # Print out the "table of contents".
- my $filenames = $self->{filenames_ref};
- my $revisions = $self->{revisions_ref};
- my $binaries = $self->{binaries_ref};
- my $numchanges = $self->{numchanges_ref};
-
- print $query->p;
- print $query->start_table({-cellspacing=>'0', -cellpadding=>'0',
- -border=>'0'}), "\n";
-
-
- # Include a link to view all files in a topic, if we are in single
- # display mode.
- if ($fview != -1) {
- print $query->Tr($query->td($query->a({name=>"contents"},
- "Files in Topic: ("),
- $query->a({href=>$display_all_url},
- "view all files"), ")"),
- $query->td(" ")), "\n";
- }
- else {
- print $query->Tr($query->td($query->a({name=>"contents"},
- "Files in Topic:")),
- $query->td(" ")), "\n";
- }
-
- my $url_builder = $self->{url_builder};
- for (my $i = 0; $i <= $#$filenames; $i++) {
- my $filename = $$filenames[$i];
- my $revision = $$revisions[$i];
- my $numchange = $$numchanges[$i];
- my $href_filename =
- $url_builder->view_url($topic, -1, $mode, $brmode, $i) .
- "#" . "$filename";
- my $anchor_filename =
- $url_builder->view_url($topic, -1, $mode, $brmode, -1) .
- "#" . "$filename";
- my $tddata = $$binaries[$i] ? $filename :
- $query->a({href=>$href_filename}, "$filename");
-
- if ($fview == -1) {
- # Add a jump to link for the all files view.
- $tddata = "[" . $query->a({href=>$anchor_filename}, "Jump to") . "] " . $tddata;
- }
-
- my $lineData = "";
-
- if ($numchange ne "") {
- $lineData = " <FONT size=-1>{$numchange}</FONT>";
- }
-
- my $class = "";
- $class = "af" if ($revision eq $Codestriker::ADDED_REVISION);
- $class = "rf" if ($revision eq $Codestriker::REMOVED_REVISION);
- $class = "cf" if ($revision eq $Codestriker::PATCH_REVISION);
- if ($revision eq $Codestriker::ADDED_REVISION ||
- $revision eq $Codestriker::REMOVED_REVISION ||
- $revision eq $Codestriker::PATCH_REVISION) {
- # Added, removed or patch file.
- print $query->Tr($query->td({-class=>"$class", -colspan=>'2'},
- $tddata),
- $query->td({-class=>"$class"}, $lineData)) . "\n";
- } else {
- # Modified file.
- print $query->Tr($query->td({-class=>'cf'}, $tddata),
- $query->td({-class=>'cf'}, " $revision"),
- $query->td({-class=>'cf'}, $lineData)) .
- "\n";
- }
- }
- print $query->end_table() . "\n";
-
# Render the "Add comment to topic" link.
print $query->p;
print $self->render_comment_link(-1, -1, 1, "Add General Comment",
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- viewtopic.html.tmpl 29 Jun 2007 07:13:59 -0000 1.38
+++ viewtopic.html.tmpl 28 Feb 2008 06:26:19 -0000 1.39
@@ -12,10 +12,88 @@
<p>
-[%# Display the "Download topic text" link #%]
-<a href="[% download_url %]">Download topic text</a> |
+[%# Display the "Download topic text" link. #%]
+<a href="[% download_url %]">Download topic text</a>
-[%# The perl script takes control from here, rendering the topic data #%]
+[%# Display the different coloured viewing modes #%]
+[% IF mode == "coloured" %]
+| View in <a href="[% coloured_mono_mode_url %]">monospace font</a>
+[% ELSIF mode == "coloured_mono" %]
+| View in <a href="[% coloured_mode_url %]">variable-width font</a>
+[% END %]
+
+[%# Display the different line breaking modes. #%]
+[% IF brmode == "normal" %]
+| View with <a href="[% br_assist_mode_url %]">minimal screen width</a>
+[% ELSIF brmode == "assist" %]
+| View with <a href="[% coloured_mode_url %]">minimal line breaks</a>
+[% END %]
+
+[%# Display the different tab-width options #%]
+| Tab width set to [% tabwidth %]
+(<a href="[% change_tabwidth_url %]">change to [% newtabwidth %]</a>)
+
+[%# Display the files in a table which are a part of this topic. #%]
+[%# Display the view all files link if required. #%]
+<p>
+<table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td><a name="contents">Files in Topic:</a>
+ [% IF fview != -1 %]
+ (<a href="[% display_all_files_url %]">view all files</a>)
+ [% END %]
+ </td><td> </td>
+ </tr>
+
+ [%# Now display a row per file which is a part of this review. #%]
+ [% FOREACH file = filetable %]
+ [% FLUSH IF loop.count() % 10 == 1 %]
+
+ <tr>
+ [%# Determine what CSS style to apply to the line. #%]
+ [% SET rowstyle = "cf" %]
+ [% IF file.revision == "added" %][% SET rowstyle = "af" %]
+ [% ELSIF file.revision == "removed" %][% SET rowstyle = "rf" %]
+ [% ELSIF file.revision == "patch" %][% SET rowstyle = "pf" %]
+ [% END %]
+
+ [% IF rowstyle != "cf" %]
+ <td colspan="2" class="[% rowstyle %]">
+ [% ELSE %]
+ <td class="[% rowstyle %]">
+ [% END %]
+
+ [%# Display the jump to link in the case when all files are displayed. #%]
+ [% IF fview == -1 %]
+ [<a href="[% file.anchor_filename_url %]">Jump to</a>]
+ [% END %]
+
+ [%# Display the filename with an internal link if its not binary. #%]
+ [% IF file.binary %]
+ [% file.filename %]
+ [% ELSE %]
+ <a href="[% file.href_filename_url %]">[% file.filename %]</a>
+ [% END %]
+ </td>
+
+ [%# Display the revision information for modified files. #%]
+ [% IF rowstyle == "cf" %]
+ <td class="[% rowstyle %]"> [% file.revision %]</td>
+ [% END %]
+
+ [%# Display the numchange information for the file. #%]
+ <td class="[% rowstyle %]">
+
+ [% IF file.numchanges != "" %]
+ <font size="-1">{[% file.numchanges %]}</font>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+
+</table>
+
+[%# The perl script takes control from here, rendering the topic data. #%]
|
|
From: <si...@us...> - 2008-02-28 11:02:02
|
User: sits
Date: 08/02/28 03:01:58
Modified: lib/Codestriker/Action ViewTopic.pm
lib/Codestriker/Http Render.pm
template/en/default viewtopic.html.tmpl
Added: lib/Codestriker/Template/Plugin CommentLine.pm
Log:
Render the add general comment link via TT rather than Render.pm
Index: ViewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopic.pm,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ViewTopic.pm 28 Feb 2008 06:26:18 -0000 1.53
+++ ViewTopic.pm 28 Feb 2008 11:01:58 -0000 1.54
@@ -227,6 +227,30 @@
}
$vars->{'filetable'} = \@filetable;
+ # Pass in existing comment information.
+ # Build a hash from filenumber|fileline|new -> comment array, so that
+ # when rendering, lines can be coloured appropriately. Also build a list
+ # of what points in the review have a comment. Also record a mapping
+ # from filenumber|fileline|new -> the comment number.
+ my %comment_hash = ();
+ my @comment_locations = ();
+ my %comment_location_map = ();
+ for (my $i = 0; $i <= $#comments; $i++) {
+ my $comment = $comments[$i];
+ my $key = $comment->{filenumber} . "|" . $comment->{fileline} . "|" .
+ $comment->{filenew};
+ if (! exists $comment_hash{$key}) {
+ push @comment_locations, $key;
+ $comment_location_map{$key} = $#comment_locations;
+ }
+ push @{ $comment_hash{$key} }, $comment;
+ }
+
+ $vars->{'query'} = $query;
+ $vars->{'comment_hash'} = \%comment_hash;
+ $vars->{'comment_locations'} = \@comment_locations;
+ $vars->{'comment_location_map'} = \%comment_location_map;
+
# Fire the template for generating the view topic screen.
my $template = Codestriker::Http::Template->new("viewtopic");
$template->process($vars);
@@ -250,11 +274,7 @@
\@numchanges, -1,
$brmode, $fview);
- # Display the data that is being reviewed.
- $render->start();
-
# Retrieve the delta set comprising this review.
-
my $old_filename = "";
# Determine which deltas are to be retrieved.
Index: Render.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Render.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- Render.pm 28 Feb 2008 06:26:18 -0000 1.55
+++ Render.pm 28 Feb 2008 11:01:58 -0000 1.56
@@ -18,9 +18,6 @@
# against.
my $CONTEXT_COLOUR = "red";
-sub _normal_mode_start( $ );
-sub _normal_mode_finish( $ );
-sub _coloured_mode_start( $ );
sub _coloured_mode_finish( $ );
# New lines within a diff block.
@@ -841,18 +838,6 @@
return $query->a($params, $text);
}
-# Start hook called when about to start rendering to a page.
-sub start($) {
- my ($self) = @_;
-
- # Now create the start of the rendering tables.
- if ($self->{mode} == $Codestriker::NORMAL_MODE) {
- $self->_normal_mode_start();
- } else {
- $self->_coloured_mode_start();
- }
-}
-
# Finished hook called when finished rendering to a page.
sub finish($) {
my ($self) = @_;
@@ -865,18 +850,6 @@
$self->_print_legend();
}
-# Start topic view display hook for normal mode.
-sub _normal_mode_start($) {
- my ($self) = @_;
- print "<PRE>\n";
-}
-
-# Finish topic view display hook for normal mode.
-sub _normal_mode_finish($) {
- my ($self) = @_;
- print "</PRE>\n";
-}
-
# Private functon to print the diff legend out at the bottom of the topic text page.
sub _print_legend($) {
my ($self) = @_;
@@ -901,26 +874,6 @@
print $query->end_table(), "\n";
}
-
-# Start topic view display hook for coloured mode. This displays a simple
-# legend, displays the files involved in the review, and opens up the initial
-# table.
-sub _coloured_mode_start($) {
- my ($self) = @_;
-
- my $query = $self->{query};
-
-
- # Render the "Add comment to topic" link.
- print $query->p;
- print $self->render_comment_link(-1, -1, 1, "Add General Comment",
- "general_comment", undef);
- print " to topic.";
- print $query->p;
-
- print $query->start_table() ;
-}
-
# Render the initial start of the coloured table, with an empty row setting
# the widths.
sub print_coloured_table($)
Index: CommentLine.pm
===================================================================
RCS file: CommentLine.pm
diff -N CommentLine.pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ CommentLine.pm 28 Feb 2008 11:01:58 -0000 1.1
@@ -0,0 +1,78 @@
+package Codestriker::Template::Plugin::CommentLine;
+
+# Template toolkit plugin module for outputting the anchor text
+# for a specific line.
+
+use Template::Plugin::Filter;
+use Codestriker;
+use Codestriker::Http::UrlBuilder;
+
+use base qw( Template::Plugin::Filter );
+
+# Indicate that the filter should be re-created on each filter call.
+our $DYNAMIC = 1;
+
+sub filter {
+ my ($self, $text, $args, $conf) = @_;
+
+ $conf = $self->merge_config($conf);
+
+ # Constructor parameters.
+ my $query = $conf->{query};
+ my $comment_hash = %{ $conf->{comment_hash} };
+ my $comment_location_map = %{ $conf->{comment_location_map} };
+ my $mode = $conf->{mode};
+
+ # Filter parameters.
+ my $filenumber = $conf->{filenumber};
+ my $line = $conf->{line};
+ my $new = $conf->{new};
+
+ # Determine the comment class to use.
+ my $comment_class = $mode eq 'coloured' ? 'com' : 'smscom';
+ my $no_comment_class = $mode eq 'coloured' ? 'nocom' : 'smsnocom';
+
+ # Determine the anchor and edit URL for this line number.
+ my $anchor = "$filenumber|$line|$new";
+ my $edit_url = "javascript:eo('$filenumber','$line','$new')";
+
+ # Set the anchor to this line number.
+ my $params = {};
+ $params->{name} = $anchor;
+
+ # Only set the href attribute if the comment is in open state.
+ if (!Codestriker::topic_readonly($self->{topic_state})) {
+ $params->{href} = $edit_url;
+ }
+
+ # If a comment exists on this line, set span and the overlib hooks onto
+ # it.
+ my $comment_number = undef;
+ if (exists $comment_hash{$anchor}) {
+ # Determine what comment number this anchor refers to.
+ $comment_number = $comment_location_map{$anchor};
+
+ if (defined $comment_class) {
+ $text = $query->span({-id=>"c$comment_number"}, "") .
+ $query->span({-class=>$comment_class}, $text);
+ }
+
+ # Determine what the next comment in line is.
+ my $index = -1;
+ my @comment_locations = @{ $self->{comment_locations} };
+ for ($index = 0; $index <= $#comment_locations; $index++) {
+ last if $anchor eq $comment_locations[$index];
+ }
+
+ $params->{onmouseover} = "return overlib(comment_text[$index],STICKY,DRAGGABLE,ALTCUT);";
+ $params->{onmouseout} = "return nd();";
+ } else {
+ if (defined $no_comment_class) {
+ $text = $query->span({-class=>$no_comment_class}, $text);
+ }
+ }
+
+ return $query->a($params, $text);
+}
+
+1;
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- viewtopic.html.tmpl 28 Feb 2008 06:26:19 -0000 1.39
+++ viewtopic.html.tmpl 28 Feb 2008 11:01:58 -0000 1.40
@@ -93,6 +93,13 @@
</table>
+[% USE CommentLine query = query comment_hash = comment_hash
+ comment_location_map = comment_location_map
+ mode = mode %]
+
+<p>
+[% FILTER $CommentLine filenumber = -1 line = -1 new = 1 %]Add General Comment[% END %] to topic.
+
[%# The perl script takes control from here, rendering the topic data. #%]
|
|
From: <si...@us...> - 2008-03-11 06:01:19
|
User: sits
Date: 08/03/10 23:01:13
Modified: html codestriker.css
template/en/default viewtopic.html.tmpl
Log:
Add legend to the bottom of the template
Index: codestriker.css
===================================================================
RCS file: /cvsroot/codestriker/codestriker/html/codestriker.css,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- codestriker.css 28 Feb 2008 06:26:18 -0000 1.15
+++ codestriker.css 11 Mar 2008 06:01:12 -0000 1.16
@@ -96,7 +96,7 @@
SPAN.file_comment {background-color: #cccccc; font-family: Helvetica, Arial; font-size: medium; color: #ff0000}
/* General heading */
-SPAN.general_comment {color: #ff0000}
+SPAN.general_comment {color: #000000; font-family: Helvetica, Arial}
/* Style used for rendering data within popup window */
PRE.ms {font-family: monospace; font-size: medium}
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- viewtopic.html.tmpl 9 Mar 2008 19:57:08 -0000 1.41
+++ viewtopic.html.tmpl 11 Mar 2008 06:01:13 -0000 1.42
@@ -103,6 +103,19 @@
[% PROCESS viewdeltas.html.tmpl deltas = deltas %]
+[%# Output the legend at the bottom. #%]
+
+<table cellspacing="0" cellpadding="0" border="0">
+ <tr><td> </td><td> </td></tr>
+ <tr><td colspan="2">Legend:</td></tr>
+ <tr><td class="rf">Removed</td><td class="rb"> </td></tr>
+ <tr><td colspan="2" align="center" class="cf">Changed</td></tr>
+ <tr><td class="ab"> </td><td class="af">Added</td></tr>
+</table>
+
+<p>
+<span class="general_comment">[% add_general_comment_element %] to topic.</span>
+
[%# The perl script takes control from here, rendering the topic data. #%]
|
|
From: <si...@us...> - 2008-03-13 00:56:06
|
User: sits
Date: 08/03/12 17:56:03
Modified: lib/Codestriker/Action ViewTopic.pm
template/en/default viewtopic.html.tmpl
Log:
Remove the old Render references from ViewTopic
Index: ViewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopic.pm,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- ViewTopic.pm 11 Mar 2008 09:06:50 -0000 1.57
+++ ViewTopic.pm 13 Mar 2008 00:56:02 -0000 1.58
@@ -16,7 +16,6 @@
use Codestriker::Model::Topic;
use Codestriker::Model::Comment;
use Codestriker::Http::UrlBuilder;
-use Codestriker::Http::Render;
use Codestriker::Http::DeltaRenderer;
use Codestriker::Repository::RepositoryFactory;
use Codestriker::TopicListeners::Manager;
@@ -306,43 +305,6 @@
# Fire the template for generating the view topic screen.
my $template = Codestriker::Http::Template->new("viewtopic");
$template->process($vars);
-
- # The rest of the output is non-template driven, as it is quite
- # complex.
-
- print $query->p if ($mode == $Codestriker::NORMAL_MODE);
-
- # Number of characters the line number should take, need the real lines
- # not the number of changed lines.
- my @document = split /\n/, $topic->{document};
- my $max_digit_width = length($#document+1);
-
- # Build the render which will be used to build this page.
- my $render = Codestriker::Http::Render->new($query, $url_builder, 1,
- $max_digit_width, $topicid,
- $mode, \@comments, $tabwidth,
- $repository, \@filenames,
- \@revisions, \@binary,
- \@numchanges, -1,
- $brmode, $fview);
-
- # Retrieve the delta set comprising this review.
- my $old_filename = "";
-
- # Now render the selected deltas.
- for (my $i = 0; $i <= $#deltas; $i++) {
- my $delta = $deltas[$i];
- $render->delta($delta);
- }
-
- $render->finish();
-
- # Render the HTML trailer.
- my $trailer = Codestriker::Http::Template->new("trailer");
- $trailer->process();
-
- print $query->end_html();
-
$http_response->generate_footer();
# Fire the topic listener to indicate that the user has viewed the topic.
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- viewtopic.html.tmpl 11 Mar 2008 06:01:13 -0000 1.42
+++ viewtopic.html.tmpl 13 Mar 2008 00:56:03 -0000 1.43
@@ -99,7 +99,8 @@
mode = mode %]
<p>
-<span class="general_comment">[% add_general_comment_element %]</span>
+<span class="general_comment">[% add_general_comment_element %] to topic.</span>
+<p>
[% PROCESS viewdeltas.html.tmpl deltas = deltas %]
@@ -116,7 +117,11 @@
<p>
<span class="general_comment">[% add_general_comment_element %] to topic.</span>
-[%# The perl script takes control from here, rendering the topic data. #%]
+[% PROCESS trailer.html.tmpl %]
+
+</body>
+</html>
+
|
|
From: <si...@us...> - 2008-06-19 03:33:57
|
User: sits
Date: 08/06/18 20:33:51
Modified: lib/Codestriker/Http DeltaRenderer.pm UrlBuilder.pm Input.pm
LineBreakLineFilter.pm
. CHANGELOG
lib/Codestriker/Action ViewTopic.pm ViewTopicFile.pm
template/en/default viewtopic.html.tmpl
Log:
* Removed the "View with minimal screen width" / "View with minimal
link break" options from the view topic screen. If the browser window
is not wide enough, lines will wrap if possible.
Index: DeltaRenderer.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/DeltaRenderer.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- DeltaRenderer.pm 18 Jun 2008 04:47:13 -0000 1.10
+++ DeltaRenderer.pm 19 Jun 2008 03:33:50 -0000 1.11
@@ -19,7 +19,7 @@
# Constructor.
sub new {
- my ($type, $topic, $comments, $deltas, $query, $mode, $brmode,
+ my ($type, $topic, $comments, $deltas, $query, $mode,
$tabwidth, $repository) = @_;
my $self = {};
@@ -28,7 +28,6 @@
$self->{deltas} = $deltas;
$self->{query} = $query;
$self->{mode} = $mode;
- $self->{brmode} = $brmode;
$self->{tabwidth} = $tabwidth;
# Build a hash from filenumber|fileline|new -> comment array, so that
@@ -57,11 +56,11 @@
@{$self->{line_filters}} = ();
if (defined $Codestriker::highlighter && $Codestriker::highlighter ne '') {
push @{$self->{line_filters}}, Codestriker::Http::HighlightLineFilter->new($Codestriker::highlighter, $tabwidth);
- push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new($brmode, 1);
+ push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new();
} else {
push @{$self->{line_filters}}, Codestriker::Http::HtmlEntityLineFilter->new();
push @{$self->{line_filters}}, Codestriker::Http::TabToNbspLineFilter->new($tabwidth);
- push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new($brmode, 0);
+ push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new();
my $lxr_config = defined $repository ?
$Codestriker::lxr_map->{$repository->toString()} : undef;
if (defined $lxr_config) {
Index: UrlBuilder.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/UrlBuilder.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- UrlBuilder.pm 9 Mar 2008 19:57:08 -0000 1.30
+++ UrlBuilder.pm 19 Jun 2008 03:33:50 -0000 1.31
@@ -17,7 +17,7 @@
$UrlBuilder::BOTH_FILES = 2;
# Constructor for this class.
-sub new($$) {
+sub new {
my ($type, $query) = @_;
my $self = {};
$self->{query} = $query;
@@ -50,46 +50,44 @@
}
# Create the URL for viewing a topic with a specified tabwidth.
-sub view_url_extended ($$$$$$$$$$) {
+sub view_url_extended {
my ($self, $topic, $line, $mode, $tabwidth, $email, $prefix,
- $updated, $brmode, $fview) = @_;
+ $updated, $fview) = @_;
return ($prefix ne "" ? $prefix : $self->{query}->url()) .
"?topic=$topic&action=view" .
($updated ? "&updated=$updated" : "") .
((defined $tabwidth && $tabwidth ne "") ? "&tabwidth=$tabwidth" : "") .
((defined $mode && $mode ne "") ? "&mode=$mode" : "") .
- ((defined $brmode && $brmode ne "") ? "&brmode=$brmode" : "") .
((defined $fview && $fview ne "") ? "&fview=$fview" : "") .
((defined $email && $email ne "") ? "&email=$email" : "") .
($line != -1 ? "#${line}" : "");
}
# Create the URL for viewing a topic.
-sub view_url ($$$$$$) {
- my ($self, $topic, $line, $mode, $brmode, $fview) = @_;
+sub view_url {
+ my ($self, $topic, $line, $mode, $fview) = @_;
if (!(defined $mode)) { $mode = $Codestriker::default_topic_create_mode; }
- if (!(defined $brmode)) { $brmode = $Codestriker::default_topic_br_mode; }
if (!(defined $fview)) { $fview = $Codestriker::default_file_to_view; }
return $self->view_url_extended($topic, $line, $mode, "", "", "",
- undef, $brmode, $fview);
+ undef, $fview);
}
# Create the URL for downloading the topic text.
-sub download_url ($$) {
+sub download_url {
my ($self, $topic) = @_;
return $self->{query}->url() . "?action=download&topic=$topic";
}
# Create the URL for creating a topic.
-sub create_topic_url ($$) {
+sub create_topic_url {
my ($self, $obsoletes) = @_;
return $self->{query}->url() . "?action=create" .
(defined $obsoletes ? "&obsoletes=$obsoletes" : "");
}
# Create the URL for editing a topic.
-sub edit_url ($$$$$$$) {
+sub edit_url {
my ($self, $filenumber, $line, $new, $topic, $context,
$anchor, $prefix) = @_;
return ($prefix ne "" ? $prefix : $self->{url_prefix}) .
@@ -99,7 +97,7 @@
}
# Create the URL for viewing a new file.
-sub view_file_url ($$$$$$$) {
+sub view_file_url {
my ($self, $topic, $filenumber, $new, $line, $mode, $parallel) = @_;
if (!(defined $mode)) { $mode = $Codestriker::default_topic_create_mode; }
return $self->{url_prefix} . "?action=view_file&fn=$filenumber&" .
@@ -107,20 +105,20 @@
}
# Create the URL for the search page.
-sub search_url ($) {
+sub search_url {
my ($self) = @_;
return $self->{query}->url() . "?action=search";
}
# Create the URL for the documentation page.
-sub doc_url ($) {
+sub doc_url {
my ($self) = @_;
return $self->{htmldir};
}
# Create the URL for listing the topics (and topic search). See
# _list_topics_url for true param list.
-sub list_topics_url ($$$$$$$$$$$\@\@$) {
+sub list_topics_url {
my ($self) = @_;
shift @_; # peal off self.
@@ -130,7 +128,7 @@
# Create the URL for listing the topics (and topic search) via RSS. See
# _list_topics_url for true param list.
-sub list_topics_url_rss ($$$$$$$$$$$\@\@$) {
+sub list_topics_url_rss {
my ($self) = @_;
shift @_; # peal off self.
@@ -139,7 +137,7 @@
}
# Create the URL for listing the topics.
-sub _list_topics_url ($$$$$$$$$$$$\@\@$) {
+sub _list_topics_url {
my ($self, $action,$sauthor, $sreviewer, $scc, $sbugid, $stext,
$stitle, $sdescription, $scomments, $sbody, $sfilename,
$state_array_ref, $project_array_ref, $content) = @_;
@@ -165,35 +163,35 @@
# Construct a URL for editing a specific project.
-sub edit_project_url ($$) {
+sub edit_project_url {
my ($self, $projectid) = @_;
return $self->{query}->url() . "?action=edit_project&projectid=$projectid";
}
# Construct a URL for listing all projects.
-sub list_projects_url ($) {
+sub list_projects_url {
my ($self) = @_;
return $self->{query}->url() . "?action=list_projects";
}
# Construct a URL for creating a project.
-sub create_project_url ($) {
+sub create_project_url {
my ($self) = @_;
return $self->{query}->url() . "?action=create_project";
}
# Create the URL for viewing comments.
-sub view_comments_url ($$) {
+sub view_comments_url {
my ($self, $topic) = @_;
return $self->{query}->url() . "?action=list_comments&topic=$topic";
}
# Create the URL for viewing the topic properties.
-sub view_topic_properties_url ($$) {
+sub view_topic_properties_url {
my ($self, $topic) = @_;
return $self->{query}->url() .
@@ -201,7 +199,7 @@
}
# Create the URL for viewing the topic metrics.
-sub view_topicinfo_url ($$) {
+sub view_topicinfo_url {
my ($self, $topic) = @_;
return $self->{query}->url() . "?action=viewinfo&topic=$topic";
Index: Input.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/Input.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- Input.pm 18 Jan 2008 21:20:13 -0000 1.46
+++ Input.pm 19 Jun 2008 03:33:50 -0000 1.47
@@ -71,7 +71,6 @@
$self->{filename} = decode_utf8($query->param('filename'));
$self->{linenumber} = $query->param('linenumber');
$self->{mode} = $query->param('mode');
- $self->{brmode} = $query->param('brmode');
$self->{fview} = $query->param('fview');
$self->{bug_ids} = $query->param('bug_ids');
$self->{new} = $query->param('new');
Index: LineBreakLineFilter.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/LineBreakLineFilter.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LineBreakLineFilter.pm 18 Jun 2008 04:47:13 -0000 1.3
+++ LineBreakLineFilter.pm 19 Jun 2008 03:33:50 -0000 1.4
@@ -17,39 +17,21 @@
@Codestriker::Http::LineBreakLineFilter::ISA =
("Codestriker::Http::LineFilter");
-# Take the linebreak mode as a parameter.
sub new {
- my ($type, $brmode, $inspan) = @_;
+ my ($type) = @_;
my $self = Codestriker::Http::LineFilter->new();
- $self->{brmode} = $brmode;
- $self->{inspan} = $inspan;
-
return bless $self, $type;
}
# Convert the spaces appropriately for line-breaking.
sub _filter {
my ($self, $text) = @_;
-
- if ($self->{brmode} == $Codestriker::LINE_BREAK_ASSIST_MODE) {
- # TODO: fix this for highlighted version.
- $text =~ s/^(\s+)/my $sp='';for(my $i=0;$i<length($1);$i++){$sp.=' '}$sp;/ge;
- }
- else {
- if ($self->{inspan}) {
- my @lines = split /\n/, $text;
- my $result = "";
- foreach my $line (@lines) {
- $line =~ s/^( [ ]+)/(' ' x length($1))/eo;
- $line =~ s/(>[^<]*?)( [ ]+)/$1 . (' ' x length($2))/eog;
- $result .= $line . "\n";
- }
- $text = $result;
- } else {
- $text =~ s/ / /g;
- }
- }
+
+ # Replace more than one space with the appropriate number of line breaks.
+ # Ensure a real space is left there so if necessary, the browser can
+ # perform wrapping.
+ $text =~ s/( [ ]+)/' ' . (' ' x (length($1)-1))/eog;
return $text;
}
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.230
retrieving revision 1.231
diff -u -r1.230 -r1.231
--- CHANGELOG 18 Jun 2008 07:11:50 -0000 1.230
+++ CHANGELOG 19 Jun 2008 03:33:51 -0000 1.231
@@ -47,7 +47,11 @@
the same as program code, but an underline is shown when hovered over.
* Updated the Subversion diff parser so that it correctly identifies new
- files, rather than treating them as modified files.
+ files, rather than treating them as modified files.
+
+* Removed the "View with minimal screen width" / "View with minimal
+ link break" options from the view topic screen. If the browser window
+ is not wide enough, lines will wrap if possible.
Version 1.9.4
Index: ViewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopic.pm,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- ViewTopic.pm 16 Jun 2008 06:01:04 -0000 1.61
+++ ViewTopic.pm 19 Jun 2008 03:33:51 -0000 1.62
@@ -1,3 +1,4 @@
+
###############################################################################
# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
# si...@us...
@@ -28,7 +29,6 @@
my $topicid = $http_input->get('topic');
my $mode = $http_input->get('mode');
- my $brmode = $http_input->get('brmode');
my $fview = $http_input->get('fview');
my $tabwidth = $http_input->get('tabwidth');
my $email = $http_input->get('email');
@@ -129,9 +129,6 @@
if ((! defined $mode) || $mode == $Codestriker::NORMAL_MODE) {
$mode = $Codestriker::COLOURED_MODE;
}
- if (! defined $brmode) {
- $brmode = $Codestriker::default_topic_br_mode;
- }
if (! defined $fview) {
$fview = $Codestriker::default_file_to_view;
if (! defined $fview) {
@@ -153,11 +150,10 @@
# Obtain the links for the different viewing modes.
$vars->{'coloured_mode_url'} =
- $url_builder->view_url($topicid, -1, $Codestriker::COLOURED_MODE,
- $brmode, $fview);
+ $url_builder->view_url($topicid, -1, $Codestriker::COLOURED_MODE, $fview);
$vars->{'coloured_mono_mode_url'} =
$url_builder->view_url($topicid, -1,
- $Codestriker::COLOURED_MONO_MODE, $brmode, $fview);
+ $Codestriker::COLOURED_MONO_MODE, $fview);
$vars->{'br_normal_mode_url'} =
$url_builder->view_url($topicid, -1, $mode,
$Codestriker::LINE_BREAK_NORMAL_MODE, $fview);
@@ -174,28 +170,19 @@
$vars->{'mode'} = 'unknown';
}
- # Set template variables relating to line breaking mode.
- if ($brmode == $Codestriker::LINE_BREAK_NORMAL_MODE) {
- $vars->{'brmode'} = 'normal';
- } elsif ($brmode == $Codestriker::LINE_BREAK_ASSIST_MODE) {
- $vars->{'brmode'} = 'assist';
- } else {
- $vars->{'brmode'} = 'unknown';
- }
-
# Set varibles relating to tab-width setting.
my $newtabwidth = ($tabwidth == 4) ? 8 : 4;
$vars->{'tabwidth'} = $tabwidth;
$vars->{'newtabwidth'} = $newtabwidth;
$vars->{'change_tabwidth_url'} =
$url_builder->view_url_extended($topicid, -1, $mode, $newtabwidth,
- "", "", 0, $brmode, $fview);
+ "", "", 0, $fview);
# Set the display all, display single URLs.
$vars->{'display_all_files_url'} =
- $url_builder->view_url($topicid, -1, $mode, $brmode, -1);
+ $url_builder->view_url($topicid, -1, $mode, -1);
$vars->{'display_single_file_url'} =
- $url_builder->view_url($topicid, -1, $mode, $brmode, 0);
+ $url_builder->view_url($topicid, -1, $mode, 0);
$vars->{'fview'} = $fview;
# Setup the filetable template variable for displaying the table of
@@ -207,7 +194,7 @@
$filerow->{filename} = $filename;
$filerow->{numchanges} = $numchanges[$i];
$filerow->{href_filename_url} =
- $url_builder->view_url($topicid, -1, $mode, $brmode, $i) .
+ $url_builder->view_url($topicid, -1, $mode, $i) .
"#" . $filename;
$filerow->{binary} = $binary[$i];
@@ -239,7 +226,7 @@
my $delta_renderer =
Codestriker::Http::DeltaRenderer->new($topic, \@comments, \@deltas, $query,
- $mode, $brmode, $tabwidth, $repository);
+ $mode, $tabwidth, $repository);
# Set the add general comment URL.
$vars->{'add_general_comment_element'} =
@@ -278,12 +265,12 @@
# Create the next/previous file URL links.
if ($filenumber > 0) {
$delta->{previous_file_url} =
- $url_builder->view_url($topicid, -1, $mode, $brmode,
+ $url_builder->view_url($topicid, -1, $mode,
$filenumber-1) . "#" . $filenames[$filenumber-1];
}
if ($filenumber < $#filenames) {
$delta->{next_file_url} =
- $url_builder->view_url($topicid, -1, $mode, $brmode,
+ $url_builder->view_url($topicid, -1, $mode,
$filenumber+1) . "#" . $filenames[$filenumber+1];
}
Index: ViewTopicFile.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopicFile.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ViewTopicFile.pm 11 Jun 2008 12:00:31 -0000 1.15
+++ ViewTopicFile.pm 19 Jun 2008 03:33:51 -0000 1.16
@@ -28,7 +28,6 @@
my $fn = $http_input->get('fn');
my $new = $http_input->get('new');
my $parallel = $http_input->get('parallel');
- my $brmode = $http_input->get('brmode');
my $fview = $http_input->get('fview');
# Check if this action is allowed.
@@ -137,7 +136,7 @@
my $delta_renderer =
Codestriker::Http::DeltaRenderer->new($topic, \@comments,
\@merged_deltas, $query,
- $mode, $brmode, $tabwidth, $repository);
+ $mode, $tabwidth, $repository);
$delta_renderer->annotate_deltas();
my $vars = {};
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- viewtopic.html.tmpl 11 Jun 2008 07:52:04 -0000 1.46
+++ viewtopic.html.tmpl 19 Jun 2008 03:33:51 -0000 1.47
@@ -17,13 +17,6 @@
| View in <a href="[% coloured_mode_url %]">variable-width font</a>
[% END %]
-[%# Display the different line breaking modes. #%]
-[% IF brmode == "normal" %]
-| View with <a href="[% br_assist_mode_url %]">minimal screen width</a>
-[% ELSIF brmode == "assist" %]
-| View with <a href="[% coloured_mode_url %]">minimal line breaks</a>
-[% END %]
-
[%# Display the different tab-width options #%]
| Tab width set to [% tabwidth %]
(<a href="[% change_tabwidth_url %]">change to [% newtabwidth %]</a>)
|
|
From: <si...@us...> - 2008-06-24 02:56:16
|
User: sits
Date: 08/06/23 19:56:15
Modified: lib/Codestriker/Http DeltaRenderer.pm TabToNbspLineFilter.pm
lib/Codestriker/Action ViewTopic.pm
html codestriker.css
template/en/default viewtopic.html.tmpl
Removed: lib/Codestriker/Http LineBreakLineFilter.pm
Log:
Use CSS for space formatting rather than
Index: DeltaRenderer.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/DeltaRenderer.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- DeltaRenderer.pm 23 Jun 2008 07:12:06 -0000 1.14
+++ DeltaRenderer.pm 24 Jun 2008 02:56:15 -0000 1.15
@@ -13,7 +13,6 @@
use Codestriker::Http::HtmlEntityLineFilter;
use Codestriker::Http::TabToNbspLineFilter;
-use Codestriker::Http::LineBreakLineFilter;
use Codestriker::Http::HighlightLineFilter;
use Codestriker::Http::HighlightedLxrLineFilter;
use Codestriker::Http::NonHighlightedLxrLineFilter;
@@ -61,14 +60,12 @@
@{$self->{line_filters}} = ();
if (defined $Codestriker::highlighter && $Codestriker::highlighter ne '') {
push @{$self->{line_filters}}, Codestriker::Http::HighlightLineFilter->new($Codestriker::highlighter, $tabwidth);
- push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new();
if (defined $lxr_config) {
push @{$self->{line_filters}}, Codestriker::Http::HighlightedLxrLineFilter->new($lxr_config);
}
} else {
push @{$self->{line_filters}}, Codestriker::Http::HtmlEntityLineFilter->new();
push @{$self->{line_filters}}, Codestriker::Http::TabToNbspLineFilter->new($tabwidth);
- push @{$self->{line_filters}}, Codestriker::Http::LineBreakLineFilter->new();
if (defined $lxr_config) {
push @{$self->{line_filters}}, Codestriker::Http::NonHighlightedLxrLineFilter->new($lxr_config);
}
Index: TabToNbspLineFilter.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Http/TabToNbspLineFilter.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TabToNbspLineFilter.pm 20 Jun 2008 02:34:00 -0000 1.3
+++ TabToNbspLineFilter.pm 24 Jun 2008 02:56:15 -0000 1.4
@@ -32,7 +32,7 @@
my ($self, $text) = @_;
my $tabwidth = $self->{tabwidth};
- 1 while $text =~ s/\t+/' ' x
+ 1 while $text =~ s/\t+/' ' x
(length($&) * $tabwidth - length($`) % $tabwidth)/eo;
return $text;
Index: LineBreakLineFilter.pm
===================================================================
RCS file: LineBreakLineFilter.pm
diff -N LineBreakLineFilter.pm
--- LineBreakLineFilter.pm 20 Jun 2008 02:34:00 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-###############################################################################
-# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
-# si...@us...
-#
-# This program is free software; you can redistribute it and modify it under
-# the terms of the GPL.
-
-# Line filter for handling line-breaks.
-# entities.
-
-package Codestriker::Http::LineBreakLineFilter;
-
-use strict;
-
-use Codestriker::Http::LineFilter;
-
-@Codestriker::Http::LineBreakLineFilter::ISA =
- ("Codestriker::Http::LineFilter");
-
-sub new {
- my ($type) = @_;
-
- my $self = Codestriker::Http::LineFilter->new();
- return bless $self, $type;
-}
-
-# Convert the spaces appropriately for line-breaking.
-sub _filter {
- my ($self, $text) = @_;
-
- # Replace more than one space with the appropriate number of line breaks.
- # Ensure a real space is left there so if necessary, the browser can
- # perform wrapping.
- $text =~ s/( [ ]+)/' ' . (' ' x (length($1)-1))/eog;
-
- return $text;
-}
-
-1;
Index: ViewTopic.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Action/ViewTopic.pm,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- ViewTopic.pm 19 Jun 2008 03:33:51 -0000 1.62
+++ ViewTopic.pm 24 Jun 2008 02:56:15 -0000 1.63
@@ -164,7 +164,7 @@
# Set template variables relating to coloured mode.
if ($mode == $Codestriker::COLOURED_MODE) {
$vars->{'mode'} = 'coloured';
- } elsif ($mode == $Codestrikier::COLOURED_MONO_MODE) {
+ } elsif ($mode == $Codestriker::COLOURED_MONO_MODE) {
$vars->{'mode'} = 'coloured_mono';
} else {
$vars->{'mode'} = 'unknown';
Index: codestriker.css
===================================================================
RCS file: /cvsroot/codestriker/codestriker/html/codestriker.css,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- codestriker.css 23 Jun 2008 10:12:16 -0000 1.24
+++ codestriker.css 24 Jun 2008 02:56:15 -0000 1.25
@@ -15,52 +15,52 @@
TD.line {background-color: #99cccc; font-family: Georgia, serif; font-size: medium}
/* Normal text */
-TD.n {font-family: Georgia, serif; font-size: smaller}
+TD.n {white-space: pre; font-family: Georgia, serif; font-size: smaller}
/* Normal text monospaced */
-TD.msn {font-family: monospace; font-size: smaller}
+TD.msn {white-space: pre; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
/* Added text */
-TD.a {background-color: #abd; font-family: Georgia, serif; font-size: smaller}
+TD.a {white-space: pre; background-color: #abd; font-family: Georgia, serif; font-size: smaller}
/* Added text monospaced */
-TD.msa {background-color: #abd; font-family: monospace; font-size: smaller}
+TD.msa {white-space: pre; background-color: #abd; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
/* Added file */
TD.af {background-color: #abd}
/* Added blank text */
-TD.ab {background-color: #cccccc; font-family: Georgia, serif; font-size: smaller}
+TD.ab {white-space: pre; background-color: #cccccc; font-family: Georgia, serif; font-size: smaller}
/* Added blank text monospaced */
-TD.msab {background-color: #cccccc; font-family: monospace; font-size: smaller}
+TD.msab {white-space: pre; background-color: #cccccc; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
/* Removed text */
-TD.r {background-color: #ff9999; font-family: Georgia, serif; font-size: smaller}
+TD.r {white-space: pre; background-color: #ff9999; font-family: Georgia, serif; font-size: smaller}
/* Removed text monospaced */
-TD.msr {background-color: #ff9999; font-family: monospace; font-size: smaller}
+TD.msr {white-space: pre; background-color: #ff9999; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
/* Removed file */
TD.rf {background-color: #ff9999}
/* Removed blank text */
-TD.rb {background-color: #cccccc; font-family: Georgia, serif; font-size: smaller}
+TD.rb {white-space: pre; background-color: #cccccc; font-family: Georgia, serif; font-size: smaller}
/* Changed text */
-TD.c {background-color: #ffff77; font-family: Georgia, serif; font-size: smaller}
+TD.c {white-space: pre; background-color: #ffff77; font-family: Georgia, serif; font-size: smaller}
/* Changed text monospaced */
-TD.msc {background-color: #ffff77; font-family: monospace; font-size: smaller}
+TD.msc {white-space: pre; background-color: #ffff77; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
/* Changed file */
TD.cf {background-color: #ffff77}
/* Changed blank text */
-TD.cb {background-color: #eeee77; font-family: Georgia, serif; font-size: smaller}
+TD.cb {white-space: pre; background-color: #eeee77; font-family: Georgia, serif; font-size: smaller}
/* Changed blank text monospaced */
-TD.mscb {background-color: #eeee77; font-family: monospace; font-size: smaller}
+TD.mscb {white-space: pre; background-color: #eeee77; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
/* Table of contents links */
A.toc { font-family: Georgia, serif; font-size: smaller}
@@ -70,30 +70,30 @@
A.toc:link:hover { text-decoration: underline; }
/* Line number with comment */
-A.comment { color: #ff0000; font-family: Georgia, serif; font-size: smaller}
+A.comment { color: #ff0000; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
A.comment:link { color: ff0000; text-decoration: none }
A.comment:visited { color: inherit; text-decoration: none }
A.comment:visited:hover { text-decoration: underline; }
A.comment:link:hover { text-decoration: underline; }
/* Line number with no comment */
-A.nocom { font-family: Georgia, serif; font-size: smaller}
+A.nocom { font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: smaller}
A.nocom:link { color: inherit; text-decoration: none }
A.nocom:visited { color: inherit; text-decoration: none }
A.nocom:visited:hover { text-decoration: underline; }
A.nocom:link:hover { text-decoration: underline; }
/* Monospaced line with added text */
-SPAN.msa {background-color: #abd; font-family: monospace; font-size: medium}
+SPAN.msa {background-color: #abd; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: medium}
/* Monospaced line with removed text */
-SPAN.msr {background-color: #ff9999; font-family: monospace; font-size: medium}
+SPAN.msr {background-color: #ff9999; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: medium}
/* Monospaced line with changed text */
-SPAN.msc {background-color: #ffff77; font-family: monospace; font-size: medium}
+SPAN.msc {background-color: #ffff77; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: medium}
/* Monospaced line with normal text */
-SPAN.ms {font-family: monospace; font-size: medium}
+SPAN.ms {font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace; font-size: medium}
/* Monospaced line number with comment */
SPAN.mscom {color: #ff0000; font-family: monospace; font-size: medium}
@@ -138,9 +138,9 @@
/* Style comment listings. */
TR.comments {background-color: #abd; font-family: Georgia, serif} /* space */
TR.commenth {background-color: #cccccc; font-family: Georgia, serif} /* header */
-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 */
+TR.commentb {background-color: #eeeeee; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace} /* comment body */
+TD.commentb {background-color: #eeeeee; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace} /* comment body */
+TR.commentc {background-color: #eeeeee; font-family: Consolas, "Nimbus Mono L", LucidaConsole, "Bitstream Vera Sans Mono", monospace} /* context */
/* Style for topic title headings. */
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- viewtopic.html.tmpl 23 Jun 2008 10:12:16 -0000 1.48
+++ viewtopic.html.tmpl 24 Jun 2008 02:56:15 -0000 1.49
@@ -87,7 +87,7 @@
mode = mode %]
<p>
-<span class="general_comment">[% add_general_comment_element %] to topic.</span>
+<span class="general_comment">[[% add_general_comment_element %]] to topic.</span>
<p>
[%# Render the delta header in the footer if only one file is being viewed. #%]
@@ -104,7 +104,7 @@
</table>
<p>
-<span class="general_comment">[% add_general_comment_element %] to topic.</span>
+<span class="general_comment">[[% add_general_comment_element %]] to topic.</span>
[% PROCESS trailer.html.tmpl %]
|
|
From: <si...@us...> - 2008-06-24 04:51:31
|
User: sits Date: 08/06/23 21:51:30 Modified: template/en/default viewtopic.html.tmpl Log: Changed "monospace" to "fixed-width". Index: viewtopic.html.tmpl =================================================================== RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- viewtopic.html.tmpl 24 Jun 2008 03:26:50 -0000 1.50 +++ viewtopic.html.tmpl 24 Jun 2008 04:51:30 -0000 1.51 @@ -12,7 +12,7 @@ [%# Display the different coloured viewing modes #%] [% IF mode == "coloured" %] -| View in <a href="[% coloured_mono_mode_url %]">monospace font</a> +| View in <a href="[% coloured_mono_mode_url %]">fixed-width font</a> [% ELSIF mode == "coloured_mono" %] | View in <a href="[% coloured_mode_url %]">variable-width font</a> [% END %] |
|
From: <si...@us...> - 2008-06-27 00:19:11
|
User: sits
Date: 08/06/26 17:19:10
Modified: template/en/default viewtopic.html.tmpl
Removed: lib/Codestriker/Template/Plugin CommentLine.pm
Log:
Remove the use of the CommentLine tt plugin. It was no longer used, and it was causing issues when running under mod_perl.
Index: CommentLine.pm
===================================================================
RCS file: CommentLine.pm
diff -N CommentLine.pm
--- CommentLine.pm 28 Feb 2008 11:01:58 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,78 +0,0 @@
-package Codestriker::Template::Plugin::CommentLine;
-
-# Template toolkit plugin module for outputting the anchor text
-# for a specific line.
-
-use Template::Plugin::Filter;
-use Codestriker;
-use Codestriker::Http::UrlBuilder;
-
-use base qw( Template::Plugin::Filter );
-
-# Indicate that the filter should be re-created on each filter call.
-our $DYNAMIC = 1;
-
-sub filter {
- my ($self, $text, $args, $conf) = @_;
-
- $conf = $self->merge_config($conf);
-
- # Constructor parameters.
- my $query = $conf->{query};
- my $comment_hash = %{ $conf->{comment_hash} };
- my $comment_location_map = %{ $conf->{comment_location_map} };
- my $mode = $conf->{mode};
-
- # Filter parameters.
- my $filenumber = $conf->{filenumber};
- my $line = $conf->{line};
- my $new = $conf->{new};
-
- # Determine the comment class to use.
- my $comment_class = $mode eq 'coloured' ? 'com' : 'smscom';
- my $no_comment_class = $mode eq 'coloured' ? 'nocom' : 'smsnocom';
-
- # Determine the anchor and edit URL for this line number.
- my $anchor = "$filenumber|$line|$new";
- my $edit_url = "javascript:eo('$filenumber','$line','$new')";
-
- # Set the anchor to this line number.
- my $params = {};
- $params->{name} = $anchor;
-
- # Only set the href attribute if the comment is in open state.
- if (!Codestriker::topic_readonly($self->{topic_state})) {
- $params->{href} = $edit_url;
- }
-
- # If a comment exists on this line, set span and the overlib hooks onto
- # it.
- my $comment_number = undef;
- if (exists $comment_hash{$anchor}) {
- # Determine what comment number this anchor refers to.
- $comment_number = $comment_location_map{$anchor};
-
- if (defined $comment_class) {
- $text = $query->span({-id=>"c$comment_number"}, "") .
- $query->span({-class=>$comment_class}, $text);
- }
-
- # Determine what the next comment in line is.
- my $index = -1;
- my @comment_locations = @{ $self->{comment_locations} };
- for ($index = 0; $index <= $#comment_locations; $index++) {
- last if $anchor eq $comment_locations[$index];
- }
-
- $params->{onmouseover} = "return overlib(comment_text[$index],STICKY,DRAGGABLE,ALTCUT);";
- $params->{onmouseout} = "return nd();";
- } else {
- if (defined $no_comment_class) {
- $text = $query->span({-class=>$no_comment_class}, $text);
- }
- }
-
- return $query->a($params, $text);
-}
-
-1;
Index: viewtopic.html.tmpl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/template/en/default/viewtopic.html.tmpl,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- viewtopic.html.tmpl 24 Jun 2008 04:51:30 -0000 1.51
+++ viewtopic.html.tmpl 27 Jun 2008 00:19:10 -0000 1.52
@@ -82,10 +82,6 @@
</table>
-[% USE CommentLine query = query comment_hash = comment_hash
- comment_location_map = comment_location_map
- mode = mode %]
-
<p>
<span class="general_comment">[[% add_general_comment_element %]] to topic.</span>
<p>
|