Fix and update Dropzonejs.
Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
6aca0cd874
commit
b083bd534b
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* The MIT License
|
||||
* Copyright (c) 2012 Matias Meno <m@tias.me>
|
||||
*/
|
||||
.dropzone, .dropzone * {
|
||||
box-sizing: border-box; }
|
||||
|
||||
.dropzone {
|
||||
position: relative; }
|
||||
.dropzone .dz-preview {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 120px;
|
||||
margin: 0.5em; }
|
||||
.dropzone .dz-preview .dz-progress {
|
||||
display: block;
|
||||
height: 15px;
|
||||
border: 1px solid #aaa; }
|
||||
.dropzone .dz-preview .dz-progress .dz-upload {
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 0;
|
||||
background: green; }
|
||||
.dropzone .dz-preview .dz-error-message {
|
||||
color: red;
|
||||
display: none; }
|
||||
.dropzone .dz-preview.dz-error .dz-error-message, .dropzone .dz-preview.dz-error .dz-error-mark {
|
||||
display: block; }
|
||||
.dropzone .dz-preview.dz-success .dz-success-mark {
|
||||
display: block; }
|
||||
.dropzone .dz-preview .dz-error-mark, .dropzone .dz-preview .dz-success-mark {
|
||||
position: absolute;
|
||||
display: none;
|
||||
left: 30px;
|
||||
top: 30px;
|
||||
width: 54px;
|
||||
height: 58px;
|
||||
left: 50%;
|
||||
margin-left: -27px; }
|
||||
+3536
File diff suppressed because it is too large
Load Diff
+51
-31
@@ -173,13 +173,11 @@
|
||||
.dropzone, .dropzone * {
|
||||
box-sizing: border-box; }
|
||||
|
||||
.dz-default {
|
||||
border-style: dotted;
|
||||
}
|
||||
|
||||
.dropzone {
|
||||
min-height: 150px;
|
||||
}
|
||||
border: 2px solid rgba(0, 0, 0, 0.3);
|
||||
background: white;
|
||||
padding: 20px 20px; }
|
||||
.dropzone.dz-clickable {
|
||||
cursor: pointer; }
|
||||
.dropzone.dz-clickable * {
|
||||
@@ -187,39 +185,48 @@
|
||||
.dropzone.dz-clickable .dz-message, .dropzone.dz-clickable .dz-message * {
|
||||
cursor: pointer; }
|
||||
.dropzone.dz-started .dz-message {
|
||||
display: none; }
|
||||
display: none; }
|
||||
.dropzone.dz-drag-hover {
|
||||
border-style: solid; }
|
||||
.dropzone.dz-drag-hover .dz-message {
|
||||
opacity: 0.5; }
|
||||
.dropzone .dz-message {
|
||||
text-align: center;
|
||||
padding: 2em 0; }
|
||||
margin: 2em 0; }
|
||||
.dropzone .dz-preview {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin: 5px;
|
||||
}
|
||||
margin: 16px;
|
||||
min-height: 100px; }
|
||||
.dropzone .dz-preview:hover {
|
||||
z-index: 1000; }
|
||||
.dropzone .dz-preview:hover .dz-details {
|
||||
opacity: 1; }
|
||||
.dropzone .dz-preview.dz-file-preview .dz-image {
|
||||
}
|
||||
border-radius: 20px;
|
||||
background: #999;
|
||||
background: linear-gradient(to bottom, #eee, #ddd); }
|
||||
.dropzone .dz-preview.dz-file-preview .dz-details {
|
||||
opacity: 1;
|
||||
margin-top: 30px;
|
||||
}
|
||||
opacity: 1; }
|
||||
.dropzone .dz-preview.dz-image-preview {
|
||||
background: white; }
|
||||
.dropzone .dz-preview.dz-image-preview .dz-details {
|
||||
}
|
||||
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
-ms-transition: opacity 0.2s linear;
|
||||
-o-transition: opacity 0.2s linear;
|
||||
transition: opacity 0.2s linear; }
|
||||
.dropzone .dz-preview .dz-remove {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
border: none; }
|
||||
.dropzone .dz-preview .dz-remove:hover {
|
||||
text-decoration: underline; }
|
||||
.dropzone .dz-preview:hover .dz-details {
|
||||
opacity: 1;
|
||||
|
||||
}
|
||||
opacity: 1; }
|
||||
.dropzone .dz-preview .dz-details {
|
||||
z-index: 20;
|
||||
position: absolute;
|
||||
@@ -231,6 +238,7 @@
|
||||
max-width: 100%;
|
||||
padding: 2em 1em;
|
||||
text-align: center;
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
line-height: 150%; }
|
||||
.dropzone .dz-preview .dz-details .dz-size {
|
||||
margin-bottom: 1em;
|
||||
@@ -248,12 +256,20 @@
|
||||
.dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span {
|
||||
background-color: rgba(255, 255, 255, 0.4);
|
||||
padding: 0 0.4em;
|
||||
}
|
||||
border-radius: 3px; }
|
||||
.dropzone .dz-preview:hover .dz-image img {
|
||||
}
|
||||
-webkit-transform: scale(1.05, 1.05);
|
||||
-moz-transform: scale(1.05, 1.05);
|
||||
-ms-transform: scale(1.05, 1.05);
|
||||
-o-transform: scale(1.05, 1.05);
|
||||
transform: scale(1.05, 1.05);
|
||||
-webkit-filter: blur(8px);
|
||||
filter: blur(8px); }
|
||||
.dropzone .dz-preview .dz-image {
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
position: relative;
|
||||
display: block;
|
||||
z-index: 10; }
|
||||
@@ -313,7 +329,7 @@
|
||||
position: absolute;
|
||||
height: 16px;
|
||||
left: 50%;
|
||||
top: 70%;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
width: 80px;
|
||||
margin-left: -40px;
|
||||
@@ -353,16 +369,20 @@
|
||||
transition: opacity 0.3s ease;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
top: 10px;
|
||||
top: 130px;
|
||||
left: -10px;
|
||||
width: 140px;
|
||||
background: #be2626;
|
||||
background: linear-gradient(to bottom, #be2626, #a92222);
|
||||
padding: 0.5em 1.2em;
|
||||
}
|
||||
|
||||
.btn-dz-remove {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.dz-message {
|
||||
background: white;
|
||||
}
|
||||
color: white; }
|
||||
.dropzone .dz-preview .dz-error-message:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 64px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #be2626; }
|
||||
+3521
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
.dropzone,.dropzone *{box-sizing:border-box}.dropzone{position:relative}.dropzone .dz-preview{position:relative;display:inline-block;width:120px;margin:0.5em}.dropzone .dz-preview .dz-progress{display:block;height:15px;border:1px solid #aaa}.dropzone .dz-preview .dz-progress .dz-upload{display:block;height:100%;width:0;background:green}.dropzone .dz-preview .dz-error-message{color:red;display:none}.dropzone .dz-preview.dz-error .dz-error-message,.dropzone .dz-preview.dz-error .dz-error-mark{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{display:block}.dropzone .dz-preview .dz-error-mark,.dropzone .dz-preview .dz-success-mark{position:absolute;display:none;left:30px;top:30px;width:54px;height:58px;left:50%;margin-left:-27px}
|
||||
Vendored
+2
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
@@ -1,61 +1,62 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
<link href="{% static 'sources/packages/dropzone.css' %}" media="screen" rel="stylesheet" type="text/css" />
|
||||
|
||||
{% include 'appearance/generic_multiform_subtemplate.html' %}
|
||||
|
||||
<script type="text/javascript" src="{% static 'sources/packages/dropzone.js' %}"></script>
|
||||
<script type="text/javascript" src="{% url 'common:javascript_catalog' 'sources' %}"></script>
|
||||
|
||||
<script type="text/x-template" id="previewTemplate">
|
||||
<div class="dz-preview dz-file-preview">
|
||||
<i class="far fa-file" style="font-size: 150px;"></i>
|
||||
|
||||
<div class="dz-image"><img data-dz-thumbnail></div>
|
||||
<i class="far fa-file fa-10x"></i>
|
||||
<div class="dz-details">
|
||||
<div class="dz-filename"><span data-dz-name></span></div>
|
||||
<div class="dz-size"><span data-dz-size></span></div>
|
||||
<div class="dz-size" data-dz-size></div>
|
||||
<img data-dz-thumbnail />
|
||||
</div>
|
||||
|
||||
<div class="dz-progress">
|
||||
<span class="dz-upload" data-dz-uploadprogress>
|
||||
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" style="width: 100%">
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="dz-error-message alert alert-danger"><span data-dz-errormessage></span></div>
|
||||
|
||||
<div class="dz-success-mark">
|
||||
<i class="text-success fa fa-4x fa-check-circle"></i>
|
||||
<span>
|
||||
<i class="text-success fa fa-4x fa-check-circle"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="dz-error-mark">
|
||||
<i class="text-danger fa fa-4x fa-times-circle"></i>
|
||||
<span>
|
||||
<i class="text-danger fa fa-4x fa-times-circle"></i>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<a class="btn btn-default btn-xs btn-dz-remove" data-dz-remove>{% trans 'Clear' %}</a>
|
||||
<div class="dz-error-message">
|
||||
<span data-dz-errormessage>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
var previewTemplate = document.querySelector('#previewTemplate').innerHTML;
|
||||
|
||||
{% verbatim %}
|
||||
Dropzone.options.html5upload = {
|
||||
paramName: 'source-file',
|
||||
addRemoveLinks: false,
|
||||
createImageThumbnails: false,
|
||||
dictDefaultMessage: '<i class="fa fa-cloud-upload-alt"></i> ' + gettext('Drop files or click here to upload files'),
|
||||
dictFallbackMessage: gettext('Your browser does not support drag\'n\'drop file uploads.'),
|
||||
dictFallbackText: gettext('Please use the fallback form below to upload your files like in the olden days.'),
|
||||
dictFileTooBig: gettext('File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.'),
|
||||
dictInvalidFileType: gettext('You can\'t upload files of this type.'),
|
||||
dictResponseError: gettext('Server responded with {{statusCode}} code.'),
|
||||
dictCancelUpload: gettext('Cancel upload'),
|
||||
dictCancelUploadConfirmation: gettext('Are you sure you want to cancel this upload?'),
|
||||
dictRemoveFile: gettext('Clear'),
|
||||
dictMaxFilesExceeded: gettext('You can not upload any more files.'),
|
||||
maxFilesize: 1024,
|
||||
previewTemplate: previewTemplate,
|
||||
};
|
||||
{% endverbatim %}
|
||||
<script>
|
||||
jQuery(document).ready(function() {
|
||||
var previewTemplate = document.querySelector('#previewTemplate').innerHTML;
|
||||
|
||||
{% verbatim %}
|
||||
$('.dropzone').dropzone({
|
||||
addRemoveLinks: true,
|
||||
createImageThumbnails: false,
|
||||
dictCancelUpload: gettext('Cancel upload'),
|
||||
dictCancelUploadConfirmation: gettext('Are you sure you want to cancel this upload?'),
|
||||
dictDefaultMessage: '<i class="fa fa-cloud-upload-alt"></i> ' + gettext('Drop files or click here to upload files'),
|
||||
dictFallbackMessage: gettext('Your browser does not support drag\'n\'drop file uploads.'),
|
||||
dictFallbackText: gettext('Please use the fallback form below to upload your files like in the olden days.'),
|
||||
dictRemoveFile: gettext('Clear'),
|
||||
dictResponseError: gettext('Server responded with {{statusCode}} code.'),
|
||||
paramName: 'source-file',
|
||||
previewTemplate: previewTemplate,
|
||||
});
|
||||
{% endverbatim %}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user