336852 - show some basic content in the feed handling page, also fix some bustage due to identicaly named libraries with toolkit/components/feeds.

git-svn-id: svn://10.0.0.236/trunk@196099 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beng%bengoodger.com
2006-05-06 04:58:38 +00:00
parent 1f1a49fbee
commit bd3dee851f
6 changed files with 31 additions and 62 deletions

View File

@@ -85,7 +85,7 @@ endif
ifdef MOZ_FEEDS
LOCAL_INCLUDES += -I$(srcdir)/../feeds/src
SHARED_LIBRARY_LIBS += ../feeds/src/$(LIB_PREFIX)feeds_s.$(LIB_SUFFIX)
SHARED_LIBRARY_LIBS += ../feeds/src/$(LIB_PREFIX)browser_feeds_s.$(LIB_SUFFIX)
endif
# Link to gkgfx for GNOME shell service

View File

@@ -39,7 +39,7 @@ const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const HTML_NS = "http://www.w3.org/1999/xhtml";
const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
const URI_BUNDLE = "chrome://browser/content/feeds/subscribe.properties";
@@ -164,18 +164,30 @@ var SubscribeHandler = {
LOG("Failed to set Title Image (this is benign): " + e);
}
// XXXben - do something with this. parameterize?
const MAX_CHARS = 600;
// Build the actual feed content
var feedContent = document.getElementById("feedContent");
var feed = container.QueryInterface(Ci.nsIFeed);
for (var i = 0; i < feed.items.length; ++i) {
var entry = feed.items.queryElementAt(i, Ci.nsIFeedEntry);
var title = document.createElementNS(XUL_NS, "label");
title.value = entry.summary(true, 100);
title.className = "feedEntryTitle";
var body = document.createElementNS(XUL_NS, "description");
body.appendChild(document.createTextNode(entry.content(true)));
body.className = "feedEntryContent";
entry.QueryInterface(Ci.nsIFeedContainer);
var a = document.createElementNS(HTML_NS, "a");
a.appendChild(document.createTextNode(entry.title));
a.setAttribute("href", entry.link.spec);
var title = document.createElementNS(HTML_NS, "h3");
title.appendChild(a);
feedContent.appendChild(title);
var body = document.createElementNS(HTML_NS, "p");
var summary = entry.summary(true)
if (summary.length > MAX_CHARS)
summary = summary.substring(0, MAX_CHARS) + "...";
// XXXben - Change to use innerHTML
body.appendChild(document.createTextNode(summary));
body.className = "feedEntryContent";
feedContent.appendChild(body);
}
},

View File

@@ -66,58 +66,7 @@
<h2 id="feedSubtitleText"/>
</div>
</div>
<div id="feedContent">
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
<p>Content</p>
</div>
<div id="feedContent"/>
</div>
</body>
</html>

View File

@@ -41,8 +41,8 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = feeds
LIBRARY_NAME = feeds_s
MODULE = browser_feeds
LIBRARY_NAME = browser_feeds_s
EXTRA_PP_COMPONENTS = \
FeedConverter.js \

View File

@@ -143,6 +143,10 @@ a[href] img {
margin: 0 0 0 .6em;
}
.feedEntryContent {
font-size: 110%;
}
.link {
color: #0000FF;
text-decoration: underline;

View File

@@ -143,6 +143,10 @@ a[href] img {
margin: 0 0 0 .6em;
}
.feedEntryContent {
font-size: 110%;
}
.link {
color: #0000FF;
text-decoration: underline;