qutebrowser/qutebrowser/html/settings.html
Brian Jackson bf37d16896 View/edit browser config in a special browser page
Add the ability to view/edit the browser's config settings via a special
browser page.

It's very simplistic for now, but a good starting point.

Future possibilities:
* Matching config types to html input types
  * colors = html colorpicker
  * options with valid_values = select/multi-select
  * plain text fallbacks where appropriate
  * multi-line text edits for long options (i.e. host-block-lists)

* Javascript option verification
  * switch from submitting changes onblur to onchange if an option passes basic
    verification, etc.
2014-11-25 10:34:06 -06:00

37 lines
1002 B
HTML

{% extends "base.html" %}
{% block script %}
var cset = function(section, option, el) {
value = el.value;
window.qutesettings.set_javascript(section, option, value);
}
{% endblock %}
{% block style %}
table { border: 1px solid grey; border-collapse: collapse; }
pre { margin: 2px; }
th, td { border: 1px solid grey; padding: 0px 5px; }
th { background: lightgrey; }
th pre { color: grey; text-align: left; }
{% endblock %}
{% block content %}
<header><h1>{{ title }}</h1></header>
<table>
{% for section in config.DATA %}
<tr><th colspan="2"><h3>{{ section }}</h3><pre>{{ config.SECTION_DESC.get(section)|wordwrap(width=120) }}</pre></th></tr>
{% for d, e in config.DATA.get(section).items() %}
<tr>
<td>{{ d }} (Current: {{ e.value()|truncate(100) }})</td>
<td>
<input type="input"
onblur="cset('{{ section }}', '{{ d }}', this)"
value="{{ e.value() }}">
</input>
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
{% endblock %}