[Codestriker-commits] CVS update: codestriker/template/en/default viewtopic.html.tmpl
Brought to you by:
sits
|
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>)
|