summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2024-01-12 18:00:55 +0300
committerAndrew Dolgov <[email protected]>2024-01-12 18:00:55 +0300
commit900655618290291d0b1598ee84a02ec1306e7274 (patch)
treed70836cd0fb70d1e40cbc1673b70e9b2581c12ec
parent008e12288991a3547dd574c74280c898840a8010 (diff)
worker - ignore /assets/, bring back caecilia
-rw-r--r--dist/reader_iframe.min.js2
-rw-r--r--js/reader_iframe.js5
-rw-r--r--read.html1
-rw-r--r--worker.js3
4 files changed, 10 insertions, 1 deletions
diff --git a/dist/reader_iframe.min.js b/dist/reader_iframe.min.js
index 27e3b6f..55aaf37 100644
--- a/dist/reader_iframe.min.js
+++ b/dist/reader_iframe.min.js
@@ -1 +1 @@
-"use strict";let Reader,App;function enable_swipes(){$(window).off("swipeleft swiperight"),$(window).on("swipeleft",(function(){Reader.Page.next()})),$(window).on("swiperight",(function(){Reader.Page.prev()}))}$(document).ready((function(){Reader=parent.__get_reader(),App=parent.__get_app(),$(window).on("click tap",(function(e){if(0==e.button){if($(".modal").is(":visible"))return;"undefined"!=typeof EpubeApp?EpubeApp.toggleActionBar():Reader.showUI(!0)}})),$(window).on("touchstart",(function(){enable_swipes()})),$(window).on("mousedown",(function(){$(window).off("swipeleft swiperight")})),$(window).on("wheel",(function(e){e.originalEvent.deltaY>0?Reader.Page.next():e.originalEvent.deltaY<0&&Reader.Page.prev()}));let e=null;$(document).on("selectionchange",(function(){App.isOnline()&&(window.clearTimeout(e),e=window.setTimeout((function(){const e=getSelection().toString().trim();e.match(/^[\w­]+$/)&&Reader.lookupWord(e,(function(){"undefined"!=typeof EpubeApp&&EpubeApp.showActionBar(!1),getSelection().removeAllRanges()}))}),250))})),enable_swipes()})); \ No newline at end of file
+"use strict";let Reader,App;function enable_swipes(){$(window).off("swipeleft swiperight"),$(window).on("swipeleft",(function(){Reader.Page.next()})),$(window).on("swiperight",(function(){Reader.Page.prev()}))}if("undefined"!=typeof EpubeApp){const e=$('<link type="text/css" rel="stylesheet" media="screen" href="/assets/android.css" />');$("head").append(e)}$(document).ready((function(){Reader=parent.__get_reader(),App=parent.__get_app(),$(window).on("click tap",(function(e){if(0==e.button){if($(".modal").is(":visible"))return;"undefined"!=typeof EpubeApp?EpubeApp.toggleActionBar():Reader.showUI(!0)}})),$(window).on("touchstart",(function(){enable_swipes()})),$(window).on("mousedown",(function(){$(window).off("swipeleft swiperight")})),$(window).on("wheel",(function(e){e.originalEvent.deltaY>0?Reader.Page.next():e.originalEvent.deltaY<0&&Reader.Page.prev()}));let e=null;$(document).on("selectionchange",(function(){App.isOnline()&&(window.clearTimeout(e),e=window.setTimeout((function(){const e=getSelection().toString().trim();e.match(/^[\w­]+$/)&&Reader.lookupWord(e,(function(){"undefined"!=typeof EpubeApp&&EpubeApp.showActionBar(!1),getSelection().removeAllRanges()}))}),250))})),enable_swipes()})); \ No newline at end of file
diff --git a/js/reader_iframe.js b/js/reader_iframe.js
index 6baf788..6a9a8e3 100644
--- a/js/reader_iframe.js
+++ b/js/reader_iframe.js
@@ -17,6 +17,11 @@ function enable_swipes() {
});
}
+if (typeof EpubeApp != "undefined") {
+ const localCss = $('<link type="text/css" rel="stylesheet" media="screen" href="/assets/android.css" />');
+ $("head").append(localCss);
+}
+
$(document).ready(function() {
Reader = parent.__get_reader();
App = parent.__get_app();
diff --git a/read.html b/read.html
index d0fc952..1b1cb35 100644
--- a/read.html
+++ b/read.html
@@ -59,6 +59,7 @@
<div class="col-sm-9">
<select class="font_family form-control" onchange="Reader.Settings.onFontChanged(this)">
<option>Arial</option>
+ <option>Caecilia</option>
<option>Calibri</option>
<option>Cambria</option>
<option>Consolas</option>
diff --git a/worker.js b/worker.js
index 5c446a2..73024fd 100644
--- a/worker.js
+++ b/worker.js
@@ -58,6 +58,9 @@ self.addEventListener('message', function(event){
this.addEventListener('fetch', function(event) {
const req = event.request.clone();
+ if (req.url.match('/assets/'))
+ return;
+
event.respondWith(
caches.match(req).then(function(resp) {