better read and starred look

This commit is contained in:
Jeena 2013-09-15 00:46:22 +02:00
parent 3850fe7c25
commit 8297a48818
3 changed files with 18 additions and 11 deletions

View file

@ -219,6 +219,12 @@ canvas {
height: 2.5em;
}
#full .star, #full .unread {
line-height: 0.52;
font-size: 2em;
vertical-align: bottom;
}
#full h1 {
font-size: 1.3em;
font-weight: normal;

View file

@ -80,8 +80,8 @@
<section id="full">
<header class="bar">
<a class="button" href="#list">List</a>
<a id="setunread" class="button" href="#unread">Set unread</a>
<a id="setstarred" class="button" href="#starred">no *</a>
<a id="setunread" class="button unread" href="#unread"></a>
<a id="setstarred" class="button star" href="#starred"></a>
<canvas width="40" height="40"></canvas>
</header>
<article>

View file

@ -46,7 +46,7 @@ App.prototype.after_login = function() {
} else if(url == "#unread") {
_this.setCurrentUnread();
} else if(url == "#starred") {
_this.ChangeStarred();
_this.toggleStarred();
} else if(url == "#logout") {
_this.logout();
} else if(url == "#reset-info") {
@ -260,14 +260,15 @@ App.prototype.showFull = function(article, slide_back) {
$(page_id + " .article").innerHTML = article.content;
if(article.set_unread) {
$("#setunread").innerHTML = "✔ unread";
$("#setunread").innerHTML = "";
} else {
$("#setunread").innerHTML = "Set unread";
$("#setunread").innerHTML = "";
}
if(article.marked) {
$("#setstarred").innerHTML = "*";
$("#setstarred").innerHTML = "";
} else {
$("#setstarred").innerHTML = "no *";
$("#setstarred").innerHTML = "";
}
};
@ -316,10 +317,10 @@ App.prototype.setCurrentUnread = function() {
var _this = this;
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];
if(!article) return; // happens if we're not on a full article site
@ -327,13 +328,13 @@ App.prototype.ChangeStarred = function() {
article.marked = true;
this.updateList();
this.ttrss.setArticleStarred(article.id);
$("#setstarred").innerHTML = "*";
$("#setstarred").innerHTML = "";
}
else {
article.marked = false;
this.updateList();
this.ttrss.setArticleUnStarred(article.id);
$("#setstarred").innerHTML = "no *";
$("#setstarred").innerHTML = "";
}
};