Skip to content

Commit a12f5ec

Browse files
committed
Add compiled files and bump version
1 parent 6280082 commit a12f5ec

File tree

9 files changed

+71
-20
lines changed

9 files changed

+71
-20
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dropzone",
33
"location": "enyo/dropzone",
4-
"version": "4.0.1",
4+
"version": "4.1.0",
55
"description": "Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.",
66
"homepage": "http://www.dropzonejs.com",
77
"main": [

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dropzone",
33
"repo": "enyo/dropzone",
4-
"version": "4.0.1",
4+
"version": "4.1.0",
55
"description": "Handles drag and drop of files for you.",
66
"scripts": [ "index.js", "dist/dropzone.js" ],
77
"styles": [ "dist/basic.css" ],

dist/dropzone-amd-module.js

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
dropzone.on("dragEnter", function() { });
124124
*/
125125

126-
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
126+
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
127127

128128
Dropzone.prototype.defaultOptions = {
129129
url: null,
@@ -139,7 +139,6 @@
139139
thumbnailHeight: 120,
140140
filesizeBase: 1000,
141141
maxFiles: null,
142-
filesizeBase: 1000,
143142
params: {},
144143
clickable: true,
145144
ignoreHiddenFiles: true,
@@ -186,7 +185,11 @@
186185
}
187186
span = messageElement.getElementsByTagName("span")[0];
188187
if (span) {
189-
span.textContent = this.options.dictFallbackMessage;
188+
if (span.textContent != null) {
189+
span.textContent = this.options.dictFallbackMessage;
190+
} else if (span.innerText != null) {
191+
span.innerText = this.options.dictFallbackMessage;
192+
}
190193
}
191194
return this.element.appendChild(this.getFallbackForm());
192195
},
@@ -399,6 +402,7 @@
399402
maxfilesexceeded: noop,
400403
maxfilesreached: noop,
401404
queuecomplete: noop,
405+
addedfiles: noop,
402406
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size></span></div>\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Check</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Error</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>"
403407
};
404408

@@ -520,6 +524,10 @@
520524
return this.getFilesWithStatus(Dropzone.UPLOADING);
521525
};
522526

527+
Dropzone.prototype.getAddedFiles = function() {
528+
return this.getFilesWithStatus(Dropzone.ADDED);
529+
};
530+
523531
Dropzone.prototype.getActiveFiles = function() {
524532
var file, _i, _len, _ref, _results;
525533
_ref = this.files;
@@ -575,6 +583,7 @@
575583
_this.addFile(file);
576584
}
577585
}
586+
_this.emit("addedfiles", files);
578587
return setupHiddenFileInput();
579588
});
580589
};
@@ -604,7 +613,7 @@
604613
})(this));
605614
this.on("complete", (function(_this) {
606615
return function(file) {
607-
if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
616+
if (_this.getAddedFiles().length === 0 && _this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
608617
return setTimeout((function() {
609618
return _this.emit("queuecomplete");
610619
}), 0);
@@ -673,6 +682,12 @@
673682
if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
674683
return _this.hiddenFileInput.click();
675684
}
685+
},
686+
"touchstart": function(evt) {
687+
noPropagation(evt);
688+
if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
689+
return _this.hiddenFileInput.click();
690+
}
676691
}
677692
}
678693
});
@@ -859,6 +874,7 @@
859874
}
860875
this.emit("drop", e);
861876
files = e.dataTransfer.files;
877+
this.emit("addedfiles", files);
862878
if (files.length) {
863879
items = e.dataTransfer.items;
864880
if (items && items.length && (items[0].webkitGetAsEntry != null)) {
@@ -1317,7 +1333,9 @@
13171333
}
13181334
for (headerName in headers) {
13191335
headerValue = headers[headerName];
1320-
xhr.setRequestHeader(headerName, headerValue);
1336+
if (headerValue) {
1337+
xhr.setRequestHeader(headerName, headerValue);
1338+
}
13211339
}
13221340
formData = new FormData();
13231341
if (this.options.params) {
@@ -1356,6 +1374,10 @@
13561374
for (i = _m = 0, _ref5 = files.length - 1; 0 <= _ref5 ? _m <= _ref5 : _m >= _ref5; i = 0 <= _ref5 ? ++_m : --_m) {
13571375
formData.append(this._getParamName(i), files[i], files[i].name);
13581376
}
1377+
return this.submitRequest(xhr, formData, files);
1378+
};
1379+
1380+
Dropzone.prototype.submitRequest = function(xhr, formData, files) {
13591381
return xhr.send(formData);
13601382
};
13611383

@@ -1397,7 +1419,7 @@
13971419

13981420
})(Emitter);
13991421

1400-
Dropzone.version = "4.0.1";
1422+
Dropzone.version = "4.1.0";
14011423

14021424
Dropzone.options = {};
14031425

dist/dropzone.js

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
dropzone.on("dragEnter", function() { });
112112
*/
113113

114-
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
114+
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
115115

116116
Dropzone.prototype.defaultOptions = {
117117
url: null,
@@ -127,7 +127,6 @@
127127
thumbnailHeight: 120,
128128
filesizeBase: 1000,
129129
maxFiles: null,
130-
filesizeBase: 1000,
131130
params: {},
132131
clickable: true,
133132
ignoreHiddenFiles: true,
@@ -174,7 +173,11 @@
174173
}
175174
span = messageElement.getElementsByTagName("span")[0];
176175
if (span) {
177-
span.textContent = this.options.dictFallbackMessage;
176+
if (span.textContent != null) {
177+
span.textContent = this.options.dictFallbackMessage;
178+
} else if (span.innerText != null) {
179+
span.innerText = this.options.dictFallbackMessage;
180+
}
178181
}
179182
return this.element.appendChild(this.getFallbackForm());
180183
},
@@ -387,6 +390,7 @@
387390
maxfilesexceeded: noop,
388391
maxfilesreached: noop,
389392
queuecomplete: noop,
393+
addedfiles: noop,
390394
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size></span></div>\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Check</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Error</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>"
391395
};
392396

@@ -508,6 +512,10 @@
508512
return this.getFilesWithStatus(Dropzone.UPLOADING);
509513
};
510514

515+
Dropzone.prototype.getAddedFiles = function() {
516+
return this.getFilesWithStatus(Dropzone.ADDED);
517+
};
518+
511519
Dropzone.prototype.getActiveFiles = function() {
512520
var file, _i, _len, _ref, _results;
513521
_ref = this.files;
@@ -563,6 +571,7 @@
563571
_this.addFile(file);
564572
}
565573
}
574+
_this.emit("addedfiles", files);
566575
return setupHiddenFileInput();
567576
});
568577
};
@@ -592,7 +601,7 @@
592601
})(this));
593602
this.on("complete", (function(_this) {
594603
return function(file) {
595-
if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
604+
if (_this.getAddedFiles().length === 0 && _this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
596605
return setTimeout((function() {
597606
return _this.emit("queuecomplete");
598607
}), 0);
@@ -661,6 +670,12 @@
661670
if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
662671
return _this.hiddenFileInput.click();
663672
}
673+
},
674+
"touchstart": function(evt) {
675+
noPropagation(evt);
676+
if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
677+
return _this.hiddenFileInput.click();
678+
}
664679
}
665680
}
666681
});
@@ -847,6 +862,7 @@
847862
}
848863
this.emit("drop", e);
849864
files = e.dataTransfer.files;
865+
this.emit("addedfiles", files);
850866
if (files.length) {
851867
items = e.dataTransfer.items;
852868
if (items && items.length && (items[0].webkitGetAsEntry != null)) {
@@ -1305,7 +1321,9 @@
13051321
}
13061322
for (headerName in headers) {
13071323
headerValue = headers[headerName];
1308-
xhr.setRequestHeader(headerName, headerValue);
1324+
if (headerValue) {
1325+
xhr.setRequestHeader(headerName, headerValue);
1326+
}
13091327
}
13101328
formData = new FormData();
13111329
if (this.options.params) {
@@ -1344,6 +1362,10 @@
13441362
for (i = _m = 0, _ref5 = files.length - 1; 0 <= _ref5 ? _m <= _ref5 : _m >= _ref5; i = 0 <= _ref5 ? ++_m : --_m) {
13451363
formData.append(this._getParamName(i), files[i], files[i].name);
13461364
}
1365+
return this.submitRequest(xhr, formData, files);
1366+
};
1367+
1368+
Dropzone.prototype.submitRequest = function(xhr, formData, files) {
13471369
return xhr.send(formData);
13481370
};
13491371

@@ -1385,7 +1407,7 @@
13851407

13861408
})(Emitter);
13871409

1388-
Dropzone.version = "4.0.1";
1410+
Dropzone.version = "4.1.0";
13891411

13901412
Dropzone.options = {};
13911413

dist/min/dropzone-amd-module.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/min/dropzone.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dropzone",
3-
"version": "4.0.1",
3+
"version": "4.1.0",
44
"description": "Handles drag and drop of files for you.",
55
"keywords": [
66
"dragndrop",

src/dropzone.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ class Dropzone extends Emitter
12541254

12551255

12561256

1257-
Dropzone.version = "4.0.1"
1257+
Dropzone.version = "4.1.0"
12581258

12591259

12601260
# This is a map of options for your different dropzones. Add configurations

test/test.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)