1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Cleaned up upload settings

This commit is contained in:
Uncled1023 2019-01-30 21:41:06 -08:00
parent 340c7fca8b
commit 1c10276092
4 changed files with 37 additions and 35 deletions

View File

@ -79,10 +79,6 @@
<h4 class="list-group-item-heading">Uguush</h4>
<p class="list-group-item-text">Command-line uploader for teknik uploads</p>
</a>
<a class="list-group-item" href="https://github.com/dylanaraps/neofetch">
<h4 class="list-group-item-heading">Neofetch</h4>
<p class="list-group-item-text">A fast, highly customizable system info script with support to upload screenshots</p>
</a>
</div>
</div>
</div>

View File

@ -52,7 +52,7 @@
<div class="row form-horizontal">
<div class="col-sm-5 col-sm-offset-1">
<div class="form-group form-group-sm">
<div class="form-group form-group-sm" data-toggle="tooltip" data-placement="top" title="When enabled, each file is encrypted before upload using an AES-256-CTR cipher. A key is generated and required to download the file later.">
<label for="encrypt" class="col-sm-6 col-xs-3 control-label">Encrypt in Browser</label>
<div class="col-sm-6 col-xs-9">
<input type="checkbox" class="center-block" name="encrypt" id="encrypt" @(Model.Encrypt ? "checked" : string.Empty) />
@ -108,11 +108,6 @@
<div class="container" id="upload-links">
</div>
<br />
<div class="well text-center">
<p>
Each file is encrypted after upload using an AES-256-CTR cipher. You can encrypt it within your browser for extra security by setting the option <strong>Encrypt in Browser</strong> in the options pane.
</p>
</div>
<div class="text-center">
Useful Tools: <a href="@Url.SubRouteUrl("help", "Help.Tools")">Upload Scripts and Utilities</a>
</div>

View File

@ -13,30 +13,41 @@
<bundle src="css/user.settings.upload.min.css" append-version="true"></bundle>
<!form class="form" action="##" method="post" id="updateForm">
<div class="row">
<div class="col-sm-3">
<h4>Encrypt in Browser</h4>
</div>
<div class="col-sm-9">
<div class="checkbox">
<input id="update_upload_encrypt" name="update_upload_encrypt" title="whether the file should be encrypted in the browser before upload" type="checkbox" value="true" @(Model.Encrypt ? "checked" : string.Empty) />
<div class="row form-horizontal">
<div class="col-sm-6">
<div class="form-group form-group-sm" data-toggle="tooltip" data-placement="top" title="When enabled, each file is encrypted before upload using an AES-256-CTR cipher. A key is generated and required to download the file later.">
<label for="encrypt" class="col-sm-6 col-xs-3 control-label">Encrypt in Browser</label>
<div class="col-sm-6 col-xs-9">
<input id="update_upload_encrypt" name="update_upload_encrypt" title="whether the file should be encrypted in the browser before upload" type="checkbox" value="true" @(Model.Encrypt ? "checked" : string.Empty) />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<h4 class="text-center">Expiration</h4>
</div>
<div class="col-sm-2 hidden" id="length-div">
<input type="number" min="1" step="1" class="form-control" name="expirelength" id="expirelength" value="@Model.ExpirationLength">
</div>
<div class="col-sm-4" id="unit-div">
<select class="form-control" name="expireunit" id="expireunit">
@foreach (ExpirationUnit unit in Enum.GetValues(typeof(ExpirationUnit)))
<div class="col-sm-6">
<div class="form-group form-group-sm">
@if (!User.Identity.IsAuthenticated)
{
<!option value="@unit" @(Model.ExpirationUnit == unit ? "selected" : string.Empty)>@unit.ToString()</!option>
@:<label class="col-xs-3 control-label" data-toggle="tooltip" data-placement="top" title="Uploads expire after 1 day for unregistered users">Expiration*</label>
}
</select>
else
{
@:<label class="col-xs-3 control-label">Expiration</label>
}
<fieldset @if (!User.Identity.IsAuthenticated) { @: disabled
}>
<div class="col-xs-4 hidden" id="length-div">
<input type="number" min="1" step="1" class="form-control" name="expirelength" id="expirelength" value="@Model.ExpirationLength">
</div>
<div class="col-xs-9" id="unit-div">
<select class="form-control" name="expireunit" id="expireunit">
@foreach (ExpirationUnit unit in Enum.GetValues(typeof(ExpirationUnit)))
{
<!option value="@unit" @(Model.ExpirationUnit == unit ? "selected" : string.Empty)>@unit.ToString()</!option>
}
</select>
</div>
</fieldset>
</div>
</div>
</div>
<div class="row">

View File

@ -1,6 +1,6 @@
/* globals editURL */
$(document).ready(function () {
$("[name='update_upload_encrypt']").bootstrapSwitch();
$("[name='update_upload_encrypt']").bootstrapSwitch({ size: "small" });
$("[name='expireunit']").change(function () {
setExpireWidth($(this).val());
@ -48,12 +48,12 @@ $(document).ready(function () {
function setExpireWidth(unit) {
if (unit === "Never") {
$('#length-div').addClass("hidden");
$('#unit-div').removeClass("col-sm-2");
$('#unit-div').addClass("col-sm-4");
$('#unit-div').removeClass("col-xs-5");
$('#unit-div').addClass("col-xs-9");
}
else {
$('#length-div').removeClass("hidden");
$('#unit-div').removeClass("col-sm-4");
$('#unit-div').addClass("col-sm-2");
$('#unit-div').removeClass("col-xs-9");
$('#unit-div').addClass("col-xs-5");
}
}