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) + escape(msg.value.author) +
'"' + '"' +
">" + msg.author.name + "</a>" + ">" + msg.author.name + "</a>" +
msgTimestamp(msg, name) + msgTimestamp(msg, opts.base + name) +
'</figcaption>' + '</figcaption>' +
'</figure>' + '</figure>' +
'</header>' + '</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 date = new Date(msg.value.timestamp);
var isoStr = date.toISOString(); var isoStr = date.toISOString();
return ( return (
'<time class="ssb-timestamp" datetime="' + isoStr + '">' + '<time class="ssb-timestamp" datetime="' + isoStr + '">' +
'<a ' + '<a ' +
'href="#' + name + '" ' + 'href="' + link + '" ' +
'title="' + isoStr + '" ' + 'title="' + isoStr + '" ' +
'>' + formatDate(date) + '</a>' + '>' + formatDate(date) + '</a>' +
'</time>' '</time>'