added info bubble
This commit is contained in:
parent
8d124c01d9
commit
34453cff32
5 changed files with 70 additions and 5 deletions
|
@ -63,6 +63,10 @@ label {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -197,6 +201,23 @@ canvas {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
border: 3px solid black;
|
||||||
|
background: white;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 0 5px black;
|
||||||
|
color: black;
|
||||||
|
padding: 0 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info.swipe {
|
||||||
|
width: 60%;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 15%;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
#settings ul {
|
#settings ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
<section id="full">
|
<section id="full">
|
||||||
<header class="bar">
|
<header class="bar">
|
||||||
<a class="button" href="#list">Back</a>
|
<a class="button" href="#list">Back</a>
|
||||||
<a class="button" href="#unread">Set unread</a>
|
<a id="setunread" class="button" href="#unread">Set unread</a>
|
||||||
<canvas></canvas>
|
<canvas></canvas>
|
||||||
</header>
|
</header>
|
||||||
<article>
|
<article>
|
||||||
|
@ -84,6 +84,9 @@
|
||||||
<p><timedate class="date"></timedate></p>
|
<p><timedate class="date"></timedate></p>
|
||||||
</header>
|
</header>
|
||||||
<div class="article"></div>
|
<div class="article"></div>
|
||||||
|
<div class="info swipe">
|
||||||
|
<p>Swipe with your finger right and left to navigate to next and previous article.</p>
|
||||||
|
</div>
|
||||||
<article>
|
<article>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
37
js/App.js
37
js/App.js
|
@ -35,8 +35,29 @@ function App() {
|
||||||
_this.showFull(_this.unread_articles[i]);
|
_this.showFull(_this.unread_articles[i]);
|
||||||
} else if(url == "#unread") {
|
} else if(url == "#unread") {
|
||||||
_this.setCurrentUnread();
|
_this.setCurrentUnread();
|
||||||
|
} else if(url == "#logout") {
|
||||||
|
_this.logout();
|
||||||
|
} else if(url == "#reset-info") {
|
||||||
|
alert("Info bubbles will be shown again.")
|
||||||
|
$$(".info").forEach(function(o) {
|
||||||
|
o.removeClass("hidden");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is here so you can tap on a button more then once
|
||||||
|
// and it will still call onhashchange
|
||||||
|
window.location.hash = "#";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(".info.swipe").ontouchend = function(e) {
|
||||||
|
localStorage.info_swipe = true;
|
||||||
|
$(".info.swipe").addClass("hidden");
|
||||||
|
};
|
||||||
|
|
||||||
|
if(localStorage.info_swipe) {
|
||||||
|
$(".info.swipe").addClass("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
App.prototype.authenticate = function() {
|
App.prototype.authenticate = function() {
|
||||||
|
@ -50,6 +71,13 @@ App.prototype.after_login = function() {
|
||||||
this.reload();
|
this.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
App.prototype.logout = function() {
|
||||||
|
this.ttrss.logOut();
|
||||||
|
this.unread_articles = [];
|
||||||
|
this.populateList();
|
||||||
|
this.login.log_out();
|
||||||
|
};
|
||||||
|
|
||||||
App.prototype.changeToPage = function(page) {
|
App.prototype.changeToPage = function(page) {
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
|
@ -195,6 +223,13 @@ App.prototype.showFull = function(article, slide_back) {
|
||||||
$(page_id + " .author").innerHTML = "– " + article.author;
|
$(page_id + " .author").innerHTML = "– " + article.author;
|
||||||
|
|
||||||
$(page_id + " .article").innerHTML = article.content;
|
$(page_id + " .article").innerHTML = article.content;
|
||||||
|
|
||||||
|
if(article.set_unread) {
|
||||||
|
$("#setunread").innerHTML = "✔ unread";
|
||||||
|
} else {
|
||||||
|
$("#setunread").innerHTML = "Set unread";
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
App.prototype.showNext = function() {
|
App.prototype.showNext = function() {
|
||||||
|
@ -238,6 +273,8 @@ App.prototype.setCurrentUnread = function() {
|
||||||
this.updateList();
|
this.updateList();
|
||||||
var _this = this;
|
var _this = this;
|
||||||
setTimeout(function() { _this.ttrss.setArticleUnread(article.id); }, 100);
|
setTimeout(function() { _this.ttrss.setArticleUnread(article.id); }, 100);
|
||||||
|
|
||||||
|
$("#setunread").innerHTML = "✔ unread";
|
||||||
};
|
};
|
||||||
|
|
||||||
App.prototype.goToList = function() {
|
App.prototype.goToList = function() {
|
||||||
|
|
10
js/Login.js
10
js/Login.js
|
@ -53,6 +53,10 @@ Login.prototype.authenticate = function(e) {
|
||||||
localStorage.server_url = server_url;
|
localStorage.server_url = server_url;
|
||||||
localStorage.session_id = data.session_id;
|
localStorage.session_id = data.session_id;
|
||||||
_this.app.after_login();
|
_this.app.after_login();
|
||||||
|
|
||||||
|
$("#url").value = "";
|
||||||
|
$("#un").value = "";
|
||||||
|
$("#pw").value = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -60,8 +64,8 @@ Login.prototype.authenticate = function(e) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Login.prototype.log_out = function() {
|
Login.prototype.log_out = function() {
|
||||||
localStorage.server_url = null;
|
localStorage.removeItem("server_url");
|
||||||
localStorage.session_id = null;
|
localStorage.removeItem("session_id");
|
||||||
localStorage.unread_articles = null;
|
localStorage.removeItem("unread_articles");
|
||||||
this.log_in();
|
this.log_in();
|
||||||
}
|
}
|
|
@ -19,5 +19,5 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installs_allowed_from": ["*"],
|
"installs_allowed_from": ["*"],
|
||||||
"version": "0.1"
|
"version": "0.2"
|
||||||
}
|
}
|
Reference in a new issue