diff --git a/cps/static/js/reading/epub.js b/cps/static/js/reading/epub.js index cfc12bad..facb7dec 100644 --- a/cps/static/js/reading/epub.js +++ b/cps/static/js/reading/epub.js @@ -13,10 +13,9 @@ var reader; bookmarks: calibre.bookmark ? [calibre.bookmark] : [] }); - reader.rendition.themes.register("lightTheme", "/static/css/epub_themes.css"); - reader.rendition.themes.register("darkTheme", "/static/css/epub_themes.css"); - reader.rendition.themes.register("sepiaTheme", "/static/css/epub_themes.css"); - reader.rendition.themes.register("blackTheme", "/static/css/epub_themes.css"); + Object.keys(themes).forEach(function (theme) { + reader.rendition.themes.register(theme, themes[theme].css_path); + }); if (calibre.useBookmarks) { reader.on("reader:bookmarked", updateBookmark.bind(reader, "add")); @@ -78,6 +77,10 @@ var reader; alert(error); }); } + + // Default settings load + const theme = localStorage.getItem("calibre.reader.theme") ?? Object.keys(themes)[0]; + selectTheme(theme); })(); diff --git a/cps/templates/read.html b/cps/templates/read.html index b75c31fe..46f54e95 100644 --- a/cps/templates/read.html +++ b/cps/templates/read.html @@ -1,33 +1,35 @@ -
- - -