From ef711dad0590b45a70617ab8717d963fc7df831c Mon Sep 17 00:00:00 2001 From: James Taylor Date: Mon, 19 Oct 2020 13:26:57 -0700 Subject: settings.py: fix img_prefix not updated when setting changes caused old prefix to still be used after changing setting see #31 --- settings.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index dfab369..6bbb558 100644 --- a/settings.py +++ b/settings.py @@ -312,12 +312,6 @@ else: globals().update(current_settings_dict) -if proxy_images: - img_prefix = "/" -else: - img_prefix = "" - - if route_tor: print("Tor routing is ON") @@ -336,6 +330,19 @@ def add_setting_changed_hook(setting, func): hooks[setting] = [func] +def set_img_prefix(old_value=None, value=None): + global img_prefix + if value is None: + value = proxy_images + if value: + img_prefix = '/' + else: + img_prefix = '' +set_img_prefix() +add_setting_changed_hook('proxy_images', set_img_prefix) + + + def settings_page(): if request.method == 'GET': return flask.render_template('settings.html', -- cgit v1.2.3 From 125ddaa8da8dad8f3e8eeb54f79a775b865c58bf Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 20 Oct 2020 15:38:00 -0700 Subject: Add setting to change font. Change default to arial Closes #33 --- settings.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 6bbb558..852310c 100644 --- a/settings.py +++ b/settings.py @@ -153,6 +153,19 @@ For security reasons, enabling this is not recommended.''', ], }), + ('font', { + 'type': int, + 'default': 1, + 'comment': '', + 'options': [ + (0, 'Browser default'), + (1, 'Arial'), + (2, 'Liberation Serif'), + (3, 'Verdana'), + (4, 'Tahoma'), + ], + }), + ('autocheck_subscriptions', { 'type': bool, 'default': 0, -- cgit v1.2.3 From a27b575380378f1b490dcabb8cc67f05adee5daa Mon Sep 17 00:00:00 2001 From: zrose584 <57181548+zrose584@users.noreply.github.com> Date: Wed, 21 Oct 2020 10:35:01 +0200 Subject: remove trailing whitespaces --- settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 852310c..159a896 100644 --- a/settings.py +++ b/settings.py @@ -134,7 +134,7 @@ For security reasons, enabling this is not recommended.''', 'default': True, 'comment': '', }), - + ('use_comments_js', { 'label': 'Enable comments.js', 'type': bool, -- cgit v1.2.3