Mercurial > snowl
changeset 367:7ff9253ec3b4
put byline, title, and content in correct order per new visual design mockups
author | Myk Melez <myk@mozilla.org> |
---|---|
date | Thu, 06 Nov 2008 17:04:44 -0800 |
parents | 03a77e6d86cd |
children | 69f55e6480f3 |
files | content/river.css content/river.js content/river.xul |
diffstat | 3 files changed, 35 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/content/river.css Tue Nov 04 21:32:43 2008 -0800 +++ b/content/river.css Thu Nov 06 17:04:44 2008 -0800 @@ -98,14 +98,24 @@ color: #555; } -h2 { - font-size: larger; - margin-bottom: 0; -} - .byline { font-size: smaller; font-family: sans-serif; + color: grey; +} + +.title { + font-size: 100%; + margin-bottom: 0.5em; + margin-top: 0; +} + + +/* Suppress the top margin on the initial content element so we can control + * the amount of margin between the subject and the content with the rule + * above on the subject element. */ +div.body > *:first-child { + margin-top: 0; } .metadata {
--- a/content/river.js Tue Nov 04 21:32:43 2008 -0800 +++ b/content/river.js Thu Nov 06 17:04:44 2008 -0800 @@ -748,21 +748,20 @@ messageBox.className = "message"; messageBox.setAttribute("index", i); - // Title - let title = this._document.createElementNS(HTML_NS, "h2"); - title.className = "title"; - let titleLink = this._document.createElementNS(HTML_NS, "a"); - titleLink.appendChild(this._document.createTextNode(message.subject || "untitled")); - if (message.link) - this._unsafeSetURIAttribute(titleLink, "href", message.link); - title.appendChild(titleLink); - messageBox.appendChild(title); - // Byline let bylineBox = this._document.createElementNS(HTML_NS, "div"); bylineBox.className = "byline"; messageBox.appendChild(bylineBox); + // Author and/or Source + if (message.author) + bylineBox.appendChild(this._document.createTextNode(message.author)); + if (message.source) { + if (message.author) + bylineBox.appendChild(this._document.createTextNode(" - ")); + bylineBox.appendChild(this._document.createTextNode(message.source.name)); + } + // Source //let source = this._document.createElementNS(HTML_NS, "a"); //source.className = "source"; @@ -775,11 +774,15 @@ // this._unsafeSetURIAttribute(source, "href", message.source.humanURI.spec); //bylineBox.appendChild(source); - // 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)); + // Title + let title = this._document.createElementNS(HTML_NS, "h2"); + title.className = "title"; + let titleLink = this._document.createElementNS(HTML_NS, "a"); + titleLink.appendChild(this._document.createTextNode(message.subject || "untitled")); + if (message.link) + this._unsafeSetURIAttribute(titleLink, "href", message.link); + title.appendChild(titleLink); + messageBox.appendChild(title); //// Timestamp //let lastUpdated = SnowlDateUtils._formatDate(message.timestamp);
--- a/content/river.xul Tue Nov 04 21:32:43 2008 -0800 +++ b/content/river.xul Thu Nov 06 17:04:44 2008 -0800 @@ -68,6 +68,8 @@ <vbox flex="1"> <toolbar id="toolbar"> + <!-- <toolbarbutton oncommand="dump(new XMLSerializer().serializeToString(document))"/> --> + <toolbarbutton id="currentButton" type="checkbox" image="chrome://snowl/content/icons/newspaper.png" oncommand="SnowlMessageView.onCommandCurrentButton(event)"