Browse Source

Removed most Dropzone properties and shrunk drop button. Also made entire window a drop zone.

master
Teknikode 7 years ago
parent
commit
5396a4ddee
  1. 10
      Teknik/Areas/Upload/Scripts/Upload.js
  2. 41
      Teknik/Areas/Upload/Views/Upload/Index.cshtml

10
Teknik/Areas/Upload/Scripts/Upload.js

@ -55,12 +55,12 @@ function linkRemove(selector, fileID) { @@ -55,12 +55,12 @@ function linkRemove(selector, fileID) {
var fileCount = 0;
Dropzone.options.TeknikUpload = {
paramName: "file", // The name that will be used to transfer the file
var dropZone = new Dropzone(document.body, {
url: uploadFileURL,
maxFilesize: maxUploadSize, // MB
addRemoveLinks: true,
autoProcessQueue: false,
clickable: true,
clickable: "#uploadButton",
previewTemplate: function () { },
addedfile: function (file) {
// Create the UI element for the new item
@ -91,7 +91,7 @@ Dropzone.options.TeknikUpload = { @@ -91,7 +91,7 @@ Dropzone.options.TeknikUpload = {
encryptFile(file, uploadFile);
this.removeFile(file);
}
};
});
// Function to encrypt a file, overide the file's data attribute with the encrypted value, and then call a callback function if supplied
function encryptFile(file, callback) {
@ -209,7 +209,7 @@ function uploadComplete(fileID, key, evt) { @@ -209,7 +209,7 @@ function uploadComplete(fileID, key, evt) {
<button type="button" class="btn btn-default btn-sm" id="generate-delete-link-' + fileID + '">Generate Deletion URL</button> \
</div> \
<div class="col-sm-4 text-center"> \
<button type="button" class="btn btn-default btn-sm" id="remove-link-' + fileID + '">Remove</button> \
<button type="button" class="btn btn-default btn-sm" id="remove-link-' + fileID + '">Remove From List</button> \
</div> \
</div> \
</div> \

41
Teknik/Areas/Upload/Views/Upload/Index.cshtml

@ -14,33 +14,34 @@ @@ -14,33 +14,34 @@
<div class="container">
<div class="row text-center">
<form action="@Url.SubRouteUrl("upload", "Upload.Action", new { action = "Upload" })" class="dropzone" id="TeknikUpload" name="TeknikUpload" enctype="multipart/form-data">
@Html.AntiForgeryToken()
<div class="dz-message text-center" id="upload_message">
<div class="row">
<div class="col-sm-12">
<h1>Drop your files here</h1>
<div class="col-sm-8 col-sm-offset-2">
<div class="row text-center">
<div class="well well-lg text-center" id="uploadButton">
<div class="row">
<div class="col-sm-12">
<h1>Drop your files here</h1>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h2>Or just click here</h2>
<div class="row">
<div class="col-sm-12">
<h2>Or just click here</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h3>Your Choice</h3>
<div class="row">
<div class="col-sm-12">
<h3>Your Choice</h3>
</div>
</div>
</div>
</div>
<div class="fallback text-center">
<div class="row">
<div class="col-sm-12">
<input name="file" type="file" class="form-control" multiple />
<div class="fallback text-center">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<input name="file" type="file" class="form-control" multiple />
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<br />
<div class="container" id="upload-links">

Loading…
Cancel
Save