changeset 95:a3ce21dba885

add favicons to source entries in the river view
author Myk Melez <myk@mozilla.org>
date Sun, 18 May 2008 01:39:03 -0700
parents ecc8118e4c2e
children f646238dc6b8
files extension/content/river.css extension/content/river.js
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/extension/content/river.css	Sun May 18 00:52:28 2008 -0700
+++ b/extension/content/river.css	Sun May 18 01:39:03 2008 -0700
@@ -75,6 +75,14 @@
   text-decoration: none;
 }
 
+/* Don't draw borders around hyperlinked favicons, but do pad them a bit
+ * between the end of the favicon and the start of its label. */
+a > img {
+  border: 0;
+  -moz-padding-end: 1px;
+  
+}
+
 .body {
   /* -moz-column-width alone won't create the correct number of columns,
    * but if I include a high -moz-column-count, it'll ignore the count
--- a/extension/content/river.js	Sun May 18 00:52:28 2008 -0700
+++ b/extension/content/river.js	Sun May 18 01:39:03 2008 -0700
@@ -569,6 +569,10 @@
         let source = this._document.createElementNS(XUL_NS, "description");
         source.className = "source";
         let a = this._document.createElementNS(HTML_NS, "a");
+        let icon = document.createElementNS(HTML_NS, "img");
+        let uri = message.source.humanURI || URI.get("urn:use-default-icon");
+        icon.src = this._faviconSvc.getFaviconImageForPage(uri).spec;
+        a.appendChild(icon);
         a.appendChild(this._document.createTextNode(message.source.name));
         if (message.source.humanURI)
           this._unsafeSetURIAttribute(a, "href", message.source.humanURI.spec);