dropzonejs-rails 0.1.6 → 0.1.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
- YWViY2IyZDBjMWVkOGVhNmU5Mzg3ZDk5ZjQxMDU0NTg1N2Y0ZjVmNQ==
4
+ NDFiNzViYWM1NTM4M2Y3MmViOWZmMWJiM2I3ZjIxYWEzMWRjOTRhNQ==
5
5
  data.tar.gz: !binary |-
6
- MTZhZWQ5MDhmYzEyM2YwZWFlOTJlNTMzMTMxMjU0NDg3ZGM5NzI0Yg==
6
+ N2ZkMWVkYmRjZmY5YTcxZGVkZTFiOTgzMmVlMmUwZmZhMTU1N2UxOA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjY0YWYxZTg2YjdhYjMxODMyODljMzI2OTc2YzM0OWM4YzcyZmViZGQ2N2Qw
10
- NjdjMTBhMTBkYTVkZjg1MzU3ZDEyYmNhNWRmZWQ3N2ZmMTdhNjZlNzUyZTVj
11
- YmViZWJjM2ExNGRjNzIyZDM5NmQ1NzRlYjdlNzkyMDBlZDNhMDk=
9
+ MTA5NmRlODBhNzExZTc0MDNiYWNkM2Q3Y2IxOThjM2M5MzZiZWIxMmYxNGVi
10
+ ZTgzNmVjYjcxYTk2NWQ0OWE4NWNmNTQ5MWE1NmVmZWIxNGMyZWRmYmJkMjQw
11
+ NTA5NGFmZDRhOWY3YTY4NmIyZGI0ZmY2NmJhMzQ4YThhZTNmOTc=
12
12
  data.tar.gz: !binary |-
13
- MWJkYjlhZDE3OGJhYTM3ZTZmMWQ4OGJiZmRjMjI1MmFjZjFhOTkyZTVmMzgw
14
- YjQzOGZmOTM5MjA1YThkZWNhYTU5ZjU4OGM5MWM2OWQ5ZGY1NzZlZjkxZTFm
15
- NjI2NGQyZWMzZGY4OTA0OTVhMDMwYzdjOWEwYjY1YzI4MzM5NzQ=
13
+ MmZhMDgwMDVmZTc5ZGZhZTE5NDIwNjEyZWFkZGZkMWE0ZTg4ZDE5NTJjMGM1
14
+ ZDJhZDI5ZTA3OTQ2M2MwYzE3NWNmMDA3MGJmNjAzNTBkNzNjNjI3MzYwMGZi
15
+ MDkzYmU4MTExZGY0MjZhNGRkZTcwOTA4NTk1YzY1OWM1OTZiODc=
@@ -1,4 +1,4 @@
1
1
  module DropzonejsRails
2
- VERSION = '0.1.6'
3
- DROPZONE_VERSION = '2.0.13'
2
+ VERSION = '0.1.7'
3
+ DROPZONE_VERSION = '2.0.14'
4
4
  end
@@ -432,6 +432,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
432
432
  thumbnailHeight: 100,
433
433
  params: {},
434
434
  clickable: true,
435
+ acceptParameter: null,
435
436
  enqueueForUpload: true,
436
437
  previewsContainer: null,
437
438
  dictDefaultMessage: "Drop files here to upload",
@@ -521,7 +522,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
521
522
  processingfile: function(file) {
522
523
  return file.previewTemplate.classList.add("processing");
523
524
  },
524
- uploadprogress: function(file, progress) {
525
+ uploadprogress: function(file, progress, bytesSent) {
525
526
  return file.previewTemplate.querySelector(".progress .upload").style.width = "" + progress + "%";
526
527
  },
527
528
  sending: noop,
@@ -622,6 +623,9 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
622
623
  _this.hiddenFileInput = document.createElement("input");
623
624
  _this.hiddenFileInput.setAttribute("type", "file");
624
625
  _this.hiddenFileInput.setAttribute("multiple", "multiple");
626
+ if (_this.options.acceptParameter != null) {
627
+ _this.hiddenFileInput.setAttribute("accept", _this.options.acceptParameter);
628
+ }
625
629
  _this.hiddenFileInput.style.display = "none";
626
630
  document.body.appendChild(_this.hiddenFileInput);
627
631
  return _this.hiddenFileInput.addEventListener("change", function() {
@@ -990,7 +994,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
990
994
  if (!((200 <= (_ref = xhr.status) && _ref < 300))) {
991
995
  return handleError();
992
996
  } else {
993
- _this.emit("uploadprogress", file, 100);
997
+ _this.emit("uploadprogress", file, 100, file.size);
994
998
  response = xhr.responseText;
995
999
  if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) {
996
1000
  response = JSON.parse(response);
@@ -1003,7 +1007,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1003
1007
  };
1004
1008
  progressObj = (_ref = xhr.upload) != null ? _ref : xhr;
1005
1009
  progressObj.onprogress = function(e) {
1006
- return _this.emit("uploadprogress", file, Math.max(0, Math.min(100, (e.loaded / e.total) * 100)));
1010
+ return _this.emit("uploadprogress", file, Math.max(0, Math.min(100, 100 * e.loaded / e.total)), e.loaded);
1007
1011
  };
1008
1012
  xhr.setRequestHeader("Accept", "application/json");
1009
1013
  xhr.setRequestHeader("Cache-Control", "no-cache");
@@ -1054,7 +1058,7 @@ require.register("dropzone/lib/dropzone.js", function(exports, require, module){
1054
1058
 
1055
1059
  })(Em);
1056
1060
 
1057
- Dropzone.version = "2.0.13";
1061
+ Dropzone.version = "2.0.14";
1058
1062
 
1059
1063
  Dropzone.options = {};
1060
1064
 
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.1.6
4
+ version: 0.1.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-04-17 00:00:00.000000000 Z
11
+ date: 2013-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails