Toggle visibility of extra requests options/settings when not in use (#584)

proxy-improvements
dgtlmoon 3 years ago committed by GitHub
parent 68db20168e
commit 0f08c8dda3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,13 +0,0 @@
window.addEventListener("load", (event) => {
// just an example for now
function toggleVisible(elem) {
// theres better ways todo this
var x = document.getElementById(elem);
if (x.style.display === "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
}
});

@ -0,0 +1,14 @@
$(document).ready(function() {
function toggle() {
if ($('input[name="fetch_backend"]:checked').val() != 'html_requests') {
$('#requests-override-options').hide();
} else {
$('#requests-override-options').show();
}
}
$('input[name="fetch_backend"]').click(function (e) {
toggle();
});
toggle();
});

@ -9,6 +9,7 @@
const email_notification_prefix=JSON.parse('{{ emailprefix|tojson }}');
{% endif %}
</script>
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='watch-settings.js')}}" defer></script>
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='notifications.js')}}" defer></script>
<div class="edit-form monospaced-textarea">
@ -65,12 +66,10 @@
</span>
</div>
<hr/>
<fieldset class="pure-group">
<span class="pure-form-message-inline">
<fieldset class="pure-group" id="requests-override-options">
<div class="pure-form-message-inline">
<strong>Request override is currently only used by the <i>Basic fast Plaintext/HTTP Client</i> method.</strong>
</span>
</div>
<div class="pure-control-group">
{{ render_field(form.method) }}
</div>

@ -9,7 +9,6 @@
const email_notification_prefix=JSON.parse('{{emailprefix|tojson}}');
{% endif %}
</script>
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='settings.js')}}" defer></script>
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='tabs.js')}}" defer></script>
<script type="text/javascript" src="{{url_for('static_content', group='js', filename='notifications.js')}}" defer></script>

Loading…
Cancel
Save