|
From: <ssc...@us...> - 2003-04-27 01:08:17
|
Update of /cvsroot/popfile/engine/UI
In directory sc8-pr-cvs1:/tmp/cvs-serv24890
Modified Files:
HTML.pm
Log Message:
localize a magnet string, fix new version checking, fix magnet highlighting for < and >
Index: HTML.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -d -r1.145 -r1.146
*** HTML.pm 26 Apr 2003 04:21:31 -0000 1.145
--- HTML.pm 27 Apr 2003 01:08:13 -0000 1.146
***************
*** 411,415 ****
if ( $self->config_( 'update_check' ) ) {
$update_check = "<a href=\"http://sourceforge.net/project/showfiles.php?group_id=63137\">\n";
! $update_check .= "<img border=\"0\" alt=\"\" src=\"http://www.usethesource.com/cgi-bin/popfile_update.pl?ma=$self->{configuration}{major_version}&mi=$self->{configuration}{minor_version}&bu=$self->{configuration}{build_version}\" />\n</a>\n";
}
--- 411,416 ----
if ( $self->config_( 'update_check' ) ) {
$update_check = "<a href=\"http://sourceforge.net/project/showfiles.php?group_id=63137\">\n";
! my ( $major_version, $minor_version, $build_version ) = $self->version() =~ /^v([^.]*)\.([^.]*)\.(.*)$/;
! $update_check .= "<img border=\"0\" alt=\"\" src=\"http://www.usethesource.com/cgi-bin/popfile_update.pl?ma=" . $major_version . "&mi=" . $minor_version . "&bu=" . $build_version . "\" />\n</a>\n";
}
***************
*** 2999,3034 ****
$body .= $self->{classifier__}->get_html_colored_message($self->global_config_( 'msgdir' ) . $mail_file);
} else {
! $self->{history__}{$mail_file}{magnet} =~ /(.+): ([^\r\n]+)/;
! my $header = $1;
! my $text = $2;
! $body .= "<tt>";
!
! open MESSAGE, '<' . $self->global_config_( 'msgdir' ) . $mail_file;
! my $line;
! # process each line of the message
! while ($line = <MESSAGE>) {
! $line =~ s/</</g;
! $line =~ s/>/>/g;
!
! $line =~ s/([^\r\n]{100,150} )/$1<br \/>/g;
! $line =~ s/([^ \r\n]{150})/$1<br \/>/g;
! $line =~ s/[\r\n]+/<br \/>/g;
!
! if ( $line =~ /^([A-Za-z-]+): ?([^\n\r]*)/ ) {
! my $head = $1;
! my $arg = $2;
!
! if ( $head =~ /\Q$header\E/i ) {
! if ( $arg =~ /\Q$text\E/i ) {
! my $new_color = $self->{classifier__}->get_bucket_color($self->{history__}{$mail_file}{bucket});
! $line =~ s/(\Q$text\E)/<b><font color=\"$new_color\">$1<\/font><\/b>/;
! }
! }
! }
!
! $body .= $line;
! }
! close MESSAGE;
! $body .= "</tt>\n";
}
--- 3000,3039 ----
$body .= $self->{classifier__}->get_html_colored_message($self->global_config_( 'msgdir' ) . $mail_file);
} else {
! $self->{history__}{$mail_file}{magnet} =~ /(.+): ([^\r\n]+)/;
! my $header = $1;
! my $text = $2;
! $body .= "<tt>";
!
! open MESSAGE, '<' . $self->global_config_( 'msgdir' ) . $mail_file;
! my $line;
! # process each line of the message
! while ($line = <MESSAGE>) {
! $line =~ s/</</g;
! $line =~ s/>/>/g;
!
! $line =~ s/([^\r\n]{100,150} )/$1<br \/>/g;
! $line =~ s/([^ \r\n]{150})/$1<br \/>/g;
! $line =~ s/[\r\n]+/<br \/>/g;
!
! if ( $line =~ /^([A-Za-z-]+): ?([^\n\r]*)/ ) {
! my $head = $1;
! my $arg = $2;
!
! if ( $head =~ /\Q$header\E/i ) {
!
! $text =~ s/</</g;
! $text =~ s/>/>/g;
!
! if ( $arg =~ /\Q$text\E/i ) {
! my $new_color = $self->{classifier__}->get_bucket_color($bucket);
! $line =~ s/(\Q$text\E)/<b><font color=\"$new_color\">$1<\/font><\/b>/;
! }
! }
! }
!
! $body .= $line;
! }
! close MESSAGE;
! $body .= "</tt>\n";
}
***************
*** 3036,3053 ****
$body .= "<tr><td class=\"top20\" valign=\"top\">\n";
!
! # Enable saving of word-scores
!
! $self->{classifier__}->wordscores( 1 );
!
! # Build the scores by classifying the message
!
! $self->{classifier__}->classify_file($self->global_config_( 'msgdir' ) . $mail_file, $self);
!
! # Disable, print, and clear saved word-scores
!
! $self->{classifier__}->wordscores( 0 );
! $body .= $self->{classifier__}->scores();
! $self->{classifier__}->scores('');
# Close button
--- 3041,3067 ----
$body .= "<tr><td class=\"top20\" valign=\"top\">\n";
!
! if ($self->{history__}{$mail_file}{magnet} eq '') {
!
! # Enable saving of word-scores
!
! $self->{classifier__}->wordscores( 1 );
!
! # Build the scores by classifying the message
!
! $self->{classifier__}->classify_file($self->global_config_( 'msgdir' ) . $mail_file, $self);
!
! # Disable, print, and clear saved word-scores
!
! $self->{classifier__}->wordscores( 0 );
! $body .= $self->{classifier__}->scores();
! $self->{classifier__}->scores('');
!
! } else {
! $body .= sprintf( $self->{language__}{History_MagnetBecause},
! $color, $bucket,
! Classifier::MailParse::splitline($self->{history__}{$mail_file}{magnet},0)
! );
! }
# Close button
|