using marked in the aricle that is the starred
This commit is contained in:
parent
d2219b0259
commit
d123626f16
2 changed files with 37 additions and 10 deletions
35
js/App.js
35
js/App.js
|
@ -46,7 +46,7 @@ App.prototype.after_login = function() {
|
|||
} else if(url == "#unread") {
|
||||
_this.setCurrentUnread();
|
||||
} else if(url == "#starred") {
|
||||
_this.setCurrentStarred();
|
||||
_this.ChangeStarred();
|
||||
} else if(url == "#logout") {
|
||||
_this.logout();
|
||||
} else if(url == "#reset-info") {
|
||||
|
@ -264,7 +264,11 @@ App.prototype.showFull = function(article, slide_back) {
|
|||
} else {
|
||||
$("#setunread").innerHTML = "Set unread";
|
||||
}
|
||||
$("#setstarred").innerHTML = "no *";
|
||||
if(article.marked) {
|
||||
$("#setstarred").innerHTML = "*";
|
||||
} else {
|
||||
$("#setstarred").innerHTML = "no *";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -304,14 +308,6 @@ App.prototype.setCurrentRead = function() {
|
|||
this.updatePieChart();
|
||||
};
|
||||
|
||||
App.prototype.setCurrentStarred = function() {
|
||||
var article = this.unread_articles[this.currentIndex];
|
||||
if(!article) return; // happens if we're not on a full article site
|
||||
this.ttrss.setArticleStarred(article.id);
|
||||
|
||||
$("#setstarred").innerHTML = "*";
|
||||
};
|
||||
|
||||
App.prototype.setCurrentUnread = function() {
|
||||
var article = this.unread_articles[this.currentIndex];
|
||||
article.unread = true;
|
||||
|
@ -323,6 +319,25 @@ App.prototype.setCurrentUnread = function() {
|
|||
$("#setunread").innerHTML = "✔ unread";
|
||||
};
|
||||
|
||||
App.prototype.ChangeStarred = function() {
|
||||
var article = this.unread_articles[this.currentIndex];
|
||||
if(!article) return; // happens if we're not on a full article site
|
||||
|
||||
if(!article.marked) {
|
||||
article.marked = true;
|
||||
this.updateList();
|
||||
this.ttrss.setArticleStarred(article.id);
|
||||
$("#setstarred").innerHTML = "*";
|
||||
}
|
||||
else {
|
||||
article.marked = false;
|
||||
this.updateList();
|
||||
this.ttrss.setArticleUnStarred(article.id);
|
||||
$("#setstarred").innerHTML = "no *";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
App.prototype.goToList = function() {
|
||||
this.changeToPage("#list");
|
||||
};
|
||||
|
|
|
@ -104,6 +104,18 @@ TinyTinyRSS.prototype.setArticleStarred = function(article_id) {
|
|||
}
|
||||
};
|
||||
|
||||
TinyTinyRSS.prototype.setArticleUnStarred = function(article_id) {
|
||||
var options = {
|
||||
article_ids: article_id,
|
||||
mode: 0,
|
||||
field: 0
|
||||
};
|
||||
|
||||
if (navigator.onLine) {
|
||||
this.doOperation("updateArticle", options);
|
||||
}
|
||||
};
|
||||
|
||||
TinyTinyRSS.prototype.setArticleUnread = function(article_id) {
|
||||
var options = {
|
||||
article_ids: article_id,
|
||||
|
|
Reference in a new issue