Skip to content

Commit

Permalink
Access Key: Fix mobile access
Browse files Browse the repository at this point in the history
  • Loading branch information
andreimarcu committed Mar 8, 2020
1 parent e446871 commit 7ca3331
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
7 changes: 0 additions & 7 deletions static/css/linx.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion static/js/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
};

Expand Down
23 changes: 14 additions & 9 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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>
Expand All @@ -48,4 +53,4 @@

<script src="{{ sitepath }}static/js/dropzone.js"></script>
<script src="{{ sitepath }}static/js/upload.js"></script>
{% endblock %}
{% endblock %}

0 comments on commit 7ca3331

Please sign in to comment.