Skip to content

Commit 7fd368b

Browse files
committed
Merge pull request #38 from christophermanning/update_assets
Update javascript assets from master
2 parents 9ce97c3 + 0ceda35 commit 7fd368b

File tree

9 files changed

+320
-128
lines changed

9 files changed

+320
-128
lines changed

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

100755100644
File mode changed.

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

100755100644
File mode changed.

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

100755100644
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload File Processing Plugin 1.2.1
2+
* jQuery File Upload File Processing Plugin 1.2.3
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2012, Sebastian Tschan
@@ -62,9 +62,13 @@
6262
// fileupload widget (via file input selection, drag & drop or add
6363
// API call). See the basic file upload widget for more information:
6464
add: function (e, data) {
65-
$(this).fileupload('process', data).done(function () {
66-
data.submit();
67-
});
65+
if (data.autoUpload || (data.autoUpload !== false &&
66+
($(this).data('blueimp-fileupload') ||
67+
$(this).data('fileupload')).options.autoUpload)) {
68+
$(this).fileupload('process', data).done(function () {
69+
data.submit();
70+
});
71+
}
6872
}
6973
},
7074

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

100755100644
Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload User Interface Plugin 7.3
2+
* jQuery File Upload User Interface Plugin 7.4.1
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -263,7 +263,7 @@
263263
// Callback for upload progress events:
264264
progress: function (e, data) {
265265
if (data.context) {
266-
var progress = parseInt(data.loaded / data.total * 100, 10);
266+
var progress = Math.floor(data.loaded / data.total * 100);
267267
data.context.find('.progress')
268268
.attr('aria-valuenow', progress)
269269
.find('.bar').css(
@@ -275,7 +275,7 @@
275275
// Callback for global upload progress events:
276276
progressall: function (e, data) {
277277
var $this = $(this),
278-
progress = parseInt(data.loaded / data.total * 100, 10),
278+
progress = Math.floor(data.loaded / data.total * 100),
279279
globalProgressNode = $this.find('.fileupload-progress'),
280280
extendedProgressNode = globalProgressNode
281281
.find('.progress-extended');
@@ -422,7 +422,7 @@
422422

423423
_formatTime: function (seconds) {
424424
var date = new Date(seconds * 1000),
425-
days = parseInt(seconds / 86400, 10);
425+
days = Math.floor(seconds / 86400);
426426
days = days ? days + 'd ' : '';
427427
return days +
428428
('0' + date.getUTCHours()).slice(-2) + ':' +
@@ -519,6 +519,12 @@
519519
// so we have to resolve manually:
520520
dfd.resolveWith(node);
521521
}
522+
node.on('remove', function () {
523+
// If the element is removed before the
524+
// transition finishes, transition events are
525+
// not triggered, resolve manually:
526+
dfd.resolveWith(node);
527+
});
522528
},
523529
{
524530
maxWidth: options.previewMaxWidth,
@@ -607,7 +613,7 @@
607613

608614
_transition: function (node) {
609615
var dfd = $.Deferred();
610-
if ($.support.transition && node.hasClass('fade')) {
616+
if ($.support.transition && node.hasClass('fade') && node.is(':visible')) {
611617
node.bind(
612618
$.support.transition.end,
613619
function (e) {
@@ -632,27 +638,28 @@
632638
this._on(fileUploadButtonBar.find('.start'), {
633639
click: function (e) {
634640
e.preventDefault();
635-
filesList.find('.start button').click();
641+
filesList.find('.start').click();
636642
}
637643
});
638644
this._on(fileUploadButtonBar.find('.cancel'), {
639645
click: function (e) {
640646
e.preventDefault();
641-
filesList.find('.cancel button').click();
647+
filesList.find('.cancel').click();
642648
}
643649
});
644650
this._on(fileUploadButtonBar.find('.delete'), {
645651
click: function (e) {
646652
e.preventDefault();
647-
filesList.find('.delete input:checked')
648-
.siblings('button').click();
653+
filesList.find('.toggle:checked')
654+
.closest('.template-download')
655+
.find('.delete').click();
649656
fileUploadButtonBar.find('.toggle')
650657
.prop('checked', false);
651658
}
652659
});
653660
this._on(fileUploadButtonBar.find('.toggle'), {
654661
change: function (e) {
655-
filesList.find('.delete input').prop(
662+
filesList.find('.toggle').prop(
656663
'checked',
657664
$(e.currentTarget).is(':checked')
658665
);
@@ -662,7 +669,8 @@
662669

663670
_destroyButtonBarEventHandlers: function () {
664671
this._off(
665-
this.element.find('.fileupload-buttonbar button'),
672+
this.element.find('.fileupload-buttonbar')
673+
.find('.start, .cancel, .delete'),
666674
'click'
667675
);
668676
this._off(
@@ -674,9 +682,9 @@
674682
_initEventHandlers: function () {
675683
this._super();
676684
this._on(this.options.filesContainer, {
677-
'click .start button': this._startHandler,
678-
'click .cancel button': this._cancelHandler,
679-
'click .delete button': this._deleteHandler
685+
'click .start': this._startHandler,
686+
'click .cancel': this._cancelHandler,
687+
'click .delete': this._deleteHandler
680688
});
681689
this._initButtonBarEventHandlers();
682690
},

0 commit comments

Comments
 (0)