jquery.fileupload-rails 1.6.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcbb03c9c287f9c4c5dd7ccce39665a1ef12274e
|
4
|
+
data.tar.gz: 6a722ff0944ea1f4a3328caa87e87767e47e310d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16b71a23180856a31a12c5835444614f770944a03051e0eea95f2a65ceb72474d424989734ec7d5a42429ef6eda8ae260183a63999cae23d6713943833700c02
|
7
|
+
data.tar.gz: e51530ccaf3028d40db540b59a0388e0a5d054ec587ee6a95b434274d28e09b6fca0a3571bb92a041f73806d46b6e1ab70147243fdb907f216923ba98b93ca67
|
data/Readme.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
//= require jquery.iframe-transport
|
3
3
|
|
4
4
|
/*
|
5
|
-
* jQuery File Upload Plugin 5.
|
5
|
+
* jQuery File Upload Plugin 5.34.0
|
6
6
|
* https://github.com/blueimp/jQuery-File-Upload
|
7
7
|
*
|
8
8
|
* Copyright 2010, Sebastian Tschan
|
@@ -177,6 +177,9 @@
|
|
177
177
|
// handlers using jQuery's Deferred callbacks:
|
178
178
|
// data.submit().done(func).fail(func).always(func);
|
179
179
|
add: function (e, data) {
|
180
|
+
if (e.isDefaultPrevented()) {
|
181
|
+
return false;
|
182
|
+
}
|
180
183
|
if (data.autoUpload || (data.autoUpload !== false &&
|
181
184
|
$(this).fileupload('option', 'autoUpload'))) {
|
182
185
|
data.process().done(function () {
|
@@ -363,10 +366,18 @@
|
|
363
366
|
// Trigger a custom progress event with a total data property set
|
364
367
|
// to the file size(s) of the current upload and a loaded data
|
365
368
|
// property calculated accordingly:
|
366
|
-
this._trigger(
|
369
|
+
this._trigger(
|
370
|
+
'progress',
|
371
|
+
$.Event('progress', {delegatedEvent: e}),
|
372
|
+
data
|
373
|
+
);
|
367
374
|
// Trigger a global progress event for all current file uploads,
|
368
375
|
// including ajax calls queued for sequential file uploads:
|
369
|
-
this._trigger(
|
376
|
+
this._trigger(
|
377
|
+
'progressall',
|
378
|
+
$.Event('progressall', {delegatedEvent: e}),
|
379
|
+
this._progress
|
380
|
+
);
|
370
381
|
}
|
371
382
|
},
|
372
383
|
|
@@ -537,8 +548,10 @@
|
|
537
548
|
options.url = options.form.prop('action') || location.href;
|
538
549
|
}
|
539
550
|
// The HTTP request method must be "POST" or "PUT":
|
540
|
-
options.type = (options.type ||
|
541
|
-
.
|
551
|
+
options.type = (options.type ||
|
552
|
+
($.type(options.form.prop('method')) === 'string' &&
|
553
|
+
options.form.prop('method')) || ''
|
554
|
+
).toUpperCase();
|
542
555
|
if (options.type !== 'POST' && options.type !== 'PUT' &&
|
543
556
|
options.type !== 'PATCH') {
|
544
557
|
options.type = 'POST';
|
@@ -611,8 +624,11 @@
|
|
611
624
|
data.submit = function () {
|
612
625
|
if (this.state() !== 'pending') {
|
613
626
|
data.jqXHR = this.jqXHR =
|
614
|
-
(that._trigger(
|
615
|
-
|
627
|
+
(that._trigger(
|
628
|
+
'submit',
|
629
|
+
$.Event('submit', {delegatedEvent: e}),
|
630
|
+
this
|
631
|
+
) !== false) && that._onSend(e, this);
|
616
632
|
}
|
617
633
|
return this.jqXHR || that._getXHRPromise();
|
618
634
|
};
|
@@ -832,7 +848,11 @@
|
|
832
848
|
// Set timer for bitrate progress calculation:
|
833
849
|
options._bitrateTimer = new that._BitrateTimer();
|
834
850
|
jqXHR = jqXHR || (
|
835
|
-
((aborted || that._trigger(
|
851
|
+
((aborted || that._trigger(
|
852
|
+
'send',
|
853
|
+
$.Event('send', {delegatedEvent: e}),
|
854
|
+
options
|
855
|
+
) === false) &&
|
836
856
|
that._getXHRPromise(false, options.context, aborted)) ||
|
837
857
|
that._chunkedUpload(options) || $.ajax(options)
|
838
858
|
).done(function (result, textStatus, jqXHR) {
|
@@ -935,7 +955,11 @@
|
|
935
955
|
that._initResponseObject(newData);
|
936
956
|
that._initProgressObject(newData);
|
937
957
|
that._addConvenienceMethods(e, newData);
|
938
|
-
result = that._trigger(
|
958
|
+
result = that._trigger(
|
959
|
+
'add',
|
960
|
+
$.Event('add', {delegatedEvent: e}),
|
961
|
+
newData
|
962
|
+
);
|
939
963
|
return result;
|
940
964
|
});
|
941
965
|
return result;
|
@@ -1104,7 +1128,11 @@
|
|
1104
1128
|
if (that.options.replaceFileInput) {
|
1105
1129
|
that._replaceFileInput(data.fileInput);
|
1106
1130
|
}
|
1107
|
-
if (that._trigger(
|
1131
|
+
if (that._trigger(
|
1132
|
+
'change',
|
1133
|
+
$.Event('change', {delegatedEvent: e}),
|
1134
|
+
data
|
1135
|
+
) !== false) {
|
1108
1136
|
that._onAdd(e, data);
|
1109
1137
|
}
|
1110
1138
|
});
|
@@ -1121,7 +1149,11 @@
|
|
1121
1149
|
data.files.push(file);
|
1122
1150
|
}
|
1123
1151
|
});
|
1124
|
-
if (this._trigger(
|
1152
|
+
if (this._trigger(
|
1153
|
+
'paste',
|
1154
|
+
$.Event('paste', {delegatedEvent: e}),
|
1155
|
+
data
|
1156
|
+
) !== false) {
|
1125
1157
|
this._onAdd(e, data);
|
1126
1158
|
}
|
1127
1159
|
}
|
@@ -1136,7 +1168,11 @@
|
|
1136
1168
|
e.preventDefault();
|
1137
1169
|
this._getDroppedFiles(dataTransfer).always(function (files) {
|
1138
1170
|
data.files = files;
|
1139
|
-
if (that._trigger(
|
1171
|
+
if (that._trigger(
|
1172
|
+
'drop',
|
1173
|
+
$.Event('drop', {delegatedEvent: e}),
|
1174
|
+
data
|
1175
|
+
) !== false) {
|
1140
1176
|
that._onAdd(e, data);
|
1141
1177
|
}
|
1142
1178
|
});
|
@@ -1145,17 +1181,14 @@
|
|
1145
1181
|
|
1146
1182
|
_onDragOver: function (e) {
|
1147
1183
|
e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
|
1148
|
-
var dataTransfer = e.dataTransfer
|
1149
|
-
data = {
|
1150
|
-
dropEffect: 'copy',
|
1151
|
-
preventDefault: true
|
1152
|
-
};
|
1184
|
+
var dataTransfer = e.dataTransfer;
|
1153
1185
|
if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 &&
|
1154
|
-
this._trigger(
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1186
|
+
this._trigger(
|
1187
|
+
'dragover',
|
1188
|
+
$.Event('dragover', {delegatedEvent: e})
|
1189
|
+
) !== false) {
|
1190
|
+
e.preventDefault();
|
1191
|
+
dataTransfer.dropEffect = 'copy';
|
1159
1192
|
}
|
1160
1193
|
},
|
1161
1194
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* jQuery Iframe Transport Plugin 1.
|
2
|
+
* jQuery Iframe Transport Plugin 1.8.0
|
3
3
|
* https://github.com/blueimp/jQuery-File-Upload
|
4
4
|
*
|
5
5
|
* Copyright 2011, Sebastian Tschan
|
@@ -27,7 +27,7 @@
|
|
27
27
|
// Helper variable to create unique names for the transport iframes:
|
28
28
|
var counter = 0;
|
29
29
|
|
30
|
-
// The iframe transport accepts
|
30
|
+
// The iframe transport accepts four additional options:
|
31
31
|
// options.fileInput: a jQuery collection of file input fields
|
32
32
|
// options.paramName: the parameter name for the file form data,
|
33
33
|
// overrides the name property of the file input field(s),
|
@@ -35,9 +35,14 @@
|
|
35
35
|
// options.formData: an array of objects with name and value properties,
|
36
36
|
// equivalent to the return data of .serializeArray(), e.g.:
|
37
37
|
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
38
|
+
// options.initialIframeSrc: the URL of the initial iframe src,
|
39
|
+
// by default set to "javascript:false;"
|
38
40
|
$.ajaxTransport('iframe', function (options) {
|
39
41
|
if (options.async) {
|
40
|
-
|
42
|
+
// javascript:false as initial iframe src
|
43
|
+
// prevents warning popups on HTTPS in IE6:
|
44
|
+
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
|
45
|
+
form,
|
41
46
|
iframe,
|
42
47
|
addParamChar;
|
43
48
|
return {
|
@@ -56,15 +61,13 @@
|
|
56
61
|
options.url = options.url + addParamChar + '_method=PATCH';
|
57
62
|
options.type = 'POST';
|
58
63
|
}
|
59
|
-
// javascript:false as initial iframe src
|
60
|
-
// prevents warning popups on HTTPS in IE6.
|
61
64
|
// IE versions below IE8 cannot set the name property of
|
62
65
|
// elements that have already been added to the DOM,
|
63
66
|
// so we set the name along with the iframe HTML markup:
|
64
67
|
counter += 1;
|
65
68
|
iframe = $(
|
66
|
-
'<iframe src="
|
67
|
-
counter + '"></iframe>'
|
69
|
+
'<iframe src="' + initialIframeSrc +
|
70
|
+
'" name="iframe-transport-' + counter + '"></iframe>'
|
68
71
|
).bind('load', function () {
|
69
72
|
var fileInputClones,
|
70
73
|
paramNames = $.isArray(options.paramName) ?
|
@@ -95,7 +98,7 @@
|
|
95
98
|
);
|
96
99
|
// Fix for IE endless progress bar activity bug
|
97
100
|
// (happens on form submits to iframe targets):
|
98
|
-
$('<iframe src="
|
101
|
+
$('<iframe src="' + initialIframeSrc + '"></iframe>')
|
99
102
|
.appendTo(form);
|
100
103
|
window.setTimeout(function () {
|
101
104
|
// Removing the form in a setTimeout call
|
@@ -159,7 +162,7 @@
|
|
159
162
|
// concat is used to avoid the "Script URL" JSLint error:
|
160
163
|
iframe
|
161
164
|
.unbind('load')
|
162
|
-
.prop('src',
|
165
|
+
.prop('src', initialIframeSrc);
|
163
166
|
}
|
164
167
|
if (form) {
|
165
168
|
form.remove();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery.fileupload-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Semyon Perepelitsa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.1.8
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Use jQuery File Upload plugin with Rails 3
|