Mercurial > snowl
changeset 224:3bd1e93cfae0
include the author or source in the byline in the river of news view
author | Myk Melez <myk@mozilla.org> |
---|---|
date | Wed, 30 Jul 2008 00:59:31 -0700 |
parents | 4f80f29ad53a |
children | d11c788c254f |
files | extension/content/river.js |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/extension/content/river.js Wed Jul 30 00:49:26 2008 -0700 +++ b/extension/content/river.js Wed Jul 30 00:59:31 2008 -0700 @@ -599,9 +599,11 @@ // this._unsafeSetURIAttribute(source, "href", message.source.humanURI.spec); //bylineBox.appendChild(source); - // Author - //if (message.author) - // bylineBox.appendChild(this._document.createTextNode(message.author)); + // Author or Source + if (message.author) + bylineBox.appendChild(this._document.createTextNode(message.author)); + else if (message.source) + bylineBox.appendChild(this._document.createTextNode(message.source.name)); // Timestamp let lastUpdated = this._formatTimestamp(new Date(message.timestamp)); @@ -609,6 +611,8 @@ let timestamp = this._document.createElementNS(HTML_NS, "span"); timestamp.className = "timestamp"; timestamp.appendChild(document.createTextNode(lastUpdated)); + if (bylineBox.hasChildNodes()) + bylineBox.appendChild(this._document.createTextNode(" - ")); bylineBox.appendChild(timestamp); }