dropzonejs-rails 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e72ebde5086f7653ba4b2ff9faf9ba1247a832d
|
4
|
+
data.tar.gz: ca8b70f7a0ddbee0002bc570383bc76095d09e1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2721ae0a488c2a4fc21c7cc39517f6bb57de7d8047df5d598ba361b1b36e4082eb7be235ea932068512dde18486b721477d0d5127f74de78754b22ed931b8277
|
7
|
+
data.tar.gz: 8ed7a066b5a47585b2e77098bd230503785e121dd7ed8cc74d5b5605e72bbaa785df68e2d50e280ddfaace1d9e1f6c3e36bc1328d6bc22d4657757a7444cdc94
|
data/README.md
CHANGED
@@ -412,7 +412,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
412
412
|
*/
|
413
413
|
|
414
414
|
|
415
|
-
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "selectedfiles", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded"];
|
415
|
+
Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "selectedfiles", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached"];
|
416
416
|
|
417
417
|
Dropzone.prototype.defaultOptions = {
|
418
418
|
url: null,
|
@@ -445,7 +445,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
445
445
|
dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
|
446
446
|
dictRemoveFile: "Remove file",
|
447
447
|
dictRemoveFileConfirmation: null,
|
448
|
-
dictMaxFilesExceeded: "You can
|
448
|
+
dictMaxFilesExceeded: "You can not upload any more files.",
|
449
449
|
accept: function(file, done) {
|
450
450
|
return done();
|
451
451
|
},
|
@@ -569,9 +569,8 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
569
569
|
}
|
570
570
|
}
|
571
571
|
});
|
572
|
-
file.previewElement.appendChild(file._removeLink);
|
572
|
+
return file.previewElement.appendChild(file._removeLink);
|
573
573
|
}
|
574
|
-
return this._updateMaxFilesReachedClass();
|
575
574
|
},
|
576
575
|
removedfile: function(file) {
|
577
576
|
var _ref;
|
@@ -596,6 +595,9 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
596
595
|
error: function(file, message) {
|
597
596
|
var node, _i, _len, _ref, _results;
|
598
597
|
file.previewElement.classList.add("dz-error");
|
598
|
+
if (typeof message !== "String" && message.error) {
|
599
|
+
message = message.error;
|
600
|
+
}
|
599
601
|
_ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
|
600
602
|
_results = [];
|
601
603
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
@@ -640,6 +642,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
640
642
|
},
|
641
643
|
completemultiple: noop,
|
642
644
|
maxfilesexceeded: noop,
|
645
|
+
maxfilesreached: noop,
|
643
646
|
previewTemplate: "<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-details\">\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n <div class=\"dz-size\" data-dz-size></div>\n <img data-dz-thumbnail />\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-success-mark\"><span>✔</span></div>\n <div class=\"dz-error-mark\"><span>✘</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>"
|
644
647
|
};
|
645
648
|
|
@@ -840,6 +843,9 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
840
843
|
return _this.emit("dragenter", e);
|
841
844
|
},
|
842
845
|
"dragover": function(e) {
|
846
|
+
var efct;
|
847
|
+
efct = e.dataTransfer.effectAllowed;
|
848
|
+
e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy';
|
843
849
|
noPropagation(e);
|
844
850
|
return _this.emit("dragover", e);
|
845
851
|
},
|
@@ -880,7 +886,8 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
880
886
|
this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
|
881
887
|
this.hiddenFileInput = null;
|
882
888
|
}
|
883
|
-
|
889
|
+
delete this.element.dropzone;
|
890
|
+
return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
|
884
891
|
};
|
885
892
|
|
886
893
|
Dropzone.prototype.updateTotalUploadProgress = function() {
|
@@ -1007,18 +1014,18 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1007
1014
|
|
1008
1015
|
Dropzone.prototype.filesize = function(size) {
|
1009
1016
|
var string;
|
1010
|
-
if (size >=
|
1011
|
-
size = size /
|
1012
|
-
string = "
|
1013
|
-
} else if (size >=
|
1014
|
-
size = size /
|
1015
|
-
string = "
|
1016
|
-
} else if (size >=
|
1017
|
-
size = size /
|
1018
|
-
string = "
|
1019
|
-
} else if (size >=
|
1020
|
-
size = size /
|
1021
|
-
string = "
|
1017
|
+
if (size >= 1024 * 1024 * 1024 * 1024 / 10) {
|
1018
|
+
size = size / (1024 * 1024 * 1024 * 1024 / 10);
|
1019
|
+
string = "TiB";
|
1020
|
+
} else if (size >= 1024 * 1024 * 1024 / 10) {
|
1021
|
+
size = size / (1024 * 1024 * 1024 / 10);
|
1022
|
+
string = "GiB";
|
1023
|
+
} else if (size >= 1024 * 1024 / 10) {
|
1024
|
+
size = size / (1024 * 1024 / 10);
|
1025
|
+
string = "MiB";
|
1026
|
+
} else if (size >= 1024 / 10) {
|
1027
|
+
size = size / (1024 / 10);
|
1028
|
+
string = "KiB";
|
1022
1029
|
} else {
|
1023
1030
|
size = size * 10;
|
1024
1031
|
string = "b";
|
@@ -1027,7 +1034,10 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1027
1034
|
};
|
1028
1035
|
|
1029
1036
|
Dropzone.prototype._updateMaxFilesReachedClass = function() {
|
1030
|
-
if (this.options.maxFiles && this.getAcceptedFiles().length >= this.options.maxFiles) {
|
1037
|
+
if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
|
1038
|
+
if (this.getAcceptedFiles().length === this.options.maxFiles) {
|
1039
|
+
this.emit('maxfilesreached', this.files);
|
1040
|
+
}
|
1031
1041
|
return this.element.classList.add("dz-max-files-reached");
|
1032
1042
|
} else {
|
1033
1043
|
return this.element.classList.remove("dz-max-files-reached");
|
@@ -1084,7 +1094,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1084
1094
|
return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
|
1085
1095
|
} else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
|
1086
1096
|
return done(this.options.dictInvalidFileType);
|
1087
|
-
} else if (this.options.maxFiles && this.getAcceptedFiles().length >= this.options.maxFiles) {
|
1097
|
+
} else if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
|
1088
1098
|
done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
|
1089
1099
|
return this.emit("maxfilesexceeded", file);
|
1090
1100
|
} else {
|
@@ -1108,10 +1118,11 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1108
1118
|
return this.accept(file, function(error) {
|
1109
1119
|
if (error) {
|
1110
1120
|
file.accepted = false;
|
1111
|
-
|
1121
|
+
_this._errorProcessing([file], error);
|
1112
1122
|
} else {
|
1113
|
-
|
1123
|
+
_this.enqueueFile(file);
|
1114
1124
|
}
|
1125
|
+
return _this._updateMaxFilesReachedClass();
|
1115
1126
|
});
|
1116
1127
|
};
|
1117
1128
|
|
@@ -1197,7 +1208,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1197
1208
|
fileReader = new FileReader;
|
1198
1209
|
fileReader.onload = function() {
|
1199
1210
|
var img;
|
1200
|
-
img =
|
1211
|
+
img = document.createElement("img");
|
1201
1212
|
img.onload = function() {
|
1202
1213
|
var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3;
|
1203
1214
|
file.width = img.width;
|
@@ -1314,7 +1325,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1314
1325
|
};
|
1315
1326
|
|
1316
1327
|
Dropzone.prototype.uploadFiles = function(files) {
|
1317
|
-
var file, formData, handleError, headerName, headerValue, headers, input, inputName, inputType, key, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3,
|
1328
|
+
var file, formData, handleError, headerName, headerValue, headers, input, inputName, inputType, key, option, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2, _ref3, _ref4,
|
1318
1329
|
_this = this;
|
1319
1330
|
xhr = new XMLHttpRequest();
|
1320
1331
|
for (_i = 0, _len = files.length; _i < _len; _i++) {
|
@@ -1432,13 +1443,21 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1432
1443
|
input = _ref2[_k];
|
1433
1444
|
inputName = input.getAttribute("name");
|
1434
1445
|
inputType = input.getAttribute("type");
|
1435
|
-
if (
|
1446
|
+
if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
|
1447
|
+
_ref3 = input.options;
|
1448
|
+
for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
|
1449
|
+
option = _ref3[_l];
|
1450
|
+
if (option.selected) {
|
1451
|
+
formData.append(inputName, option.value);
|
1452
|
+
}
|
1453
|
+
}
|
1454
|
+
} else if (!inputType || ((_ref4 = inputType.toLowerCase()) !== "checkbox" && _ref4 !== "radio") || input.checked) {
|
1436
1455
|
formData.append(inputName, input.value);
|
1437
1456
|
}
|
1438
1457
|
}
|
1439
1458
|
}
|
1440
|
-
for (
|
1441
|
-
file = files[
|
1459
|
+
for (_m = 0, _len4 = files.length; _m < _len4; _m++) {
|
1460
|
+
file = files[_m];
|
1442
1461
|
formData.append("" + this.options.paramName + (this.options.uploadMultiple ? "[]" : ""), file, file.name);
|
1443
1462
|
}
|
1444
1463
|
return xhr.send(formData);
|
@@ -1482,13 +1501,13 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
|
|
1482
1501
|
|
1483
1502
|
})(Em);
|
1484
1503
|
|
1485
|
-
Dropzone.version = "3.7.
|
1504
|
+
Dropzone.version = "3.7.4";
|
1486
1505
|
|
1487
1506
|
Dropzone.options = {};
|
1488
1507
|
|
1489
1508
|
Dropzone.optionsForElement = function(element) {
|
1490
|
-
if (element.id) {
|
1491
|
-
return Dropzone.options[camelize(element.id)];
|
1509
|
+
if (element.getAttribute("id")) {
|
1510
|
+
return Dropzone.options[camelize(element.getAttribute("id"))];
|
1492
1511
|
} else {
|
1493
1512
|
return void 0;
|
1494
1513
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dropzonejs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Nahuel Cuesta Luengo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|