initial implementation of showing non-subscribed feed in river view

--HG--
extra : rebase_source : e81522fdf43b2745133e74711d7f9d61e08471a2
This commit is contained in:
Myk Melez 2009-05-26 18:43:15 -07:00
Родитель 13837c96fb
Коммит 5d7414a612
4 изменённых файлов: 27 добавлений и 10 удалений

Просмотреть файл

@ -97,11 +97,11 @@ let Snowl = {
// Init tab listeners
this._initTabListeners();
//let feedButton = document.getElementById("feed-button");
//let feedMenuPopup = feedButton.firstChild;
//let t = this;
//feedButton.addEventListener("click", function(evt) { t._onClickFeedButton(evt) }, true);
//feedMenuPopup.addEventListener("popupshowing", function(evt) { t._onPopupShowingFeedMenu(evt) }, true);
let feedButton = document.getElementById("feed-button");
let feedMenuPopup = feedButton.firstChild;
let t = this;
feedButton.addEventListener("click", function(evt) { t._onClickFeedButton(evt) }, true);
feedMenuPopup.addEventListener("popupshowing", function(evt) { t._onPopupShowingFeedMenu(evt) }, true);
},

Просмотреть файл

@ -374,6 +374,17 @@ let SnowlMessageView = {
if (CollectionsView.itemIds != -1) {
CollectionsView._tree.restoreSelection();
}
if ("feed" in this._params) {
let title = "title" in this._params ? this._params.title : null;
let feed = new SnowlFeed(null, null, new URI(this._params.feed), undefined, null);
feed.refresh(null, this.onFeedRefresh, this);
}
},
onFeedRefresh: function(feed) {
this._collection = feed;
this._rebuildView.async(this, function() {});
},
onFilter: function() {

Просмотреть файл

@ -378,8 +378,9 @@ SnowlFeed.prototype = {
// Figure out the ID for the entry, then check if the entry has already
// been retrieved. If the entry doesn't provide its own ID, we generate
// one for it based on its content.
let externalID;
try {
let externalID = entry.id || this._generateID(entry);
externalID = entry.id || this._generateID(entry);
let message = this._processEntry(feed, entry, externalID, received);
messages.push(message);
}
@ -402,6 +403,9 @@ SnowlFeed.prototype = {
_processEntry: function(aFeed, aEntry, aExternalID, aReceived) {
let message = new SnowlMessage();
// FIXME: we don't need to set sourceID if we always set source,
// so figure out if that's the case and update this code accordingly.
message.source = this;
message.sourceID = this.id;
message.externalID = aExternalID;
message.subject = aEntry.title.text;

Просмотреть файл

@ -110,6 +110,12 @@ SnowlMessage.prototype = {
timestamp: null,
received: null,
read: false,
// FIXME: we don't need to set sourceID if we always set source,
// so figure out if that's the case and update this code accordingly.
sourceID: null,
// FIXME: make sure there aren't any consumers that expect us to provide this
// automatically from the persistent datastore, which we used to do.
source: null,
/**
* The content of the message. If undefined, we haven't retrieved it from
@ -182,10 +188,6 @@ SnowlMessage.prototype = {
return part;
},
get source() {
return SnowlService.sourcesByID[this.sourceID];
},
get _stmtInsertMessage() {
let statement = SnowlDatastore.createStatement(
"INSERT INTO messages(sourceID, externalID, subject, authorID, timestamp, received, link, read) \