Merge branch 'cherry-pick-53b8ee78' into 'dev'

composer update blueimp/jquery-file-upload

See merge request hubzilla/core!1731
This commit is contained in:
M. Dent 2019-09-23 19:08:47 +02:00
commit cc860b4a76
7 changed files with 60 additions and 23 deletions

10
composer.lock generated
View File

@ -8,16 +8,16 @@
"packages": [
{
"name": "blueimp/jquery-file-upload",
"version": "v9.31.0",
"version": "v9.34.0",
"source": {
"type": "git",
"url": "https://github.com/vkhramtsov/jQuery-File-Upload.git",
"reference": "2485bf016e1085f0cd8308723064458cb0af5729"
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/2485bf016e1085f0cd8308723064458cb0af5729",
"reference": "2485bf016e1085f0cd8308723064458cb0af5729",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"shasum": ""
},
"type": "library",
@ -59,7 +59,7 @@
"upload",
"widget"
],
"time": "2019-05-24T07:59:46+00:00"
"time": "2019-07-22T13:10:51+00:00"
},
{
"name": "bshaffer/oauth2-server-php",

View File

@ -96,12 +96,16 @@ The File Upload plugin is regularly tested with the latest browser versions and
### Mobile browsers
The File Upload plugin has been tested with and supports the following mobile browsers:
* Apple Safari on iOS 6.0+
* Google Chrome on iOS 6.0+
* Apple Safari on iOS 6.0+ (see Caveats below)
* Google Chrome on iOS 6.0+ (see Caveats below)
* Google Chrome on Android 4.0+
* Default Browser on Android 2.3+
* Opera Mobile 12.0+
### Caveats
- iOS 9 has a [known bug](https://apple.stackexchange.com/questions/118154) where photos chosen from the Photo Library are all given the name `image.jpeg`, which is problematic when uploading multiple files at a time. Ideally your server should be responsible for deduplicating file uploads ([example](https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php#L490)). If you don't have control, as in the case of direct uploads to S3, you can pass an option `uniqueFilenames: {}` as part of the options object, which tells the uploader to deduplicate filenames. More details [here](https://github.com/blueimp/jQuery-File-Upload/commit/d419f43478aeafe95a794815f80a3016f58eb3b7).
### Supported features
For a detailed overview of the features supported by each browser version, please have a look at the [Extended browser support information](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).

View File

@ -162,14 +162,14 @@ $(function () {
}).on('fileuploadadd', function (e, data) {
data.context = $('<div/>').appendTo('#files');
$.each(data.files, function (index, file) {
var node = $('<p/>')
.append($('<span/>').text(file.name));
if (!index) {
node
.append('<br>')
.append(uploadButton.clone(true).data(data));
$('<p/>')
.append($('<span/>').text(file.name))
.appendTo(data.context);
if (index === data.files.length - 1) {
$('<p/>')
.append(uploadButton.clone(true).data(data))
.appendTo(data.context);
}
node.appendTo(data.context);
});
}).on('fileuploadprocessalways', function (e, data) {
var index = data.index,

View File

@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload",
"version": "9.31.0",
"version": "9.34.0",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images.",
"keywords": [

View File

@ -165,6 +165,15 @@
bitrateInterval: 500,
// By default, uploads are started automatically when adding files:
autoUpload: true,
// By default, duplicate file names are expected to be handled on
// the server-side. If this is not possible (e.g. when uploading
// files directly to Amazon S3), the following option can be set to
// an empty object or an object mapping existing filenames, e.g.:
// { "image.jpg": true, "image (1).jpg": true }
// If it is set, all files will be uploaded with unique filenames,
// adding increasing number suffixes if necessary, e.g.:
// "image (2).jpg"
uniqueFilenames: undefined,
// Error and info messages:
messages: {
@ -449,6 +458,23 @@
return Object.prototype.toString.call(obj) === '[object ' + type + ']';
},
_getUniqueFilename: function (name, map) {
name = String(name);
if (map[name]) {
name = name.replace(
/(?: \(([\d]+)\))?(\.[^.]+)?$/,
function (_, p1, p2) {
var index = p1 ? Number(p1) + 1 : 1;
var ext = p2 || '';
return ' (' + index + ')' + ext;
}
);
return this._getUniqueFilename(name, map);
}
map[name] = true;
return name;
},
_initXHRData: function (options) {
var that = this,
formData,
@ -510,11 +536,18 @@
// dummy objects:
if (that._isInstanceOf('File', file) ||
that._isInstanceOf('Blob', file)) {
var fileName = file.uploadName || file.name;
if (options.uniqueFilenames) {
fileName = that._getUniqueFilename(
fileName,
options.uniqueFilenames
);
}
formData.append(
($.type(options.paramName) === 'array' &&
options.paramName[index]) || paramName,
file,
file.uploadName || file.name
fileName
);
}
});

View File

@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload",
"version": "9.31.0",
"version": "9.34.0",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.",
"keywords": [

View File

@ -1,20 +1,20 @@
[
{
"name": "blueimp/jquery-file-upload",
"version": "v9.31.0",
"version_normalized": "9.31.0.0",
"version": "v9.34.0",
"version_normalized": "9.34.0.0",
"source": {
"type": "git",
"url": "https://github.com/vkhramtsov/jQuery-File-Upload.git",
"reference": "2485bf016e1085f0cd8308723064458cb0af5729"
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/2485bf016e1085f0cd8308723064458cb0af5729",
"reference": "2485bf016e1085f0cd8308723064458cb0af5729",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"shasum": ""
},
"time": "2019-05-24T07:59:46+00:00",
"time": "2019-07-22T13:10:51+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {