Skip to content

Commit fbd5c6b

Browse files
committed
jquery-fileupload library upgrade to 6.8.8
1 parent ef6b1ad commit fbd5c6b

File tree

13 files changed

+127
-23
lines changed

13 files changed

+127
-23
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
jquery-fileupload-rails is a library that integrates jQuery File Upload for Rails 3.1 Asset Pipeline.
66

7-
jquery-fileupload-rails is currently using jQuery-File-Plugin version 6.7.0.
7+
jquery-fileupload-rails is currently using jQuery-File-Plugin version 6.8.8.
88

99
## Installing Gem
1010

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module JQuery
22
module FileUpload
33
module Rails
4-
VERSION = "0.3.0"
4+
VERSION = "0.3.1"
55
end
66
end
77
end

vendor/assets/javascripts/jquery-fileupload/cors/jquery.postmessage-transport.js

100644100755
File mode changed.

vendor/assets/javascripts/jquery-fileupload/cors/jquery.xdr-transport.js

100644100755
File mode changed.

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-fp.js

100644100755
File mode changed.

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload-ui.js

100644100755
Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload User Interface Plugin 6.8.2
2+
* jQuery File Upload User Interface Plugin 6.9.1
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -128,9 +128,10 @@
128128
.find('.progress').addClass(
129129
!$.support.transition && 'progress-animated'
130130
)
131+
.attr('aria-valuenow', 100)
131132
.find('.bar').css(
132133
'width',
133-
parseInt(100, 10) + '%'
134+
'100%'
134135
);
135136
}
136137
return that._trigger('sent', e, data);
@@ -227,26 +228,34 @@
227228
// Callback for upload progress events:
228229
progress: function (e, data) {
229230
if (data.context) {
230-
data.context.find('.bar').css(
231-
'width',
232-
parseInt(data.loaded / data.total * 100, 10) + '%'
233-
);
231+
var progress = parseInt(data.loaded / data.total * 100, 10);
232+
data.context.find('.progress')
233+
.attr('aria-valuenow', progress)
234+
.find('.bar').css(
235+
'width',
236+
progress + '%'
237+
);
234238
}
235239
},
236240
// Callback for global upload progress events:
237241
progressall: function (e, data) {
238-
var $this = $(this);
239-
$this.find('.fileupload-progress')
242+
var $this = $(this),
243+
progress = parseInt(data.loaded / data.total * 100, 10),
244+
globalProgressNode = $this.find('.fileupload-progress'),
245+
extendedProgressNode = globalProgressNode
246+
.find('.progress-extended');
247+
if (extendedProgressNode.length) {
248+
extendedProgressNode.html(
249+
$this.data('fileupload')._renderExtendedProgress(data)
250+
);
251+
}
252+
globalProgressNode
253+
.find('.progress')
254+
.attr('aria-valuenow', progress)
240255
.find('.bar').css(
241256
'width',
242-
parseInt(data.loaded / data.total * 100, 10) + '%'
243-
).end()
244-
.find('.progress-extended').each(function () {
245-
$(this).html(
246-
$this.data('fileupload')
247-
._renderExtendedProgress(data)
248-
);
249-
});
257+
progress + '%'
258+
);
250259
},
251260
// Callback for uploads start, equivalent to the global ajaxStart event:
252261
start: function (e) {
@@ -262,7 +271,9 @@
262271
var that = $(this).data('fileupload');
263272
that._transition($(this).find('.fileupload-progress')).done(
264273
function () {
265-
$(this).find('.bar').css('width', '0%');
274+
$(this).find('.progress')
275+
.attr('aria-valuenow', '0')
276+
.find('.bar').css('width', '0%');
266277
$(this).find('.progress-extended').html(' ');
267278
that._trigger('stopped', e);
268279
}
@@ -519,8 +530,8 @@
519530
},
520531

521532
_forceReflow: function (node) {
522-
this._reflow = $.support.transition &&
523-
node.length && node[0].offsetWidth;
533+
return $.support.transition && node.length &&
534+
node[0].offsetWidth;
524535
},
525536

526537
_transition: function (node) {

vendor/assets/javascripts/jquery-fileupload/jquery.fileupload.js

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@
210210
if (typeof options.formData === 'function') {
211211
return options.formData(options.form);
212212
}
213-
if ($.isArray(options.formData)) {
213+
if ($.isArray(options.formData)) {
214214
return options.formData;
215215
}
216-
if (options.formData) {
216+
if (options.formData) {
217217
formData = [];
218218
$.each(options.formData, function (name, value) {
219219
formData.push({name: name, value: value});

vendor/assets/javascripts/jquery-fileupload/jquery.iframe-transport.js

100644100755
File mode changed.

vendor/assets/javascripts/jquery-fileupload/locale.js

100644100755
File mode changed.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/*
2+
* jQuery File Upload Plugin JS Example 6.7
3+
* https://github.com/blueimp/jQuery-File-Upload
4+
*
5+
* Copyright 2010, Sebastian Tschan
6+
* https://blueimp.net
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/MIT
10+
*/
11+
12+
/*jslint nomen: true, unparam: true, regexp: true */
13+
/*global $, window, document */
14+
15+
$(function () {
16+
'use strict';
17+
18+
// Initialize the jQuery File Upload widget:
19+
$('#fileupload').fileupload();
20+
21+
// Enable iframe cross-domain access via redirect option:
22+
$('#fileupload').fileupload(
23+
'option',
24+
'redirect',
25+
window.location.href.replace(
26+
/\/[^\/]*$/,
27+
'/cors/result.html?%s'
28+
)
29+
);
30+
31+
if (window.location.hostname === 'blueimp.github.com') {
32+
// Demo settings:
33+
$('#fileupload').fileupload('option', {
34+
url: '//jquery-file-upload.appspot.com/',
35+
maxFileSize: 5000000,
36+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
37+
process: [
38+
{
39+
action: 'load',
40+
fileTypes: /^image\/(gif|jpeg|png)$/,
41+
maxFileSize: 20000000 // 20MB
42+
},
43+
{
44+
action: 'resize',
45+
maxWidth: 1440,
46+
maxHeight: 900
47+
},
48+
{
49+
action: 'save'
50+
}
51+
]
52+
});
53+
// Upload server status check for browsers with CORS support:
54+
if ($.support.cors) {
55+
$.ajax({
56+
url: '//jquery-file-upload.appspot.com/',
57+
type: 'HEAD'
58+
}).fail(function () {
59+
$('<span class="alert alert-error"/>')
60+
.text('Upload server currently unavailable - ' +
61+
new Date())
62+
.appendTo('#fileupload');
63+
});
64+
}
65+
} else {
66+
// Load existing files:
67+
$('#fileupload').each(function () {
68+
var that = this;
69+
$.getJSON(this.action, function (result) {
70+
if (result && result.length) {
71+
$(that).fileupload('option', 'done')
72+
.call(that, null, {result: result});
73+
}
74+
});
75+
});
76+
}
77+
78+
});

vendor/assets/javascripts/jquery-fileupload/vendor/jquery.ui.widget.js

100644100755
File mode changed.

vendor/assets/stylesheets/jquery.fileupload-ui.css

100644100755
File mode changed.

vendor/assets/stylesheets/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@charset 'UTF-8';
2+
/*
3+
* jQuery File Upload Plugin CSS Example 1.0
4+
* https://github.com/blueimp/jQuery-File-Upload
5+
*
6+
* Copyright 2012, Sebastian Tschan
7+
* https://blueimp.net
8+
*
9+
* Licensed under the MIT license:
10+
* http://www.opensource.org/licenses/MIT
11+
*/
12+
13+
body{
14+
padding-top: 60px;
15+
}

0 commit comments

Comments
 (0)