Access Key: Fix mobile access

This commit is contained in:
Andrei Marcu 2020-03-07 18:52:29 -08:00
parent e4468715ac
commit 7ca3331044
3 changed files with 20 additions and 17 deletions

View File

@ -277,13 +277,6 @@ body {
margin: 0;
}
#access_key_checkbox:checked ~ #access_key_input {
display: inline-block;
}
#access_key_checkbox:checked ~ #access_key_text {
display: none;
}
#access_key_input {
padding: 0;
display: none;

View File

@ -141,8 +141,13 @@ document.onpaste = function (event) {
};
document.getElementById("access_key_checkbox").onchange = function (event) {
if (event.target.checked == false) {
if (event.target.checked) {
document.getElementById("access_key_input").style.display = "inline-block";
document.getElementById("access_key_text").style.display = "none";
} else {
document.getElementById("access_key_input").value = "";
document.getElementById("access_key_input").style.display = "none";
document.getElementById("access_key_text").style.display = "inline-block";
}
};

View File

@ -4,9 +4,10 @@
<link href='{{ sitepath }}static/css/dropzone.css' media='screen, projection' rel='stylesheet' type='text/css'>
{% endblock %}
{% block content %}
{% block content %}
<div id="fileupload">
<form action="{{ sitepath }}upload" class="dropzone" id="dropzone" method="POST" enctype="multipart/form-data" data-maxsize="{{ maxsize }}" data-auth="{{ auth }}">
<form action="{{ sitepath }}upload" class="dropzone" id="dropzone" method="POST" enctype="multipart/form-data"
data-maxsize="{{ maxsize }}" data-auth="{{ auth }}">
<div class="fallback">
<input id="fileinput" name="file" type="file" /><br />
<input id="submitbtn" type="submit" value="Upload">
@ -17,26 +18,30 @@
</div>
<div id="choices">
<span class="hint--top hint--bounce" data-hint="Replace the filename with random characters. The file extension is retained">
<label><input {% if forcerandom %} disabled {% endif %} name="randomize" id="randomize" type="checkbox" checked /> Randomize filename</label>
<span class="hint--top hint--bounce"
data-hint="Replace the filename with random characters. The file extension is retained">
<label><input {% if forcerandom %} disabled {% endif %} name="randomize" id="randomize" type="checkbox"
checked /> Randomize filename</label>
</span>
<div id="expiry">
<label>File expiry:
<select name="expires" id="expires">
{% for expiry in expirylist %}
<option value="{{ expiry.Seconds }}"{% if forloop.Last %} selected{% endif %}>{{ expiry.Human }}</option>
<option value="{{ expiry.Seconds }}" {% if forloop.Last %} selected{% endif %}>
{{ expiry.Human }}</option>
{% endfor %}
</select>
</label>
</div>
<div id="access_key">
<span class="hint--top hint--bounce" data-hint="Require password to access (this does not encrypt the file but only limits access)">
<span class="hint--top hint--bounce"
data-hint="Require password to access (this does not encrypt the file but only limits access)">
<label>
<input type="checkbox" id="access_key_checkbox"/>
<input id="access_key_input" name="access_key" type="text" placeholder="Access password"/>
<input type="checkbox" id="access_key_checkbox" />
<span id="access_key_text">Require access password</span>
</label>
<input id="access_key_input" name="access_key" type="text" placeholder="Access password" />
</span>
</div>
</div>
@ -48,4 +53,4 @@
<script src="{{ sitepath }}static/js/dropzone.js"></script>
<script src="{{ sitepath }}static/js/upload.js"></script>
{% endblock %}
{% endblock %}