From 007d71f333e82cbf5922956a76cd9847db571250 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 6 Jan 2021 15:50:47 +0100 Subject: [PATCH] Applied feature request to current version --- README.md | 1 + public/js/reader.js | 3 ++- src/config.cr | 1 + src/library/entry.cr | 1 + src/views/reader.html.ecr | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 34944ca9..96486699 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ log_level: info upload_path: ~/mango/uploads plugin_path: ~/mango/plugins download_timeout_seconds: 30 +page_margin: 30 mangadex: base_url: https://mangadex.org api_url: https://mangadex.org/api diff --git a/public/js/reader.js b/public/js/reader.js index 7ff46aa8..e39b46d4 100644 --- a/public/js/reader.js +++ b/public/js/reader.js @@ -76,7 +76,8 @@ const getPages = () => { id: i + 1, url: `${base_url}api/page/${tid}/${eid}/${i+1}`, width: d.width, - height: d.height + height: d.height, + style: `margin-top: ${d.margin}px; margin-bottom: ${d.margin}px;` }; }); diff --git a/src/config.cr b/src/config.cr index 1c80542c..6bdeca78 100644 --- a/src/config.cr +++ b/src/config.cr @@ -20,6 +20,7 @@ class Config property plugin_path : String = File.expand_path "~/mango/plugins", home: true property download_timeout_seconds : Int32 = 30 + property page_margin : Int32 = 30 property mangadex = Hash(String, String | Int32).new @[YAML::Field(ignore: true)] diff --git a/src/library/entry.cr b/src/library/entry.cr index 810c6c85..fc158adc 100644 --- a/src/library/entry.cr +++ b/src/library/entry.cr @@ -116,6 +116,7 @@ class Entry sizes << { "width" => size.width, "height" => size.height, + "margin" => Config.current.page_margin, } rescue e Logger.warn "Failed to read page #{i} of entry #{zip_path}. #{e}" diff --git a/src/views/reader.html.ecr b/src/views/reader.html.ecr index 91360713..cca3cfb6 100644 --- a/src/views/reader.html.ecr +++ b/src/views/reader.html.ecr @@ -35,6 +35,7 @@