Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 22, 2022. It is now read-only.

支持上传空文件 #3072

Open
YanxinTang wants to merge 2 commits into fex-team:master
base: master
Choose a base branch
Loading
from YanxinTang:dev
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions dist/webuploader.custom.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


/**
Expand Down Expand Up @@ -3009,7 +3009,7 @@

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3528,7 +3528,7 @@
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -4198,10 +4198,11 @@
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -4223,7 +4224,7 @@
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down Expand Up @@ -6563,7 +6564,8 @@
var separator = '|', // 分隔符
// 拼接的状态,在 widgets/upload.js 会有代码用到这个分隔符
status = separator + xhr.status +
separator + xhr.statusText;
separator + xhr.statusText +
separator + xhr.responseText;

if ( xhr.status >= 200 && xhr.status < 300 ) {
me._response = xhr.responseText;
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.custom.min.js
View file Open in desktop

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/webuploader.fis.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


var jQuery = require('example:widget/ui/jquery/jquery.js');
Expand Down Expand Up @@ -2883,7 +2883,7 @@ module.exports = (function( root, factory ) {

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3402,7 +3402,7 @@ module.exports = (function( root, factory ) {
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -4072,10 +4072,11 @@ module.exports = (function( root, factory ) {
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -4097,7 +4098,7 @@ module.exports = (function( root, factory ) {
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down Expand Up @@ -6966,7 +6967,8 @@ module.exports = (function( root, factory ) {
var separator = '|', // 分隔符
// 拼接的状态,在 widgets/upload.js 会有代码用到这个分隔符
status = separator + xhr.status +
separator + xhr.statusText;
separator + xhr.statusText +
separator + xhr.responseText;

if ( xhr.status >= 200 && xhr.status < 300 ) {
me._response = xhr.responseText;
Expand Down
13 changes: 7 additions & 6 deletions dist/webuploader.flashonly.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


/**
Expand Down Expand Up @@ -2706,7 +2706,7 @@

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3225,7 +3225,7 @@
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -3895,10 +3895,11 @@
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -3920,7 +3921,7 @@
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/webuploader.flashonly.min.js
View file Open in desktop

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/webuploader.html5nodepend.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


/**
Expand Down Expand Up @@ -3438,7 +3438,7 @@

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3957,7 +3957,7 @@
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -4627,10 +4627,11 @@
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -4652,7 +4653,7 @@
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down Expand Up @@ -6609,7 +6610,8 @@
var separator = '|', // 分隔符
// 拼接的状态,在 widgets/upload.js 会有代码用到这个分隔符
status = separator + xhr.status +
separator + xhr.statusText;
separator + xhr.statusText +
separator + xhr.responseText;

if ( xhr.status >= 200 && xhr.status < 300 ) {
me._response = xhr.responseText;
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.html5nodepend.min.js
View file Open in desktop

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/webuploader.html5only.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


/**
Expand Down Expand Up @@ -2908,7 +2908,7 @@

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3427,7 +3427,7 @@
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -4097,10 +4097,11 @@
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -4122,7 +4123,7 @@
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down Expand Up @@ -6079,7 +6080,8 @@
var separator = '|', // 分隔符
// 拼接的状态,在 widgets/upload.js 会有代码用到这个分隔符
status = separator + xhr.status +
separator + xhr.statusText;
separator + xhr.statusText +
separator + xhr.responseText;

if ( xhr.status >= 200 && xhr.status < 300 ) {
me._response = xhr.responseText;
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.html5only.min.js
View file Open in desktop

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/webuploader.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


/**
Expand Down Expand Up @@ -2908,7 +2908,7 @@

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3427,7 +3427,7 @@
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -4097,10 +4097,11 @@
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -4122,7 +4123,7 @@
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down Expand Up @@ -6991,7 +6992,8 @@
var separator = '|', // 分隔符
// 拼接的状态,在 widgets/upload.js 会有代码用到这个分隔符
status = separator + xhr.status +
separator + xhr.statusText;
separator + xhr.statusText +
separator + xhr.responseText;

if ( xhr.status >= 200 && xhr.status < 300 ) {
me._response = xhr.responseText;
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.min.js
View file Open in desktop

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions dist/webuploader.noimage.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! WebUploader 0.1.8-alpha */
/*! WebUploader 0.1.8-alpha */


/**
Expand Down Expand Up @@ -2501,7 +2501,7 @@

// 判断文件是否可以被加入队列
acceptFile: function( file ) {
var invalid = !file || !file.size || this.accept &&
var invalid = !file || this.accept &&

// 如果名字中有后缀,才做后缀白名单处理。
rExt.exec( file.name ) && !this.accept.test( file.name );
Expand Down Expand Up @@ -3020,7 +3020,7 @@
var pending = [],
blob = file.source,
total = blob.size,
chunks = chunkSize ? Math.ceil( total / chunkSize ) : 1,
chunks = total && chunkSize ? Math.ceil( total / chunkSize ) : 1,
start = 0,
index = 0,
len, api;
Expand Down Expand Up @@ -3690,10 +3690,11 @@
tr.on( 'error', function( type, flag ) {
// 在 runtime/html5/transport.js 上为 type 加上了状态码,形式:type|status|text(如:http-403-Forbidden)
// 这里把状态码解释出来,并还原后面代码所依赖的 type 变量
var typeArr = type.split( '|' ), status, statusText;
var typeArr = type.split( '|' ), status, statusText, responseText;
type = typeArr[0];
status = parseFloat( typeArr[1] ),
status = parseFloat( typeArr[1] );
statusText = typeArr[2];
responseText = typeArr[3];

block.retried = block.retried || 0;

Expand All @@ -3715,7 +3716,7 @@
}

file.setStatus( Status.ERROR, type );
owner.trigger( 'uploadError', file, type, status, statusText );
owner.trigger( 'uploadError', file, type, status, statusText, responseText );
owner.trigger( 'uploadComplete', file );
}
});
Expand Down Expand Up @@ -4689,7 +4690,8 @@
var separator = '|', // 分隔符
// 拼接的状态,在 widgets/upload.js 会有代码用到这个分隔符
status = separator + xhr.status +
separator + xhr.statusText;
separator + xhr.statusText +
separator + xhr.responseText;

if ( xhr.status >= 200 && xhr.status < 300 ) {
me._response = xhr.responseText;
Expand Down
4 changes: 2 additions & 2 deletions dist/webuploader.noimage.min.js
View file Open in desktop

Large diffs are not rendered by default.

Loading

AltStyle によって変換されたページ (->オリジナル) /