From d68224091d6927207bb70e6a79c786fd857e35aa Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 15 Jun 2022 16:35:35 +0300 Subject: [PATCH 1/2] allow % in filenames --- mirva/__init__.py | 2 +- mirva/mirva.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mirva/__init__.py b/mirva/__init__.py index ccd7f8b..e501512 100644 --- a/mirva/__init__.py +++ b/mirva/__init__.py @@ -1,4 +1,4 @@ -__version__ = "20220607.0" +__version__ = "20220615.0" def get_version(): diff --git a/mirva/mirva.py b/mirva/mirva.py index 8b9d042..0cca93e 100755 --- a/mirva/mirva.py +++ b/mirva/mirva.py @@ -70,7 +70,7 @@ class Mirva: def create_config(self): - self.config = configparser.ConfigParser() + self.config = configparser.RawConfigParser() self.config.read(self.config_file) config_changed = False if not "SITE" in self.config: @@ -128,7 +128,7 @@ class Mirva: self.posts.append(post) def get_config(self): - self.config = configparser.ConfigParser() + self.config = configparser.RawConfigParser() self.config.read(self.config_file) def write_config(self): @@ -478,4 +478,4 @@ class SmartFormatter(HelpFormatter): def _split_lines(self, help, width): if help.startswith("smart|"): return help[6:].splitlines() - return HelpFormatter._split_lines(self, help, width) \ No newline at end of file + return HelpFormatter._split_lines(self, help, width) From 6724bbf6218f4be3623ffd66414e1b6cbf9d6dac Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 15 Jun 2022 16:50:55 +0300 Subject: [PATCH 2/2] default scroll behavior --- mirva/resources/mirva.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mirva/resources/mirva.js b/mirva/resources/mirva.js index 39a0a08..5c474bf 100644 --- a/mirva/resources/mirva.js +++ b/mirva/resources/mirva.js @@ -2,11 +2,13 @@ let current = -1; let currentScrolled = -1; let scrollTimer = null; let scrollEventTimer = null; +let defaultScroll = "smooth"; function r(f) { /in/.test(document.readyState) ? setTimeout('r(' + f + ')', 9) : f() } r(function() { + defaultScroll = typeof document.body.dataset.scroll === "string" ? document.body.dataset.scroll : "smooth"; create_nav(); document.onkeydown = keyboard_entry; }); @@ -37,7 +39,7 @@ function create_button(direction, to, next) { button.classList.add("navigation_button"); button.onclick = function() { to.parentElement.scrollIntoView({ - behavior: "smooth" + behavior: defaultScroll }); current = next; }; @@ -132,7 +134,7 @@ function keyboard_entry(ev) { return } if (current == -1) { - window.scrollTo({ top: 0, behavior: 'smooth' }); + window.scrollTo({ top: 0, behavior: defaultScroll }); return } current = Math.max(0, current); @@ -145,7 +147,7 @@ function keyboard_entry(ev) { clearTimeout(scrollTimer); } else { posts[current].parentElement.scrollIntoView({ - behavior: "smooth" + behavior: defaultScroll }); } scrollTimer = setTimeout(function() { @@ -153,4 +155,4 @@ function keyboard_entry(ev) { }, 200 ); -} \ No newline at end of file +}