From ec5a4963276b10d28da890017a6911461ae68758 Mon Sep 17 00:00:00 2001 From: bnu Date: Wed, 15 Jul 2015 17:18:45 +0900 Subject: [PATCH] =?UTF-8?q?jQuery=20file=20upload=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=20-=20IE8=EC=97=90=EC=84=9C=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=ED=95=98=EC=A7=80=20=EC=95=8A=EC=9D=84=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/plugins/jquery.fileupload/js/app.js | 2 +- .../js/jquery.fileupload-image.js | 2 +- .../jquery.fileupload/js/jquery.fileupload.js | 31 +++++++++++-------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/common/js/plugins/jquery.fileupload/js/app.js b/common/js/plugins/jquery.fileupload/js/app.js index 47b4f923b..548a60d31 100755 --- a/common/js/plugins/jquery.fileupload/js/app.js +++ b/common/js/plugins/jquery.fileupload/js/app.js @@ -37,7 +37,7 @@ // send Blob objects via XHR requests: disableImageResize: /Android(?!.*Chrome)|Opera/ .test(window.navigator.userAgent), - maxFileSize: 5000000, + maxFileSize: 999000, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i }); } diff --git a/common/js/plugins/jquery.fileupload/js/jquery.fileupload-image.js b/common/js/plugins/jquery.fileupload/js/jquery.fileupload-image.js index 0ac993650..266b088de 100755 --- a/common/js/plugins/jquery.fileupload/js/jquery.fileupload-image.js +++ b/common/js/plugins/jquery.fileupload/js/jquery.fileupload-image.js @@ -242,7 +242,7 @@ blob.name = file.name; } else if (file.name) { blob.name = file.name.replace( - /\..+$/, + /\.\w+$/, '.' + blob.type.substr(6) ); } diff --git a/common/js/plugins/jquery.fileupload/js/jquery.fileupload.js b/common/js/plugins/jquery.fileupload/js/jquery.fileupload.js index e99f3091e..ab0748fc0 100755 --- a/common/js/plugins/jquery.fileupload/js/jquery.fileupload.js +++ b/common/js/plugins/jquery.fileupload/js/jquery.fileupload.js @@ -1,5 +1,5 @@ /* - * jQuery File Upload Plugin 5.42.2 + * jQuery File Upload Plugin 5.42.3 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan @@ -277,7 +277,8 @@ // The following are jQuery ajax settings required for the file uploads: processData: false, contentType: false, - cache: false + cache: false, + timeout: 0 }, // A list of options that require reinitializing event listeners and/or @@ -983,7 +984,10 @@ fileSet, i, j = 0; - if (limitSize && (!filesLength || files[0].size === undefined)) { + if (!filesLength) { + return false; + } + if (limitSize && files[0].size === undefined) { limitSize = undefined; } if (!(options.singleFileUploads || limit || limitSize) || @@ -1344,18 +1348,19 @@ _initDataAttributes: function () { var that = this, options = this.options, - clone = $(this.element[0].cloneNode(false)), - data = clone.data(); - // Avoid memory leaks: - clone.remove(); + data = this.element.data(); // Initialize options set via HTML5 data-attributes: $.each( - data, - function (key, value) { - var dataAttributeName = 'data-' + - // Convert camelCase to hyphen-ated key: - key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); - if (clone.attr(dataAttributeName)) { + this.element[0].attributes, + function (index, attr) { + var key = attr.name.toLowerCase(), + value; + if (/^data-/.test(key)) { + // Convert hyphen-ated key to camelCase: + key = key.slice(5).replace(/-[a-z]/g, function (str) { + return str.charAt(1).toUpperCase(); + }); + value = data[key]; if (that._isRegExpOption(key, value)) { value = that._getRegExp(value); }