From d2ad78eb40dc5949ba153b6660eef75d011d5c1e Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 24 Jan 2021 11:16:57 +0100 Subject: [PATCH] Added swipe support for comic reader and txt reader (#925) Bugfix for txt file not present on serving file --- cps/static/js/kthoom.js | 8 ++++++++ cps/templates/readcbr.html | 8 ++------ cps/templates/readtxt.html | 9 +++++++++ cps/web.py | 15 +++++++++------ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/cps/static/js/kthoom.js b/cps/static/js/kthoom.js index 33a2ac0e..40db69ab 100644 --- a/cps/static/js/kthoom.js +++ b/cps/static/js/kthoom.js @@ -635,6 +635,14 @@ function init(filename) { // Focus the scrollable area so that keyboard scrolling work as expected $("#mainContent").focus(); + $("#mainContent").swipe( { + swipeRight:function() { + showLeftPage(); + }, + swipeLeft:function() { + showRightPage(); + }, + }); $("#mainImage").click(function(evt) { // Firefox does not support offsetX/Y so we have to manually calculate // where the user clicked in the image. diff --git a/cps/templates/readcbr.html b/cps/templates/readcbr.html index 29508fbf..35943b34 100644 --- a/cps/templates/readcbr.html +++ b/cps/templates/readcbr.html @@ -13,14 +13,10 @@ + - - - - - - + +