mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-18 01:45:25 +00:00
Update jQuery File Upload to version 9.5.7
This commit is contained in:
+23
-14
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* jQuery File Upload Plugin 5.39.0
|
||||
* jQuery File Upload Plugin 5.40.1
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2010, Sebastian Tschan
|
||||
@@ -9,8 +9,8 @@
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/*jslint nomen: true, unparam: true, regexp: true */
|
||||
/*global define, window, document, location, File, Blob, FormData */
|
||||
/* jshint nomen:false */
|
||||
/* global define, window, document, location, Blob, FormData */
|
||||
|
||||
(function (factory) {
|
||||
'use strict';
|
||||
@@ -419,7 +419,8 @@
|
||||
file = options.files[0],
|
||||
// Ignore non-multipart setting if not supported:
|
||||
multipart = options.multipart || !$.support.xhrFileUpload,
|
||||
paramName = options.paramName[0];
|
||||
paramName = $.type(options.paramName) === 'array' ?
|
||||
options.paramName[0] : options.paramName;
|
||||
options.headers = $.extend({}, options.headers);
|
||||
if (options.contentRange) {
|
||||
options.headers['Content-Range'] = options.contentRange;
|
||||
@@ -429,7 +430,7 @@
|
||||
encodeURI(file.name) + '"';
|
||||
}
|
||||
if (!multipart) {
|
||||
options.contentType = file.type;
|
||||
options.contentType = file.type || 'application/octet-stream';
|
||||
options.data = options.blob || file;
|
||||
} else if ($.support.xhrFormDataFileUpload) {
|
||||
if (options.postMessage) {
|
||||
@@ -446,7 +447,8 @@
|
||||
} else {
|
||||
$.each(options.files, function (index, file) {
|
||||
formData.push({
|
||||
name: options.paramName[index] || paramName,
|
||||
name: ($.type(options.paramName) === 'array' &&
|
||||
options.paramName[index]) || paramName,
|
||||
value: file
|
||||
});
|
||||
});
|
||||
@@ -469,7 +471,8 @@
|
||||
if (that._isInstanceOf('File', file) ||
|
||||
that._isInstanceOf('Blob', file)) {
|
||||
formData.append(
|
||||
options.paramName[index] || paramName,
|
||||
($.type(options.paramName) === 'array' &&
|
||||
options.paramName[index]) || paramName,
|
||||
file,
|
||||
file.uploadName || file.name
|
||||
);
|
||||
@@ -979,8 +982,8 @@
|
||||
for (i = 0; i < filesLength; i = i + 1) {
|
||||
batchSize += files[i].size + overhead;
|
||||
if (i + 1 === filesLength ||
|
||||
(batchSize + files[i + 1].size + overhead) >
|
||||
limitSize) {
|
||||
((batchSize + files[i + 1].size + overhead) > limitSize) ||
|
||||
(limit && i + 1 - j >= limit)) {
|
||||
fileSet.push(files.slice(j, i + 1));
|
||||
paramNameSlice = paramName.slice(j, i + 1);
|
||||
if (!paramNameSlice.length) {
|
||||
@@ -1304,15 +1307,21 @@
|
||||
|
||||
_initDataAttributes: function () {
|
||||
var that = this,
|
||||
options = this.options;
|
||||
options = this.options,
|
||||
clone = $(this.element[0].cloneNode(false));
|
||||
// Initialize options set via HTML5 data-attributes:
|
||||
$.each(
|
||||
$(this.element[0].cloneNode(false)).data(),
|
||||
clone.data(),
|
||||
function (key, value) {
|
||||
if (that._isRegExpOption(key, value)) {
|
||||
value = that._getRegExp(value);
|
||||
var dataAttributeName = 'data-' +
|
||||
// Convert camelCase to hyphen-ated key:
|
||||
key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
if (clone.attr(dataAttributeName)) {
|
||||
if (that._isRegExpOption(key, value)) {
|
||||
value = that._getRegExp(value);
|
||||
}
|
||||
options[key] = value;
|
||||
}
|
||||
options[key] = value;
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user