dropzonejs-rails 0.4.9 → 0.4.10

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: adb641f39f6a5ad904f6e9361e0a76df81a463bd
4
- data.tar.gz: d330f431d23f3fea4f71150e22284c815a844787
3
+ metadata.gz: fe9ee50a0edeab493470c4d53733167350ac2509
4
+ data.tar.gz: 8b71aa171ac3937fa58ce8bc6502cb0d5af843dc
5
5
  SHA512:
6
- metadata.gz: 91a9c8779a21eb6d02f32b688f69e31293f91880e3b9ae112aecd37cf556dea3c8382a35123b1822a424e3406f93b0f85e65973a57dba974c6138c04a8c69569
7
- data.tar.gz: ca9d6043345d4b8012281189601619cba7b85ce587884ec8a7c34bd6db8ae13c33b9d528e9fb8fbe65988011377b4b7790137436934bb4bc1b9faa60a7c89816
6
+ metadata.gz: 554d70f56bc01d1e1be06fbfc5753ad04a363ebd24cb29b4ceed271524f534e8f258796d2925c1259fa3c400881928f8d696eb97b6a9293ca1f83c8ce6df449e
7
+ data.tar.gz: c7b820d918653d23d0c7e2acd9978b55fb68f53641597862e4deae799fa888fc46406e74f3b3830b99900bde86399c12c1614b10106a754721da6ca77cd5a5b5
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.7.1**.
7
+ The latest version of this gem bundles **Dropzone v3.7.3**.
8
8
 
9
9
  ## Installation and usage
10
10
 
@@ -1,4 +1,4 @@
1
1
  module DropzonejsRails
2
- VERSION = '0.4.9'
3
- DROPZONE_VERSION = '3.7.1'
2
+ VERSION = '0.4.10'
3
+ DROPZONE_VERSION = '3.7.3'
4
4
  end
@@ -27,10 +27,14 @@ function require(path, parent, orig) {
27
27
  // perform real require()
28
28
  // by invoking the module's
29
29
  // registered function
30
- if (!module.exports) {
31
- module.exports = {};
32
- module.client = module.component = true;
33
- module.call(this, module.exports, require.relative(resolved), module);
30
+ if (!module._resolving && !module.exports) {
31
+ var mod = {};
32
+ mod.exports = {};
33
+ mod.client = mod.component = true;
34
+ module._resolving = true;
35
+ module.call(this, mod.exports, require.relative(resolved), mod);
36
+ delete module._resolving;
37
+ module.exports = mod.exports;
34
38
  }
35
39
 
36
40
  return module.exports;
@@ -531,12 +535,21 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
531
535
  return this.element.classList.remove("dz-started");
532
536
  },
533
537
  addedfile: function(file) {
534
- var _this = this;
535
- file.previewElement = Dropzone.createElement(this.options.previewTemplate);
538
+ var node, _i, _j, _len, _len1, _ref, _ref1,
539
+ _this = this;
540
+ file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
536
541
  file.previewTemplate = file.previewElement;
537
542
  this.previewsContainer.appendChild(file.previewElement);
538
- file.previewElement.querySelector("[data-dz-name]").textContent = file.name;
539
- file.previewElement.querySelector("[data-dz-size]").innerHTML = this.filesize(file.size);
543
+ _ref = file.previewElement.querySelectorAll("[data-dz-name]");
544
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
545
+ node = _ref[_i];
546
+ node.textContent = file.name;
547
+ }
548
+ _ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
549
+ for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
550
+ node = _ref1[_j];
551
+ node.innerHTML = this.filesize(file.size);
552
+ }
540
553
  if (this.options.addRemoveLinks) {
541
554
  file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\">" + this.options.dictRemoveFile + "</a>");
542
555
  file._removeLink.addEventListener("click", function(e) {
@@ -568,16 +581,28 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
568
581
  return this._updateMaxFilesReachedClass();
569
582
  },
570
583
  thumbnail: function(file, dataUrl) {
571
- var thumbnailElement;
584
+ var thumbnailElement, _i, _len, _ref, _results;
572
585
  file.previewElement.classList.remove("dz-file-preview");
573
586
  file.previewElement.classList.add("dz-image-preview");
574
- thumbnailElement = file.previewElement.querySelector("[data-dz-thumbnail]");
575
- thumbnailElement.alt = file.name;
576
- return thumbnailElement.src = dataUrl;
587
+ _ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]");
588
+ _results = [];
589
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
590
+ thumbnailElement = _ref[_i];
591
+ thumbnailElement.alt = file.name;
592
+ _results.push(thumbnailElement.src = dataUrl);
593
+ }
594
+ return _results;
577
595
  },
578
596
  error: function(file, message) {
597
+ var node, _i, _len, _ref, _results;
579
598
  file.previewElement.classList.add("dz-error");
580
- return file.previewElement.querySelector("[data-dz-errormessage]").textContent = message;
599
+ _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
600
+ _results = [];
601
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
602
+ node = _ref[_i];
603
+ _results.push(node.textContent = message);
604
+ }
605
+ return _results;
581
606
  },
582
607
  errormultiple: noop,
583
608
  processing: function(file) {
@@ -588,7 +613,14 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
588
613
  },
589
614
  processingmultiple: noop,
590
615
  uploadprogress: function(file, progress, bytesSent) {
591
- return file.previewElement.querySelector("[data-dz-uploadprogress]").style.width = "" + progress + "%";
616
+ var node, _i, _len, _ref, _results;
617
+ _ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]");
618
+ _results = [];
619
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
620
+ node = _ref[_i];
621
+ _results.push(node.style.width = "" + progress + "%");
622
+ }
623
+ return _results;
592
624
  },
593
625
  totaluploadprogress: noop,
594
626
  sending: noop,
@@ -642,7 +674,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
642
674
  throw new Error("Dropzone already attached.");
643
675
  }
644
676
  Dropzone.instances.push(this);
645
- element.dropzone = this;
677
+ this.element.dropzone = this;
646
678
  elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {};
647
679
  this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {});
648
680
  if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {
@@ -748,7 +780,9 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
748
780
  }
749
781
  _this.hiddenFileInput = document.createElement("input");
750
782
  _this.hiddenFileInput.setAttribute("type", "file");
751
- _this.hiddenFileInput.setAttribute("multiple", "multiple");
783
+ if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) {
784
+ _this.hiddenFileInput.setAttribute("multiple", "multiple");
785
+ }
752
786
  if (_this.options.acceptedFiles != null) {
753
787
  _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
754
788
  }
@@ -877,7 +911,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
877
911
  if (this.options.dictFallbackText) {
878
912
  fieldsString += "<p>" + this.options.dictFallbackText + "</p>";
879
913
  }
880
- fieldsString += "<input type=\"file\" name=\"" + this.options.paramName + (this.options.uploadMultiple ? "[]" : "") + "\" " + (this.options.uploadMultiple ? 'multiple="multiple"' : void 0) + " /><button type=\"submit\">Upload!</button></div>";
914
+ fieldsString += "<input type=\"file\" name=\"" + this.options.paramName + (this.options.uploadMultiple ? "[]" : "") + "\" " + (this.options.uploadMultiple ? 'multiple="multiple"' : void 0) + " /><input type=\"submit\" value=\"Upload!\"></div>";
881
915
  fields = Dropzone.createElement(fieldsString);
882
916
  if (this.element.tagName !== "FORM") {
883
917
  form = Dropzone.createElement("<form action=\"" + this.options.url + "\" enctype=\"multipart/form-data\" method=\"" + this.options.method + "\"></form>");
@@ -1448,7 +1482,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1448
1482
 
1449
1483
  })(Em);
1450
1484
 
1451
- Dropzone.version = "3.7.1";
1485
+ Dropzone.version = "3.7.3";
1452
1486
 
1453
1487
  Dropzone.options = {};
1454
1488
 
@@ -1631,7 +1665,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1631
1665
  validType = acceptedFiles[_i];
1632
1666
  validType = validType.trim();
1633
1667
  if (validType.charAt(0) === ".") {
1634
- if (file.name.indexOf(validType, file.name.length - validType.length) !== -1) {
1668
+ if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {
1635
1669
  return true;
1636
1670
  }
1637
1671
  } else if (/\/\*$/.test(validType)) {
@@ -343,12 +343,11 @@
343
343
  }
344
344
  .dropzone a.dz-remove,
345
345
  .dropzone-previews a.dz-remove {
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%);
346
+ background-image: -webkit-linear-gradient(top, #fafafa, #eee);
347
+ background-image: -moz-linear-gradient(top, #fafafa, #eee);
348
+ background-image: -o-linear-gradient(top, #fafafa, #eee);
349
+ background-image: -ms-linear-gradient(top, #fafafa, #eee);
350
+ background-image: linear-gradient(to bottom, #fafafa, #eee);
352
351
  -webkit-border-radius: 2px;
353
352
  border-radius: 2px;
354
353
  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.9
4
+ version: 0.4.10
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-08-15 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project:
80
- rubygems_version: 2.0.6
80
+ rubygems_version: 2.1.11
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: Integrates Dropzone JS File upload into Rails Asset pipeline.