summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-07-30 13:05:43 +0300
committerAndrew Dolgov <[email protected]>2019-07-30 13:05:43 +0300
commit1994ed155e125597a6f4b7975475a4399322b144 (patch)
tree076e285028cd56796bb09a7e355a5f1924ef70f7
parent6920124b40ca11d70584df69c2cc56e11cfdaa99 (diff)
add sepia theme
-rw-r--r--js/read.js8
-rw-r--r--read.html1
-rw-r--r--worker.js1
3 files changed, 9 insertions, 1 deletions
diff --git a/js/read.js b/js/read.js
index bd7d8af..58605ec 100644
--- a/js/read.js
+++ b/js/read.js
@@ -24,7 +24,7 @@ function init_loader() {
"css/transitions.css",
"js/reader.js", "css/reader.css", "js/dict.js",
"themes/default.css", "themes/mocca.css", "themes/night.css",
- "themes/plan9.css", "themes/gray.css" ];
+ "themes/plan9.css", "themes/gray.css", "themes/sepia.css" ];
for (let i = 0; i < res_names.length; i++) {
fetch(res_names[i], {credentials: 'same-origin'}).then(function(resp) {
@@ -954,6 +954,12 @@ function apply_theme() {
if (!theme) theme = 'default';
const theme_url = base_url + "themes/" + theme + ".css";
+ const theme_data = _res_data[theme_url];
+
+ if (!theme_data) {
+ console.error('theme data not found for', theme, '- check resource loader configuration');
+ return;
+ }
$("#theme_css").attr("href", theme_url);
diff --git a/read.html b/read.html
index bc50754..f218dd4 100644
--- a/read.html
+++ b/read.html
@@ -70,6 +70,7 @@
<option value="mocca">Mocca</option>
<option value="night">Night</option>
<option value="plan9">Plan9</option>
+ <option value="sepia">Sepia</option>
</select>
</div>
</div>
diff --git a/worker.js b/worker.js
index 256f1c3..dd8e77f 100644
--- a/worker.js
+++ b/worker.js
@@ -21,6 +21,7 @@ const CACHE_URLS = [
'themes/night.css',
'themes/plan9.css',
'themes/gray.css',
+ 'themes/sepia.css',
'lib/promise.js',
'lib/fetch.js',
'lib/zip.min.js',