give a window alert instead of greying-out to prevent confusion

master
Aevann 2024-02-29 00:34:29 +02:00
parent adc545769b
commit 17433202d1
2 changed files with 8 additions and 1 deletions

View File

@ -767,3 +767,10 @@ function delReport(t, url) {
for (const el of document.getElementsByClassName('autofocus')) {
el.focus()
}
for (const el of document.getElementsByClassName('tor-disabled')) {
el.onclick = (e) => {
e.preventDefault();
window.alert("File uploads are not allowed through TOR!")
};
}

View File

@ -149,7 +149,7 @@
{% endmacro %}
{% macro file_btn(input_id, disabled, image_only) %}
<label class="btn btn-secondary format m-0" for="{{input_id}}" {% if g.is_tor or disabled %}disabled{% endif %}>
<label class="btn btn-secondary format m-0 {% if g.is_tor %}tor-disabled{% endif %}" for="{{input_id}}" {% if disabled %}disabled{% endif %}>
<span class="fas fa-{% if image_only %}image{% else %}file{% endif %}"></span>
<input autocomplete="off" id="{{input_id}}" accept="image/*{% if not image_only %}, video/*, audio/*{% endif %}" type="file" multiple="multiple" name="file" {% if g.is_tor or disabled %}disabled{% endif %} hidden>
</label>