fixes
This commit is contained in:
parent
6caee6de79
commit
be33cd8921
2 changed files with 4 additions and 5 deletions
|
@ -140,8 +140,6 @@ App.prototype.reload = function() {
|
||||||
|
|
||||||
App.prototype.gotUnreadFeeds = function(new_articles) {
|
App.prototype.gotUnreadFeeds = function(new_articles) {
|
||||||
|
|
||||||
console.log(JSON.stringify(new_articles.length))
|
|
||||||
|
|
||||||
if(new_articles == null || !this.validate(new_articles)) { // on error load the saved unread articles.
|
if(new_articles == null || !this.validate(new_articles)) { // on error load the saved unread articles.
|
||||||
|
|
||||||
var old_articles = localStorage.unread_articles;
|
var old_articles = localStorage.unread_articles;
|
||||||
|
|
|
@ -87,13 +87,15 @@ OwnCloud.prototype.getUnreadFeeds = function(callback, skip) {
|
||||||
this.doOperation("GET", "items", options, function(data) {
|
this.doOperation("GET", "items", options, function(data) {
|
||||||
var items = data.items;
|
var items = data.items;
|
||||||
// FIXME
|
// FIXME
|
||||||
|
/*
|
||||||
var feeds = {};
|
var feeds = {};
|
||||||
for (var i = 0; i < data.feeds.length; i++) {
|
for (var i = 0; i < data.feeds.length; i++) {
|
||||||
var feed = data.feeds[i];
|
var feed = data.feeds[i];
|
||||||
feeds[feed.id] = feed;
|
feeds[feed.id] = feed;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
callback(items.map(_this.normalize_article, feeds));
|
callback(items.map(_this.normalize_article));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +165,7 @@ OwnCloud.prototype.normalize_article = function(article) {
|
||||||
id: article.id,
|
id: article.id,
|
||||||
title: article.title,
|
title: article.title,
|
||||||
content: article.body,
|
content: article.body,
|
||||||
feed_title: feeds[article.feedId].title,
|
feed_title: "", // FIXME: feeds[article.feedId].title,
|
||||||
excerpt: article.body.stripHTML().substring(0, 50),
|
excerpt: article.body.stripHTML().substring(0, 50),
|
||||||
updated: article.pubDate,
|
updated: article.pubDate,
|
||||||
link: article.link,
|
link: article.link,
|
||||||
|
@ -182,7 +184,6 @@ OwnCloud.login = function(server_url, user, password, callback) {
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
console.log(xhr.status)
|
|
||||||
if(xhr.readyState == 4) {
|
if(xhr.readyState == 4) {
|
||||||
if(xhr.status == 200) {
|
if(xhr.status == 200) {
|
||||||
callback(JSON.parse(xhr.responseText))
|
callback(JSON.parse(xhr.responseText))
|
||||||
|
|
Reference in a new issue