From c78af7d56c4d2dbc46ffa1ebebc6d0bbf802e35b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 18 Jun 2019 14:19:03 +0300 Subject: switch to jquery mobile events; use doubletap to toggle fullscreen --- js/read.js | 4 ++-- js/reader.js | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/read.js b/js/read.js index 262c67f..9e86502 100644 --- a/js/read.js +++ b/js/read.js @@ -20,7 +20,7 @@ function cacheId(suffix) { function init_loader() { // we need to preload resources for reader iframe because it can't utilize our // service worker because while offline it is created outside our base server context - const res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile.custom.js", + const res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile-events.min.js", "css/transitions.css", "js/reader.js", "css/reader.css", "js/dict.js", "themes/default.css", "themes/mocca.css", "themes/night.css", @@ -241,7 +241,7 @@ function init_reader() { }); const base_url = window.location.href.match(/^.*\//)[0]; - const res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile.custom.js", + const res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile-events.min.js", "js/reader.js", "js/dict.js" ]; const doc = contents.document; diff --git a/js/reader.js b/js/reader.js index 7178aec..bc4db56 100644 --- a/js/reader.js +++ b/js/reader.js @@ -13,6 +13,11 @@ function enable_swipes() { } $(document).ready(function() { + + $(window).on("doubletap", function(evt) { + parent.toggle_fullscreen(); + }); + $(window).on("click tap", function(evt) { if (evt.button == 0) { -- cgit v1.2.3