X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=4058bee775507c70e0c1a73ca82235c4f9026f78;hb=476fc666c223f0fb;hp=7d855550888d7096949670ba477530aa22c48dd0;hpb=930f2746d48829af6ca8b14ba96e006204fae4d5;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 7d855550..4058bee7 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -1,5 +1,8 @@ # Copyright (C) 2014-2015 all contributors # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt) +# +# Used for displaying the HTML web interface. +# See Documentation/design_www.txt for this. package PublicInbox::View; use strict; use warnings; @@ -8,21 +11,17 @@ use Date::Parse qw/str2time/; use Encode qw/find_encoding/; use Encode::MIME::Header; use Email::MIME::ContentType qw/parse_content_type/; -use PublicInbox::Hval; -use PublicInbox::MID qw/mid_clean mid_compress mid2path/; -use Digest::SHA qw/sha1_hex/; -my $SALT = rand; +use PublicInbox::Hval qw/ascii_html/; +use PublicInbox::Linkify; +use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/; require POSIX; # TODO: make these constants tunable use constant MAX_INLINE_QUOTED => 12; # half an 80x24 terminal use constant MAX_TRUNC_LEN => 72; -use constant PRE_WRAP => "
"; use constant T_ANCHOR => '#u'; use constant INDENT => ' '; -*ascii_html = *PublicInbox::Hval::ascii_html; - my $enc_utf8 = find_encoding('UTF-8'); # public functions: @@ -33,27 +32,68 @@ sub msg_html { } else { $footer = ''; } - headers_to_html_header($mime, $full_pfx, $ctx) . + my $hdr = $mime->header_obj; + headers_to_html_header($hdr, $full_pfx, $ctx) . multipart_text_as_html($mime, $full_pfx) . - '
' . + html_footer($hdr, 1, $full_pfx, $ctx) . $footer . '