Skip to content

Commit

Permalink
changes for v2.2.4: Updated Dropzone framework to 5.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hochleitner committed Jul 9, 2018
1 parent 08f83a7 commit f52ac6c
Show file tree
Hide file tree
Showing 12 changed files with 1,837 additions and 1,912 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ https://apex.oracle.com/pls/apex/f?p=APEXPLUGIN

## Changelog

#### 2.2.4 - Updated Dropzone framework to 5.5.0

#### 2.2.3 - Fixed displaying of special characters #39 / some server side code improvements

#### 2.2.2 - Updated Dropzone framework to 5.3.0
Expand Down
2 changes: 1 addition & 1 deletion apexplugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dropzone",
"version": "2.2.3",
"version": "2.2.4",
"description": "Dropzone is a region type plugin that allows you to provide nice looking drag’n’drop file uploads.",
"keywords": ["dropzone", "drag", "drop", "file", "upload", "multi", "multiple"],
"homepage": "https://github.com/Dani3lSun/apex-plugin-dropzone",
Expand Down
2 changes: 1 addition & 1 deletion server/css/apexdropzone.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
APEX Dropzone CSS
Author: Daniel Hochleitner
Version: 2.2.3
Version: 2.2.4
*/

.dz-message {
Expand Down
2 changes: 1 addition & 1 deletion server/css/apexdropzone.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/css/dropzone.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server/js/apexdropzone.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
APEX Dropzone JS
Author: Daniel Hochleitner
Version: 2.2.3
Version: 2.2.4
*/

/**
Expand Down
29 changes: 1 addition & 28 deletions server/js/apexdropzone.min.js

Large diffs are not rendered by default.

29 changes: 19 additions & 10 deletions server/js/dropzone.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ var Dropzone = function (_Emitter) {
* This is the element the hidden input field (which is used when clicking on the
* dropzone to trigger file selection) will be appended to. This might
* be important in case you use frameworks to switch the content of your page.
*
* Can be a selector string, or an element directly.
*/
hiddenInputContainer: "body",

Expand Down Expand Up @@ -894,7 +896,7 @@ var Dropzone = function (_Emitter) {
if (file.previewElement) {
file.previewElement.classList.add("dz-processing");
if (file._removeLink) {
return file._removeLink.textContent = this.options.dictCancelUpload;
return file._removeLink.innerHTML = this.options.dictCancelUpload;
}
}
},
Expand Down Expand Up @@ -959,7 +961,7 @@ var Dropzone = function (_Emitter) {
// Receives `file`
complete: function complete(file) {
if (file._removeLink) {
file._removeLink.textContent = this.options.dictRemoveFile;
file._removeLink.innerHTML = this.options.dictRemoveFile;
}
if (file.previewElement) {
return file.previewElement.classList.add("dz-complete");
Expand Down Expand Up @@ -1222,7 +1224,7 @@ var Dropzone = function (_Emitter) {
_this3.hiddenFileInput.style.left = "0";
_this3.hiddenFileInput.style.height = "0";
_this3.hiddenFileInput.style.width = "0";
document.querySelector(_this3.options.hiddenInputContainer).appendChild(_this3.hiddenFileInput);
Dropzone.getElement(_this3.options.hiddenInputContainer, 'hiddenInputContainer').appendChild(_this3.hiddenFileInput);
return _this3.hiddenFileInput.addEventListener("change", function () {
var files = _this3.hiddenFileInput.files;

Expand Down Expand Up @@ -1620,7 +1622,12 @@ var Dropzone = function (_Emitter) {
}
this.emit("drop", e);

var files = e.dataTransfer.files;
// Convert the FileList to an Array
// This is necessary for IE11
var files = [];
for (var i = 0; i < e.dataTransfer.files.length; i++) {
files[i] = e.dataTransfer.files[i];
}

this.emit("addedfiles", files);

Expand Down Expand Up @@ -1789,7 +1796,7 @@ var Dropzone = function (_Emitter) {
}, {
key: "accept",
value: function accept(file, done) {
if (file.size > this.options.maxFilesize * 1024 * 1024) {
if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) {
return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
} else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
return done(this.options.dictInvalidFileType);
Expand Down Expand Up @@ -1962,7 +1969,7 @@ var Dropzone = function (_Emitter) {
value: function resizeImage(file, width, height, resizeMethod, callback) {
var _this11 = this;

return this.createThumbnail(file, width, height, resizeMethod, false, function (dataUrl, canvas) {
return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) {
if (canvas == null) {
// The image has not been resized
return callback(file);
Expand Down Expand Up @@ -2071,18 +2078,18 @@ var Dropzone = function (_Emitter) {
case 6:
// 90° rotate right
ctx.rotate(0.5 * Math.PI);
ctx.translate(0, -canvas.height);
ctx.translate(0, -canvas.width);
break;
case 7:
// horizontal flip + 90 rotate right
ctx.rotate(0.5 * Math.PI);
ctx.translate(canvas.width, -canvas.height);
ctx.translate(canvas.height, -canvas.width);
ctx.scale(-1, 1);
break;
case 8:
// 90° rotate left
ctx.rotate(-0.5 * Math.PI);
ctx.translate(-canvas.width, 0);
ctx.translate(-canvas.height, 0);
break;
}

Expand Down Expand Up @@ -2324,6 +2331,8 @@ var Dropzone = function (_Emitter) {

// Clear the data from the chunk
chunk.dataBlock = null;
// Leaving this reference to xhr intact here will cause memory leaks in some browsers
chunk.xhr = null;

for (var i = 0; i < file.upload.totalChunkCount; i++) {
if (file.upload.chunks[i] === undefined) {
Expand Down Expand Up @@ -2855,7 +2864,7 @@ var Dropzone = function (_Emitter) {

Dropzone.initClass();

Dropzone.version = "5.3.0";
Dropzone.version = "5.5.0";

// This is a map of options for your different dropzones. Add configurations
// to this object for your different dropzone elemens.
Expand Down
Loading

0 comments on commit f52ac6c

Please sign in to comment.