|
|
|
@@ -3,88 +3,88 @@ |
|
|
|
} |
|
|
|
@using SecureSharing.Business.Infrastructure |
|
|
|
@model MessageModel |
|
|
|
|
|
|
|
<body> |
|
|
|
<h1>Share files</h1> |
|
|
|
<form method="post" enctype="multipart/form-data" asp-controller="Home" asp-action="CreateMessage" class="share-files-form"> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Sharing link avaliability</label> |
|
|
|
<div class="button-box row"> |
|
|
|
<div class="single-button-input col-4"> |
|
|
|
<input id="OneTime" checked="checked" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_TIME"> |
|
|
|
<label for="OneTime" class="label-available"><span style="color:#FFA463">One</span> Time</label> |
|
|
|
</div> |
|
|
|
<div class="single-button-input d-none"> |
|
|
|
<input id="OneHour" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_HOUR"/> <label for="OneHour" class="label-available">1 hour</label> |
|
|
|
</div> |
|
|
|
<div class="single-button-input col-4"> |
|
|
|
<input id="OneDay" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_DAY"/> <label for="OneDay" class="label-available">1 day</label> |
|
|
|
</div> |
|
|
|
<div class="single-button-input col-4"> |
|
|
|
<input id="SevenDays" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_WEEK"/> <label for="SevenDays" class="label-available">7 days</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Message (optional)</label> |
|
|
|
<textarea asp-for="Text" class="input-message"></textarea> |
|
|
|
</div> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Upload files</label> |
|
|
|
<div id="dropContainer" class="drop-here"> |
|
|
|
<img class="image-file-upload" src="~/img/file-upload-image.png" alt=""/> |
|
|
|
<div class="default-text text-files-upload"> |
|
|
|
<label for="fileInput" class="btn browse-button"> |
|
|
|
<span style="color:#0D1C52">Drag and drop files here or</span> browse |
|
|
|
</label> |
|
|
|
<input asp-for="Files" id="fileInput" type="file" multiple style="display: none"/> |
|
|
|
<input asp-for="FilesAsText" id="fileInputAsText" type="text" style="display:none" value="978682e8-3ce7-4258-b731-d027b5b213aa"/> |
|
|
|
<form method="post" enctype="multipart/form-data" asp-controller="Home" asp-action="CreateMessage" class="share-files-form"> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Sharing link avaliability</label> |
|
|
|
<div class="button-box row"> |
|
|
|
<div class="single-button-input col-4"> |
|
|
|
<input id="OneTime" checked="checked" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_TIME"> |
|
|
|
<label for="OneTime" class="label-available"><span style="color:#FFA463">One</span> Time</label> |
|
|
|
</div> |
|
|
|
<div class="single-button-input d-none"> |
|
|
|
<input id="OneHour" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_HOUR"/> <label for="OneHour" class="label-available">1 hour</label> |
|
|
|
</div> |
|
|
|
<div class="single-button-input col-4"> |
|
|
|
<input id="OneDay" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_DAY"/> <label for="OneDay" class="label-available">1 day</label> |
|
|
|
</div> |
|
|
|
<div class="single-button-input col-4"> |
|
|
|
<input id="SevenDays" class="radio-input" type="radio" asp-for="ChosenPeriod" value="@PeriodOfValidity.ONE_WEEK"/> <label for="SevenDays" class="label-available">7 days</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mb-3"> |
|
|
|
<div class="label-text"> |
|
|
|
Your files |
|
|
|
</div> |
|
|
|
<div id="filesUploaded"> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Message (optional)</label> |
|
|
|
<textarea asp-for="Text" class="input-message"></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="button-box row"> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Anonymous share</label> |
|
|
|
<div class="tooltip-div"> |
|
|
|
<i class="fas fa-info"></i> |
|
|
|
<span class="tooltip-label">This indicates that this message will be visible to people outside diligent network.</span> |
|
|
|
<label class="label-text">Upload files</label> |
|
|
|
<div class="drop-here"> |
|
|
|
<img class="image-file-upload" src="~/img/file-upload-image.png" alt=""/> |
|
|
|
<div class="default-text text-files-upload"> |
|
|
|
<label for="fileInput" class="btn browse-button"> |
|
|
|
<span style="color:#0D1C52">Drag and drop files here or</span> browse |
|
|
|
</label> |
|
|
|
<input asp-for="Files" id="fileInput" type="file" multiple style="display: none"/> |
|
|
|
<input asp-for="FilesAsText" id="fileInputAsText" type="text" style="display:none" value="978682e8-3ce7-4258-b731-d027b5b213aa"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<label class="switch"> |
|
|
|
<input id="Anonymous" type="checkbox" asp-for="Anonymous" value="true"> |
|
|
|
<span class="slider round"></span> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Allow editing</label> |
|
|
|
<div class="tooltip-div"> |
|
|
|
<i class="fas fa-info"></i> |
|
|
|
<span class="tooltip-label">This indicates that this message can be edited by everyone.</span> |
|
|
|
<div class="label-text"> |
|
|
|
Your files |
|
|
|
</div> |
|
|
|
<div id="filesUploaded"> |
|
|
|
</div> |
|
|
|
<label class="switch"> |
|
|
|
<input id="AllowEditing" type="checkbox" asp-for="AllowEditing" value="true"> |
|
|
|
<span class="slider round"></span> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<button class=" btn btn-light share-button" type="submit">Share</button> |
|
|
|
</form> |
|
|
|
<div class="button-box row"> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Anonymous share</label> |
|
|
|
<div class="tooltip-div"> |
|
|
|
<i class="fas fa-info"></i> |
|
|
|
<span class="tooltip-label">This indicates that this message will be visible to people outside diligent network.</span> |
|
|
|
</div> |
|
|
|
<label class="switch"> |
|
|
|
<input id="Anonymous" type="checkbox" asp-for="Anonymous" value="true"> |
|
|
|
<span class="slider round"></span> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
<div class="mb-3"> |
|
|
|
<label class="label-text">Allow editing</label> |
|
|
|
<div class="tooltip-div"> |
|
|
|
<i class="fas fa-info"></i> |
|
|
|
<span class="tooltip-label">This indicates that this message can be edited by everyone.</span> |
|
|
|
</div> |
|
|
|
<label class="switch"> |
|
|
|
<input id="AllowEditing" type="checkbox" asp-for="AllowEditing" value="true"> |
|
|
|
<span class="slider round"></span> |
|
|
|
</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<button class=" btn btn-light share-button" type="submit">Share</button> |
|
|
|
</form> |
|
|
|
</body> |
|
|
|
<script src="~/plugins/jquery/jquery.js" type="text/javascript"></script> |
|
|
|
<script type="text/javascript"> |
|
|
|
var filesUploaded = document.getElementById("filesUploaded"); |
|
|
|
let filesUploaded = document.getElementById("filesUploaded"); |
|
|
|
$('#fileInput').change(function() { |
|
|
|
var files = $('#fileInput')[0].files |
|
|
|
let files = $('#fileInput')[0].files |
|
|
|
|
|
|
|
for (var i = 0; i < files.length; i++){ |
|
|
|
for (let i = 0; i < files.length; i++){ |
|
|
|
filesUploaded.innerHTML +='<p>' + files[i].name + '</p>'; |
|
|
|
} |
|
|
|
}); |
|
|
|
@@ -101,11 +101,11 @@ document.getElementById("Anonymous").onchange = () => { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
var selectedFiles; |
|
|
|
let selectedFiles; |
|
|
|
|
|
|
|
$(document).ready(() => { |
|
|
|
var box; |
|
|
|
box = document.getElementById("dropContainer"); |
|
|
|
let box; |
|
|
|
box = document.body; |
|
|
|
box.addEventListener("dragenter", OnDragEnter, false); |
|
|
|
box.addEventListener("dragover", OnDragOver, false); |
|
|
|
box.addEventListener("drop", OnDrop, false); |
|
|
|
@@ -124,11 +124,11 @@ function OnDragOver(e) { |
|
|
|
function OnDrop(e) { |
|
|
|
e.stopPropagation(); |
|
|
|
e.preventDefault(); |
|
|
|
var selectedFiles = e.dataTransfer.files; |
|
|
|
var formData = new FormData(); |
|
|
|
var fileInput = document.getElementById("fileInputAsText"); |
|
|
|
let selectedFiles = e.dataTransfer.files; |
|
|
|
let formData = new FormData(); |
|
|
|
let fileInput = document.getElementById("fileInputAsText"); |
|
|
|
|
|
|
|
for (var i = 0; i < selectedFiles.length; i++){ |
|
|
|
for (let i = 0; i < selectedFiles.length; i++){ |
|
|
|
formData.append(selectedFiles[i].name, selectedFiles[i]); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -139,7 +139,7 @@ function OnDrop(e) { |
|
|
|
processData: false, |
|
|
|
data: formData, |
|
|
|
success: function (result) { |
|
|
|
for (var i = 0; i < selectedFiles.length; i++){ |
|
|
|
for (let i = 0; i < selectedFiles.length; i++){ |
|
|
|
fileInput.value += result + ':' + selectedFiles[i].name + ';'; |
|
|
|
filesUploaded.innerHTML += '<p>' + selectedFiles[i].name + '</p>'; |
|
|
|
} |