* [PATCH 07/10] extmsg: switch to wwwstream for partial match, too
2016-07-06 7:14 5% [PATCH 0/10] various misc fixes and updates Eric Wong
@ 2016-07-06 7:14 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-07-06 7:14 UTC (permalink / raw)
To: meta
Another step towards a consistent WWW UI...
---
lib/PublicInbox/ExtMsg.pm | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm
index 4925a59..019d50a 100644
--- a/lib/PublicInbox/ExtMsg.pm
+++ b/lib/PublicInbox/ExtMsg.pm
@@ -104,14 +104,12 @@ again:
my $h = PublicInbox::Hval->new_msgid($mid);
my $href = $h->as_href;
my $html = $h->as_html;
- my $title = "Message-ID <$html> not found";
- my $s = "<html><head><title>$title</title>" .
- "</head><body><pre><b>$title</b>\n";
-
+ my $title = "<$html> not found";
+ my $s = "<pre>Message-ID <$html>\nnot found\n";
if ($n_partial) {
$code = 300;
my $es = $n_partial == 1 ? '' : 'es';
- $s.= "\n$n_partial partial match$es found:\n\n";
+ $s .= "\n$n_partial partial match$es found:\n\n";
foreach my $pair (@partial) {
my ($ibx, $res) = @$pair;
my $u = $ibx->base_url or next;
@@ -123,21 +121,15 @@ again:
}
}
}
-
- # Fall back to external repos if configured
- if (@EXT_URL && index($mid, '@') >= 0) {
+ my $ext = ext_urls($ctx, $mid, $href, $html);
+ if ($ext ne '') {
+ $s .= $ext;
$code = 300;
- $s .= "\nPerhaps try an external site:\n\n";
- foreach my $url (@EXT_URL) {
- my $u = PublicInbox::Hval::prurl($env, $url);
- my $r = sprintf($u, $href);
- my $t = sprintf($u, $html);
- $s .= qq{<a\nhref="$r">$t</a>\n};
- }
}
- $s .= '</pre></body></html>';
-
- [$code, ['Content-Type'=>'text/html; charset=UTF-8'], [$s]];
+ $ctx->{-html_tip} = $s .= '</pre>';
+ $ctx->{-title_html} = $title;
+ $ctx->{-upfx} = '../';
+ PublicInbox::WwwStream->response($ctx, $code);
}
sub ext_urls {
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/10] various misc fixes and updates
@ 2016-07-06 7:14 5% Eric Wong
2016-07-06 7:14 7% ` [PATCH 07/10] extmsg: switch to wwwstream for partial match, too Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-07-06 7:14 UTC (permalink / raw)
To: meta
Close to a milestone with HTML UI consistency!
Eric Wong (10):
scripts/dc-dlvr: ensure temporary files are removed
daemon: disable USR2/TTIN/TTOU/WINCH in workers
hval: get rid of unused parameter for new_msgid
address: attempt to handle comments somewhat
wwwstream: allow undef noop callback
extmsg: disable automatic inbox switching
extmsg: switch to wwwstream for partial match, too
view: fix double-escaping of ghost links
www: use HTML <hr> instead of XHTML <hr />
feed: fix links to attachments in Atom feed
lib/PublicInbox/Address.pm | 6 ++--
lib/PublicInbox/Daemon.pm | 3 +-
lib/PublicInbox/ExtMsg.pm | 73 +++++++++++++++++++++++++++---------------
lib/PublicInbox/Feed.pm | 6 ++--
lib/PublicInbox/Hval.pm | 2 +-
lib/PublicInbox/SearchView.pm | 6 ++--
lib/PublicInbox/Unsubscribe.pm | 2 +-
lib/PublicInbox/View.pm | 17 +++++-----
lib/PublicInbox/WwwStream.pm | 6 ++--
scripts/dc-dlvr | 3 +-
t/address.t | 9 ++++++
11 files changed, 84 insertions(+), 49 deletions(-)
--
EW
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-07-06 7:14 5% [PATCH 0/10] various misc fixes and updates Eric Wong
2016-07-06 7:14 7% ` [PATCH 07/10] extmsg: switch to wwwstream for partial match, too Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).