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");
|
||||
};
|
||||
|
|
Reference in a new issue