better read and starred look
This commit is contained in:
parent
3850fe7c25
commit
8297a48818
3 changed files with 18 additions and 11 deletions
|
@ -219,6 +219,12 @@ canvas {
|
||||||
height: 2.5em;
|
height: 2.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#full .star, #full .unread {
|
||||||
|
line-height: 0.52;
|
||||||
|
font-size: 2em;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
#full h1 {
|
#full h1 {
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
|
@ -80,8 +80,8 @@
|
||||||
<section id="full">
|
<section id="full">
|
||||||
<header class="bar">
|
<header class="bar">
|
||||||
<a class="button" href="#list">List</a>
|
<a class="button" href="#list">List</a>
|
||||||
<a id="setunread" class="button" href="#unread">Set unread</a>
|
<a id="setunread" class="button unread" href="#unread">○</a>
|
||||||
<a id="setstarred" class="button" href="#starred">no *</a>
|
<a id="setstarred" class="button star" href="#starred">☆</a>
|
||||||
<canvas width="40" height="40"></canvas>
|
<canvas width="40" height="40"></canvas>
|
||||||
</header>
|
</header>
|
||||||
<article>
|
<article>
|
||||||
|
|
19
js/App.js
19
js/App.js
|
@ -46,7 +46,7 @@ App.prototype.after_login = function() {
|
||||||
} else if(url == "#unread") {
|
} else if(url == "#unread") {
|
||||||
_this.setCurrentUnread();
|
_this.setCurrentUnread();
|
||||||
} else if(url == "#starred") {
|
} else if(url == "#starred") {
|
||||||
_this.ChangeStarred();
|
_this.toggleStarred();
|
||||||
} else if(url == "#logout") {
|
} else if(url == "#logout") {
|
||||||
_this.logout();
|
_this.logout();
|
||||||
} else if(url == "#reset-info") {
|
} else if(url == "#reset-info") {
|
||||||
|
@ -260,14 +260,15 @@ App.prototype.showFull = function(article, slide_back) {
|
||||||
$(page_id + " .article").innerHTML = article.content;
|
$(page_id + " .article").innerHTML = article.content;
|
||||||
|
|
||||||
if(article.set_unread) {
|
if(article.set_unread) {
|
||||||
$("#setunread").innerHTML = "✔ unread";
|
$("#setunread").innerHTML = "●";
|
||||||
} else {
|
} else {
|
||||||
$("#setunread").innerHTML = "Set unread";
|
$("#setunread").innerHTML = "○";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(article.marked) {
|
if(article.marked) {
|
||||||
$("#setstarred").innerHTML = "*";
|
$("#setstarred").innerHTML = "★";
|
||||||
} else {
|
} else {
|
||||||
$("#setstarred").innerHTML = "no *";
|
$("#setstarred").innerHTML = "☆";
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -316,10 +317,10 @@ App.prototype.setCurrentUnread = function() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.ttrss.setArticleUnread(article.id);
|
this.ttrss.setArticleUnread(article.id);
|
||||||
|
|
||||||
$("#setunread").innerHTML = "✔ unread";
|
$("#setunread").innerHTML = "●";
|
||||||
};
|
};
|
||||||
|
|
||||||
App.prototype.ChangeStarred = function() {
|
App.prototype.toggleStarred = function() {
|
||||||
var article = this.unread_articles[this.currentIndex];
|
var article = this.unread_articles[this.currentIndex];
|
||||||
if(!article) return; // happens if we're not on a full article site
|
if(!article) return; // happens if we're not on a full article site
|
||||||
|
|
||||||
|
@ -327,13 +328,13 @@ App.prototype.ChangeStarred = function() {
|
||||||
article.marked = true;
|
article.marked = true;
|
||||||
this.updateList();
|
this.updateList();
|
||||||
this.ttrss.setArticleStarred(article.id);
|
this.ttrss.setArticleStarred(article.id);
|
||||||
$("#setstarred").innerHTML = "*";
|
$("#setstarred").innerHTML = "★";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
article.marked = false;
|
article.marked = false;
|
||||||
this.updateList();
|
this.updateList();
|
||||||
this.ttrss.setArticleUnStarred(article.id);
|
this.ttrss.setArticleUnStarred(article.id);
|
||||||
$("#setstarred").innerHTML = "no *";
|
$("#setstarred").innerHTML = "☆";
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue