summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-05-20 19:25:38 +0300
committerAndrew Dolgov <[email protected]>2018-05-20 19:25:38 +0300
commit22b94bcc3463366c8ad27c33272fe4594a69dc69 (patch)
tree5447a856332094062974e3bd0a48c153426e45a7 /read.html
parentc85f98198a09d4da999e671cd697d8fef1c16520 (diff)
mention the reason for resource loader; check for response statuses
Diffstat (limited to 'read.html')
-rw-r--r--read.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/read.html b/read.html
index eaa9861..cf1095e 100644
--- a/read.html
+++ b/read.html
@@ -259,6 +259,8 @@
}
$(document).ready(function() {
+ // 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
var res_names = [ "lib/bootstrap/v3/js/jquery.js", "lib/jquery.mobile.custom.js",
"css/transitions.css",
"js/reader.js", "css/reader.css", "js/dict.js",
@@ -266,7 +268,7 @@
for (var i = 0; i < res_names.length; i++) {
fetch(res_names[i], {credentials: 'same-origin'}).then(function(resp) {
- resp.text().then(function(data) {
+ if (resp.status == 200) resp.text().then(function(data) {
_res_data[resp.url] = data;
});
});