dropzonejs-rails 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWU2MGE3NTg5YmMxOGMxN2U0YWUwMTE3OTJmMzc5ZGQ5YmU1ZDI1MQ==
4
+ MWFhOTE0OTE4NWY4ZDBjYjk1ZDQ5ZDdkYzQwYzBjZjBmYjlhMjRhMA==
5
5
  data.tar.gz: !binary |-
6
- NWVmNDUwNTNiZDgxOGUxOWIxMTA1OWMzZTc4MTA5ZTAzNjRhYTZkYg==
6
+ NjdmMjMyYWUyOWEzZjk4ZjQ2MTAzZTQwMmE4OWJkNWM0ZTMzOThiZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDY5MTY4MTYwMmU5YzE0ZDAyNDdiN2IwNjViNjM3ZjE3ODg3MmFmODMyNGI1
10
- NThmMTQzMjRiNWZjMWQ4ZGMwMmFlNTE0NDI1YTQzMDhhYmY0OGU5YTI0NzY0
11
- YmI1NWYyMThmZmQ1YmY5ZjVkOWE4Zjg1MTI3MDNjMzFmMjQ0MTE=
9
+ MzE4NDU5ODU4YjczNzVlM2EyODY2ZjFhZGZkOGJmMjkxYjk5N2U4ZGUwZmFi
10
+ NjM0MGJjNzE5ODVmYjJkMzU2NzFkYjEyYzA2MWU5ODFjYzc4ZmI1YTFlYzU2
11
+ Mzc5ZTllNzU0YTQwMTgxOGM5MzkyNjBlMjdhMzc4ZjhlZDAyNzQ=
12
12
  data.tar.gz: !binary |-
13
- MjIzYzM5N2RmMGJkOWZiOWIzODg1NzYyZGUxYjM3NWViNmNhNmYxZWUzN2Uz
14
- Mzk3M2JmNDk5NDVkODE5NGJmNTI0MzZmM2Y0YTY2YjZkYzJmYmYwOWU2NTE1
15
- NjI5M2MyYzE2YWI4YzM4MWY0YjI4MThiMThlYTRjYWMzMDIxNGQ=
13
+ MTczYTk1MWQzNTgwOWI5NTY2OTI1MmQ0NTQwNTU4NDQ5MjQzNjk5NDUxYjA3
14
+ ODkwN2ZiZGEyZWJiYTBiYTE0YTlkMTJmNjkxMTBjM2E5OWZkYTExMDBiMGE2
15
+ MjJlNTk0ZTBhMzQwNjkwZTc3MjQ5ZTU5YzFiNDBmYjYxMzAyNzc=
data/README.md CHANGED
@@ -4,7 +4,7 @@ Integrate [Matias Meno's Dropzone](http://www.dropzonejs.com/) awesome file uplo
4
4
 
5
5
  ## Version
6
6
 
7
- The latest version of this gem bundles **Dropzone v3.6.1**.
7
+ The latest version of this gem bundles **Dropzone v3.6.2**.
8
8
 
9
9
  ## Installation and usage
10
10
 
@@ -1,4 +1,4 @@
1
1
  module DropzonejsRails
2
- VERSION = '0.4.6'
3
- DROPZONE_VERSION = '3.6.1'
2
+ VERSION = '0.4.7'
3
+ DROPZONE_VERSION = '3.6.2'
4
4
  end
@@ -439,6 +439,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
439
439
  dictCancelUpload: "Cancel upload",
440
440
  dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
441
441
  dictRemoveFile: "Remove file",
442
+ dictRemoveFileConfirmation: null,
442
443
  accept: function(file, done) {
443
444
  return done();
444
445
  },
@@ -544,7 +545,13 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
544
545
  return _this.removeFile(file);
545
546
  }
546
547
  } else {
547
- return _this.removeFile(file);
548
+ if (_this.options.dictRemoveFileConfirmation) {
549
+ if (window.confirm(_this.options.dictRemoveFileConfirmation)) {
550
+ return _this.removeFile(file);
551
+ }
552
+ } else {
553
+ return _this.removeFile(file);
554
+ }
548
555
  }
549
556
  });
550
557
  return file.previewElement.appendChild(file._removeLink);
@@ -733,9 +740,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
733
740
  }
734
741
  _this.hiddenFileInput = document.createElement("input");
735
742
  _this.hiddenFileInput.setAttribute("type", "file");
736
- if (_this.options.uploadMultiple) {
737
- _this.hiddenFileInput.setAttribute("multiple", "multiple");
738
- }
743
+ _this.hiddenFileInput.setAttribute("multiple", "multiple");
739
744
  if (_this.options.acceptedFiles != null) {
740
745
  _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
741
746
  }
@@ -1169,12 +1174,15 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1169
1174
  parallelUploads = this.options.parallelUploads;
1170
1175
  processingLength = this.getUploadingFiles().length;
1171
1176
  i = processingLength;
1177
+ if (processingLength >= parallelUploads) {
1178
+ return;
1179
+ }
1172
1180
  queuedFiles = this.getQueuedFiles();
1173
1181
  if (!(queuedFiles.length > 0)) {
1174
1182
  return;
1175
1183
  }
1176
1184
  if (this.options.uploadMultiple) {
1177
- return this.processFiles(queuedFiles.slice(0, parallelUploads));
1185
+ return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
1178
1186
  } else {
1179
1187
  while (i < parallelUploads) {
1180
1188
  if (!queuedFiles.length) {
@@ -1253,7 +1261,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1253
1261
  };
1254
1262
 
1255
1263
  Dropzone.prototype.uploadFiles = function(files) {
1256
- var file, formData, handleError, header, headers, input, inputName, inputType, key, name, progressObj, response, updateProgress, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3,
1264
+ 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,
1257
1265
  _this = this;
1258
1266
  xhr = new XMLHttpRequest();
1259
1267
  for (_i = 0, _len = files.length; _i < _len; _i++) {
@@ -1346,9 +1354,9 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1346
1354
  if (this.options.headers) {
1347
1355
  extend(headers, this.options.headers);
1348
1356
  }
1349
- for (header in headers) {
1350
- name = headers[header];
1351
- xhr.setRequestHeader(header, name);
1357
+ for (headerName in headers) {
1358
+ headerValue = headers[headerName];
1359
+ xhr.setRequestHeader(headerName, headerValue);
1352
1360
  }
1353
1361
  formData = new FormData();
1354
1362
  if (this.options.params) {
@@ -1421,7 +1429,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1421
1429
 
1422
1430
  })(Em);
1423
1431
 
1424
- Dropzone.version = "3.6.1";
1432
+ Dropzone.version = "3.6.2";
1425
1433
 
1426
1434
  Dropzone.options = {};
1427
1435
 
@@ -1449,9 +1457,6 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1449
1457
 
1450
1458
  Dropzone.discover = function() {
1451
1459
  var checkElements, dropzone, dropzones, _i, _len, _results;
1452
- if (!Dropzone.autoDiscover) {
1453
- return;
1454
- }
1455
1460
  if (document.querySelectorAll) {
1456
1461
  dropzones = document.querySelectorAll(".dropzone");
1457
1462
  } else {
@@ -1704,14 +1709,19 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1704
1709
  }
1705
1710
  };
1706
1711
 
1707
- contentLoaded(window, Dropzone.discover);
1712
+ Dropzone._autoDiscoverFunction = function() {
1713
+ if (Dropzone.autoDiscover) {
1714
+ return Dropzone.discover();
1715
+ }
1716
+ };
1717
+
1718
+ contentLoaded(window, Dropzone._autoDiscoverFunction);
1708
1719
 
1709
1720
  }).call(this);
1710
1721
 
1711
1722
  });
1712
1723
  require.alias("component-emitter/index.js", "dropzone/deps/emitter/index.js");
1713
1724
  require.alias("component-emitter/index.js", "emitter/index.js");
1714
-
1715
1725
  if (typeof exports == "object") {
1716
1726
  module.exports = require("dropzone");
1717
1727
  } else if (typeof define == "function" && define.amd) {
@@ -180,7 +180,7 @@
180
180
  top: 50%;
181
181
  left: 50%;
182
182
  }
183
- @media all and (-webkit-min-device-pixel-ratio: 1.5) {
183
+ @media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
184
184
  .dropzone .dz-default.dz-message {
185
185
  background-image: image-url("dropzone/spritemap@2x.png");
186
186
  -webkit-background-size: 428px 406px;
@@ -200,14 +200,14 @@
200
200
  }
201
201
  .dropzone.dz-drag-hover .dz-message {
202
202
  opacity: 0.15;
203
- filter: alpha(opacity=15);
204
203
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=15)";
204
+ filter: alpha(opacity=15);
205
205
  }
206
206
  .dropzone.dz-started .dz-message {
207
207
  display: block;
208
208
  opacity: 0;
209
- filter: alpha(opacity=0);
210
209
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
210
+ filter: alpha(opacity=0);
211
211
  }
212
212
  .dropzone .dz-preview,
213
213
  .dropzone-previews .dz-preview {
@@ -219,8 +219,8 @@
219
219
  .dropzone-previews .dz-preview.dz-image-preview:hover .dz-details img {
220
220
  display: block;
221
221
  opacity: 0.1;
222
- filter: alpha(opacity=10);
223
222
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";
223
+ filter: alpha(opacity=10);
224
224
  }
225
225
  .dropzone .dz-preview.dz-success .dz-success-mark,
226
226
  .dropzone-previews .dz-preview.dz-success .dz-success-mark {
@@ -244,8 +244,8 @@
244
244
  .dropzone-previews .dz-preview .dz-success-mark {
245
245
  display: block;
246
246
  opacity: 0;
247
- filter: alpha(opacity=0);
248
247
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
248
+ filter: alpha(opacity=0);
249
249
  -webkit-transition: opacity 0.4s ease-in-out;
250
250
  -moz-transition: opacity 0.4s ease-in-out;
251
251
  -o-transition: opacity 0.4s ease-in-out;
@@ -254,7 +254,7 @@
254
254
  background-image: image-url("dropzone/spritemap.png");
255
255
  background-repeat: no-repeat;
256
256
  }
257
- @media all and (-webkit-min-device-pixel-ratio: 1.5) {
257
+ @media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
258
258
  .dropzone .dz-preview .dz-error-mark,
259
259
  .dropzone-previews .dz-preview .dz-error-mark,
260
260
  .dropzone .dz-preview .dz-success-mark,
@@ -302,7 +302,7 @@
302
302
  background-repeat: repeat-x;
303
303
  background-position: 0px -400px;
304
304
  }
305
- @media all and (-webkit-min-device-pixel-ratio: 1.5) {
305
+ @media all and (-webkit-min-device-pixel-ratio:1.5),(min--moz-device-pixel-ratio:1.5),(-o-min-device-pixel-ratio:1.5/1),(min-device-pixel-ratio:1.5),(min-resolution:138dpi),(min-resolution:1.5dppx) {
306
306
  .dropzone .dz-preview .dz-progress .dz-upload,
307
307
  .dropzone-previews .dz-preview .dz-progress .dz-upload {
308
308
  background-image: image-url("dropzone/spritemap@2x.png");
@@ -315,8 +315,8 @@
315
315
  .dropzone-previews .dz-preview.dz-success .dz-progress {
316
316
  display: block;
317
317
  opacity: 0;
318
- filter: alpha(opacity=0);
319
318
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
319
+ filter: alpha(opacity=0);
320
320
  -webkit-transition: opacity 0.4s ease-in-out;
321
321
  -moz-transition: opacity 0.4s ease-in-out;
322
322
  -o-transition: opacity 0.4s ease-in-out;
@@ -327,8 +327,8 @@
327
327
  .dropzone-previews .dz-preview .dz-error-message {
328
328
  display: block;
329
329
  opacity: 0;
330
- filter: alpha(opacity=0);
331
330
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
331
+ filter: alpha(opacity=0);
332
332
  -webkit-transition: opacity 0.3s ease-in-out;
333
333
  -moz-transition: opacity 0.3s ease-in-out;
334
334
  -o-transition: opacity 0.3s ease-in-out;
@@ -344,11 +344,11 @@
344
344
  .dropzone a.dz-remove,
345
345
  .dropzone-previews a.dz-remove {
346
346
  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fafafa), color-stop(1, #eee));
347
- background-image: -webkit-linear-gradient(top, #fafafa 0%, #eee 100%);
348
- background-image: -moz-linear-gradient(top, #fafafa 0%, #eee 100%);
349
- background-image: -o-linear-gradient(top, #fafafa 0%, #eee 100%);
350
- background-image: -ms-linear-gradient(top, #fafafa 0%, #eee 100%);
351
- background-image: linear-gradient(top, #fafafa 0%, #eee 100%);
347
+ background-image: -webkit-linear-gradient(top, #fafafa 0, #eee 100%);
348
+ background-image: -moz-linear-gradient(top, #fafafa 0, #eee 100%);
349
+ background-image: -o-linear-gradient(top, #fafafa 0, #eee 100%);
350
+ background-image: -ms-linear-gradient(top, #fafafa 0, #eee 100%);
351
+ background-image: linear-gradient(top, #fafafa 0, #eee 100%);
352
352
  -webkit-border-radius: 2px;
353
353
  border-radius: 2px;
354
354
  border: 1px solid #eee;
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.6
4
+ version: 0.4.7
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-07-08 00:00:00.000000000 Z
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit