* [PATCH 0/4] minor navigation tweaks
@ 2015-09-13 23:35 Eric Wong
2015-09-13 23:35 ` [PATCH 1/4] view: extra Atom feed link in standalone message view Eric Wong
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Eric Wong @ 2015-09-13 23:35 UTC (permalink / raw)
To: meta
A few navigation tweaks to hopefully improve per-message and
per-thread views.
Eric Wong (4):
view: extra Atom feed link in standalone message view
view: use header_obj to avoid extra method calls
view: do not show References unless a message has them
view: jump to anchor of current message on References
lib/PublicInbox/View.pm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] view: extra Atom feed link in standalone message view
2015-09-13 23:35 [PATCH 0/4] minor navigation tweaks Eric Wong
@ 2015-09-13 23:35 ` Eric Wong
2015-09-13 23:35 ` [PATCH 2/4] view: use header_obj to avoid extra method calls Eric Wong
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2015-09-13 23:35 UTC (permalink / raw)
To: meta
It might be helpful if user agents do not display the <link>
element in <head>.
---
lib/PublicInbox/View.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 7e1fb04..6cb340b 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -544,6 +544,10 @@ sub html_footer {
my $srch = $ctx->{srch} if $ctx;
my $upfx = $full_pfx ? '../' : '../../';
my $idx = $standalone ? " <a\nhref=\"$upfx\">index</a>" : '';
+
+ if ($srch && $standalone) {
+ $idx .= qq{ / follow: <a\nhref="t.atom">Atom feed</a>};
+ }
if ($idx && $srch) {
my ($next, $p) = thread_inline(\$idx, $ctx, $mime, $full_pfx);
if (defined $p) {
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] view: use header_obj to avoid extra method calls
2015-09-13 23:35 [PATCH 0/4] minor navigation tweaks Eric Wong
2015-09-13 23:35 ` [PATCH 1/4] view: extra Atom feed link in standalone message view Eric Wong
@ 2015-09-13 23:35 ` Eric Wong
2015-09-13 23:35 ` [PATCH 3/4] view: do not show References unless a message has them Eric Wong
2015-09-13 23:35 ` [PATCH 4/4] view: jump to anchor of current message on References Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2015-09-13 23:35 UTC (permalink / raw)
To: meta
Email::MIME will call the header_obj each time anyways, avoid
the extra method lookups and hit header_obj directly for the
header lookup.
---
lib/PublicInbox/View.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 6cb340b..2cda691 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -410,7 +410,7 @@ sub headers_to_html_header {
my $mid = $header_obj->header('Message-ID');
$mid = PublicInbox::Hval->new_msgid($mid);
foreach my $h (qw(From To Cc Subject Date)) {
- my $v = $mime->header($h);
+ my $v = $header_obj->header($h);
defined($v) && ($v ne '') or next;
$v = PublicInbox::Hval->new_oneline($v);
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] view: do not show References unless a message has them
2015-09-13 23:35 [PATCH 0/4] minor navigation tweaks Eric Wong
2015-09-13 23:35 ` [PATCH 1/4] view: extra Atom feed link in standalone message view Eric Wong
2015-09-13 23:35 ` [PATCH 2/4] view: use header_obj to avoid extra method calls Eric Wong
@ 2015-09-13 23:35 ` Eric Wong
2015-09-13 23:35 ` [PATCH 4/4] view: jump to anchor of current message on References Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2015-09-13 23:35 UTC (permalink / raw)
To: meta
It's a waste of space and potentially confusing.
---
lib/PublicInbox/View.pm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 2cda691..aaab3b2 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -434,7 +434,12 @@ sub headers_to_html_header {
$rv .= "(<a\nhref=\"${upfx}raw\">raw</a>)\n";
my $atom;
if ($srch) {
- $rv .= "<a\nhref=\"${upfx}t/\">References: [expand]</a>\n";
+ if ($header_obj->header('In-Reply-To') ||
+ $header_obj->header('References')) {
+ $rv .= "<a\nhref=\"${upfx}t/\">" .
+ "References: [expand]</a>\n";
+ }
+
$atom = qq{<link\nrel=alternate\ntitle="Atom feed"\n} .
qq!href="${upfx}t.atom"\ntype="application/atom+xml"/>!;
} else {
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] view: jump to anchor of current message on References
2015-09-13 23:35 [PATCH 0/4] minor navigation tweaks Eric Wong
` (2 preceding siblings ...)
2015-09-13 23:35 ` [PATCH 3/4] view: do not show References unless a message has them Eric Wong
@ 2015-09-13 23:35 ` Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2015-09-13 23:35 UTC (permalink / raw)
To: meta
Otherwise it could be a bit disorienting to jump to the
first message in the thread without navigation context.
---
lib/PublicInbox/View.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index aaab3b2..65bc2f8 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -436,7 +436,7 @@ sub headers_to_html_header {
if ($srch) {
if ($header_obj->header('In-Reply-To') ||
$header_obj->header('References')) {
- $rv .= "<a\nhref=\"${upfx}t/\">" .
+ $rv .= "<a\nhref=\"${upfx}t/#u\">" .
"References: [expand]</a>\n";
}
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-13 23:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-13 23:35 [PATCH 0/4] minor navigation tweaks Eric Wong
2015-09-13 23:35 ` [PATCH 1/4] view: extra Atom feed link in standalone message view Eric Wong
2015-09-13 23:35 ` [PATCH 2/4] view: use header_obj to avoid extra method calls Eric Wong
2015-09-13 23:35 ` [PATCH 3/4] view: do not show References unless a message has them Eric Wong
2015-09-13 23:35 ` [PATCH 4/4] view: jump to anchor of current message on References Eric Wong
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).