Let timestamps link directly to the message, makes it easier to see a thread from channel or user-feed

This commit is contained in:
Anders Rune Jensen
2017-05-31 21:20:43 +02:00
parent f5e2111be8
commit 42c466b4df
+3 -3
View File
@@ -331,7 +331,7 @@ function renderMsg(opts, msg) {
escape(msg.value.author) +
'"' +
">" + msg.author.name + "</a>" +
msgTimestamp(msg, name) +
msgTimestamp(msg, opts.base + name) +
'</figcaption>' +
'</figure>' +
'</header>' +
@@ -340,13 +340,13 @@ function renderMsg(opts, msg) {
);
}
function msgTimestamp(msg, name) {
function msgTimestamp(msg, link) {
var date = new Date(msg.value.timestamp);
var isoStr = date.toISOString();
return (
'<time class="ssb-timestamp" datetime="' + isoStr + '">' +
'<a ' +
'href="#' + name + '" ' +
'href="' + link + '" ' +
'title="' + isoStr + '" ' +
'>' + formatDate(date) + '</a>' +
'</time>'