Add setting to change font. Change default to arial

Closes #33
This commit is contained in:
James Taylor 2020-10-20 15:38:00 -07:00
parent c9d0f685a4
commit 125ddaa8da
4 changed files with 32 additions and 2 deletions

View File

@ -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,

View File

@ -66,3 +66,20 @@ def error_page(e):
error_message += ' Exit node IP address: ' + exc_info()[1].ip
return flask.render_template('error.html', error_message=error_message), 502
return flask.render_template('error.html', traceback=traceback.format_exc()), 500
font_choices = {
0: 'initial',
1: 'arial, "liberation sans", sans-serif',
2: '"liberation serif", "times new roman", calibri, carlito, serif',
3: 'verdana, sans-serif',
4: 'tahoma, sans-serif',
}
@yt_app.route('/shared.css')
def get_css():
return flask.Response(
flask.render_template('shared.css',
font_family = font_choices[settings.font]
),
mimetype='text/css',
)

View File

@ -6,7 +6,7 @@
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline'; media-src 'self' https://*.googlevideo.com;
{{ "img-src 'self' https://*.googleusercontent.com https://*.ggpht.com https://*.ytimg.com;" if not settings.proxy_images else "" }}">
<link href="{{ theme_path }}" type="text/css" rel="stylesheet">
<link href="/youtube.com/static/shared.css" type="text/css" rel="stylesheet">
<link href="/youtube.com/shared.css" type="text/css" rel="stylesheet">
<link href="/youtube.com/static/comments.css" type="text/css" rel="stylesheet">
<link href="/youtube.com/static/favicon.ico" type="image/x-icon" rel="icon">
<link title="Youtube local" href="/youtube.com/opensearch.xml" rel="search" type="application/opensearchdescription+xml">

View File

@ -12,7 +12,7 @@ address{
}
html{
font-family: "liberation serif", "times new roman", calibri, carlito, serif;
font-family: {{ font_family }};
}
body{