From d603cd2e74ed896f621b2d60625518ea28cfcddb Mon Sep 17 00:00:00 2001 From: jeena Date: Wed, 28 Aug 2013 15:16:53 +0200 Subject: [PATCH] more fixes --- css/screen.css | 8 ++++++++ index.html | 8 ++++++-- js/App.js | 39 +++++++++++++++++++++------------------ js/jester.js | 2 +- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/css/screen.css b/css/screen.css index 2b64d8c..97ccf82 100644 --- a/css/screen.css +++ b/css/screen.css @@ -202,6 +202,14 @@ canvas { text-decoration: underline; } +#full footer.bar { + margin: 10px -10px 0 -10px; +} + +#full footer.bar a.next { + float: right; +} + .info { border: 3px solid black; background: white; diff --git a/index.html b/index.html index b0c9b29..6ef398d 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,7 @@

- +

@@ -74,7 +74,7 @@

- Back + List Set unread
@@ -89,6 +89,10 @@

Swipe with your finger right and left to navigate to next and previous article.

diff --git a/js/App.js b/js/App.js index 94e17a1..6cfdbb3 100644 --- a/js/App.js +++ b/js/App.js @@ -7,24 +7,6 @@ function App() { if(!color) color = "red"; this.setColor(color); - var _this = this; - - jester($("#full")).flick(function(touches, direction) { - if(direction == "left") _this.showNext(); - else _this.showPrevious(); - }); - - // FIXME move that code somewhere else - $(".info.swipe").ontouchend = function(e) { - localStorage.info_swipe = true; - $(".info.swipe").addClass("hidden"); - }; - - if(localStorage.info_swipe) { - $(".info.swipe").addClass("hidden"); - } - - var request = window.navigator.mozApps.getSelf(); request.onsuccess = function() { $("#version").innerHTML = request.result.manifest.version; @@ -69,6 +51,10 @@ App.prototype.after_login = function() { $$(".info").forEach(function(o) { o.removeClass("hidden"); }); + } else if(url == "#next") { + _this.showNext(); + } else if(url == "#previous") { + _this.showPrevious(); } // this is here so you can tap on a button more then once @@ -76,6 +62,23 @@ App.prototype.after_login = function() { window.location.hash = "#"; } + // FIXME move that code somewhere else + $(".info.swipe").ontouchend = function(e) { + localStorage.info_swipe = true; + $(".info.swipe").addClass("hidden"); + }; + + if(localStorage.info_swipe) { + $(".info.swipe").addClass("hidden"); + } + + // set up swiping + jester($("#full")).flick(function(touches, direction) { + if(direction == "left") _this.showNext(); + else _this.showPrevious(); + }); + + this.changeToPage("#list"); this.ttrss = new TinyTinyRSS(this, localStorage.server_url, localStorage.session_id); diff --git a/js/jester.js b/js/jester.js index a37e728..4612443 100644 --- a/js/jester.js +++ b/js/jester.js @@ -254,7 +254,7 @@ opts.swipeDistance = opts.swipeDistance || 200; opts.flickTime = opts.flickTime || 300; - opts.flickDistance = opts.flickDistance || 200; + opts.flickDistance = opts.flickDistance || 100; opts.deadX = opts.deadX || 0; opts.deadY = opts.deadY || 0;