jquery-fileupload-rails 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -7,7 +7,7 @@ jquery-fileupload-rails is a library that integrates jQuery File Upload for Rail
7
7
  ## Plugin versions
8
8
 
9
9
  * jQuery File Upload User Interface Plugin 6.9.4
10
- * jQuery File Upload Plugin 5.16.1
10
+ * jQuery File Upload Plugin 5.16.3
11
11
  * jQuery UI Widget 1.8.23+amd
12
12
 
13
13
  ## Installing Gem
@@ -1,7 +1,7 @@
1
1
  module JQuery
2
2
  module FileUpload
3
3
  module Rails
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  /*
2
- * jQuery File Upload Plugin 5.16.1
2
+ * jQuery File Upload Plugin 5.16.3
3
3
  * https://github.com/blueimp/jQuery-File-Upload
4
4
  *
5
5
  * Copyright 2010, Sebastian Tschan
@@ -850,7 +850,7 @@
850
850
  fileInput.prop('entries'),
851
851
  files,
852
852
  value;
853
- if (entries) {
853
+ if (entries && entries.length) {
854
854
  return this._handleFileTreeEntries(entries);
855
855
  }
856
856
  files = $.makeArray(fileInput.prop('files'));
@@ -963,8 +963,8 @@
963
963
  _initSpecialOptions: function () {
964
964
  var options = this.options;
965
965
  if (options.fileInput === undefined) {
966
- options.fileInput = this.element.is('input:file') ?
967
- this.element : this.element.find('input:file');
966
+ options.fileInput = this.element.is('input[type="file"]') ?
967
+ this.element : this.element.find('input[type="file"]');
968
968
  } else if (!(options.fileInput instanceof $)) {
969
969
  options.fileInput = $(options.fileInput);
970
970
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- * JavaScript Canvas to Blob 2.0.2
2
+ * JavaScript Canvas to Blob 2.0.3
3
3
  * https://github.com/blueimp/JavaScript-Canvas-to-Blob
4
4
  *
5
5
  * Copyright 2012, Sebastian Tschan
@@ -19,13 +19,21 @@
19
19
  'use strict';
20
20
  var CanvasPrototype = window.HTMLCanvasElement &&
21
21
  window.HTMLCanvasElement.prototype,
22
- hasBlobConstructor = function () {
22
+ hasBlobConstructor = window.Blob && (function () {
23
+ try {
24
+ return Boolean(new Blob());
25
+ } catch (e) {
26
+ return false;
27
+ }
28
+ }()),
29
+ hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array &&
30
+ (function () {
23
31
  try {
24
- return !!new Blob();
32
+ return new Blob([new Uint8Array(100)]).size === 100;
25
33
  } catch (e) {
26
34
  return false;
27
35
  }
28
- }(),
36
+ }()),
29
37
  BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder ||
30
38
  window.MozBlobBuilder || window.MSBlobBuilder,
31
39
  dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob &&
@@ -34,8 +42,8 @@
34
42
  arrayBuffer,
35
43
  intArray,
36
44
  i,
37
- bb,
38
- mimeString;
45
+ mimeString,
46
+ bb;
39
47
  if (dataURI.split(',')[0].indexOf('base64') >= 0) {
40
48
  // Convert base64 to raw binary data held in a string:
41
49
  byteString = atob(dataURI.split(',')[1]);
@@ -51,9 +59,12 @@
51
59
  }
52
60
  // Separate out the mime component:
53
61
  mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
54
- // Write the ArrayBuffer to a blob:
62
+ // Write the ArrayBuffer (or ArrayBufferView) to a blob:
55
63
  if (hasBlobConstructor) {
56
- return new Blob([arrayBuffer], {type: mimeString});
64
+ return new Blob(
65
+ [hasArrayBufferViewSupport ? intArray : arrayBuffer],
66
+ {type: mimeString}
67
+ );
57
68
  }
58
69
  bb = new BlobBuilder();
59
70
  bb.append(arrayBuffer);
@@ -70,7 +81,7 @@
70
81
  };
71
82
  }
72
83
  }
73
- if (typeof define !== 'undefined' && define.amd) {
84
+ if (typeof define === 'function' && define.amd) {
74
85
  define(function () {
75
86
  return dataURLtoBlob;
76
87
  });
@@ -111,7 +111,7 @@
111
111
  return false;
112
112
  };
113
113
 
114
- if (typeof define !== 'undefined' && define.amd) {
114
+ if (typeof define === 'function' && define.amd) {
115
115
  define(function () {
116
116
  return loadImage;
117
117
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-fileupload-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-22 00:00:00.000000000 Z
12
+ date: 2012-09-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties