From 9599d67bcd04762b94f596edb013eee299046c92 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 16 May 2018 13:21:29 +0300 Subject: use inline resource loading for theme content --- js/read.js | 7 ++++++- js/reader.js | 2 ++ read.html | 8 +++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/js/read.js b/js/read.js index 8d38ccd..04b1e47 100644 --- a/js/read.js +++ b/js/read.js @@ -275,7 +275,12 @@ function apply_theme() { var themeUrl = baseUrl + "themes/" + theme + ".css"; $("#theme_css").attr("href", themeUrl); - $(book.renderer.doc).find("#theme_css").attr('href', themeUrl); + //$(book.renderer.doc).find("#theme_css").attr('href', themeUrl); + + window.parent.$.get(baseUrl + 'themes/' + theme + '.css', function(data) { + $(book.renderer.doc).find("#theme_css").html(data); + }); + }); } diff --git a/js/reader.js b/js/reader.js index 0a49a4b..15e2e65 100644 --- a/js/reader.js +++ b/js/reader.js @@ -17,6 +17,8 @@ function enable_swipes() { } $(document).ready(function() { + console.log('setting taps'); + $(window).on("click tap", function() { if (parent.$(".header").is(":visible")) { parent.show_ui(false); diff --git a/read.html b/read.html index d68d58b..541e28a 100644 --- a/read.html +++ b/read.html @@ -380,9 +380,11 @@ else theme = theme.replace("/", ""); - $(book.renderer.doc.head) - .append($("") - .attr('href', baseUrl + 'themes/' + theme + '.css')); + window.parent.$.get(baseUrl + 'themes/' + theme + '.css', function(data) { + $(book.renderer.doc.head) + .append($("