Use <noscript> tag for qute:settings without JS.

There was already a noscript tag, this just removes the special check and makes
it a bit more obvious.

See #727.
This commit is contained in:
Florian Bruhin 2015-06-07 21:33:35 +02:00
parent da2ff6f3cb
commit f85ca19cef
2 changed files with 7 additions and 13 deletions

View File

@ -179,18 +179,10 @@ def qute_help(win_id, request):
def qute_settings(win_id, _request):
"""Handler for qute:settings. View/change qute configuration."""
if not QWebSettings.globalSettings().testAttribute(
QWebSettings.JavascriptEnabled):
# https://github.com/The-Compiler/qutebrowser/issues/727
template = jinja.env.get_template('pre.html')
html = template.render(
title='Failed to open qute:settings.',
content="qute:settings needs javascript enabled to work.")
else:
config_getter = functools.partial(objreg.get('config').get, raw=True)
html = jinja.env.get_template('settings.html').render(
win_id=win_id, title='settings', config=configdata,
confget=config_getter)
config_getter = functools.partial(objreg.get('config').get, raw=True)
html = jinja.env.get_template('settings.html').render(
win_id=win_id, title='settings', config=configdata,
confget=config_getter)
return html.encode('UTF-8', errors='xmlcharrefreplace')

View File

@ -14,10 +14,12 @@ pre { margin: 2px; }
th, td { border: 1px solid grey; padding: 0px 5px; }
th { background: lightgrey; }
th pre { color: grey; text-align: left; }
.noscript, .noscript-text { color:red; }
.noscript-text { margin-bottom: 5cm; }
{% endblock %}
{% block content %}
<noscript><h1>View Only</h1><p>Changing settings requires javascript to be enabled</p></noscript>
<noscript><h1 class="noscript">View Only</h1><p class="noscript-text">Changing settings requires javascript to be enabled!</p></noscript>
<header><h1>{{ title }}</h1></header>
<table>
{% for section in config.DATA %}